time.h 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _ASMi386_TIME_H
  2. #define _ASMi386_TIME_H
  3. #include <linux/efi.h>
  4. #include "mach_time.h"
  5. static inline unsigned long native_get_wallclock(void)
  6. {
  7. unsigned long retval;
  8. if (efi_enabled)
  9. retval = efi_get_time();
  10. else
  11. retval = mach_get_cmos_time();
  12. return retval;
  13. }
  14. static inline int native_set_wallclock(unsigned long nowtime)
  15. {
  16. int retval;
  17. if (efi_enabled)
  18. retval = efi_set_rtc_mmss(nowtime);
  19. else
  20. retval = mach_set_rtc_mmss(nowtime);
  21. return retval;
  22. }
  23. extern void (*late_time_init)(void);
  24. extern void hpet_time_init(void);
  25. #ifdef CONFIG_PARAVIRT
  26. #include <asm/paravirt.h>
  27. #else /* !CONFIG_PARAVIRT */
  28. #define get_wallclock() native_get_wallclock()
  29. #define set_wallclock(x) native_set_wallclock(x)
  30. #define choose_time_init() hpet_time_init
  31. #endif /* CONFIG_PARAVIRT */
  32. #endif