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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct DiskBase * DiskBase;
  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 DiskBase
  11. #endif
  12. __inline static BOOL AllocUnit(BASE_PAR_DECL long int unitNum)
  13. {
  14.     BASE_EXT_DECL
  15.     register BOOL res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register long int d0 __asm("d0");
  18.  
  19.     a6 = BASE_NAME;
  20.     d0 = unitNum;
  21.     __asm volatile ("
  22.     jsr a6@(-0x6)"
  23.     : "=g" (res)
  24.     : "g" (a6), "g" (d0)
  25.     : "d0", "d1", "a0", "a1");
  26.     return res;
  27. }
  28. __inline static void FreeUnit(BASE_PAR_DECL long int unitNum)
  29. {
  30.     BASE_EXT_DECL
  31.     register void *a6 __asm ("a6");
  32.     register long int d0 __asm("d0");
  33.  
  34.     a6 = BASE_NAME;
  35.     d0 = unitNum;
  36.     __asm volatile ("
  37.     jsr a6@(-0xc)"
  38.     : /* no output */
  39.     : "g" (a6), "g" (d0)
  40.     : "d0", "d1", "a0", "a1");
  41. }
  42. __inline static struct DiskResourceUnit* GetUnit(BASE_PAR_DECL struct DiskResourceUnit* unitPointer)
  43. {
  44.     BASE_EXT_DECL
  45.     register struct DiskResourceUnit* res __asm("d0");
  46.     register void *a6 __asm ("a6");
  47.     register struct DiskResourceUnit* a1 __asm("a1");
  48.  
  49.     a6 = BASE_NAME;
  50.     a1 = unitPointer;
  51.     __asm volatile ("
  52.     jsr a6@(-0x12)"
  53.     : "=g" (res)
  54.     : "g" (a6), "g" (a1)
  55.     : "d0", "d1", "a0", "a1");
  56.     return res;
  57. }
  58. __inline static void GiveUnit(BASE_PAR_DECL0)
  59. {
  60.     BASE_EXT_DECL
  61.     register void *a6 __asm ("a6");
  62.     a6 = BASE_NAME;
  63.     __asm volatile ("
  64.     jsr a6@(-0x18)"
  65.     : /* no output */
  66.     : "g" (a6)
  67.     : "d0", "d1", "a0", "a1");
  68. }
  69. __inline static LONG GetUnitID(BASE_PAR_DECL long int unitNum)
  70. {
  71.     BASE_EXT_DECL
  72.     register LONG res __asm("d0");
  73.     register void *a6 __asm ("a6");
  74.     register long int d0 __asm("d0");
  75.  
  76.     a6 = BASE_NAME;
  77.     d0 = unitNum;
  78.     __asm volatile ("
  79.     jsr a6@(-0x1e)"
  80.     : "=g" (res)
  81.     : "g" (a6), "g" (d0)
  82.     : "d0", "d1", "a0", "a1");
  83.     return res;
  84. }
  85. __inline static LONG ReadUnitID(BASE_PAR_DECL long int unitNum)
  86. {
  87.     BASE_EXT_DECL
  88.     register LONG res __asm("d0");
  89.     register void *a6 __asm ("a6");
  90.     register long int d0 __asm("d0");
  91.  
  92.     a6 = BASE_NAME;
  93.     d0 = unitNum;
  94.     __asm volatile ("
  95.     jsr a6@(-0x24)"
  96.     : "=g" (res)
  97.     : "g" (a6), "g" (d0)
  98.     : "d0", "d1", "a0", "a1");
  99.     return res;
  100. }
  101. #undef BASE_EXT_DECL
  102. #undef BASE_PAR_DECL
  103. #undef BASE_PAR_DECL0
  104. #undef BASE_NAME
  105.