aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-19 09:37:03 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 03:35:46 -0400
commit845b3944bbdf9e9247849bf037f27ff3a3f26d87 (patch)
treeb14b40b5ba650996c646ed760cfa4b3283e04953 /arch/x86/include/asm
parent736decac643e8982655e22ac7f0e5e61c5b7f9bd (diff)
x86: Add timer_init to x86_init_ops
The timer init code is convoluted with several quirks and the paravirt timer chooser. Figuring out which code path is actually taken is not for the faint hearted. Move the numaq TSC quirk to tsc_pre_init x86_init_ops function and replace the paravirt time chooser and the remaining x86 quirk with a simple x86_init_ops function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/paravirt.h5
-rw-r--r--arch/x86/include/asm/paravirt_types.h2
-rw-r--r--arch/x86/include/asm/setup.h21
-rw-r--r--arch/x86/include/asm/time.h1
-rw-r--r--arch/x86/include/asm/timer.h3
-rw-r--r--arch/x86/include/asm/x86_init.h4
6 files changed, 7 insertions, 29 deletions
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 825674a968d1..11a4ba7b209c 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -34,11 +34,6 @@ static inline int set_wallclock(unsigned long nowtime)
34 return PVOP_CALL1(int, pv_time_ops.set_wallclock, nowtime); 34 return PVOP_CALL1(int, pv_time_ops.set_wallclock, nowtime);
35} 35}
36 36
37static inline void (*choose_time_init(void))(void)
38{
39 return pv_time_ops.time_init;
40}
41
42/* The paravirtualized CPUID instruction. */ 37/* The paravirtualized CPUID instruction. */
43static inline void __cpuid(unsigned int *eax, unsigned int *ebx, 38static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
44 unsigned int *ecx, unsigned int *edx) 39 unsigned int *ecx, unsigned int *edx)
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 1da89276d142..0d812e592e3b 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -88,8 +88,6 @@ struct pv_lazy_ops {
88}; 88};
89 89
90struct pv_time_ops { 90struct pv_time_ops {
91 void (*time_init)(void);
92
93 /* Set and set time of day */ 91 /* Set and set time of day */
94 unsigned long (*get_wallclock)(void); 92 unsigned long (*get_wallclock)(void);
95 int (*set_wallclock)(unsigned long); 93 int (*set_wallclock)(unsigned long);
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 58b58952b80d..861e1fe2303b 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -5,24 +5,6 @@
5 5
6#define COMMAND_LINE_SIZE 2048 6#define COMMAND_LINE_SIZE 2048
7 7
8#ifndef __ASSEMBLY__
9
10#include <asm/x86_init.h>
11
12/*
13 * Any setup quirks to be performed?
14 */
15
16struct x86_quirks {
17 int (*arch_pre_time_init)(void);
18 int (*arch_time_init)(void);
19};
20
21extern void x86_quirk_pre_time_init(void);
22extern void x86_quirk_time_init(void);
23
24#endif /* __ASSEMBLY__ */
25
26#ifdef __i386__ 8#ifdef __i386__
27 9
28#include <linux/pfn.h> 10#include <linux/pfn.h>
@@ -42,6 +24,7 @@ extern void x86_quirk_time_init(void);
42 24
43#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
44#include <asm/bootparam.h> 26#include <asm/bootparam.h>
27#include <asm/x86_init.h>
45 28
46/* Interrupt control for vSMPowered x86_64 systems */ 29/* Interrupt control for vSMPowered x86_64 systems */
47#ifdef CONFIG_X86_64 30#ifdef CONFIG_X86_64
@@ -60,11 +43,11 @@ static inline void visws_early_detect(void) { }
60static inline int is_visws_box(void) { return 0; } 43static inline int is_visws_box(void) { return 0; }
61#endif 44#endif
62 45
63extern struct x86_quirks *x86_quirks;
64extern unsigned long saved_video_mode; 46extern unsigned long saved_video_mode;
65 47
66extern void reserve_standard_io_resources(void); 48extern void reserve_standard_io_resources(void);
67extern void i386_reserve_resources(void); 49extern void i386_reserve_resources(void);
50extern void setup_default_timer_irq(void);
68 51
69#ifndef _SETUP 52#ifndef _SETUP
70 53
diff --git a/arch/x86/include/asm/time.h b/arch/x86/include/asm/time.h
index 50c733aac421..91bb162b5a31 100644
--- a/arch/x86/include/asm/time.h
+++ b/arch/x86/include/asm/time.h
@@ -54,7 +54,6 @@ extern void time_init(void);
54 54
55#define get_wallclock() native_get_wallclock() 55#define get_wallclock() native_get_wallclock()
56#define set_wallclock(x) native_set_wallclock(x) 56#define set_wallclock(x) native_set_wallclock(x)
57#define choose_time_init() hpet_time_init
58 57
59#endif /* CONFIG_PARAVIRT */ 58#endif /* CONFIG_PARAVIRT */
60 59
diff --git a/arch/x86/include/asm/timer.h b/arch/x86/include/asm/timer.h
index 20ca9c4d4686..e854c7ab4169 100644
--- a/arch/x86/include/asm/timer.h
+++ b/arch/x86/include/asm/timer.h
@@ -12,8 +12,7 @@ unsigned long native_calibrate_tsc(void);
12 12
13#ifdef CONFIG_X86_32 13#ifdef CONFIG_X86_32
14extern int timer_ack; 14extern int timer_ack;
15extern irqreturn_t timer_interrupt(int irq, void *dev_id); 15#endif
16#endif /* CONFIG_X86_32 */
17extern int recalibrate_cpu_khz(void); 16extern int recalibrate_cpu_khz(void);
18 17
19extern int no_timer_check; 18extern int no_timer_check;
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index b7d258f4c401..f8bdd2271a04 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -82,9 +82,13 @@ struct x86_init_paging {
82 * struct x86_init_timers - platform specific timer setup 82 * struct x86_init_timers - platform specific timer setup
83 * @setup_perpcu_clockev: set up the per cpu clock event device for the 83 * @setup_perpcu_clockev: set up the per cpu clock event device for the
84 * boot cpu 84 * boot cpu
85 * @tsc_pre_init: platform function called before TSC init
86 * @timer_init: initialize the platform timer (default PIT/HPET)
85 */ 87 */
86struct x86_init_timers { 88struct x86_init_timers {
87 void (*setup_percpu_clockev)(void); 89 void (*setup_percpu_clockev)(void);
90 void (*tsc_pre_init)(void);
91 void (*timer_init)(void);
88}; 92};
89 93
90/** 94/**