aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/entry-armv.S
diff options
context:
space:
mode:
authoreric miao <eric.y.miao@gmail.com>2010-12-13 03:42:34 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-24 04:47:34 -0500
commit521086412ee423fbdfc7da81f257239c43f707b4 (patch)
tree88423e6db9544002ebec1494b82a3d91bfb57363 /arch/arm/kernel/entry-armv.S
parent4a50bfe365a977f634311504484342fbfffe855c (diff)
ARM: 6532/1: Allow machine to specify it's own IRQ handlers at run-time
Normally different ARM platform has different way to decode the IRQ hardware status and demultiplex to the corresponding IRQ handler. This is highly optimized by macro irq_handler in entry-armv.S, and each machine defines their own macro to decode the IRQ number. However, this prevents multiple machine classes to be built into a single kernel. By allowing each machine to specify thier own handler, and making function pointer 'handle_arch_irq' to point to it at run time, this can be solved. And introduce CONFIG_MULTI_IRQ_HANDLER to allow both solutions to work. Comparing with the highly optimized macro of irq_handler, the new function must be written with care not to lose too much performance. And the IPI stuff on SMP is expected to move to the provided arch IRQ handler as well. The assembly code to invoke handle_arch_irq is optimized by Russell King. Signed-off-by: Eric Miao <eric.miao@canonical.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r--arch/arm/kernel/entry-armv.S17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 35f3f20d6731..caa6c396ec78 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -30,6 +30,14 @@
30 * Interrupt handling. Preserves r7, r8, r9 30 * Interrupt handling. Preserves r7, r8, r9
31 */ 31 */
32 .macro irq_handler 32 .macro irq_handler
33#ifdef CONFIG_MULTI_IRQ_HANDLER
34 ldr r5, =handle_arch_irq
35 mov r0, sp
36 ldr r5, [r5]
37 adr lr, BSYM(9997f)
38 teq r5, #0
39 movne pc, r5
40#endif
33 get_irqnr_preamble r5, lr 41 get_irqnr_preamble r5, lr
341: get_irqnr_and_base r0, r6, r5, lr 421: get_irqnr_and_base r0, r6, r5, lr
35 movne r1, sp 43 movne r1, sp
@@ -58,9 +66,8 @@
58 adrne lr, BSYM(1b) 66 adrne lr, BSYM(1b)
59 bne do_local_timer 67 bne do_local_timer
60#endif 68#endif
619997:
62#endif 69#endif
63 709997:
64 .endm 71 .endm
65 72
66#ifdef CONFIG_KPROBES 73#ifdef CONFIG_KPROBES
@@ -1245,3 +1252,9 @@ cr_alignment:
1245 .space 4 1252 .space 4
1246cr_no_alignment: 1253cr_no_alignment:
1247 .space 4 1254 .space 4
1255
1256#ifdef CONFIG_MULTI_IRQ_HANDLER
1257 .globl handle_arch_irq
1258handle_arch_irq:
1259 .space 4
1260#endif