Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * IRQ vector handles
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  *
0008  * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
0009  */
0010 #include <linux/kernel.h>
0011 #include <linux/init.h>
0012 #include <linux/irq.h>
0013 #include <linux/interrupt.h>
0014 #include <linux/pci.h>
0015 
0016 #include <asm/i8259.h>
0017 #include <asm/irq_cpu.h>
0018 #include <asm/irq_gt641xx.h>
0019 #include <asm/gt64120.h>
0020 
0021 #include <irq.h>
0022 
0023 asmlinkage void plat_irq_dispatch(void)
0024 {
0025     unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
0026     int irq;
0027 
0028     if (pending & CAUSEF_IP2)
0029         gt641xx_irq_dispatch();
0030     else if (pending & CAUSEF_IP6) {
0031         irq = i8259_irq();
0032         if (irq < 0)
0033             spurious_interrupt();
0034         else
0035             do_IRQ(irq);
0036     } else if (pending & CAUSEF_IP3)
0037         do_IRQ(MIPS_CPU_IRQ_BASE + 3);
0038     else if (pending & CAUSEF_IP4)
0039         do_IRQ(MIPS_CPU_IRQ_BASE + 4);
0040     else if (pending & CAUSEF_IP5)
0041         do_IRQ(MIPS_CPU_IRQ_BASE + 5);
0042     else if (pending & CAUSEF_IP7)
0043         do_IRQ(MIPS_CPU_IRQ_BASE + 7);
0044     else
0045         spurious_interrupt();
0046 }
0047 
0048 void __init arch_init_irq(void)
0049 {
0050     mips_cpu_irq_init();
0051     gt641xx_irq_init();
0052     init_i8259_irqs();
0053 
0054     if (request_irq(GT641XX_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
0055             "cascade", NULL)) {
0056         pr_err("Failed to request irq %d (cascade)\n",
0057                GT641XX_CASCADE_IRQ);
0058     }
0059     if (request_irq(I8259_CASCADE_IRQ, no_action, IRQF_NO_THREAD,
0060             "cascade", NULL)) {
0061         pr_err("Failed to request irq %d (cascade)\n",
0062                I8259_CASCADE_IRQ);
0063     }
0064 }