Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / 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 #define AVIC_NIMASK     0x04
13
14         @ this macro disables fast irq (not implemented)
15         .macro  disable_fiq
16         .endm
17
18         .macro  get_irqnr_preamble, base, tmp
19         ldr     \base, =AVIC_IO_ADDRESS(AVIC_BASE_ADDR)
20 #ifdef CONFIG_MXC_IRQ_PRIOR
21         ldr     r4, [\base, #AVIC_NIMASK]
22 #endif
23         .endm
24
25         .macro  arch_ret_to_user, tmp1, tmp2
26         .endm
27
28         @ this macro checks which interrupt occured
29         @ and returns its number in irqnr
30         @ and returns if an interrupt occured in irqstat
31         .macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
32         @ Load offset & priority of the highest priority
33         @ interrupt pending from AVIC_NIVECSR
34         ldr     \irqstat, [\base, #0x40]
35         @ Shift to get the decoded IRQ number, using ASR so
36         @ 'no interrupt pending' becomes 0xffffffff
37         mov     \irqnr, \irqstat, asr #16
38         @ set zero flag if IRQ + 1 == 0
39         adds    \tmp, \irqnr, #1
40 #ifdef CONFIG_MXC_IRQ_PRIOR
41         bicne   \tmp, \irqstat, #0xFFFFFFE0
42         strne   \tmp, [\base, #AVIC_NIMASK]
43         streq   r4, [\base, #AVIC_NIMASK]
44 #endif
45         .endm
46
47         @ irq priority table (not used)
48         .macro  irq_prio_table
49         .endm