]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/commitdiff
ARM: architected timers: add support for UP timer
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 20 Jan 2012 12:05:09 +0000 (12:05 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 8 Jun 2012 11:58:12 +0000 (11:58 +0000)
If CONFIG_LOCAL_TIMERS is not defined, let the architected timer
driver register a single clock_event_device that is used as a
global timer.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm/kernel/arch_timer.c

index 46729a2e2307c2c42d01ed301350b9d4f3bfcdea..9189e6392e98d261de7eb2aa0bda94887a0c3c4a 100644 (file)
@@ -229,6 +229,7 @@ static struct clocksource clocksource_counter = {
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+#ifdef CONFIG_LOCAL_TIMERS
 static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
 {
        pr_debug("arch_timer_teardown disable IRQ%d cpu #%d\n",
@@ -243,6 +244,9 @@ static struct local_timer_ops arch_timer_ops __cpuinitdata = {
        .setup  = arch_timer_setup,
        .stop   = arch_timer_stop,
 };
+#else
+static struct clock_event_device arch_timer_global_evt;
+#endif
 
 static int __init arch_timer_common_register(void)
 {
@@ -277,7 +281,12 @@ static int __init arch_timer_common_register(void)
                }
        }
 
+#ifdef CONFIG_LOCAL_TIMERS
        err = local_timer_register(&arch_timer_ops);
+#else
+       arch_timer_global_evt.cpumask = cpumask_of(0);
+       err = arch_timer_setup(&arch_timer_global_evt);
+#endif
        if (err)
                goto out_free_irq;