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 /arch/arm/kernel | |
| 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>
Diffstat (limited to 'arch/arm/kernel')
| -rw-r--r-- | arch/arm/kernel/smp.c | 29 |
1 files changed, 27 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; |
