diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-01-10 18:38:25 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2012-03-13 09:45:55 -0400 |
commit | d45785929f1248d2e769f959f180f0504e326622 (patch) | |
tree | b9ff3ebc9ec742f649261d51d269dd8c7b2e6172 | |
parent | 5ca709c16d0fb88b86db35e958b165b61cbc1962 (diff) |
ARM: local timers: make the runtime registration interface mandatory
Remove all traces of the compile-time local timer interface,
and make the runtime selection mandatory.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm/include/asm/localtimer.h | 26 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 23 |
2 files changed, 6 insertions, 43 deletions
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h index 955eed10ffb5..f77ffc1eb0c2 100644 --- a/arch/arm/include/asm/localtimer.h +++ b/arch/arm/include/asm/localtimer.h | |||
@@ -19,38 +19,12 @@ struct local_timer_ops { | |||
19 | void (*stop)(struct clock_event_device *); | 19 | void (*stop)(struct clock_event_device *); |
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* | ||
23 | * Setup a per-cpu timer, whether it be a local timer or dummy broadcast | ||
24 | */ | ||
25 | void percpu_timer_setup(void); | ||
26 | |||
27 | #ifdef CONFIG_LOCAL_TIMERS | 22 | #ifdef CONFIG_LOCAL_TIMERS |
28 | /* | 23 | /* |
29 | * Stop the local timer | ||
30 | */ | ||
31 | void local_timer_stop(struct clock_event_device *); | ||
32 | |||
33 | /* | ||
34 | * Setup a local timer interrupt for a CPU. | ||
35 | */ | ||
36 | int local_timer_setup(struct clock_event_device *); | ||
37 | |||
38 | /* | ||
39 | * Register a local timer driver | 24 | * Register a local timer driver |
40 | */ | 25 | */ |
41 | int local_timer_register(struct local_timer_ops *); | 26 | int local_timer_register(struct local_timer_ops *); |
42 | |||
43 | #else | 27 | #else |
44 | |||
45 | static inline int local_timer_setup(struct clock_event_device *evt) | ||
46 | { | ||
47 | return -ENXIO; | ||
48 | } | ||
49 | |||
50 | static inline void local_timer_stop(struct clock_event_device *evt) | ||
51 | { | ||
52 | } | ||
53 | |||
54 | static inline int local_timer_register(struct local_timer_ops *ops) | 28 | static inline int local_timer_register(struct local_timer_ops *ops) |
55 | { | 29 | { |
56 | return -ENXIO; | 30 | return -ENXIO; |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 89bb02c90ae1..1ad84a6c9bfb 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -246,6 +246,8 @@ static void __cpuinit smp_store_cpu_info(unsigned int cpuid) | |||
246 | store_cpu_topology(cpuid); | 246 | store_cpu_topology(cpuid); |
247 | } | 247 | } |
248 | 248 | ||
249 | static void percpu_timer_setup(void); | ||
250 | |||
249 | /* | 251 | /* |
250 | * This is the secondary CPU boot entry. We're using this CPUs | 252 | * This is the secondary CPU boot entry. We're using this CPUs |
251 | * idle thread stack, but a set of temporary page tables. | 253 | * idle thread stack, but a set of temporary page tables. |
@@ -472,21 +474,7 @@ int local_timer_register(struct local_timer_ops *ops) | |||
472 | } | 474 | } |
473 | #endif | 475 | #endif |
474 | 476 | ||
475 | int __cpuinit __attribute__ ((weak)) local_timer_setup(struct clock_event_device *clk) | 477 | static void __cpuinit percpu_timer_setup(void) |
476 | { | ||
477 | if (lt_ops) | ||
478 | return lt_ops->setup(clk); | ||
479 | |||
480 | return -ENXIO; | ||
481 | } | ||
482 | |||
483 | void __attribute__ ((weak)) local_timer_stop(struct clock_event_device *clk) | ||
484 | { | ||
485 | if (lt_ops) | ||
486 | lt_ops->stop(clk); | ||
487 | } | ||
488 | |||
489 | void __cpuinit percpu_timer_setup(void) | ||
490 | { | 478 | { |
491 | unsigned int cpu = smp_processor_id(); | 479 | unsigned int cpu = smp_processor_id(); |
492 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); | 480 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); |
@@ -494,7 +482,7 @@ void __cpuinit percpu_timer_setup(void) | |||
494 | evt->cpumask = cpumask_of(cpu); | 482 | evt->cpumask = cpumask_of(cpu); |
495 | evt->broadcast = smp_timer_broadcast; | 483 | evt->broadcast = smp_timer_broadcast; |
496 | 484 | ||
497 | if (local_timer_setup(evt)) | 485 | if (!lt_ops || lt_ops->setup(evt)) |
498 | broadcast_timer_setup(evt); | 486 | broadcast_timer_setup(evt); |
499 | } | 487 | } |
500 | 488 | ||
@@ -509,7 +497,8 @@ static void percpu_timer_stop(void) | |||
509 | unsigned int cpu = smp_processor_id(); | 497 | unsigned int cpu = smp_processor_id(); |
510 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); | 498 | struct clock_event_device *evt = &per_cpu(percpu_clockevent, cpu); |
511 | 499 | ||
512 | local_timer_stop(evt); | 500 | if (lt_ops) |
501 | lt_ops->stop(evt); | ||
513 | } | 502 | } |
514 | #endif | 503 | #endif |
515 | 504 | ||