Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Magnus Damm | 2bc58a6 | 2011-06-13 06:46:44 +0100 | [diff] [blame] | 2 | #include <asm/assembler.h> |
| 3 | |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 4 | /* |
| 5 | * Interrupt handling. Preserves r7, r8, r9 |
| 6 | */ |
| 7 | .macro arch_irq_handler_default |
Russell King | d9600c9 | 2011-06-26 10:34:02 +0100 | [diff] [blame] | 8 | get_irqnr_preamble r6, lr |
| 9 | 1: get_irqnr_and_base r0, r2, r6, lr |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 10 | movne r1, sp |
| 11 | @ |
| 12 | @ routine called with r0 = irq number, r1 = struct pt_regs * |
| 13 | @ |
Russell King | 14327c6 | 2015-04-21 14:17:25 +0100 | [diff] [blame] | 14 | badrne lr, 1b |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 15 | bne asm_do_IRQ |
| 16 | |
| 17 | #ifdef CONFIG_SMP |
| 18 | /* |
| 19 | * XXX |
| 20 | * |
Russell King | d9600c9 | 2011-06-26 10:34:02 +0100 | [diff] [blame] | 21 | * this macro assumes that irqstat (r2) and base (r6) are |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 22 | * preserved from get_irqnr_and_base above |
| 23 | */ |
Russell King | d9600c9 | 2011-06-26 10:34:02 +0100 | [diff] [blame] | 24 | ALT_SMP(test_for_ipi r0, r2, r6, lr) |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 25 | ALT_UP_B(9997f) |
Russell King | 4ec3eb1 | 2011-01-06 22:31:35 +0000 | [diff] [blame] | 26 | movne r1, sp |
Russell King | 14327c6 | 2015-04-21 14:17:25 +0100 | [diff] [blame] | 27 | badrne lr, 1b |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 28 | bne do_IPI |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 29 | #endif |
| 30 | 9997: |
| 31 | .endm |
| 32 | |
| 33 | .macro arch_irq_handler, symbol_name |
| 34 | .align 5 |
| 35 | .global \symbol_name |
| 36 | \symbol_name: |
Russell King | d9600c9 | 2011-06-26 10:34:02 +0100 | [diff] [blame] | 37 | mov r8, lr |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 38 | arch_irq_handler_default |
Russell King | 6ebbf2c | 2014-06-30 16:29:12 +0100 | [diff] [blame] | 39 | ret r8 |
Magnus Damm | cd544ce | 2010-12-22 13:20:08 +0100 | [diff] [blame] | 40 | .endm |