blob: 88d61815f0c03caceaa94af319687b6dbd6913ce [file] [log] [blame]
Magnus Damm2bc58a62011-06-13 06:46:44 +01001#include <asm/assembler.h>
2
Magnus Dammcd544ce2010-12-22 13:20:08 +01003/*
4 * Interrupt handling. Preserves r7, r8, r9
5 */
6 .macro arch_irq_handler_default
Russell Kingd9600c92011-06-26 10:34:02 +01007 get_irqnr_preamble r6, lr
81: get_irqnr_and_base r0, r2, r6, lr
Magnus Dammcd544ce2010-12-22 13:20:08 +01009 movne r1, sp
10 @
11 @ routine called with r0 = irq number, r1 = struct pt_regs *
12 @
13 adrne lr, BSYM(1b)
14 bne asm_do_IRQ
15
16#ifdef CONFIG_SMP
17 /*
18 * XXX
19 *
Russell Kingd9600c92011-06-26 10:34:02 +010020 * this macro assumes that irqstat (r2) and base (r6) are
Magnus Dammcd544ce2010-12-22 13:20:08 +010021 * preserved from get_irqnr_and_base above
22 */
Russell Kingd9600c92011-06-26 10:34:02 +010023 ALT_SMP(test_for_ipi r0, r2, r6, lr)
Magnus Dammcd544ce2010-12-22 13:20:08 +010024 ALT_UP_B(9997f)
Russell King4ec3eb12011-01-06 22:31:35 +000025 movne r1, sp
Magnus Dammcd544ce2010-12-22 13:20:08 +010026 adrne lr, BSYM(1b)
27 bne do_IPI
Magnus Dammcd544ce2010-12-22 13:20:08 +010028#endif
299997:
30 .endm
31
32 .macro arch_irq_handler, symbol_name
33 .align 5
34 .global \symbol_name
35\symbol_name:
Russell Kingd9600c92011-06-26 10:34:02 +010036 mov r8, lr
Magnus Dammcd544ce2010-12-22 13:20:08 +010037 arch_irq_handler_default
Russell Kingd9600c92011-06-26 10:34:02 +010038 mov pc, r8
Magnus Dammcd544ce2010-12-22 13:20:08 +010039 .endm