home *** CD-ROM | disk | FTP | other *** search
- #include <inline/stub.h>
- #ifndef BASE_EXT_DECL
- #define BASE_EXT_DECL extern struct BattMemBase * BattMemBase;
- #endif
- #ifndef BASE_PAR_DECL
- #define BASE_PAR_DECL
- #define BASE_PAR_DECL0 void
- #endif
- #ifndef BASE_NAME
- #define BASE_NAME BattMemBase
- #endif
- __inline static void ObtainBattSemaphore(BASE_PAR_DECL0)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- a6 = BASE_NAME;
- __asm volatile ("
- jsr a6@(-0x6)"
- : /* no output */
- : "g" (a6)
- : "d0", "d1", "a0", "a1");
- }
- __inline static void ReleaseBattSemaphore(BASE_PAR_DECL0)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- a6 = BASE_NAME;
- __asm volatile ("
- jsr a6@(-0xc)"
- : /* no output */
- : "g" (a6)
- : "d0", "d1", "a0", "a1");
- }
- __inline static ULONG ReadBattMem(BASE_PAR_DECL APTR buffer, long unsigned int offset, long unsigned int length)
- {
- BASE_EXT_DECL
- register ULONG res __asm("d0");
- register void *a6 __asm ("a6");
- register APTR a0 __asm("a0");
- register long unsigned int d0 __asm("d0");
- register long unsigned int d1 __asm("d1");
-
- a6 = BASE_NAME;
- a0 = buffer;
- d0 = offset;
- d1 = length;
- __asm volatile ("
- jsr a6@(-0x12)"
- : "=g" (res)
- : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
- : "d0", "d1", "a0", "a1");
- return res;
- }
- __inline static ULONG WriteBattMem(BASE_PAR_DECL APTR buffer, long unsigned int offset, long unsigned int length)
- {
- BASE_EXT_DECL
- register ULONG res __asm("d0");
- register void *a6 __asm ("a6");
- register APTR a0 __asm("a0");
- register long unsigned int d0 __asm("d0");
- register long unsigned int d1 __asm("d1");
-
- a6 = BASE_NAME;
- a0 = buffer;
- d0 = offset;
- d1 = length;
- __asm volatile ("
- jsr a6@(-0x18)"
- : "=g" (res)
- : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
- : "d0", "d1", "a0", "a1");
- return res;
- }
- #undef BASE_EXT_DECL
- #undef BASE_PAR_DECL
- #undef BASE_PAR_DECL0
- #undef BASE_NAME
-