1 /* arch/arm/include/asm/entry-macro-vic2.S
3 * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S
5 * Copyright 2008 Openmoko, Inc.
6 * Copyright 2008 Simtec Electronics
7 * http://armlinux.simtec.co.uk/
8 * Ben Dooks <ben@simtec.co.uk>
10 * Low-level IRQ helper macros for a device with two VICs
12 * This file is licensed under the terms of the GNU General Public
13 * License version 2. This program is licensed "as is" without any
14 * warranty of any kind, whether express or implied.
17 /* This should be included from <mach/entry-macro.S> with the necessary
18 * defines for virtual addresses and IRQ bases for the two vics.
20 * The code needs the following defined:
21 * IRQ_VIC0_BASE IRQ number of VIC0's first IRQ
22 * IRQ_VIC1_BASE IRQ number of VIC1's first IRQ
23 * VA_VIC0 Virtual address of VIC0
24 * VA_VIC1 Virtual address of VIC1
26 * Note, code assumes VIC0's virtual address is an ARM immediate constant
30 #include <asm/hardware/vic.h>
35 .macro get_irqnr_preamble, base, tmp
39 .macro arch_ret_to_user, tmp1, tmp2
42 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
45 mov \irqnr, #IRQ_VIC0_BASE + 31
46 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
50 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
51 addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)
52 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
55 clzne \irqstat, \irqstat
56 subne \irqnr, \irqnr, \irqstat