Path: blob/master/arch/arm/mach-exynos4/include/mach/entry-macro.S
10820 views
/* arch/arm/mach-exynos4/include/mach/entry-macro.S1*2* Cloned from arch/arm/mach-realview/include/mach/entry-macro.S3*4* Low-level IRQ helper macros for EXYNOS4 platforms5*6* This file is licensed under the terms of the GNU General Public7* License version 2. This program is licensed "as is" without any8* warranty of any kind, whether express or implied.9*/1011#include <mach/hardware.h>12#include <asm/hardware/gic.h>1314.macro disable_fiq15.endm1617.macro get_irqnr_preamble, base, tmp18ldr \base, =gic_cpu_base_addr19ldr \base, [\base]20.endm2122.macro arch_ret_to_user, tmp1, tmp223.endm2425/*26* The interrupt numbering scheme is defined in the27* interrupt controller spec. To wit:28*29* Interrupts 0-15 are IPI30* 16-28 are reserved31* 29-31 are local. We allow 30 to be used for the watchdog.32* 32-1020 are global33* 1021-1022 are reserved34* 1023 is "spurious" (no interrupt)35*36* For now, we ignore all local interrupts so only return an interrupt if it's37* between 30 and 1020. The test_for_ipi routine below will pick up on IPIs.38*39* A simple read from the controller will tell us the number of the highest40* priority enabled interrupt. We then just need to check whether it is in the41* valid range for an IRQ (30-1020 inclusive).42*/4344.macro get_irqnr_and_base, irqnr, irqstat, base, tmp4546ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */4748ldr \tmp, =10214950bic \irqnr, \irqstat, #0x1c005152cmp \irqnr, #2953cmpcc \irqnr, \irqnr54cmpne \irqnr, \tmp55cmpcs \irqnr, \irqnr56addne \irqnr, \irqnr, #325758.endm5960/* We assume that irqstat (the raw value of the IRQ acknowledge61* register) is preserved from the macro above.62* If there is an IPI, we immediately signal end of interrupt on the63* controller, since this requires the original irqstat value which64* we won't easily be able to recreate later.65*/6667.macro test_for_ipi, irqnr, irqstat, base, tmp68bic \irqnr, \irqstat, #0x1c0069cmp \irqnr, #1670strcc \irqstat, [\base, #GIC_CPU_EOI]71cmpcs \irqnr, \irqnr72.endm7374/* As above, this assumes that irqstat and base are preserved.. */7576.macro test_for_ltirq, irqnr, irqstat, base, tmp77bic \irqnr, \irqstat, #0x1c0078mov \tmp, #079cmp \irqnr, #2980moveq \tmp, #181streq \irqstat, [\base, #GIC_CPU_EOI]82cmp \tmp, #083.endm848586