blob: cd8c5a0bc7bce6dfae9b8060b4347840a4b539d6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Uwe Zeisbergerf30c2262006-10-03 23:01:26 +02002 * include/asm-arm/arch-clps711x/entry-macro.S
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * Low-level IRQ helper macros for CLPS711X-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 */
Russell King78ff18a2006-01-03 17:39:34 +000010#include <asm/hardware.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011#include <asm/hardware/clps7111.h>
12
13 .macro disable_fiq
14 .endm
15
Dan Williamsf80dff92007-02-16 22:16:32 +010016 .macro get_irqnr_preamble, base, tmp
17 .endm
18
19 .macro arch_ret_to_user, tmp1, tmp2
20 .endm
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#if (INTSR2 - INTSR1) != (INTMR2 - INTMR1)
23#error INTSR stride != INTMR stride
24#endif
25
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]
30 mov \irqnr, #4
31 mov \mask, \mask, lsl #16
32 and \stat, \stat, \mask, lsr #16
33 movs \stat, \stat, lsr #4
34 bne 1001f
35
36 add \base, \base, #INTSR2 - INTSR1
37 ldr \stat, [\base, #INTSR1]
38 ldr \mask, [\base, #INTMR1]
39 mov \irqnr, #16
40 mov \mask, \mask, lsl #16
41 and \stat, \stat, \mask, lsr #16
42
431001: tst \stat, #255
44 addeq \irqnr, \irqnr, #8
45 moveq \stat, \stat, lsr #8
46 tst \stat, #15
47 addeq \irqnr, \irqnr, #4
48 moveq \stat, \stat, lsr #4
49 tst \stat, #3
50 addeq \irqnr, \irqnr, #2
51 moveq \stat, \stat, lsr #2
52 tst \stat, #1
53 addeq \irqnr, \irqnr, #1
54 moveq \stat, \stat, lsr #1
55 tst \stat, #1 @ bit 0 should be set
56 .endm
57
58