aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/paravirt.c2
-rw-r--r--arch/i386/kernel/time.c14
-rw-r--r--include/asm-i386/paravirt.h4
-rw-r--r--include/asm-i386/time.h5
4 files changed, 18 insertions, 7 deletions
diff --git a/arch/i386/kernel/paravirt.c b/arch/i386/kernel/paravirt.c
index 871448db1425..2ec331e03fa9 100644
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/i386/kernel/paravirt.c
@@ -494,7 +494,7 @@ struct paravirt_ops paravirt_ops = {
494 .memory_setup = machine_specific_memory_setup, 494 .memory_setup = machine_specific_memory_setup,
495 .get_wallclock = native_get_wallclock, 495 .get_wallclock = native_get_wallclock,
496 .set_wallclock = native_set_wallclock, 496 .set_wallclock = native_set_wallclock,
497 .time_init = time_init_hook, 497 .time_init = hpet_time_init,
498 .init_IRQ = native_init_IRQ, 498 .init_IRQ = native_init_IRQ,
499 499
500 .cpuid = native_cpuid, 500 .cpuid = native_cpuid,
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index a5350059557a..ccd3734edb8f 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -262,14 +262,22 @@ void notify_arch_cmos_timer(void)
262 262
263extern void (*late_time_init)(void); 263extern void (*late_time_init)(void);
264/* Duplicate of time_init() below, with hpet_enable part added */ 264/* Duplicate of time_init() below, with hpet_enable part added */
265static void __init hpet_time_init(void) 265void __init hpet_time_init(void)
266{ 266{
267 if (!hpet_enable()) 267 if (!hpet_enable())
268 setup_pit_timer(); 268 setup_pit_timer();
269 do_time_init(); 269 time_init_hook();
270} 270}
271 271
272/*
273 * This is called directly from init code; we must delay timer setup in the
274 * HPET case as we can't make the decision to turn on HPET this early in the
275 * boot process.
276 *
277 * The chosen time_init function will usually be hpet_time_init, above, but
278 * in the case of virtual hardware, an alternative function may be substituted.
279 */
272void __init time_init(void) 280void __init time_init(void)
273{ 281{
274 late_time_init = hpet_time_init; 282 late_time_init = choose_time_init();
275} 283}
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index 1e4226a85263..f8319cae2ac5 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -186,9 +186,9 @@ static inline int set_wallclock(unsigned long nowtime)
186 return paravirt_ops.set_wallclock(nowtime); 186 return paravirt_ops.set_wallclock(nowtime);
187} 187}
188 188
189static inline void do_time_init(void) 189static inline void (*choose_time_init(void))(void)
190{ 190{
191 return paravirt_ops.time_init(); 191 return paravirt_ops.time_init;
192} 192}
193 193
194/* The paravirtualized CPUID instruction. */ 194/* The paravirtualized CPUID instruction. */
diff --git a/include/asm-i386/time.h b/include/asm-i386/time.h
index ea8065af825a..eac011366dc2 100644
--- a/include/asm-i386/time.h
+++ b/include/asm-i386/time.h
@@ -28,13 +28,16 @@ static inline int native_set_wallclock(unsigned long nowtime)
28 return retval; 28 return retval;
29} 29}
30 30
31extern void (*late_time_init)(void);
32extern void hpet_time_init(void);
33
31#ifdef CONFIG_PARAVIRT 34#ifdef CONFIG_PARAVIRT
32#include <asm/paravirt.h> 35#include <asm/paravirt.h>
33#else /* !CONFIG_PARAVIRT */ 36#else /* !CONFIG_PARAVIRT */
34 37
35#define get_wallclock() native_get_wallclock() 38#define get_wallclock() native_get_wallclock()
36#define set_wallclock(x) native_set_wallclock(x) 39#define set_wallclock(x) native_set_wallclock(x)
37#define do_time_init() time_init_hook() 40#define choose_time_init() hpet_time_init
38 41
39#endif /* CONFIG_PARAVIRT */ 42#endif /* CONFIG_PARAVIRT */
40 43