Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * arch-arm/mach-u300/include/mach/entry-macro.S |
| 4 | * |
| 5 | * |
| 6 | * Copyright (C) 2006-2009 ST-Ericsson AB |
| 7 | * License terms: GNU General Public License (GPL) version 2 |
| 8 | * Low-level IRQ helper macros for ST-Ericsson U300 |
| 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
| 10 | */ |
| 11 | #include <mach/hardware.h> |
| 12 | #include <asm/hardware/vic.h> |
| 13 | |
| 14 | .macro disable_fiq |
| 15 | .endm |
| 16 | |
| 17 | .macro get_irqnr_preamble, base, tmp |
| 18 | .endm |
| 19 | |
| 20 | .macro arch_ret_to_user, tmp1, tmp2 |
| 21 | .endm |
| 22 | |
| 23 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
| 24 | ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON0_BASE |
| 25 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status |
| 26 | mov \irqnr, #0 |
| 27 | teq \irqstat, #0 |
| 28 | bne 1002f |
| 29 | 1001: ldr \base, = U300_AHB_PER_VIRT_BASE-U300_AHB_PER_PHYS_BASE+U300_INTCON1_BASE |
| 30 | ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status |
| 31 | mov \irqnr, #32 |
| 32 | teq \irqstat, #0 |
| 33 | beq 1003f |
| 34 | 1002: tst \irqstat, #1 |
| 35 | bne 1003f |
| 36 | add \irqnr, \irqnr, #1 |
| 37 | movs \irqstat, \irqstat, lsr #1 |
| 38 | bne 1002b |
| 39 | 1003: /* EQ will be set if no irqs pending */ |
| 40 | .endm |