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

  1. #include <inline/stub.h>
  2. #ifndef BASE_EXT_DECL
  3. #define BASE_EXT_DECL extern struct Library * PotgoBase;
  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 PotgoBase
  11. #endif
  12. __inline static UWORD AllocPotBits(BASE_PAR_DECL long unsigned int bits)
  13. {
  14.     BASE_EXT_DECL
  15.     register UWORD res __asm("d0");
  16.     register void *a6 __asm ("a6");
  17.     register long unsigned int d0 __asm("d0");
  18.  
  19.     a6 = BASE_NAME;
  20.     d0 = bits;
  21.     __asm volatile ("
  22.     jsr a6@(-0x6)"
  23.     : "=g" (res)
  24.     : "g" (a6), "g" (d0)
  25.     : "d0", "d1", "a0", "a1");
  26.     return res;
  27. }
  28. __inline static void FreePotBits(BASE_PAR_DECL long unsigned int bits)
  29. {
  30.     BASE_EXT_DECL
  31.     register void *a6 __asm ("a6");
  32.     register long unsigned int d0 __asm("d0");
  33.  
  34.     a6 = BASE_NAME;
  35.     d0 = bits;
  36.     __asm volatile ("
  37.     jsr a6@(-0xc)"
  38.     : /* no output */
  39.     : "g" (a6), "g" (d0)
  40.     : "d0", "d1", "a0", "a1");
  41. }
  42. __inline static void WritePotgo(BASE_PAR_DECL long unsigned int word, long unsigned int mask)
  43. {
  44.     BASE_EXT_DECL
  45.     register void *a6 __asm ("a6");
  46.     register long unsigned int d0 __asm("d0");
  47.     register long unsigned int d1 __asm("d1");
  48.  
  49.     a6 = BASE_NAME;
  50.     d0 = word;
  51.     d1 = mask;
  52.     __asm volatile ("
  53.     jsr a6@(-0x12)"
  54.     : /* no output */
  55.     : "g" (a6), "g" (d0), "g" (d1)
  56.     : "d0", "d1", "a0", "a1");
  57. }
  58. #undef BASE_EXT_DECL
  59. #undef BASE_PAR_DECL
  60. #undef BASE_PAR_DECL0
  61. #undef BASE_NAME
  62.