mc146818rtc.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

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