mc146818rtc_64.h 650 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Machine dependent access functions for RTC registers.
  3. */
  4. #ifndef __ASM_SPARC64_MC146818RTC_H
  5. #define __ASM_SPARC64_MC146818RTC_H
  6. #include <asm/io.h>
  7. #ifndef RTC_PORT
  8. extern unsigned long cmos_regs;
  9. #define RTC_PORT(x) (cmos_regs + (x))
  10. #define RTC_ALWAYS_BCD 0
  11. #endif
  12. /*
  13. * The yet supported machines all access the RTC index register via
  14. * an ISA port access but the way to access the date register differs ...
  15. */
  16. #define CMOS_READ(addr) ({ \
  17. outb_p((addr),RTC_PORT(0)); \
  18. inb_p(RTC_PORT(1)); \
  19. })
  20. #define CMOS_WRITE(val, addr) ({ \
  21. outb_p((addr),RTC_PORT(0)); \
  22. outb_p((val),RTC_PORT(1)); \
  23. })
  24. #endif /* __ASM_SPARC64_MC146818RTC_H */