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

  1. #ifndef _INLINE_RAMDRIVE_H
  2. #define _INLINE_RAMDRIVE_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 Device * RamdriveDevice;
  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 RamdriveDevice
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline STRPTR 
  24. KillRAD (BASE_PAR_DECL unsigned long unit)
  25. {
  26.   BASE_EXT_DECL
  27.   register STRPTR  _res  __asm("d0");
  28.   register struct Device *a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = unit;
  30.   __asm __volatile ("jsr a6@(-0x30)"
  31.   : "=r" (_res)
  32.   : "r" (a6), "r" (d0)
  33.   : "a0","a1","d0","d1", "memory");
  34.   return _res;
  35. }
  36. extern __inline STRPTR 
  37. KillRAD0 (BASE_PAR_DECL0)
  38. {
  39.   BASE_EXT_DECL
  40.   register STRPTR  _res  __asm("d0");
  41.   register struct Device *a6 __asm("a6") = BASE_NAME;
  42.   __asm __volatile ("jsr a6@(-0x2a)"
  43.   : "=r" (_res)
  44.   : "r" (a6)
  45.   : "a0","a1","d0","d1", "memory");
  46.   return _res;
  47. }
  48.  
  49. #undef BASE_EXT_DECL
  50. #undef BASE_EXT_DECL0
  51. #undef BASE_PAR_DECL
  52. #undef BASE_PAR_DECL0
  53. #undef BASE_NAME
  54.  
  55. __END_DECLS
  56.  
  57. #endif /* _INLINE_RAMDRIVE_H */
  58.