Merge commit 'v2.6.29-rc1' into perfcounters/core
[linux-2.6] / arch / arm / plat-mxc / include / mach / entry-macro.S
1 /*
2  *  Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
3  *  Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
4  */
5
6 /*
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.
10  */
11
12 #include <mach/hardware.h>
13
14 #define AVIC_NIMASK     0x04
15
16         @ this macro disables fast irq (not implemented)
17         .macro  disable_fiq
18         .endm
19
20         .macro  get_irqnr_preamble, base, tmp
21         ldr     \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
22 #ifdef CONFIG_MXC_IRQ_PRIOR
23         ldr     r4, [\base, #AVIC_NIMASK]
24 #endif
25         .endm
26
27         .macro  arch_ret_to_user, tmp1, tmp2
28         .endm
29
30         @ this macro checks which interrupt occured
31         @ and returns its number in irqnr
32         @ and returns if an interrupt occured in irqstat
33         .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
34         @ Load offset & priority of the highest priority
35         @ interrupt pending from AVIC_NIVECSR
36         ldr     \irqstat, [\base, #0x40]
37         @ Shift to get the decoded IRQ number, using ASR so
38         @ 'no interrupt pending' becomes 0xffffffff
39         mov     \irqnr, \irqstat, asr #16
40         @ set zero flag if IRQ + 1 == 0
41         adds    \tmp, \irqnr, #1
42 #ifdef CONFIG_MXC_IRQ_PRIOR
43         bicne   \tmp, \irqstat, #0xFFFFFFE0
44         strne   \tmp, [\base, #AVIC_NIMASK]
45         streq   r4, [\base, #AVIC_NIMASK]
46 #endif
47         .endm
48
49         @ irq priority table (not used)
50         .macro  irq_prio_table
51         .endm