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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct MiscBase * MiscBase;
  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 MiscBase
  11. #endif
  12. __inline static UBYTE* AllocMiscResource(BASE_PAR_DECL long unsigned int unitNum, UBYTE* name)
  13. {
  14.     BASE_EXT_DECL
  15.     register UBYTE* res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register long unsigned int d0 __asm("d0");
  18.     register UBYTE* a1 __asm("a1");
  19.  
  20.     a6 = BASE_NAME;
  21.     d0 = unitNum;
  22.     a1 = name;
  23.     __asm volatile ("
  24.     jsr a6@(-0x6)"
  25.     : "=g" (res)
  26.     : "g" (a6), "g" (d0), "g" (a1)
  27.     : "d0", "d1", "a0", "a1");
  28.     return res;
  29. }
  30. __inline static void FreeMiscResource(BASE_PAR_DECL long unsigned int unitNum)
  31. {
  32.     BASE_EXT_DECL
  33.     register void *a6 __asm ("a6");
  34.     register long unsigned int d0 __asm("d0");
  35.  
  36.     a6 = BASE_NAME;
  37.     d0 = unitNum;
  38.     __asm volatile ("
  39.     jsr a6@(-0xc)"
  40.     : /* no output */
  41.     : "g" (a6), "g" (d0)
  42.     : "d0", "d1", "a0", "a1");
  43. }
  44. #undef BASE_EXT_DECL
  45. #undef BASE_PAR_DECL
  46. #undef BASE_PAR_DECL0
  47. #undef BASE_NAME
  48.