Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3e459990961db7f3f2dcf21e2b38a7216dfd10dd
Commit:     3e459990961db7f3f2dcf21e2b38a7216dfd10dd
Parent:     ae30ceac3c6bbacdb227816abe6f0c7ea867ac7c
Author:     Catalin Marinas <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 4 17:28:56 2008 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Mon Feb 4 17:52:18 2008 +0000

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/kernel/smp.c |   29 +++++++++++++++++++++++++++--
 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 eafbb2b..aef6f9a 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,
 }
 EXPORT_SYMBOL_GPL(smp_call_function);
 
+int smp_call_function_single(int cpu, void (*func)(void *info), void *info,
+                            int retry, int wait)
+{
+       /* prevent preemption and reschedule on another processor */
+       int current_cpu = get_cpu();
+       int ret = 0;
+
+       if (cpu == current_cpu) {
+               local_irq_disable();
+               func(info);
+               local_irq_enable();
+       } else
+               ret = smp_call_function_on_cpu(func, info, retry, wait,
+                                              cpumask_of_cpu(cpu));
+
+       put_cpu();
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(smp_call_function_single);
+
 void show_ipi_list(struct seq_file *p)
 {
        unsigned int cpu;
@@ -481,8 +502,7 @@ void show_local_irqs(struct seq_file *p)
 static void ipi_timer(void)
 {
        irq_enter();
-       profile_tick(CPU_PROFILING);
-       update_process_times(user_mode(get_irq_regs()));
+       local_timer_interrupt();
        irq_exit();
 }
 
@@ -621,6 +641,11 @@ void smp_send_timer(void)
        send_ipi_message(mask, IPI_TIMER);
 }
 
+void smp_timer_broadcast(cpumask_t mask)
+{
+       send_ipi_message(mask, IPI_TIMER);
+}
+
 void smp_send_stop(void)
 {
        cpumask_t mask = cpu_online_map;
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
index f67acce..1f7c51a 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);
 extern void smp_send_timer(void);
 
 /*
+ * Broadcast a clock event to other CPUs.
+ */
+extern void smp_timer_broadcast(cpumask_t mask);
+
+/*
  * Boot a secondary CPU, and assign it the specified idle task.
  * This also gives us the initial stack to use for this CPU.
  */
@@ -96,6 +101,11 @@ extern void platform_cpu_die(unsigned int cpu);
 extern int platform_cpu_kill(unsigned int cpu);
 extern void platform_cpu_enable(unsigned int cpu);
 
+/*
+ * Local timer interrupt handling function (can be IPI'ed).
+ */
+extern void local_timer_interrupt(void);
+
 #ifdef CONFIG_LOCAL_TIMERS
 /*
  * Setup a local timer interrupt for a CPU.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to