1/*
2 *  arch/mips/philips/nino/int-handler.S
3 *
4 *  Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 *  Interrupt exception dispatch code for Philips Nino
11 */
12#include <asm/asm.h>
13#include <asm/mipsregs.h>
14#include <asm/regdef.h>
15#include <asm/stackframe.h>
16
17	/*
18	 * Here is the table of interrupts for the Philips Nino
19	 * which uses the Philips PR31700/Toshiba TMPR3912 core.
20	 *
21	 *   MIPS IRQ             Description
22	 *   --------	--------------------------------
23	 *       0	SW0 interrupt (unused)
24	 *       1	SW1 interrupt (unused)
25	 *       2
26	 *       3
27	 *       4	PR31700 low priority interrupts
28	 *       5
29	 *       6	PR31700 high priority interrupts
30	 *       7
31	 */
32
33	.text
34	.set	noreorder
35	.set	noat
36	.align	5
37	NESTED(ninoIRQ, PT_SIZE, sp)
38	SAVE_ALL
39	CLI
40	.set	at
41	mfc0	s0, CP0_CAUSE		# determine cause
42
43	andi	a0, s0, CAUSEF_IP6
44	beq	a0, zero, 1f
45	andi	a0, s0, CAUSEF_IP4	# delay slot
46	move    a0, sp
47	jal	irq6_dispatch
48	nop				# delay slot
49	j	ret_from_irq
50	nop				# delay slot
51
521:
53	beq	a0, zero, 1f
54	nop				# delay slot
55	move	a0, sp
56	jal	irq4_dispatch
57	nop				# delay slot
58	j	ret_from_irq
59	nop				# delay slot
60
611:
62	/* We should never get here */
63	move	a0, sp
64	j	irq_bad
65	nop
66	END(ninoIRQ)
67