home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / comm / tcp / amitcp / src / l / inet-handler / inl_exec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-05  |  8.8 KB  |  322 lines

  1. #ifndef _INL_EXEC_H_
  2. #define _INL_EXEC_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 ExecBase * SysBase;
  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 SysBase
  18. #endif
  19.  
  20. static __inline void 
  21. AbortIO (BASE_PAR_DECL struct IORequest *ioRequest)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  25.   register struct IORequest *a1 __asm("a1") = ioRequest;
  26.   __asm __volatile ("jsr a6@(-0x1e0)"
  27.   : /* no output */
  28.   : "r" (a6), "r" (a1)
  29.   : "a0","a1","d0","d1", "memory");
  30. }
  31. static __inline void 
  32. AddHead (BASE_PAR_DECL struct List *list,struct Node *node)
  33. {
  34.   BASE_EXT_DECL
  35.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  36.   register struct List *a0 __asm("a0") = list;
  37.   register struct Node *a1 __asm("a1") = node;
  38.   __asm __volatile ("jsr a6@(-0xf0)"
  39.   : /* no output */
  40.   : "r" (a6), "r" (a0), "r" (a1)
  41.   : "a0","a1","d0","d1", "memory");
  42. }
  43. static __inline void 
  44. AddTail (BASE_PAR_DECL struct List *list,struct Node *node)
  45. {
  46.   BASE_EXT_DECL
  47.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  48.   register struct List *a0 __asm("a0") = list;
  49.   register struct Node *a1 __asm("a1") = node;
  50.   __asm __volatile ("jsr a6@(-0xf6)"
  51.   : /* no output */
  52.   : "r" (a6), "r" (a0), "r" (a1)
  53.   : "a0","a1","d0","d1", "memory");
  54. }
  55. static __inline APTR 
  56. AllocMem (BASE_PAR_DECL unsigned long byteSize,unsigned long requirements)
  57. {
  58.   BASE_EXT_DECL
  59.   register APTR  _res  __asm("d0");
  60.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  61.   register unsigned long d0 __asm("d0") = byteSize;
  62.   register unsigned long d1 __asm("d1") = requirements;
  63.   __asm __volatile ("jsr a6@(-0xc6)"
  64.   : "=r" (_res)
  65.   : "r" (a6), "r" (d0), "r" (d1)
  66.   : "a0","a1","d0","d1", "memory");
  67.   return _res;
  68. }
  69. static __inline BYTE 
  70. AllocSignal (BASE_PAR_DECL long signalNum)
  71. {
  72.   BASE_EXT_DECL
  73.   register BYTE  _res  __asm("d0");
  74.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  75.   register long d0 __asm("d0") = signalNum;
  76.   __asm __volatile ("jsr a6@(-0x14a)"
  77.   : "=r" (_res)
  78.   : "r" (a6), "r" (d0)
  79.   : "a0","a1","d0","d1", "memory");
  80.   return _res;
  81. }
  82. static __inline void 
  83. CloseDevice (BASE_PAR_DECL struct IORequest *ioRequest)
  84. {
  85.   BASE_EXT_DECL
  86.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  87.   register struct IORequest *a1 __asm("a1") = ioRequest;
  88.   __asm __volatile ("jsr a6@(-0x1c2)"
  89.   : /* no output */
  90.   : "r" (a6), "r" (a1)
  91.   : "a0","a1","d0","d1", "memory");
  92. }
  93. static __inline void 
  94. CloseLibrary (BASE_PAR_DECL struct Library *library)
  95. {
  96.   BASE_EXT_DECL
  97.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  98.   register struct Library *a1 __asm("a1") = library;
  99.   __asm __volatile ("jsr a6@(-0x19e)"
  100.   : /* no output */
  101.   : "r" (a6), "r" (a1)
  102.   : "a0","a1","d0","d1", "memory");
  103. }
  104. static __inline void 
  105. CopyMem (BASE_PAR_DECL APTR source,APTR dest,unsigned long size)
  106. {
  107.   BASE_EXT_DECL
  108.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  109.   register APTR a0 __asm("a0") = source;
  110.   register APTR a1 __asm("a1") = dest;
  111.   register unsigned long d0 __asm("d0") = size;
  112.   __asm __volatile ("jsr a6@(-0x270)"
  113.   : /* no output */
  114.   : "r" (a6), "r" (a0), "r" (a1), "r" (d0)
  115.   : "a0","a1","d0","d1", "memory");
  116. }
  117. static __inline struct MsgPort *
  118. CreateMsgPort (BASE_PAR_DECL0)
  119. {
  120.   BASE_EXT_DECL
  121.   register struct MsgPort * _res  __asm("d0");
  122.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  123.   __asm __volatile ("jsr a6@(-0x29a)"
  124.   : "=r" (_res)
  125.   : "r" (a6)
  126.   : "a0","a1","d0","d1", "memory");
  127.   return _res;
  128. }
  129. static __inline void 
  130. DeleteMsgPort (BASE_PAR_DECL struct MsgPort *port)
  131. {
  132.   BASE_EXT_DECL
  133.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  134.   register struct MsgPort *a0 __asm("a0") = port;
  135.   __asm __volatile ("jsr a6@(-0x2a0)"
  136.   : /* no output */
  137.   : "r" (a6), "r" (a0)
  138.   : "a0","a1","d0","d1", "memory");
  139. }
  140. static __inline struct Task *
  141. FindTask (BASE_PAR_DECL UBYTE *name)
  142. {
  143.   BASE_EXT_DECL
  144.   register struct Task * _res  __asm("d0");
  145.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  146.   register UBYTE *a1 __asm("a1") = name;
  147.   __asm __volatile ("jsr a6@(-0x126)"
  148.   : "=r" (_res)
  149.   : "r" (a6), "r" (a1)
  150.   : "a0","a1","d0","d1", "memory");
  151.   return _res;
  152. }
  153. static __inline void 
  154. Forbid (BASE_PAR_DECL0)
  155. {
  156.   BASE_EXT_DECL
  157.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  158.   __asm __volatile ("jsr a6@(-0x84)"
  159.   : /* no output */
  160.   : "r" (a6)
  161.   : "a0","a1","d0","d1", "memory");
  162. }
  163. static __inline void 
  164. FreeMem (BASE_PAR_DECL APTR memoryBlock,unsigned long byteSize)
  165. {
  166.   BASE_EXT_DECL
  167.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  168.   register APTR a1 __asm("a1") = memoryBlock;
  169.   register unsigned long d0 __asm("d0") = byteSize;
  170.   __asm __volatile ("jsr a6@(-0xd2)"
  171.   : /* no output */
  172.   : "r" (a6), "r" (a1), "r" (d0)
  173.   : "a0","a1","d0","d1", "memory");
  174. }
  175. static __inline void 
  176. FreeSignal (BASE_PAR_DECL long signalNum)
  177. {
  178.   BASE_EXT_DECL
  179.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  180.   register long d0 __asm("d0") = signalNum;
  181.   __asm __volatile ("jsr a6@(-0x150)"
  182.   : /* no output */
  183.   : "r" (a6), "r" (d0)
  184.   : "a0","a1","d0","d1", "memory");
  185. }
  186. static __inline struct Message *
  187. GetMsg (BASE_PAR_DECL struct MsgPort *port)
  188. {
  189.   BASE_EXT_DECL
  190.   register struct Message * _res  __asm("d0");
  191.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  192.   register struct MsgPort *a0 __asm("a0") = port;
  193.   __asm __volatile ("jsr a6@(-0x174)"
  194.   : "=r" (_res)
  195.   : "r" (a6), "r" (a0)
  196.   : "a0","a1","d0","d1", "memory");
  197.   return _res;
  198. }
  199. static __inline BYTE 
  200. OpenDevice (BASE_PAR_DECL UBYTE *devName,unsigned long unit,struct IORequest *ioRequest,unsigned long flags)
  201. {
  202.   BASE_EXT_DECL
  203.   register BYTE  _res  __asm("d0");
  204.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  205.   register UBYTE *a0 __asm("a0") = devName;
  206.   register unsigned long d0 __asm("d0") = unit;
  207.   register struct IORequest *a1 __asm("a1") = ioRequest;
  208.   register unsigned long d1 __asm("d1") = flags;
  209.   __asm __volatile ("jsr a6@(-0x1bc)"
  210.   : "=r" (_res)
  211.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1)
  212.   : "a0","a1","d0","d1", "memory");
  213.   return _res;
  214. }
  215. static __inline struct Library *
  216. OpenLibrary (BASE_PAR_DECL UBYTE *libName,unsigned long version)
  217. {
  218.   BASE_EXT_DECL
  219.   register struct Library * _res  __asm("d0");
  220.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  221.   register UBYTE *a1 __asm("a1") = libName;
  222.   register unsigned long d0 __asm("d0") = version;
  223.   __asm __volatile ("jsr a6@(-0x228)"
  224.   : "=r" (_res)
  225.   : "r" (a6), "r" (a1), "r" (d0)
  226.   : "a0","a1","d0","d1", "memory");
  227.   return _res;
  228. }
  229. static __inline void 
  230. Permit (BASE_PAR_DECL0)
  231. {
  232.   BASE_EXT_DECL
  233.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  234.   __asm __volatile ("jsr a6@(-0x8a)"
  235.   : /* no output */
  236.   : "r" (a6)
  237.   : "a0","a1","d0","d1", "memory");
  238. }
  239. static __inline struct Node *
  240. RemHead (BASE_PAR_DECL struct List *list)
  241. {
  242.   BASE_EXT_DECL
  243.   register struct Node * _res  __asm("d0");
  244.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  245.   register struct List *a0 __asm("a0") = list;
  246.   __asm __volatile ("jsr a6@(-0x102)"
  247.   : "=r" (_res)
  248.   : "r" (a6), "r" (a0)
  249.   : "a0","a1","d0","d1", "memory");
  250.   return _res;
  251. }
  252. static __inline struct Node *
  253. RemTail (BASE_PAR_DECL struct List *list)
  254. {
  255.   BASE_EXT_DECL
  256.   register struct Node * _res  __asm("d0");
  257.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  258.   register struct List *a0 __asm("a0") = list;
  259.   __asm __volatile ("jsr a6@(-0x108)"
  260.   : "=r" (_res)
  261.   : "r" (a6), "r" (a0)
  262.   : "a0","a1","d0","d1", "memory");
  263.   return _res;
  264. }
  265.  
  266. static __inline void 
  267. Remove (BASE_PAR_DECL struct Node *node)
  268. {
  269.   BASE_EXT_DECL
  270.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  271.   register struct Node *a1 __asm("a1") = node;
  272.   __asm __volatile ("jsr a6@(-0xfc)"
  273.   : /* no output */
  274.   : "r" (a6), "r" (a1)
  275.   : "a0","a1","d0","d1", "memory");
  276. }
  277. static __inline void 
  278. SendIO (BASE_PAR_DECL struct IORequest *ioRequest)
  279. {
  280.   BASE_EXT_DECL
  281.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  282.   register struct IORequest *a1 __asm("a1") = ioRequest;
  283.   __asm __volatile ("jsr a6@(-0x1ce)"
  284.   : /* no output */
  285.   : "r" (a6), "r" (a1)
  286.   : "a0","a1","d0","d1", "memory");
  287. }
  288. static __inline ULONG 
  289. Wait (BASE_PAR_DECL unsigned long signalSet)
  290. {
  291.   BASE_EXT_DECL
  292.   register ULONG  _res  __asm("d0");
  293.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  294.   register unsigned long d0 __asm("d0") = signalSet;
  295.   __asm __volatile ("jsr a6@(-0x13e)"
  296.   : "=r" (_res)
  297.   : "r" (a6), "r" (d0)
  298.   : "a0","a1","d0","d1", "memory");
  299.   return _res;
  300. }
  301. static __inline BYTE 
  302. WaitIO (BASE_PAR_DECL struct IORequest *ioRequest)
  303. {
  304.   BASE_EXT_DECL
  305.   register BYTE  _res  __asm("d0");
  306.   register struct ExecBase *a6 __asm("a6") = BASE_NAME;
  307.   register struct IORequest *a1 __asm("a1") = ioRequest;
  308.   __asm __volatile ("jsr a6@(-0x1da)"
  309.   : "=r" (_res)
  310.   : "r" (a6), "r" (a1)
  311.   : "a0","a1","d0","d1", "memory");
  312.   return _res;
  313. }
  314. #undef BASE_EXT_DECL
  315. #undef BASE_PAR_DECL
  316. #undef BASE_PAR_DECL0
  317. #undef BASE_NAME
  318.  
  319. __END_DECLS
  320.  
  321. #endif /* _INL_EXEC_H_ */
  322.