home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / gcc_9112.lzh / include20 / inline / rexxsyslib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-15  |  4.0 KB  |  182 lines

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct RexxSysBase * RexxSysBase;
  4. #endif
  5. #ifndef BASE_PAR_DECL
  6. #define BASE_PAR_DECL
  7. #define BASE_PAR_DECL0 void
  8. #endif
  9. #ifndef BASE_NAME
  10. #define BASE_NAME RexxSysBase
  11. #endif
  12. #ifdef PRIVATE
  13. #endif
  14. __inline static UBYTE* CreateArgstring(BASE_PAR_DECL UBYTE* string, long unsigned int length)
  15. {
  16.     BASE_EXT_DECL
  17.     register UBYTE* res __asm("d0");
  18.     register void *a6 __asm ("a6");
  19.     register UBYTE* a0 __asm("a0");
  20.     register long unsigned int d0 __asm("d0");
  21.  
  22.     a6 = BASE_NAME;
  23.     a0 = string;
  24.     d0 = length;
  25.     __asm volatile ("
  26.     jsr a6@(-0x7e)"
  27.     : "=g" (res)
  28.     : "g" (a6), "g" (a0), "g" (d0)
  29.     : "d0", "d1", "a0", "a1");
  30.     return res;
  31. }
  32. __inline static void DeleteArgstring(BASE_PAR_DECL UBYTE* argstring)
  33. {
  34.     BASE_EXT_DECL
  35.     register void *a6 __asm ("a6");
  36.     register UBYTE* a0 __asm("a0");
  37.  
  38.     a6 = BASE_NAME;
  39.     a0 = argstring;
  40.     __asm volatile ("
  41.     jsr a6@(-0x84)"
  42.     : /* no output */
  43.     : "g" (a6), "g" (a0)
  44.     : "d0", "d1", "a0", "a1");
  45. }
  46. __inline static ULONG LengthArgstring(BASE_PAR_DECL UBYTE* argstring)
  47. {
  48.     BASE_EXT_DECL
  49.     register ULONG res __asm("d0");
  50.     register void *a6 __asm ("a6");
  51.     register UBYTE* a0 __asm("a0");
  52.  
  53.     a6 = BASE_NAME;
  54.     a0 = argstring;
  55.     __asm volatile ("
  56.     jsr a6@(-0x8a)"
  57.     : "=g" (res)
  58.     : "g" (a6), "g" (a0)
  59.     : "d0", "d1", "a0", "a1");
  60.     return res;
  61. }
  62. __inline static struct RexxMsg* CreateRexxMsg(BASE_PAR_DECL struct MsgPort* port, UBYTE* extension, UBYTE* host)
  63. {
  64.     BASE_EXT_DECL
  65.     register struct RexxMsg* res __asm("d0");
  66.     register void *a6 __asm ("a6");
  67.     register struct MsgPort* a0 __asm("a0");
  68.     register UBYTE* a1 __asm("a1");
  69.     register UBYTE* d0 __asm("d0");
  70.  
  71.     a6 = BASE_NAME;
  72.     a0 = port;
  73.     a1 = extension;
  74.     d0 = host;
  75.     __asm volatile ("
  76.     jsr a6@(-0x90)"
  77.     : "=g" (res)
  78.     : "g" (a6), "g" (a0), "g" (a1), "g" (d0)
  79.     : "d0", "d1", "a0", "a1");
  80.     return res;
  81. }
  82. __inline static void DeleteRexxMsg(BASE_PAR_DECL struct RexxMsg* packet)
  83. {
  84.     BASE_EXT_DECL
  85.     register void *a6 __asm ("a6");
  86.     register struct RexxMsg* a0 __asm("a0");
  87.  
  88.     a6 = BASE_NAME;
  89.     a0 = packet;
  90.     __asm volatile ("
  91.     jsr a6@(-0x96)"
  92.     : /* no output */
  93.     : "g" (a6), "g" (a0)
  94.     : "d0", "d1", "a0", "a1");
  95. }
  96. __inline static void ClearRexxMsg(BASE_PAR_DECL struct RexxMsg* msgptr, long unsigned int count)
  97. {
  98.     BASE_EXT_DECL
  99.     register void *a6 __asm ("a6");
  100.     register struct RexxMsg* a0 __asm("a0");
  101.     register long unsigned int d0 __asm("d0");
  102.  
  103.     a6 = BASE_NAME;
  104.     a0 = msgptr;
  105.     d0 = count;
  106.     __asm volatile ("
  107.     jsr a6@(-0x9c)"
  108.     : /* no output */
  109.     : "g" (a6), "g" (a0), "g" (d0)
  110.     : "d0", "d1", "a0", "a1");
  111. }
  112. __inline static BOOL FillRexxMsg(BASE_PAR_DECL struct RexxMsg* msgptr, long unsigned int count, long unsigned int mask)
  113. {
  114.     BASE_EXT_DECL
  115.     register BOOL res __asm("d0");
  116.     register void *a6 __asm ("a6");
  117.     register struct RexxMsg* a0 __asm("a0");
  118.     register long unsigned int d0 __asm("d0");
  119.     register long unsigned int d1 __asm("d1");
  120.  
  121.     a6 = BASE_NAME;
  122.     a0 = msgptr;
  123.     d0 = count;
  124.     d1 = mask;
  125.     __asm volatile ("
  126.     jsr a6@(-0xa2)"
  127.     : "=g" (res)
  128.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
  129.     : "d0", "d1", "a0", "a1");
  130.     return res;
  131. }
  132. __inline static BOOL IsRexxMsg(BASE_PAR_DECL struct RexxMsg* msgptr)
  133. {
  134.     BASE_EXT_DECL
  135.     register BOOL res __asm("d0");
  136.     register void *a6 __asm ("a6");
  137.     register struct RexxMsg* a0 __asm("a0");
  138.  
  139.     a6 = BASE_NAME;
  140.     a0 = msgptr;
  141.     __asm volatile ("
  142.     jsr a6@(-0xa8)"
  143.     : "=g" (res)
  144.     : "g" (a6), "g" (a0)
  145.     : "d0", "d1", "a0", "a1");
  146.     return res;
  147. }
  148. #ifdef PRIVATE
  149. #endif
  150. __inline static void LockRexxBase(BASE_PAR_DECL long unsigned int resource)
  151. {
  152.     BASE_EXT_DECL
  153.     register void *a6 __asm ("a6");
  154.     register long unsigned int d0 __asm("d0");
  155.  
  156.     a6 = BASE_NAME;
  157.     d0 = resource;
  158.     __asm volatile ("
  159.     jsr a6@(-0x1c2)"
  160.     : /* no output */
  161.     : "g" (a6), "g" (d0)
  162.     : "d0", "d1", "a0", "a1");
  163. }
  164. __inline static void UnlockRexxBase(BASE_PAR_DECL long unsigned int resource)
  165. {
  166.     BASE_EXT_DECL
  167.     register void *a6 __asm ("a6");
  168.     register long unsigned int d0 __asm("d0");
  169.  
  170.     a6 = BASE_NAME;
  171.     d0 = resource;
  172.     __asm volatile ("
  173.     jsr a6@(-0x1c8)"
  174.     : /* no output */
  175.     : "g" (a6), "g" (d0)
  176.     : "d0", "d1", "a0", "a1");
  177. }
  178. #undef BASE_EXT_DECL
  179. #undef BASE_PAR_DECL
  180. #undef BASE_PAR_DECL0
  181. #undef BASE_NAME
  182.