Path: blob/master/arch/arm/mach-bcmring/include/mach/entry-macro.S
10820 views
/*****************************************************************************1* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.2*3* Unless you and Broadcom execute a separate written software license4* agreement governing use of this software, this software is licensed to you5* under the terms of the GNU General Public License version 2, available at6* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").7*8* Notwithstanding the above, under no circumstances may you combine this9* software in any way with any other Broadcom software provided under a10* license other than the GPL, without Broadcom's express prior written11* consent.12*****************************************************************************/1314/*15*16* Low-level IRQ helper macros for BCMRing-based platforms17*18*/19#include <mach/irqs.h>20#include <mach/hardware.h>21#include <mach/csp/mm_io.h>2223.macro disable_fiq24.endm2526.macro get_irqnr_and_base, irqnr, irqstat, base, tmp27ldr \base, =(MM_IO_BASE_INTC0)28ldr \irqstat, [\base, #0] @ get status29ldr \irqnr, [\base, #0x10] @ mask with enable register30ands \irqstat, \irqstat, \irqnr31mov \irqnr, #IRQ_INTC0_START32cmp \irqstat, #033bne 1001f3435ldr \base, =(MM_IO_BASE_INTC1)36ldr \irqstat, [\base, #0] @ get status37ldr \irqnr, [\base, #0x10] @ mask with enable register38ands \irqstat, \irqstat, \irqnr39mov \irqnr, #IRQ_INTC1_START40cmp \irqstat, #041bne 1001f4243ldr \base, =(MM_IO_BASE_SINTC)44ldr \irqstat, [\base, #0] @ get status45ldr \irqnr, [\base, #0x10] @ mask with enable register46ands \irqstat, \irqstat, \irqnr47mov \irqnr, #0xffffffff @ code meaning no interrupt bits set48cmp \irqstat, #049beq 1002f5051mov \irqnr, #IRQ_SINTC_START @ something is set, so fixup return value52531001:54movs \tmp, \irqstat, lsl #1655movne \irqstat, \tmp56addeq \irqnr, \irqnr, #165758movs \tmp, \irqstat, lsl #859movne \irqstat, \tmp60addeq \irqnr, \irqnr, #86162movs \tmp, \irqstat, lsl #463movne \irqstat, \tmp64addeq \irqnr, \irqnr, #46566movs \tmp, \irqstat, lsl #267movne \irqstat, \tmp68addeq \irqnr, \irqnr, #26970movs \tmp, \irqstat, lsl #171addeq \irqnr, \irqnr, #172orrs \base, \base, #173741002: @ irqnr will be set to 0xffffffff if no irq bits are set75.endm7677.macro get_irqnr_preamble, base, tmp78.endm7980.macro arch_ret_to_user, tmp1, tmp281.endm8283.macro irq_prio_table84.endm85868788