home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / cbm / os-include-bin.lha / GNU / os-include / inline / potgo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  1.5 KB  |  69 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
  11. #define BASE_EXT_DECL0 extern struct Node * PotgoBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME PotgoBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline UWORD 
  24. AllocPotBits (BASE_PAR_DECL unsigned long bits)
  25. {
  26.   BASE_EXT_DECL
  27.   register UWORD  _res  __asm("d0");
  28.   register struct Node *a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = bits;
  30.   __asm __volatile ("jsr a6@(-0x6)"
  31.   : "=r" (_res)
  32.   : "r" (a6), "r" (d0)
  33.   : "a0","a1","d0","d1", "memory");
  34.   return _res;
  35. }
  36. extern __inline void 
  37. FreePotBits (BASE_PAR_DECL unsigned long bits)
  38. {
  39.   BASE_EXT_DECL
  40.   register struct Node *a6 __asm("a6") = BASE_NAME;
  41.   register unsigned long d0 __asm("d0") = bits;
  42.   __asm __volatile ("jsr a6@(-0xc)"
  43.   : /* no output */
  44.   : "r" (a6), "r" (d0)
  45.   : "a0","a1","d0","d1", "memory");
  46. }
  47. extern __inline void 
  48. WritePotgo (BASE_PAR_DECL unsigned long word,unsigned long mask)
  49. {
  50.   BASE_EXT_DECL
  51.   register struct Node *a6 __asm("a6") = BASE_NAME;
  52.   register unsigned long d0 __asm("d0") = word;
  53.   register unsigned long d1 __asm("d1") = mask;
  54.   __asm __volatile ("jsr a6@(-0x12)"
  55.   : /* no output */
  56.   : "r" (a6), "r" (d0), "r" (d1)
  57.   : "a0","a1","d0","d1", "memory");
  58. }
  59.  
  60. #undef BASE_EXT_DECL
  61. #undef BASE_EXT_DECL0
  62. #undef BASE_PAR_DECL
  63. #undef BASE_PAR_DECL0
  64. #undef BASE_NAME
  65.  
  66. __END_DECLS
  67.  
  68. #endif /* _INLINE_POTGO_H */
  69.