home *** CD-ROM | disk | FTP | other *** search
- #include <inline/stub.h>
- #ifndef BASE_EXT_DECL
- #define BASE_EXT_DECL extern struct Device * TimerBase;
- #endif
- #ifndef BASE_PAR_DECL
- #define BASE_PAR_DECL
- #define BASE_PAR_DECL0 void
- #endif
- #ifndef BASE_NAME
- #define BASE_NAME TimerBase
- #endif
- __inline static void AddTime(BASE_PAR_DECL struct timeval* dest, struct timeval* src)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- register struct timeval* a0 __asm("a0");
- register struct timeval* a1 __asm("a1");
-
- a6 = BASE_NAME;
- a0 = dest;
- a1 = src;
- __asm volatile ("
- jsr a6@(-0x2a)"
- : /* no output */
- : "g" (a6), "g" (a0), "g" (a1)
- : "d0", "d1", "a0", "a1");
- }
- __inline static void SubTime(BASE_PAR_DECL struct timeval* dest, struct timeval* src)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- register struct timeval* a0 __asm("a0");
- register struct timeval* a1 __asm("a1");
-
- a6 = BASE_NAME;
- a0 = dest;
- a1 = src;
- __asm volatile ("
- jsr a6@(-0x30)"
- : /* no output */
- : "g" (a6), "g" (a0), "g" (a1)
- : "d0", "d1", "a0", "a1");
- }
- __inline static LONG CmpTime(BASE_PAR_DECL struct timeval* dest, struct timeval* src)
- {
- BASE_EXT_DECL
- register LONG res __asm("d0");
- register void *a6 __asm ("a6");
- register struct timeval* a0 __asm("a0");
- register struct timeval* a1 __asm("a1");
-
- a6 = BASE_NAME;
- a0 = dest;
- a1 = src;
- __asm volatile ("
- jsr a6@(-0x36)"
- : "=g" (res)
- : "g" (a6), "g" (a0), "g" (a1)
- : "d0", "d1", "a0", "a1");
- return res;
- }
- __inline static ULONG ReadEClock(BASE_PAR_DECL struct EClockVal* dest)
- {
- BASE_EXT_DECL
- register ULONG res __asm("d0");
- register void *a6 __asm ("a6");
- register struct EClockVal* a0 __asm("a0");
-
- a6 = BASE_NAME;
- a0 = dest;
- __asm volatile ("
- jsr a6@(-0x3c)"
- : "=g" (res)
- : "g" (a6), "g" (a0)
- : "d0", "d1", "a0", "a1");
- return res;
- }
- __inline static void GetSysTime(BASE_PAR_DECL struct timeval* dest)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- register struct timeval* a0 __asm("a0");
-
- a6 = BASE_NAME;
- a0 = dest;
- __asm volatile ("
- jsr a6@(-0x42)"
- : /* no output */
- : "g" (a6), "g" (a0)
- : "d0", "d1", "a0", "a1");
- }
- #undef BASE_EXT_DECL
- #undef BASE_PAR_DECL
- #undef BASE_PAR_DECL0
- #undef BASE_NAME
-