revert-mm-fix-blkdev-size-calculation-in-generic_write_checks
[linux-2.6/linux-trees-mm.git] / arch / mips / tx4938 / common / irq.c
blobc059b899d1200220aa8b3e5a0682b7500bc30de4
1 /*
2 * linux/arch/mips/tx4938/common/irq.c
4 * Common tx4938 irq handler
5 * Copyright (C) 2000-2001 Toshiba Corporation
7 * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
12 * Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
16 #include <asm/irq_cpu.h>
17 #include <asm/mipsregs.h>
18 #include <asm/tx4938/rbtx4938.h>
20 void __init
21 tx4938_irq_init(void)
23 mips_cpu_irq_init();
24 txx9_irq_init(TX4938_IRC_REG);
25 set_irq_chained_handler(TX4938_IRQ_NEST_PIC_ON_CP0, handle_simple_irq);
28 int toshiba_rbtx4938_irq_nested(int irq);
30 asmlinkage void plat_irq_dispatch(void)
32 unsigned int pending = read_c0_cause() & read_c0_status();
34 if (pending & STATUSF_IP7)
35 do_IRQ(TX4938_IRQ_CPU_TIMER);
36 else if (pending & STATUSF_IP2) {
37 int irq = txx9_irq();
38 if (irq == TX4938_IRQ_PIC_BEG + TX4938_IR_INT(0))
39 irq = toshiba_rbtx4938_irq_nested(irq);
40 if (irq >= 0)
41 do_IRQ(irq);
42 else
43 spurious_interrupt();
44 } else if (pending & STATUSF_IP1)
45 do_IRQ(TX4938_IRQ_USER1);
46 else if (pending & STATUSF_IP0)
47 do_IRQ(TX4938_IRQ_USER0);