home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / os-include / inline / battclock.h < prev    next >
C/C++ Source or Header  |  1994-09-22  |  1KB  |  66 lines

  1. #ifndef _INLINE_BATTCLOCK_H
  2. #define _INLINE_BATTCLOCK_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 * BattClockBase;
  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 BattClockBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline ULONG 
  24. ReadBattClock (BASE_PAR_DECL0)
  25. {
  26.   BASE_EXT_DECL
  27.   register ULONG  _res  __asm("d0");
  28.   register struct Node *a6 __asm("a6") = BASE_NAME;
  29.   __asm __volatile ("jsr a6@(-0xc)"
  30.   : "=r" (_res)
  31.   : "r" (a6)
  32.   : "a0","a1","d0","d1", "memory");
  33.   return _res;
  34. }
  35. extern __inline void 
  36. ResetBattClock (BASE_PAR_DECL0)
  37. {
  38.   BASE_EXT_DECL
  39.   register struct Node *a6 __asm("a6") = BASE_NAME;
  40.   __asm __volatile ("jsr a6@(-0x6)"
  41.   : /* no output */
  42.   : "r" (a6)
  43.   : "a0","a1","d0","d1", "memory");
  44. }
  45. extern __inline void 
  46. WriteBattClock (BASE_PAR_DECL unsigned long time)
  47. {
  48.   BASE_EXT_DECL
  49.   register struct Node *a6 __asm("a6") = BASE_NAME;
  50.   register unsigned long d0 __asm("d0") = time;
  51.   __asm __volatile ("jsr a6@(-0x12)"
  52.   : /* no output */
  53.   : "r" (a6), "r" (d0)
  54.   : "a0","a1","d0","d1", "memory");
  55. }
  56.  
  57. #undef BASE_EXT_DECL
  58. #undef BASE_EXT_DECL0
  59. #undef BASE_PAR_DECL
  60. #undef BASE_PAR_DECL0
  61. #undef BASE_NAME
  62.  
  63. __END_DECLS
  64.  
  65. #endif /* _INLINE_BATTCLOCK_H */
  66.