2 * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 @ this macro disables fast irq (not implemented)
16 .macro get_irqnr_preamble, base, tmp
19 .macro arch_ret_to_user, tmp1, tmp2
22 @ this macro checks which interrupt occured
23 @ and returns its number in irqnr
24 @ and returns if an interrupt occured in irqstat
25 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
26 ldr \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
27 @ Load offset & priority of the highest priority
28 @ interrupt pending from AVIC_NIVECSR
29 ldr \irqstat, [\base, #0x40]
30 @ Shift to get the decoded IRQ number, using ASR so
31 @ 'no interrupt pending' becomes 0xffffffff
32 mov \irqnr, \irqstat, asr #16
33 @ set zero flag if IRQ + 1 == 0
37 @ irq priority table (not used)