aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos4/include/mach/entry-macro.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-exynos4/include/mach/entry-macro.S')
-rw-r--r--arch/arm/mach-exynos4/include/mach/entry-macro.S83
1 files changed, 83 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/include/mach/entry-macro.S b/arch/arm/mach-exynos4/include/mach/entry-macro.S
new file mode 100644
index 00000000000..d7a1e281ce7
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/entry-macro.S
@@ -0,0 +1,83 @@
1/* arch/arm/mach-exynos4/include/mach/entry-macro.S
2 *
3 * Cloned from arch/arm/mach-realview/include/mach/entry-macro.S
4 *
5 * Low-level IRQ helper macros for EXYNOS4 platforms
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10*/
11
12#include <mach/hardware.h>
13#include <mach/map.h>
14#include <asm/hardware/gic.h>
15
16 .macro disable_fiq
17 .endm
18
19 .macro get_irqnr_preamble, base, tmp
20 ldr \base, =gic_cpu_base_addr
21 ldr \base, [\base]
22 mrc p15, 0, \tmp, c0, c0, 5
23 and \tmp, \tmp, #3
24 cmp \tmp, #1
25 addeq \base, \base, #EXYNOS4_GIC_BANK_OFFSET
26 .endm
27
28 .macro arch_ret_to_user, tmp1, tmp2
29 .endm
30
31 /*
32 * The interrupt numbering scheme is defined in the
33 * interrupt controller spec. To wit:
34 *
35 * Interrupts 0-15 are IPI
36 * 16-28 are reserved
37 * 29-31 are local. We allow 30 to be used for the watchdog.
38 * 32-1020 are global
39 * 1021-1022 are reserved
40 * 1023 is "spurious" (no interrupt)
41 *
42 * For now, we ignore all local interrupts so only return an interrupt if it's
43 * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.
44 *
45 * A simple read from the controller will tell us the number of the highest
46 * priority enabled interrupt. We then just need to check whether it is in the
47 * valid range for an IRQ (30-1020 inclusive).
48 */
49
50 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
51
52 ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */
53
54 ldr \tmp, =1021
55
56 bic \irqnr, \irqstat, #0x1c00
57
58 cmp \irqnr, #29
59 cmpcc \irqnr, \irqnr
60 cmpne \irqnr, \tmp
61 cmpcs \irqnr, \irqnr
62 addne \irqnr, \irqnr, #32
63
64 .endm
65
66 /* We assume that irqstat (the raw value of the IRQ acknowledge
67 * register) is preserved from the macro above.
68 * If there is an IPI, we immediately signal end of interrupt on the
69 * controller, since this requires the original irqstat value which
70 * we won't easily be able to recreate later.
71 */
72
73 .macro test_for_ipi, irqnr, irqstat, base, tmp
74 bic \irqnr, \irqstat, #0x1c00
75 cmp \irqnr, #16
76 strcc \irqstat, [\base, #GIC_CPU_EOI]
77 cmpcs \irqnr, \irqnr
78 .endm
79
80 /* As above, this assumes that irqstat and base are preserved.. */
81
82 .macro test_for_ltirq, irqnr, irqstat, base, tmp
83 .endm