Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-arm/arch-ixp4xx/entry-macro.S |
| 3 | * |
| 4 | * Low-level IRQ helper macros for IXP4xx-based platforms |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public |
| 7 | * License version 2. This program is licensed "as is" without any |
| 8 | * warranty of any kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | .macro disable_fiq |
| 12 | .endm |
| 13 | |
| 14 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
| 15 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) |
| 16 | ldr \irqstat, [\irqstat] @ get interrupts |
| 17 | cmp \irqstat, #0 |
Kenneth Tan | 251b928 | 2005-10-18 07:53:35 +0100 | [diff] [blame] | 18 | beq 1001f @ upper IRQ? |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | clz \irqnr, \irqstat |
| 20 | mov \base, #31 |
Kenneth Tan | 251b928 | 2005-10-18 07:53:35 +0100 | [diff] [blame] | 21 | sub \irqnr, \base, \irqnr |
| 22 | b 1002f @ lower IRQ being |
| 23 | @ handled |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
| 25 | 1001: |
| 26 | /* |
| 27 | * IXP465 has an upper IRQ status register |
| 28 | */ |
| 29 | #if defined(CONFIG_CPU_IXP46X) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) |
| 31 | ldr \irqstat, [\irqstat] @ get upper interrupts |
| 32 | mov \irqnr, #63 |
| 33 | clz \irqstat, \irqstat |
| 34 | cmp \irqstat, #32 |
| 35 | subne \irqnr, \irqnr, \irqstat |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | #endif |
Kenneth Tan | 251b928 | 2005-10-18 07:53:35 +0100 | [diff] [blame] | 37 | 1002: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | .endm |
| 39 | |
| 40 | |