home *** CD-ROM | disk | FTP | other *** search
- #include <inline/stub.h>
- #ifndef BASE_EXT_DECL
- #define BASE_EXT_DECL extern struct MiscBase * MiscBase;
- #endif
- #ifndef BASE_PAR_DECL
- #define BASE_PAR_DECL
- #define BASE_PAR_DECL0 void
- #endif
- #ifndef BASE_NAME
- #define BASE_NAME MiscBase
- #endif
- __inline static UBYTE* AllocMiscResource(BASE_PAR_DECL long unsigned int unitNum, UBYTE* name)
- {
- BASE_EXT_DECL
- register UBYTE* res __asm("d0");
- register void *a6 __asm ("a6");
- register long unsigned int d0 __asm("d0");
- register UBYTE* a1 __asm("a1");
-
- a6 = BASE_NAME;
- d0 = unitNum;
- a1 = name;
- __asm volatile ("
- jsr a6@(-0x6)"
- : "=g" (res)
- : "g" (a6), "g" (d0), "g" (a1)
- : "d0", "d1", "a0", "a1");
- return res;
- }
- __inline static void FreeMiscResource(BASE_PAR_DECL long unsigned int unitNum)
- {
- BASE_EXT_DECL
- register void *a6 __asm ("a6");
- register long unsigned int d0 __asm("d0");
-
- a6 = BASE_NAME;
- d0 = unitNum;
- __asm volatile ("
- jsr a6@(-0xc)"
- : /* no output */
- : "g" (a6), "g" (d0)
- : "d0", "d1", "a0", "a1");
- }
- #undef BASE_EXT_DECL
- #undef BASE_PAR_DECL
- #undef BASE_PAR_DECL0
- #undef BASE_NAME
-