home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / gcc233.lha / os-include / inline / rexxsyslib.h < prev    next >
C/C++ Source or Header  |  1992-12-29  |  4KB  |  154 lines

  1. #ifndef _INLINE_REXXSYSLIB_H
  2. #define _INLINE_REXXSYSLIB_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 Library*  RexxSysBase;
  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 RexxSysBase
  18. #endif
  19.  
  20. static __inline void 
  21. ClearRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr,unsigned long count)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct Library* a6 __asm("a6") = BASE_NAME;
  25.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  26.   register unsigned long d0 __asm("d0") = count;
  27.   __asm __volatile ("jsr a6@(-0x9c)"
  28.   : /* no output */
  29.   : "r" (a6), "r" (a0), "r" (d0)
  30.   : "a0","a1","d0","d1", "memory");
  31. }
  32. static __inline UBYTE *
  33. CreateArgstring (BASE_PAR_DECL UBYTE *string,unsigned long length)
  34. {
  35.   BASE_EXT_DECL
  36.   register UBYTE * _res  __asm("d0");
  37.   register struct Library* a6 __asm("a6") = BASE_NAME;
  38.   register UBYTE *a0 __asm("a0") = string;
  39.   register unsigned long d0 __asm("d0") = length;
  40.   __asm __volatile ("jsr a6@(-0x7e)"
  41.   : "=r" (_res)
  42.   : "r" (a6), "r" (a0), "r" (d0)
  43.   : "a0","a1","d0","d1", "memory");
  44.   return _res;
  45. }
  46. static __inline struct RexxMsg *
  47. CreateRexxMsg (BASE_PAR_DECL struct MsgPort *port,UBYTE *extension,UBYTE *host)
  48. {
  49.   BASE_EXT_DECL
  50.   register struct RexxMsg * _res  __asm("d0");
  51.   register struct Library* a6 __asm("a6") = BASE_NAME;
  52.   register struct MsgPort *a0 __asm("a0") = port;
  53.   register UBYTE *a1 __asm("a1") = extension;
  54.   register UBYTE *d0 __asm("d0") = host;
  55.   __asm __volatile ("jsr a6@(-0x90)"
  56.   : "=r" (_res)
  57.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0)
  58.   : "a0","a1","d0","d1", "memory");
  59.   return _res;
  60. }
  61. static __inline void 
  62. DeleteArgstring (BASE_PAR_DECL UBYTE *argstring)
  63. {
  64.   BASE_EXT_DECL
  65.   register struct Library* a6 __asm("a6") = BASE_NAME;
  66.   register UBYTE *a0 __asm("a0") = argstring;
  67.   __asm __volatile ("jsr a6@(-0x84)"
  68.   : /* no output */
  69.   : "r" (a6), "r" (a0)
  70.   : "a0","a1","d0","d1", "memory");
  71. }
  72. static __inline void 
  73. DeleteRexxMsg (BASE_PAR_DECL struct RexxMsg *packet)
  74. {
  75.   BASE_EXT_DECL
  76.   register struct Library* a6 __asm("a6") = BASE_NAME;
  77.   register struct RexxMsg *a0 __asm("a0") = packet;
  78.   __asm __volatile ("jsr a6@(-0x96)"
  79.   : /* no output */
  80.   : "r" (a6), "r" (a0)
  81.   : "a0","a1","d0","d1", "memory");
  82. }
  83. static __inline BOOL 
  84. FillRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr,unsigned long count,unsigned long mask)
  85. {
  86.   BASE_EXT_DECL
  87.   register BOOL  _res  __asm("d0");
  88.   register struct Library* a6 __asm("a6") = BASE_NAME;
  89.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  90.   register unsigned long d0 __asm("d0") = count;
  91.   register unsigned long d1 __asm("d1") = mask;
  92.   __asm __volatile ("jsr a6@(-0xa2)"
  93.   : "=r" (_res)
  94.   : "r" (a6), "r" (a0), "r" (d0), "r" (d1)
  95.   : "a0","a1","d0","d1", "memory");
  96.   return _res;
  97. }
  98. static __inline BOOL 
  99. IsRexxMsg (BASE_PAR_DECL struct RexxMsg *msgptr)
  100. {
  101.   BASE_EXT_DECL
  102.   register BOOL  _res  __asm("d0");
  103.   register struct Library* a6 __asm("a6") = BASE_NAME;
  104.   register struct RexxMsg *a0 __asm("a0") = msgptr;
  105.   __asm __volatile ("jsr a6@(-0xa8)"
  106.   : "=r" (_res)
  107.   : "r" (a6), "r" (a0)
  108.   : "a0","a1","d0","d1", "memory");
  109.   return _res;
  110. }
  111. static __inline ULONG 
  112. LengthArgstring (BASE_PAR_DECL UBYTE *argstring)
  113. {
  114.   BASE_EXT_DECL
  115.   register ULONG  _res  __asm("d0");
  116.   register struct Library* a6 __asm("a6") = BASE_NAME;
  117.   register UBYTE *a0 __asm("a0") = argstring;
  118.   __asm __volatile ("jsr a6@(-0x8a)"
  119.   : "=r" (_res)
  120.   : "r" (a6), "r" (a0)
  121.   : "a0","a1","d0","d1", "memory");
  122.   return _res;
  123. }
  124. static __inline void 
  125. LockRexxBase (BASE_PAR_DECL unsigned long resource)
  126. {
  127.   BASE_EXT_DECL
  128.   register struct Library* a6 __asm("a6") = BASE_NAME;
  129.   register unsigned long d0 __asm("d0") = resource;
  130.   __asm __volatile ("jsr a6@(-0x1c2)"
  131.   : /* no output */
  132.   : "r" (a6), "r" (d0)
  133.   : "a0","a1","d0","d1", "memory");
  134. }
  135. static __inline void 
  136. UnlockRexxBase (BASE_PAR_DECL unsigned long resource)
  137. {
  138.   BASE_EXT_DECL
  139.   register struct Library* a6 __asm("a6") = BASE_NAME;
  140.   register unsigned long d0 __asm("d0") = resource;
  141.   __asm __volatile ("jsr a6@(-0x1c8)"
  142.   : /* no output */
  143.   : "r" (a6), "r" (d0)
  144.   : "a0","a1","d0","d1", "memory");
  145. }
  146. #undef BASE_EXT_DECL
  147. #undef BASE_PAR_DECL
  148. #undef BASE_PAR_DECL0
  149. #undef BASE_NAME
  150.  
  151. __END_DECLS
  152.  
  153. #endif /* _INLINE_REXXSYSLIB_H */
  154.