aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/time.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:10 -0500
commitee238e5ca66858f80170f87724f84d67183b069a (patch)
treec08fe7edeac9b55fad0be5f7050cc3ddf8796232 /include/asm-x86/time.h
parent49a697871e2edcbc9cc682466bc4f2316b854d23 (diff)
x86: prepare time related functions for paravirt
This patch add provisions for time related functions so they can be later replaced by paravirt versions. it basically encloses {g,s}et_wallclock inside the already existent functions update_persistent_clock and read_persistent_clock, and defines {s,g}et_wallclock to the core of such functions. it also allow for a later-on-game time initialization, as done by i386. Paravirt guests can set a function to do their own initialization this way. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/time.h')
-rw-r--r--include/asm-x86/time.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/asm-x86/time.h b/include/asm-x86/time.h
index b3f94cd81ac6..68779b048a3e 100644
--- a/include/asm-x86/time.h
+++ b/include/asm-x86/time.h
@@ -1,8 +1,12 @@
1#ifndef _ASMi386_TIME_H 1#ifndef _ASMX86_TIME_H
2#define _ASMi386_TIME_H 2#define _ASMX86_TIME_H
3
4extern void (*late_time_init)(void);
5extern void hpet_time_init(void);
3 6
4#include <linux/efi.h>
5#include <asm/mc146818rtc.h> 7#include <asm/mc146818rtc.h>
8#ifdef CONFIG_X86_32
9#include <linux/efi.h>
6 10
7static inline unsigned long native_get_wallclock(void) 11static inline unsigned long native_get_wallclock(void)
8{ 12{
@@ -28,8 +32,20 @@ static inline int native_set_wallclock(unsigned long nowtime)
28 return retval; 32 return retval;
29} 33}
30 34
31extern void (*late_time_init)(void); 35#else
32extern void hpet_time_init(void); 36extern void native_time_init_hook(void);
37
38static inline unsigned long native_get_wallclock(void)
39{
40 return mach_get_cmos_time();
41}
42
43static inline int native_set_wallclock(unsigned long nowtime)
44{
45 return mach_set_rtc_mmss(nowtime);
46}
47
48#endif
33 49
34#ifdef CONFIG_PARAVIRT 50#ifdef CONFIG_PARAVIRT
35#include <asm/paravirt.h> 51#include <asm/paravirt.h>