blob: 58f0d71759f6606f342652b8f61702cf7e3a2168 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-arm/arch-versatile/entry-macro.S
3 *
4 * Low-level IRQ helper macros for Versatile 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 */
Russell King78ff18a2006-01-03 17:39:34 +000010#include <asm/hardware.h>
11
12 .macro disable_fiq
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 .endm
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16 ldr \base, =IO_ADDRESS(VERSATILE_VIC_BASE)
17 ldr \irqstat, [\base, #VIC_IRQ_STATUS] @ get masked status
18 mov \irqnr, #0
19 teq \irqstat, #0
20 beq 1003f
21
221001: tst \irqstat, #15
23 bne 1002f
24 add \irqnr, \irqnr, #4
25 movs \irqstat, \irqstat, lsr #4
26 bne 1001b
271002: tst \irqstat, #1
28 bne 1003f
29 add \irqnr, \irqnr, #1
30 movs \irqstat, \irqstat, lsr #1
31 bne 1002b
321003: /* EQ will be set if no irqs pending */
33
34@ clz \irqnr, \irqstat
35@1003: /* EQ will be set if we reach MAXIRQNUM */
36 .endm
37