aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/smp.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-01-10 14:26:45 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2012-03-13 09:27:50 -0400
commit0ef330e10dcdbca8f4566e9eaf77015f8ce039d3 (patch)
treeb6adfb473921a37bf73372dd3dfec23a1e450d67 /arch/arm/kernel/smp.c
parentabde710ca8776f851e41c3dfe78ad7dcafa26dc9 (diff)
ARM: local timers: introduce a new registration interface
In order to switch to a runtime selectable local timer, add a registration interface that timer drivers can use to register to the core. local_timer_setup() and local_timer_stop() are made weak symbols in order not to break existing setups. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/kernel/smp.c')
-rw-r--r--arch/arm/kernel/smp.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index cdeb727527d3..89bb02c90ae1 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -459,6 +459,33 @@ static void __cpuinit broadcast_timer_setup(struct clock_event_device *evt)
459 clockevents_register_device(evt); 459 clockevents_register_device(evt);
460} 460}
461 461
462static struct local_timer_ops *lt_ops;
463
464#ifdef CONFIG_LOCAL_TIMERS
465int local_timer_register(struct local_timer_ops *ops)
466{
467 if (lt_ops)
468 return -EBUSY;
469
470 lt_ops = ops;
471 return 0;
472}
473#endif
474
475int __cpuinit __attribute__ ((weak)) local_timer_setup(struct clock_event_device *clk)
476{
477 if (lt_ops)
478 return lt_ops->setup(clk);
479
480 return -ENXIO;
481}
482
483void __attribute__ ((weak)) local_timer_stop(struct clock_event_device *clk)
484{
485 if (lt_ops)
486 lt_ops->stop(clk);
487}
488
462void __cpuinit percpu_timer_setup(void) 489void __cpuinit percpu_timer_setup(void)
463{ 490{
464 unsigned int cpu = smp_processor_id(); 491 unsigned int cpu = smp_processor_id();