home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / c / gcc233.lha / os-include / inline / battclock.h < prev    next >
C/C++ Source or Header  |  1992-12-29  |  1KB  |  61 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 extern struct Library*  BattClockBase;
  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 BattClockBase
  18. #endif
  19.  
  20. static __inline ULONG 
  21. ReadBattClock (BASE_PAR_DECL0)
  22. {
  23.   BASE_EXT_DECL
  24.   register ULONG  _res  __asm("d0");
  25.   register struct Library* a6 __asm("a6") = BASE_NAME;
  26.   __asm __volatile ("jsr a6@(-0xc)"
  27.   : "=r" (_res)
  28.   : "r" (a6)
  29.   : "a0","a1","d0","d1", "memory");
  30.   return _res;
  31. }
  32. static __inline void 
  33. ResetBattClock (BASE_PAR_DECL0)
  34. {
  35.   BASE_EXT_DECL
  36.   register struct Library* a6 __asm("a6") = BASE_NAME;
  37.   __asm __volatile ("jsr a6@(-0x6)"
  38.   : /* no output */
  39.   : "r" (a6)
  40.   : "a0","a1","d0","d1", "memory");
  41. }
  42. static __inline void 
  43. WriteBattClock (BASE_PAR_DECL unsigned long time)
  44. {
  45.   BASE_EXT_DECL
  46.   register struct Library* a6 __asm("a6") = BASE_NAME;
  47.   register unsigned long d0 __asm("d0") = time;
  48.   __asm __volatile ("jsr a6@(-0x12)"
  49.   : /* no output */
  50.   : "r" (a6), "r" (d0)
  51.   : "a0","a1","d0","d1", "memory");
  52. }
  53. #undef BASE_EXT_DECL
  54. #undef BASE_PAR_DECL
  55. #undef BASE_PAR_DECL0
  56. #undef BASE_NAME
  57.  
  58. __END_DECLS
  59.  
  60. #endif /* _INLINE_BATTCLOCK_H */
  61.