home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / gcc_9112.lzh / include20 / inline / timer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  2.1 KB  |  96 lines

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