Browse Source

ARM: 7123/1: smp: Add an IPI handler callable from C code

In order to be able to handle IPI directly from C code instead of
assembly code, introduce handle_IPI(), which is modeled after handle_IRQ().

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Shawn Guo 13 years ago
parent
commit
0b5a1b95dc
2 changed files with 10 additions and 0 deletions
  1. 5 0
      arch/arm/include/asm/smp.h
  2. 5 0
      arch/arm/kernel/smp.c

+ 5 - 0
arch/arm/include/asm/smp.h

@@ -32,6 +32,11 @@ extern void show_ipi_list(struct seq_file *, int);
  */
  */
 asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);
 asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);
 
 
+/*
+ * Called from C code, this handles an IPI.
+ */
+void handle_IPI(int ipinr, struct pt_regs *regs);
+
 /*
 /*
  * Setup the set of possible CPUs (via set_cpu_possible)
  * Setup the set of possible CPUs (via set_cpu_possible)
  */
  */

+ 5 - 0
arch/arm/kernel/smp.c

@@ -586,6 +586,11 @@ static void ipi_cpu_stop(unsigned int cpu)
  * Main handler for inter-processor interrupts
  * Main handler for inter-processor interrupts
  */
  */
 asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
 asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
+{
+	handle_IPI(ipinr, regs);
+}
+
+void handle_IPI(int ipinr, struct pt_regs *regs)
 {
 {
 	unsigned int cpu = smp_processor_id();
 	unsigned int cpu = smp_processor_id();
 	struct pt_regs *old_regs = set_irq_regs(regs);
 	struct pt_regs *old_regs = set_irq_regs(regs);