2 * include/asm-arm/arch-tcc83x/entry-macro.S
4 * Author : <linux@telechips.com>
5 * Created: June 10, 2008
6 * Description: Low-level IRQ helper macros for Telechips-based platforms
8 * Copyright (C) 2008-2009 Telechips
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.
15 #include <mach/hardware.h>
16 #include <mach/irqs.h>
21 .macro get_irqnr_preamble, base, tmp
24 .macro arch_ret_to_user, tmp1, tmp2
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
29 ldr \base, =0xF2003000 @ base address of PIC registers
31 @@ read MREQ register of PIC0
34 ldr \irqstat, [\base, #0x00000014 ] @ lower 32 interrupts
38 @@ read MREQ register of PIC1
40 ldr \irqstat, [\base, #0x00000094] @ upper 32 interrupts
46 movs \tmp, \irqstat, lsl #16
48 addeq \irqnr, \irqnr, #16
50 movs \tmp, \irqstat, lsl #8
52 addeq \irqnr, \irqnr, #8
54 movs \tmp, \irqstat, lsl #4
56 addeq \irqnr, \irqnr, #4
58 movs \tmp, \irqstat, lsl #2
60 addeq \irqnr, \irqnr, #2
62 movs \tmp, \irqstat, lsl #1
63 addeq \irqnr, \irqnr, #1
66 @@ exit here, Z flag unset if IRQ