[MIPS] Fix the crime against humanity that mipsIRQ.S is.
[linux-2.6/mini2440.git] / arch / mips / philips / pnx8550 / common / mipsIRQ.S
blobe049a719f83d7bdaa964941ac9ca6fcf4600829e
1 /*
2  * Copyright (c) 2002 Philips, Inc. All rights.
3  * Copyright (c) 2002 Red Hat, Inc. All rights.
4  *
5  * This software may be freely redistributed under the terms of the
6  * GNU General Public License.
7  *
8  * You should have received a copy of the GNU General Public License
9  * along with this program; if not, write to the Free Software
10  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
11  *
12  * Based upon arch/mips/galileo-boards/ev64240/int-handler.S
13  *
14  */
15 #include <asm/asm.h>
16 #include <asm/mipsregs.h>
17 #include <asm/addrspace.h>
18 #include <asm/regdef.h>
19 #include <asm/stackframe.h>
22  * cp0_irqdispatch
23  *
24  *    Code to handle in-core interrupt exception.
25  */
27                 .align  5
28                 .set    reorder
29                 .set    noat
30                 NESTED(cp0_irqdispatch, PT_SIZE, sp)
31                 SAVE_ALL
32                 CLI
33                 .set    at
34                 mfc0    t0,CP0_CAUSE
35                 mfc0    t2,CP0_STATUS
37                 and     t0,t2
39                 andi    t1,t0,STATUSF_IP2 /* int0 hardware line */
40                 bnez    t1,ll_hw0_irq
41                 nop
43                 andi    t1,t0,STATUSF_IP7 /* int5 hardware line */
44                 bnez    t1,ll_timer_irq
45                 nop
47                 /* wrong alarm or masked ... */
49                 jal     spurious_interrupt
50                 nop
51                 j       ret_from_irq
52                 END(cp0_irqdispatch)
54                 .align  5
55                 .set    reorder
56 ll_hw0_irq:
57                 li      a0,2
58                 move    a1,sp
59                 jal     hw0_irqdispatch
60                 nop
61                 j       ret_from_irq
62                 nop
64                 .align  5
65                 .set    reorder
66 ll_timer_irq:
67                 mfc0    t3,CP0_CONFIG,7
68                 andi    t4,t3,0x01c0
69                 beqz    t4,ll_timer_out
70                 nop
71                 li      a0,7
72                 move    a1,sp
73                 jal     timer_irqdispatch
74                 nop
76 ll_timer_out:   j       ret_from_irq
77                 nop