irq.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * IRQ vector handles
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 1995, 1996, 1997, 2003 by Ralf Baechle
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/irq.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/pci.h>
  15. #include <asm/i8259.h>
  16. #include <asm/irq_cpu.h>
  17. #include <asm/irq_gt641xx.h>
  18. #include <asm/gt64120.h>
  19. #include <irq.h>
  20. asmlinkage void plat_irq_dispatch(void)
  21. {
  22. unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
  23. int irq;
  24. if (pending & CAUSEF_IP2)
  25. gt641xx_irq_dispatch();
  26. else if (pending & CAUSEF_IP6) {
  27. irq = i8259_irq();
  28. if (irq < 0)
  29. spurious_interrupt();
  30. else
  31. do_IRQ(irq);
  32. } else if (pending & CAUSEF_IP3)
  33. do_IRQ(MIPS_CPU_IRQ_BASE + 3);
  34. else if (pending & CAUSEF_IP4)
  35. do_IRQ(MIPS_CPU_IRQ_BASE + 4);
  36. else if (pending & CAUSEF_IP5)
  37. do_IRQ(MIPS_CPU_IRQ_BASE + 5);
  38. else if (pending & CAUSEF_IP7)
  39. do_IRQ(MIPS_CPU_IRQ_BASE + 7);
  40. else
  41. spurious_interrupt();
  42. }
  43. static struct irqaction cascade = {
  44. .handler = no_action,
  45. .name = "cascade",
  46. .flags = IRQF_NO_THREAD,
  47. };
  48. void __init arch_init_irq(void)
  49. {
  50. mips_cpu_irq_init();
  51. gt641xx_irq_init();
  52. init_i8259_irqs();
  53. setup_irq(GT641XX_CASCADE_IRQ, &cascade);
  54. setup_irq(I8259_CASCADE_IRQ, &cascade);
  55. }