home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / src / linux-headers-2.6.28-15 / arch / x86 / include / asm / time.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-24  |  1.1 KB  |  64 lines

  1. #ifndef _ASM_X86_TIME_H
  2. #define _ASM_X86_TIME_H
  3.  
  4. extern void hpet_time_init(void);
  5.  
  6. #include <asm/mc146818rtc.h>
  7. #ifdef CONFIG_X86_32
  8. #include <linux/efi.h>
  9.  
  10. static inline unsigned long native_get_wallclock(void)
  11. {
  12.     unsigned long retval;
  13.  
  14.     if (efi_enabled)
  15.         retval = efi_get_time();
  16.     else
  17.         retval = mach_get_cmos_time();
  18.  
  19.     return retval;
  20. }
  21.  
  22. static inline int native_set_wallclock(unsigned long nowtime)
  23. {
  24.     int retval;
  25.  
  26.     if (efi_enabled)
  27.         retval = efi_set_rtc_mmss(nowtime);
  28.     else
  29.         retval = mach_set_rtc_mmss(nowtime);
  30.  
  31.     return retval;
  32. }
  33.  
  34. #else
  35. extern void native_time_init_hook(void);
  36.  
  37. static inline unsigned long native_get_wallclock(void)
  38. {
  39.     return mach_get_cmos_time();
  40. }
  41.  
  42. static inline int native_set_wallclock(unsigned long nowtime)
  43. {
  44.     return mach_set_rtc_mmss(nowtime);
  45. }
  46.  
  47. #endif
  48.  
  49. extern void time_init(void);
  50.  
  51. #ifdef CONFIG_PARAVIRT
  52. #include <asm/paravirt.h>
  53. #else /* !CONFIG_PARAVIRT */
  54.  
  55. #define get_wallclock() native_get_wallclock()
  56. #define set_wallclock(x) native_set_wallclock(x)
  57. #define choose_time_init() hpet_time_init
  58.  
  59. #endif /* CONFIG_PARAVIRT */
  60.  
  61. extern unsigned long __init calibrate_cpu(void);
  62.  
  63. #endif /* _ASM_X86_TIME_H */
  64.