home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / inline / timer.h < prev    next >
C/C++ Source or Header  |  1994-09-22  |  2KB  |  95 lines

  1. #ifndef _INLINE_TIMER_H
  2. #define _INLINE_TIMER_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL
  11. #define BASE_EXT_DECL0 extern struct Device * TimerBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME TimerBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline void 
  24. AddTime (BASE_PAR_DECL struct timeval *dest,struct timeval *src)
  25. {
  26.   BASE_EXT_DECL
  27.   register struct Device *a6 __asm("a6") = BASE_NAME;
  28.   register struct timeval *a0 __asm("a0") = dest;
  29.   register struct timeval *a1 __asm("a1") = src;
  30.   __asm __volatile ("jsr a6@(-0x2a)"
  31.   : /* no output */
  32.   : "r" (a6), "r" (a0), "r" (a1)
  33.   : "a0","a1","d0","d1", "memory");
  34. }
  35. extern __inline LONG 
  36. CmpTime (BASE_PAR_DECL struct timeval *dest,struct timeval *src)
  37. {
  38.   BASE_EXT_DECL
  39.   register LONG  _res  __asm("d0");
  40.   register struct Device *a6 __asm("a6") = BASE_NAME;
  41.   register struct timeval *a0 __asm("a0") = dest;
  42.   register struct timeval *a1 __asm("a1") = src;
  43.   __asm __volatile ("jsr a6@(-0x36)"
  44.   : "=r" (_res)
  45.   : "r" (a6), "r" (a0), "r" (a1)
  46.   : "a0","a1","d0","d1", "memory");
  47.   return _res;
  48. }
  49. extern __inline void 
  50. GetSysTime (BASE_PAR_DECL struct timeval *dest)
  51. {
  52.   BASE_EXT_DECL
  53.   register struct Device *a6 __asm("a6") = BASE_NAME;
  54.   register struct timeval *a0 __asm("a0") = dest;
  55.   __asm __volatile ("jsr a6@(-0x42)"
  56.   : /* no output */
  57.   : "r" (a6), "r" (a0)
  58.   : "a0","a1","d0","d1", "memory");
  59. }
  60. extern __inline ULONG 
  61. ReadEClock (BASE_PAR_DECL struct EClockVal *dest)
  62. {
  63.   BASE_EXT_DECL
  64.   register ULONG  _res  __asm("d0");
  65.   register struct Device *a6 __asm("a6") = BASE_NAME;
  66.   register struct EClockVal *a0 __asm("a0") = dest;
  67.   __asm __volatile ("jsr a6@(-0x3c)"
  68.   : "=r" (_res)
  69.   : "r" (a6), "r" (a0)
  70.   : "a0","a1","d0","d1", "memory");
  71.   return _res;
  72. }
  73. extern __inline void 
  74. SubTime (BASE_PAR_DECL struct timeval *dest,struct timeval *src)
  75. {
  76.   BASE_EXT_DECL
  77.   register struct Device *a6 __asm("a6") = BASE_NAME;
  78.   register struct timeval *a0 __asm("a0") = dest;
  79.   register struct timeval *a1 __asm("a1") = src;
  80.   __asm __volatile ("jsr a6@(-0x30)"
  81.   : /* no output */
  82.   : "r" (a6), "r" (a0), "r" (a1)
  83.   : "a0","a1","d0","d1", "memory");
  84. }
  85.  
  86. #undef BASE_EXT_DECL
  87. #undef BASE_EXT_DECL0
  88. #undef BASE_PAR_DECL
  89. #undef BASE_PAR_DECL0
  90. #undef BASE_NAME
  91.  
  92. __END_DECLS
  93.  
  94. #endif /* _INLINE_TIMER_H */
  95.