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

  1. #ifndef _INLINE_ASL_H
  2. #define _INLINE_ASL_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 Library * AslBase;
  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 AslBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline APTR 
  24. AllocAslRequest (BASE_PAR_DECL unsigned long reqType,struct TagItem *tagList)
  25. {
  26.   BASE_EXT_DECL
  27.   register APTR  _res  __asm("d0");
  28.   register struct Library *a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = reqType;
  30.   register struct TagItem *a0 __asm("a0") = tagList;
  31.   __asm __volatile ("jsr a6@(-0x30)"
  32.   : "=r" (_res)
  33.   : "r" (a6), "r" (d0), "r" (a0)
  34.   : "a0","a1","d0","d1", "memory");
  35.   return _res;
  36. }
  37. #ifndef NO_INLINE_STDARG
  38. #define AllocAslRequestTags(a0, tags...) \
  39.   ({ struct TagItem _tags[] = { tags }; AllocAslRequest ((a0), _tags); })
  40. #endif /* not NO_INLINE_STDARG */
  41. extern __inline struct FileRequester *
  42. AllocFileRequest (BASE_PAR_DECL0)
  43. {
  44.   BASE_EXT_DECL
  45.   register struct FileRequester * _res  __asm("d0");
  46.   register struct Library *a6 __asm("a6") = BASE_NAME;
  47.   __asm __volatile ("jsr a6@(-0x1e)"
  48.   : "=r" (_res)
  49.   : "r" (a6)
  50.   : "a0","a1","d0","d1", "memory");
  51.   return _res;
  52. }
  53. extern __inline BOOL 
  54. AslRequest (BASE_PAR_DECL APTR requester,struct TagItem *tagList)
  55. {
  56.   BASE_EXT_DECL
  57.   register BOOL  _res  __asm("d0");
  58.   register struct Library *a6 __asm("a6") = BASE_NAME;
  59.   register APTR a0 __asm("a0") = requester;
  60.   register struct TagItem *a1 __asm("a1") = tagList;
  61.   __asm __volatile ("jsr a6@(-0x3c)"
  62.   : "=r" (_res)
  63.   : "r" (a6), "r" (a0), "r" (a1)
  64.   : "a0","a1","d0","d1", "memory");
  65.   return _res;
  66. }
  67. #ifndef NO_INLINE_STDARG
  68. #define AslRequestTags(a0, tags...) \
  69.   ({ struct TagItem _tags[] = { tags }; AslRequest ((a0), _tags); })
  70. #endif /* not NO_INLINE_STDARG */
  71. extern __inline void 
  72. FreeAslRequest (BASE_PAR_DECL APTR requester)
  73. {
  74.   BASE_EXT_DECL
  75.   register struct Library *a6 __asm("a6") = BASE_NAME;
  76.   register APTR a0 __asm("a0") = requester;
  77.   __asm __volatile ("jsr a6@(-0x36)"
  78.   : /* no output */
  79.   : "r" (a6), "r" (a0)
  80.   : "a0","a1","d0","d1", "memory");
  81. }
  82. extern __inline void 
  83. FreeFileRequest (BASE_PAR_DECL struct FileRequester *fileReq)
  84. {
  85.   BASE_EXT_DECL
  86.   register struct Library *a6 __asm("a6") = BASE_NAME;
  87.   register struct FileRequester *a0 __asm("a0") = fileReq;
  88.   __asm __volatile ("jsr a6@(-0x24)"
  89.   : /* no output */
  90.   : "r" (a6), "r" (a0)
  91.   : "a0","a1","d0","d1", "memory");
  92. }
  93. extern __inline BOOL 
  94. RequestFile (BASE_PAR_DECL struct FileRequester *fileReq)
  95. {
  96.   BASE_EXT_DECL
  97.   register BOOL  _res  __asm("d0");
  98.   register struct Library *a6 __asm("a6") = BASE_NAME;
  99.   register struct FileRequester *a0 __asm("a0") = fileReq;
  100.   __asm __volatile ("jsr a6@(-0x2a)"
  101.   : "=r" (_res)
  102.   : "r" (a6), "r" (a0)
  103.   : "a0","a1","d0","d1", "memory");
  104.   return _res;
  105. }
  106.  
  107. #undef BASE_EXT_DECL
  108. #undef BASE_EXT_DECL0
  109. #undef BASE_PAR_DECL
  110. #undef BASE_PAR_DECL0
  111. #undef BASE_NAME
  112.  
  113. __END_DECLS
  114.  
  115. #endif /* _INLINE_ASL_H */
  116.