i386: add TRACE_IRQS_OFF for exception 1 (debug)
[linux-2.6/x86.git] / include / asm-x86 / time.h
blob3e724eef7ac468f118bb8c7c95edac31577cc739
1 #ifndef ASM_X86__TIME_H
2 #define ASM_X86__TIME_H
4 extern void hpet_time_init(void);
6 #include <asm/mc146818rtc.h>
7 #ifdef CONFIG_X86_32
8 #include <linux/efi.h>
10 static inline unsigned long native_get_wallclock(void)
12 unsigned long retval;
14 if (efi_enabled)
15 retval = efi_get_time();
16 else
17 retval = mach_get_cmos_time();
19 return retval;
22 static inline int native_set_wallclock(unsigned long nowtime)
24 int retval;
26 if (efi_enabled)
27 retval = efi_set_rtc_mmss(nowtime);
28 else
29 retval = mach_set_rtc_mmss(nowtime);
31 return retval;
34 #else
35 extern void native_time_init_hook(void);
37 static inline unsigned long native_get_wallclock(void)
39 return mach_get_cmos_time();
42 static inline int native_set_wallclock(unsigned long nowtime)
44 return mach_set_rtc_mmss(nowtime);
47 #endif
49 extern void time_init(void);
51 #ifdef CONFIG_PARAVIRT
52 #include <asm/paravirt.h>
53 #else /* !CONFIG_PARAVIRT */
55 #define get_wallclock() native_get_wallclock()
56 #define set_wallclock(x) native_set_wallclock(x)
57 #define choose_time_init() hpet_time_init
59 #endif /* CONFIG_PARAVIRT */
61 extern unsigned long __init calibrate_cpu(void);
63 #endif /* ASM_X86__TIME_H */