home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnuc / inline-2.0 / asl.h next >
Encoding:
C/C++ Source or Header  |  1992-06-14  |  2.7 KB  |  108 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 extern struct AslBase*  AslBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME AslBase
  18. #endif
  19.  
  20. static __inline APTR 
  21. AllocAslRequest (BASE_PAR_DECL unsigned long reqType,struct TagItem *tagList)
  22. {
  23.   BASE_EXT_DECL
  24.   register APTR  _res  __asm("d0");
  25.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  26.   register unsigned long d0 __asm("d0") = reqType;
  27.   register struct TagItem *a0 __asm("a0") = tagList;
  28.   __asm __volatile ("jsr a6@(-0x30)"
  29.   : "=r" (_res)
  30.   : "r" (a6), "r" (d0), "r" (a0)
  31.   : "a0","a1","d0","d1");
  32.   *(char *)a0 = *(char *)a0;
  33.   return _res;
  34. }
  35. static __inline struct FileRequester *
  36. AllocFileRequest (BASE_PAR_DECL0)
  37. {
  38.   BASE_EXT_DECL
  39.   register struct FileRequester * _res  __asm("d0");
  40.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  41.   __asm __volatile ("jsr a6@(-0x1e)"
  42.   : "=r" (_res)
  43.   : "r" (a6)
  44.   : "a0","a1","d0","d1");
  45.   return _res;
  46. }
  47. static __inline BOOL 
  48. AslRequest (BASE_PAR_DECL APTR requester,struct TagItem *tagList)
  49. {
  50.   BASE_EXT_DECL
  51.   register BOOL  _res  __asm("d0");
  52.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  53.   register APTR a0 __asm("a0") = requester;
  54.   register struct TagItem *a1 __asm("a1") = tagList;
  55.   __asm __volatile ("jsr a6@(-0x42)"
  56.   : "=r" (_res)
  57.   : "r" (a6), "r" (a0), "r" (a1)
  58.   : "a0","a1","d0","d1");
  59.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;
  60.   return _res;
  61. }
  62. static __inline void 
  63. FreeAslRequest (BASE_PAR_DECL APTR requester)
  64. {
  65.   BASE_EXT_DECL
  66.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  67.   register APTR a0 __asm("a0") = requester;
  68.   __asm __volatile ("jsr a6@(-0x36)"
  69.   : /* no output */
  70.   : "r" (a6), "r" (a0)
  71.   : "a0","a1","d0","d1");
  72.   *(char *)a0 = *(char *)a0;
  73. }
  74. static __inline void 
  75. FreeFileRequest (BASE_PAR_DECL struct FileRequester *fileReq)
  76. {
  77.   BASE_EXT_DECL
  78.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  79.   register struct FileRequester *a0 __asm("a0") = fileReq;
  80.   __asm __volatile ("jsr a6@(-0x24)"
  81.   : /* no output */
  82.   : "r" (a6), "r" (a0)
  83.   : "a0","a1","d0","d1");
  84.   *(char *)a0 = *(char *)a0;
  85. }
  86. static __inline BOOL 
  87. RequestFile (BASE_PAR_DECL struct FileRequester *fileReq)
  88. {
  89.   BASE_EXT_DECL
  90.   register BOOL  _res  __asm("d0");
  91.   register struct AslBase* a6 __asm("a6") = BASE_NAME;
  92.   register struct FileRequester *a0 __asm("a0") = fileReq;
  93.   __asm __volatile ("jsr a6@(-0x2a)"
  94.   : "=r" (_res)
  95.   : "r" (a6), "r" (a0)
  96.   : "a0","a1","d0","d1");
  97.   *(char *)a0 = *(char *)a0;
  98.   return _res;
  99. }
  100. #undef BASE_EXT_DECL
  101. #undef BASE_PAR_DECL
  102. #undef BASE_PAR_DECL0
  103. #undef BASE_NAME
  104.  
  105. __END_DECLS
  106.  
  107. #endif /* _INLINE_ASL_H */
  108.