blob: dfc6bfa430121673015fb927349b161c94798217 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Magnus Damm2bc58a62011-06-13 06:46:44 +01002#include <asm/assembler.h>
3
Magnus Dammcd544ce2010-12-22 13:20:08 +01004/*
5 * Interrupt handling. Preserves r7, r8, r9
6 */
7 .macro arch_irq_handler_default
Russell Kingd9600c92011-06-26 10:34:02 +01008 get_irqnr_preamble r6, lr
91: get_irqnr_and_base r0, r2, r6, lr
Magnus Dammcd544ce2010-12-22 13:20:08 +010010 movne r1, sp
11 @
12 @ routine called with r0 = irq number, r1 = struct pt_regs *
13 @
Russell King14327c62015-04-21 14:17:25 +010014 badrne lr, 1b
Magnus Dammcd544ce2010-12-22 13:20:08 +010015 bne asm_do_IRQ
16
17#ifdef CONFIG_SMP
18 /*
19 * XXX
20 *
Russell Kingd9600c92011-06-26 10:34:02 +010021 * this macro assumes that irqstat (r2) and base (r6) are
Magnus Dammcd544ce2010-12-22 13:20:08 +010022 * preserved from get_irqnr_and_base above
23 */
Russell Kingd9600c92011-06-26 10:34:02 +010024 ALT_SMP(test_for_ipi r0, r2, r6, lr)
Magnus Dammcd544ce2010-12-22 13:20:08 +010025 ALT_UP_B(9997f)
Russell King4ec3eb12011-01-06 22:31:35 +000026 movne r1, sp
Russell King14327c62015-04-21 14:17:25 +010027 badrne lr, 1b
Magnus Dammcd544ce2010-12-22 13:20:08 +010028 bne do_IPI
Magnus Dammcd544ce2010-12-22 13:20:08 +010029#endif
309997:
31 .endm
32
33 .macro arch_irq_handler, symbol_name
34 .align 5
35 .global \symbol_name
36\symbol_name:
Russell Kingd9600c92011-06-26 10:34:02 +010037 mov r8, lr
Magnus Dammcd544ce2010-12-22 13:20:08 +010038 arch_irq_handler_default
Russell King6ebbf2c2014-06-30 16:29:12 +010039 ret r8
Magnus Dammcd544ce2010-12-22 13:20:08 +010040 .endm