diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2008-02-04 11:28:56 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-04 12:52:18 -0500 |
commit | 3e459990961db7f3f2dcf21e2b38a7216dfd10dd (patch) | |
tree | d85f86d36cf2433817ba8f4d29447ca4950e206d | |
parent | ae30ceac3c6bbacdb227816abe6f0c7ea867ac7c (diff) |
[ARM] 4813/1: Add SMP helper functions for clockevents support
This patch adds the smp_call_function_single and smp_timer_broadcast
functions and modifies ipi_timer to call the platform-specific function
local_timer_interrupt.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/kernel/smp.c | 29 | ||||
-rw-r--r-- | include/asm-arm/smp.h | 10 |
2 files changed, 37 insertions, 2 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index eafbb2b05eb8..aef6f9ab900e 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -454,6 +454,27 @@ int smp_call_function(void (*func)(void *info), void *info, int retry, | |||
454 | } | 454 | } |
455 | EXPORT_SYMBOL_GPL(smp_call_function); | 455 | EXPORT_SYMBOL_GPL(smp_call_function); |
456 | 456 | ||
457 | int smp_call_function_single(int cpu, void (*func)(void *info), void *info, | ||
458 | int retry, int wait) | ||
459 | { | ||
460 | /* prevent preemption and reschedule on another processor */ | ||
461 | int current_cpu = get_cpu(); | ||
462 | int ret = 0; | ||
463 | |||
464 | if (cpu == current_cpu) { | ||
465 | local_irq_disable(); | ||
466 | func(info); | ||
467 | local_irq_enable(); | ||
468 | } else | ||
469 | ret = smp_call_function_on_cpu(func, info, retry, wait, | ||
470 | cpumask_of_cpu(cpu)); | ||
471 | |||
472 | put_cpu(); | ||
473 | |||
474 | return ret; | ||
475 | } | ||
476 | EXPORT_SYMBOL_GPL(smp_call_function_single); | ||
477 | |||
457 | void show_ipi_list(struct seq_file *p) | 478 | void show_ipi_list(struct seq_file *p) |
458 | { | 479 | { |
459 | unsigned int cpu; | 480 | unsigned int cpu; |
@@ -481,8 +502,7 @@ void show_local_irqs(struct seq_file *p) | |||
481 | static void ipi_timer(void) | 502 | static void ipi_timer(void) |
482 | { | 503 | { |
483 | irq_enter(); | 504 | irq_enter(); |
484 | profile_tick(CPU_PROFILING); | 505 | local_timer_interrupt(); |
485 | update_process_times(user_mode(get_irq_regs())); | ||
486 | irq_exit(); | 506 | irq_exit(); |
487 | } | 507 | } |
488 | 508 | ||
@@ -621,6 +641,11 @@ void smp_send_timer(void) | |||
621 | send_ipi_message(mask, IPI_TIMER); | 641 | send_ipi_message(mask, IPI_TIMER); |
622 | } | 642 | } |
623 | 643 | ||
644 | void smp_timer_broadcast(cpumask_t mask) | ||
645 | { | ||
646 | send_ipi_message(mask, IPI_TIMER); | ||
647 | } | ||
648 | |||
624 | void smp_send_stop(void) | 649 | void smp_send_stop(void) |
625 | { | 650 | { |
626 | cpumask_t mask = cpu_online_map; | 651 | cpumask_t mask = cpu_online_map; |
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h index f67acce387e7..1f7c51a1886d 100644 --- a/include/asm-arm/smp.h +++ b/include/asm-arm/smp.h | |||
@@ -61,6 +61,11 @@ extern void smp_cross_call(cpumask_t callmap); | |||
61 | extern void smp_send_timer(void); | 61 | extern void smp_send_timer(void); |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * Broadcast a clock event to other CPUs. | ||
65 | */ | ||
66 | extern void smp_timer_broadcast(cpumask_t mask); | ||
67 | |||
68 | /* | ||
64 | * Boot a secondary CPU, and assign it the specified idle task. | 69 | * Boot a secondary CPU, and assign it the specified idle task. |
65 | * This also gives us the initial stack to use for this CPU. | 70 | * This also gives us the initial stack to use for this CPU. |
66 | */ | 71 | */ |
@@ -96,6 +101,11 @@ extern void platform_cpu_die(unsigned int cpu); | |||
96 | extern int platform_cpu_kill(unsigned int cpu); | 101 | extern int platform_cpu_kill(unsigned int cpu); |
97 | extern void platform_cpu_enable(unsigned int cpu); | 102 | extern void platform_cpu_enable(unsigned int cpu); |
98 | 103 | ||
104 | /* | ||
105 | * Local timer interrupt handling function (can be IPI'ed). | ||
106 | */ | ||
107 | extern void local_timer_interrupt(void); | ||
108 | |||
99 | #ifdef CONFIG_LOCAL_TIMERS | 109 | #ifdef CONFIG_LOCAL_TIMERS |
100 | /* | 110 | /* |
101 | * Setup a local timer interrupt for a CPU. | 111 | * Setup a local timer interrupt for a CPU. |