2 * include/asm-arm/arch-clps711x/entry-macro.S
4 * Low-level IRQ helper macros for CLPS711X-based platforms
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.
10 #include <asm/hardware.h>
11 #include <asm/hardware/clps7111.h>
16 .macro get_irqnr_preamble, base, tmp
19 .macro arch_ret_to_user, tmp1, tmp2
22 #if (INTSR2 - INTSR1) != (INTMR2 - INTMR1)
23 #error INTSR stride != INTMR stride
26 .macro get_irqnr_and_base, irqnr, stat, base, mask
27 mov \base, #CLPS7111_BASE
28 ldr \stat, [\base, #INTSR1]
29 ldr \mask, [\base, #INTMR1]
31 mov \mask, \mask, lsl #16
32 and \stat, \stat, \mask, lsr #16
33 movs \stat, \stat, lsr #4
36 add \base, \base, #INTSR2 - INTSR1
37 ldr \stat, [\base, #INTSR1]
38 ldr \mask, [\base, #INTMR1]
40 mov \mask, \mask, lsl #16
41 and \stat, \stat, \mask, lsr #16
44 addeq \irqnr, \irqnr, #8
45 moveq \stat, \stat, lsr #8
47 addeq \irqnr, \irqnr, #4
48 moveq \stat, \stat, lsr #4
50 addeq \irqnr, \irqnr, #2
51 moveq \stat, \stat, lsr #2
53 addeq \irqnr, \irqnr, #1
54 moveq \stat, \stat, lsr #1
55 tst \stat, #1 @ bit 0 should be set