blob: ba76af052c81fac1183584e33bf0e337246f9d48 [file] [log] [blame]
Byungho Min8acd1ad2009-06-23 21:40:15 +09001/* arch/arm/mach-s5pc100/include/mach/entry-macro.S
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6400/include/mach/entry-macro.S
7 *
8 * Low-level IRQ helper macros for the Samsung S5PC1XX series
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13*/
14
15#include <asm/hardware/vic.h>
16#include <mach/map.h>
17#include <plat/irqs.h>
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_preamble, base, tmp
Marek Szyprowskiacc84702010-05-20 07:51:08 +020023 ldr \base, =VA_VIC0
Byungho Min8acd1ad2009-06-23 21:40:15 +090024 .endm
25
26 .macro arch_ret_to_user, tmp1, tmp2
27 .endm
28
29 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
30
31 @ check the vic0
Marek Szyprowskiacc84702010-05-20 07:51:08 +020032 mov \irqnr, # S5P_IRQ_OFFSET + 31
Byungho Min8acd1ad2009-06-23 21:40:15 +090033 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
34 teq \irqstat, #0
35
36 @ otherwise try vic1
Marek Szyprowskiacc84702010-05-20 07:51:08 +020037 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
Byungho Min8acd1ad2009-06-23 21:40:15 +090038 addeq \irqnr, \irqnr, #32
39 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
40 teqeq \irqstat, #0
41
42 @ otherwise try vic2
Marek Szyprowskiacc84702010-05-20 07:51:08 +020043 addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
Byungho Min8acd1ad2009-06-23 21:40:15 +090044 addeq \irqnr, \irqnr, #32
45 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
46 teqeq \irqstat, #0
47
48 clzne \irqstat, \irqstat
49 subne \irqnr, \irqnr, \irqstat
50 .endm