home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / inline / disk.h < prev    next >
C/C++ Source or Header  |  1994-09-22  |  2KB  |  106 lines

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