aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2008-02-04 11:28:56 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-02-04 12:52:18 -0500
commit3e459990961db7f3f2dcf21e2b38a7216dfd10dd (patch)
treed85f86d36cf2433817ba8f4d29447ca4950e206d
parentae30ceac3c6bbacdb227816abe6f0c7ea867ac7c (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.c29
-rw-r--r--include/asm-arm/smp.h10
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}
455EXPORT_SYMBOL_GPL(smp_call_function); 455EXPORT_SYMBOL_GPL(smp_call_function);
456 456
457int 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}
476EXPORT_SYMBOL_GPL(smp_call_function_single);
477
457void show_ipi_list(struct seq_file *p) 478void 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)
481static void ipi_timer(void) 502static 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
644void smp_timer_broadcast(cpumask_t mask)
645{
646 send_ipi_message(mask, IPI_TIMER);
647}
648
624void smp_send_stop(void) 649void 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);
61extern void smp_send_timer(void); 61extern void smp_send_timer(void);
62 62
63/* 63/*
64 * Broadcast a clock event to other CPUs.
65 */
66extern 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);
96extern int platform_cpu_kill(unsigned int cpu); 101extern int platform_cpu_kill(unsigned int cpu);
97extern void platform_cpu_enable(unsigned int cpu); 102extern void platform_cpu_enable(unsigned int cpu);
98 103
104/*
105 * Local timer interrupt handling function (can be IPI'ed).
106 */
107extern 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.