aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/time.h
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2009-09-09 22:48:56 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-09-16 08:34:50 -0400
commit7bd867dfb4e0357e06a3211ab2bd0e714110def3 (patch)
treefb66f4944f655ba594a7ae98f640e2310a389559 /arch/x86/include/asm/time.h
parent54e2603f1a85b9725aa13518d69148b6e7061aa9 (diff)
x86: Move get/set_wallclock to x86_platform_ops
get/set_wallclock() have already a set of platform dependent implementations (default, EFI, paravirt). MRST will add another variant. Moving them to platform ops simplifies the existing code and minimizes the effort to integrate new variants. Signed-off-by: Feng Tang <feng.tang@intel.com> LKML-Reference: <new-submission> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/include/asm/time.h')
-rw-r--r--arch/x86/include/asm/time.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/arch/x86/include/asm/time.h b/arch/x86/include/asm/time.h
index 9c5608b21c27..7bdec4e9b739 100644
--- a/arch/x86/include/asm/time.h
+++ b/arch/x86/include/asm/time.h
@@ -4,57 +4,7 @@
4extern void hpet_time_init(void); 4extern void hpet_time_init(void);
5 5
6#include <asm/mc146818rtc.h> 6#include <asm/mc146818rtc.h>
7#ifdef CONFIG_X86_32
8#include <linux/efi.h>
9
10static 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
22static 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
35extern void native_time_init_hook(void);
36
37static inline unsigned long native_get_wallclock(void)
38{
39 return mach_get_cmos_time();
40}
41
42static inline int native_set_wallclock(unsigned long nowtime)
43{
44 return mach_set_rtc_mmss(nowtime);
45}
46
47#endif
48 7
49extern void time_init(void); 8extern void time_init(void);
50 9
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
58#endif /* CONFIG_PARAVIRT */
59
60#endif /* _ASM_X86_TIME_H */ 10#endif /* _ASM_X86_TIME_H */