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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct ExpansionBase * ExpansionBase;
  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 ExpansionBase
  11. #endif
  12. __inline static void AddConfigDev(BASE_PAR_DECL struct ConfigDev* configDev)
  13. {
  14.     BASE_EXT_DECL
  15.     register void *a6 __asm ("a6");
  16.     register struct ConfigDev* a0 __asm("a0");
  17.  
  18.     a6 = BASE_NAME;
  19.     a0 = configDev;
  20.     __asm volatile ("
  21.     jsr a6@(-0x1e)"
  22.     : /* no output */
  23.     : "g" (a6), "g" (a0)
  24.     : "d0", "d1", "a0", "a1");
  25. }
  26. __inline static BOOL AddBootNode(BASE_PAR_DECL long int bootPri, long unsigned int flags, struct DeviceNode* deviceNode, struct ConfigDev* configDev)
  27. {
  28.     BASE_EXT_DECL
  29.     register BOOL res __asm("d0");
  30.     register void *a6 __asm ("a6");
  31.     register long int d0 __asm("d0");
  32.     register long unsigned int d1 __asm("d1");
  33.     register struct DeviceNode* a0 __asm("a0");
  34.     register struct ConfigDev* a1 __asm("a1");
  35.  
  36.     a6 = BASE_NAME;
  37.     d0 = bootPri;
  38.     d1 = flags;
  39.     a0 = deviceNode;
  40.     a1 = configDev;
  41.     __asm volatile ("
  42.     jsr a6@(-0x24)"
  43.     : "=g" (res)
  44.     : "g" (a6), "g" (d0), "g" (d1), "g" (a0), "g" (a1)
  45.     : "d0", "d1", "a0", "a1");
  46.     return res;
  47. }
  48. __inline static void AllocBoardMem(BASE_PAR_DECL long unsigned int slotSpec)
  49. {
  50.     BASE_EXT_DECL
  51.     register void *a6 __asm ("a6");
  52.     register long unsigned int d0 __asm("d0");
  53.  
  54.     a6 = BASE_NAME;
  55.     d0 = slotSpec;
  56.     __asm volatile ("
  57.     jsr a6@(-0x2a)"
  58.     : /* no output */
  59.     : "g" (a6), "g" (d0)
  60.     : "d0", "d1", "a0", "a1");
  61. }
  62. __inline static struct ConfigDev* AllocConfigDev(BASE_PAR_DECL0)
  63. {
  64.     BASE_EXT_DECL
  65.     register struct ConfigDev* res __asm("d0");
  66.     register void *a6 __asm ("a6");
  67.     a6 = BASE_NAME;
  68.     __asm volatile ("
  69.     jsr a6@(-0x30)"
  70.     : "=g" (res)
  71.     : "g" (a6)
  72.     : "d0", "d1", "a0", "a1");
  73.     return res;
  74. }
  75. __inline static APTR AllocExpansionMem(BASE_PAR_DECL long unsigned int numSlots, long unsigned int slotAlign)
  76. {
  77.     BASE_EXT_DECL
  78.     register APTR res __asm("d0");
  79.     register void *a6 __asm ("a6");
  80.     register long unsigned int d0 __asm("d0");
  81.     register long unsigned int d1 __asm("d1");
  82.  
  83.     a6 = BASE_NAME;
  84.     d0 = numSlots;
  85.     d1 = slotAlign;
  86.     __asm volatile ("
  87.     jsr a6@(-0x36)"
  88.     : "=g" (res)
  89.     : "g" (a6), "g" (d0), "g" (d1)
  90.     : "d0", "d1", "a0", "a1");
  91.     return res;
  92. }
  93. __inline static void ConfigBoard(BASE_PAR_DECL APTR board, struct ConfigDev* configDev)
  94. {
  95.     BASE_EXT_DECL
  96.     register void *a6 __asm ("a6");
  97.     register APTR a0 __asm("a0");
  98.     register struct ConfigDev* a1 __asm("a1");
  99.  
  100.     a6 = BASE_NAME;
  101.     a0 = board;
  102.     a1 = configDev;
  103.     __asm volatile ("
  104.     jsr a6@(-0x3c)"
  105.     : /* no output */
  106.     : "g" (a6), "g" (a0), "g" (a1)
  107.     : "d0", "d1", "a0", "a1");
  108. }
  109. __inline static void ConfigChain(BASE_PAR_DECL APTR baseAddr)
  110. {
  111.     BASE_EXT_DECL
  112.     register void *a6 __asm ("a6");
  113.     register APTR a0 __asm("a0");
  114.  
  115.     a6 = BASE_NAME;
  116.     a0 = baseAddr;
  117.     __asm volatile ("
  118.     jsr a6@(-0x42)"
  119.     : /* no output */
  120.     : "g" (a6), "g" (a0)
  121.     : "d0", "d1", "a0", "a1");
  122. }
  123. __inline static struct ConfigDev* FindConfigDev(BASE_PAR_DECL struct ConfigDev* oldConfigDev, long int manufacturer, long int product)
  124. {
  125.     BASE_EXT_DECL
  126.     register struct ConfigDev* res __asm("d0");
  127.     register void *a6 __asm ("a6");
  128.     register struct ConfigDev* a0 __asm("a0");
  129.     register long int d0 __asm("d0");
  130.     register long int d1 __asm("d1");
  131.  
  132.     a6 = BASE_NAME;
  133.     a0 = oldConfigDev;
  134.     d0 = manufacturer;
  135.     d1 = product;
  136.     __asm volatile ("
  137.     jsr a6@(-0x48)"
  138.     : "=g" (res)
  139.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
  140.     : "d0", "d1", "a0", "a1");
  141.     return res;
  142. }
  143. __inline static void FreeBoardMem(BASE_PAR_DECL long unsigned int startSlot, long unsigned int slotSpec)
  144. {
  145.     BASE_EXT_DECL
  146.     register void *a6 __asm ("a6");
  147.     register long unsigned int d0 __asm("d0");
  148.     register long unsigned int d1 __asm("d1");
  149.  
  150.     a6 = BASE_NAME;
  151.     d0 = startSlot;
  152.     d1 = slotSpec;
  153.     __asm volatile ("
  154.     jsr a6@(-0x4e)"
  155.     : /* no output */
  156.     : "g" (a6), "g" (d0), "g" (d1)
  157.     : "d0", "d1", "a0", "a1");
  158. }
  159. __inline static void FreeConfigDev(BASE_PAR_DECL struct ConfigDev* configDev)
  160. {
  161.     BASE_EXT_DECL
  162.     register void *a6 __asm ("a6");
  163.     register struct ConfigDev* a0 __asm("a0");
  164.  
  165.     a6 = BASE_NAME;
  166.     a0 = configDev;
  167.     __asm volatile ("
  168.     jsr a6@(-0x54)"
  169.     : /* no output */
  170.     : "g" (a6), "g" (a0)
  171.     : "d0", "d1", "a0", "a1");
  172. }
  173. __inline static void FreeExpansionMem(BASE_PAR_DECL long unsigned int startSlot, long unsigned int numSlots)
  174. {
  175.     BASE_EXT_DECL
  176.     register void *a6 __asm ("a6");
  177.     register long unsigned int d0 __asm("d0");
  178.     register long unsigned int d1 __asm("d1");
  179.  
  180.     a6 = BASE_NAME;
  181.     d0 = startSlot;
  182.     d1 = numSlots;
  183.     __asm volatile ("
  184.     jsr a6@(-0x5a)"
  185.     : /* no output */
  186.     : "g" (a6), "g" (d0), "g" (d1)
  187.     : "d0", "d1", "a0", "a1");
  188. }
  189. __inline static UBYTE ReadExpansionByte(BASE_PAR_DECL APTR board, long unsigned int offset)
  190. {
  191.     BASE_EXT_DECL
  192.     register UBYTE res __asm("d0");
  193.     register void *a6 __asm ("a6");
  194.     register APTR a0 __asm("a0");
  195.     register long unsigned int d0 __asm("d0");
  196.  
  197.     a6 = BASE_NAME;
  198.     a0 = board;
  199.     d0 = offset;
  200.     __asm volatile ("
  201.     jsr a6@(-0x60)"
  202.     : "=g" (res)
  203.     : "g" (a6), "g" (a0), "g" (d0)
  204.     : "d0", "d1", "a0", "a1");
  205.     return res;
  206. }
  207. __inline static void ReadExpansionRom(BASE_PAR_DECL APTR board, struct ConfigDev* configDev)
  208. {
  209.     BASE_EXT_DECL
  210.     register void *a6 __asm ("a6");
  211.     register APTR a0 __asm("a0");
  212.     register struct ConfigDev* a1 __asm("a1");
  213.  
  214.     a6 = BASE_NAME;
  215.     a0 = board;
  216.     a1 = configDev;
  217.     __asm volatile ("
  218.     jsr a6@(-0x66)"
  219.     : /* no output */
  220.     : "g" (a6), "g" (a0), "g" (a1)
  221.     : "d0", "d1", "a0", "a1");
  222. }
  223. __inline static void RemConfigDev(BASE_PAR_DECL struct ConfigDev* configDev)
  224. {
  225.     BASE_EXT_DECL
  226.     register void *a6 __asm ("a6");
  227.     register struct ConfigDev* a0 __asm("a0");
  228.  
  229.     a6 = BASE_NAME;
  230.     a0 = configDev;
  231.     __asm volatile ("
  232.     jsr a6@(-0x6c)"
  233.     : /* no output */
  234.     : "g" (a6), "g" (a0)
  235.     : "d0", "d1", "a0", "a1");
  236. }
  237. __inline static void WriteExpansionByte(BASE_PAR_DECL APTR board, long unsigned int offset, long unsigned int byte)
  238. {
  239.     BASE_EXT_DECL
  240.     register void *a6 __asm ("a6");
  241.     register APTR a0 __asm("a0");
  242.     register long unsigned int d0 __asm("d0");
  243.     register long unsigned int d1 __asm("d1");
  244.  
  245.     a6 = BASE_NAME;
  246.     a0 = board;
  247.     d0 = offset;
  248.     d1 = byte;
  249.     __asm volatile ("
  250.     jsr a6@(-0x72)"
  251.     : /* no output */
  252.     : "g" (a6), "g" (a0), "g" (d0), "g" (d1)
  253.     : "d0", "d1", "a0", "a1");
  254. }
  255. __inline static void ObtainConfigBinding(BASE_PAR_DECL0)
  256. {
  257.     BASE_EXT_DECL
  258.     register void *a6 __asm ("a6");
  259.     a6 = BASE_NAME;
  260.     __asm volatile ("
  261.     jsr a6@(-0x78)"
  262.     : /* no output */
  263.     : "g" (a6)
  264.     : "d0", "d1", "a0", "a1");
  265. }
  266. __inline static void ReleaseConfigBinding(BASE_PAR_DECL0)
  267. {
  268.     BASE_EXT_DECL
  269.     register void *a6 __asm ("a6");
  270.     a6 = BASE_NAME;
  271.     __asm volatile ("
  272.     jsr a6@(-0x7e)"
  273.     : /* no output */
  274.     : "g" (a6)
  275.     : "d0", "d1", "a0", "a1");
  276. }
  277. __inline static void SetCurrentBinding(BASE_PAR_DECL struct CurrentBinding* currentBinding, long unsigned int bindingSize)
  278. {
  279.     BASE_EXT_DECL
  280.     register void *a6 __asm ("a6");
  281.     register struct CurrentBinding* a0 __asm("a0");
  282.     register long unsigned int d0 __asm("d0");
  283.  
  284.     a6 = BASE_NAME;
  285.     a0 = currentBinding;
  286.     d0 = bindingSize;
  287.     __asm volatile ("
  288.     jsr a6@(-0x84)"
  289.     : /* no output */
  290.     : "g" (a6), "g" (a0), "g" (d0)
  291.     : "d0", "d1", "a0", "a1");
  292. }
  293. __inline static ULONG GetCurrentBinding(BASE_PAR_DECL struct CurrentBinding* currentBinding, long unsigned int bindingSize)
  294. {
  295.     BASE_EXT_DECL
  296.     register ULONG res __asm("d0");
  297.     register void *a6 __asm ("a6");
  298.     register struct CurrentBinding* a0 __asm("a0");
  299.     register long unsigned int d0 __asm("d0");
  300.  
  301.     a6 = BASE_NAME;
  302.     a0 = currentBinding;
  303.     d0 = bindingSize;
  304.     __asm volatile ("
  305.     jsr a6@(-0x8a)"
  306.     : "=g" (res)
  307.     : "g" (a6), "g" (a0), "g" (d0)
  308.     : "d0", "d1", "a0", "a1");
  309.     return res;
  310. }
  311. __inline static struct DeviceNode* MakeDosNode(BASE_PAR_DECL APTR parmPacket)
  312. {
  313.     BASE_EXT_DECL
  314.     register struct DeviceNode* res __asm("d0");
  315.     register void *a6 __asm ("a6");
  316.     register APTR a0 __asm("a0");
  317.  
  318.     a6 = BASE_NAME;
  319.     a0 = parmPacket;
  320.     __asm volatile ("
  321.     jsr a6@(-0x90)"
  322.     : "=g" (res)
  323.     : "g" (a6), "g" (a0)
  324.     : "d0", "d1", "a0", "a1");
  325.     return res;
  326. }
  327. __inline static BOOL AddDosNode(BASE_PAR_DECL long int bootPri, long unsigned int flags, struct DeviceNode* deviceNode)
  328. {
  329.     BASE_EXT_DECL
  330.     register BOOL res __asm("d0");
  331.     register void *a6 __asm ("a6");
  332.     register long int d0 __asm("d0");
  333.     register long unsigned int d1 __asm("d1");
  334.     register struct DeviceNode* a0 __asm("a0");
  335.  
  336.     a6 = BASE_NAME;
  337.     d0 = bootPri;
  338.     d1 = flags;
  339.     a0 = deviceNode;
  340.     __asm volatile ("
  341.     jsr a6@(-0x96)"
  342.     : "=g" (res)
  343.     : "g" (a6), "g" (d0), "g" (d1), "g" (a0)
  344.     : "d0", "d1", "a0", "a1");
  345.     return res;
  346. }
  347. #undef BASE_EXT_DECL
  348. #undef BASE_PAR_DECL
  349. #undef BASE_PAR_DECL0
  350. #undef BASE_NAME
  351.