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

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