summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/time_32.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-19 15:37:03 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 09:35:46 +0200
commit845b3944bbdf9e9247849bf037f27ff3a3f26d87 (patch)
treeb14b40b5ba650996c646ed760cfa4b3283e04953 /arch/x86/kernel/time_32.c
parent736decac643e8982655e22ac7f0e5e61c5b7f9bd (diff)
downloadop-kernel-dev-845b3944bbdf9e9247849bf037f27ff3a3f26d87.zip
op-kernel-dev-845b3944bbdf9e9247849bf037f27ff3a3f26d87.tar.gz
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/kernel/time_32.c')
-rw-r--r--arch/x86/kernel/time_32.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 5c5d87f..89bbb52 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(profile_pc);
* Time Stamp Counter value at the time of the timer interrupt, so that
* we later on can estimate the time of day more exactly.
*/
-irqreturn_t timer_interrupt(int irq, void *dev_id)
+static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
/* Keep nmi watchdog up to date */
inc_irq_stat(irq0_irqs);
@@ -113,25 +113,37 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-/* Duplicate of time_init() below, with hpet_enable part added */
+static struct irqaction irq0 = {
+ .handler = timer_interrupt,
+ .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
+ .name = "timer"
+};
+
+void __init setup_default_timer_irq(void)
+{
+ irq0.mask = cpumask_of_cpu(0);
+ setup_irq(0, &irq0);
+}
+
+/* Default timer init function */
void __init hpet_time_init(void)
{
if (!hpet_enable())
setup_pit_timer();
- x86_quirk_time_init();
+ setup_default_timer_irq();
+}
+
+static void x86_late_time_init(void)
+{
+ x86_init.timers.timer_init();
}
/*
- * This is called directly from init code; we must delay timer setup in the
- * HPET case as we can't make the decision to turn on HPET this early in the
- * boot process.
- *
- * The chosen time_init function will usually be hpet_time_init, above, but
- * in the case of virtual hardware, an alternative function may be substituted.
+ * Initialize TSC and delay the periodic timer init to
+ * late x86_late_time_init() so ioremap works.
*/
void __init time_init(void)
{
- x86_quirk_pre_time_init();
tsc_init();
- late_time_init = choose_time_init();
+ late_time_init = x86_late_time_init;
}
OpenPOWER on IntegriCloud