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>
This commit is contained in:
Thomas Gleixner
2009-08-19 15:37:03 +02:00
parent 736decac64
commit 845b3944bb
17 changed files with 53 additions and 113 deletions

View File

@@ -34,11 +34,6 @@ static inline int set_wallclock(unsigned long nowtime)
return PVOP_CALL1(int, pv_time_ops.set_wallclock, nowtime);
}
static inline void (*choose_time_init(void))(void)
{
return pv_time_ops.time_init;
}
/* The paravirtualized CPUID instruction. */
static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)

View File

@@ -88,8 +88,6 @@ struct pv_lazy_ops {
};
struct pv_time_ops {
void (*time_init)(void);
/* Set and set time of day */
unsigned long (*get_wallclock)(void);
int (*set_wallclock)(unsigned long);

View File

@@ -5,24 +5,6 @@
#define COMMAND_LINE_SIZE 2048
#ifndef __ASSEMBLY__
#include <asm/x86_init.h>
/*
* Any setup quirks to be performed?
*/
struct x86_quirks {
int (*arch_pre_time_init)(void);
int (*arch_time_init)(void);
};
extern void x86_quirk_pre_time_init(void);
extern void x86_quirk_time_init(void);
#endif /* __ASSEMBLY__ */
#ifdef __i386__
#include <linux/pfn.h>
@@ -42,6 +24,7 @@ extern void x86_quirk_time_init(void);
#ifndef __ASSEMBLY__
#include <asm/bootparam.h>
#include <asm/x86_init.h>
/* Interrupt control for vSMPowered x86_64 systems */
#ifdef CONFIG_X86_64
@@ -60,11 +43,11 @@ static inline void visws_early_detect(void) { }
static inline int is_visws_box(void) { return 0; }
#endif
extern struct x86_quirks *x86_quirks;
extern unsigned long saved_video_mode;
extern void reserve_standard_io_resources(void);
extern void i386_reserve_resources(void);
extern void setup_default_timer_irq(void);
#ifndef _SETUP

View File

@@ -54,7 +54,6 @@ extern void time_init(void);
#define get_wallclock() native_get_wallclock()
#define set_wallclock(x) native_set_wallclock(x)
#define choose_time_init() hpet_time_init
#endif /* CONFIG_PARAVIRT */

View File

@@ -12,8 +12,7 @@ unsigned long native_calibrate_tsc(void);
#ifdef CONFIG_X86_32
extern int timer_ack;
extern irqreturn_t timer_interrupt(int irq, void *dev_id);
#endif /* CONFIG_X86_32 */
#endif
extern int recalibrate_cpu_khz(void);
extern int no_timer_check;

View File

@@ -82,9 +82,13 @@ struct x86_init_paging {
* struct x86_init_timers - platform specific timer setup
* @setup_perpcu_clockev: set up the per cpu clock event device for the
* boot cpu
* @tsc_pre_init: platform function called before TSC init
* @timer_init: initialize the platform timer (default PIT/HPET)
*/
struct x86_init_timers {
void (*setup_percpu_clockev)(void);
void (*tsc_pre_init)(void);
void (*timer_init)(void);
};
/**