irq.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * irq.c
  3. *
  4. * (C) Copyright 2007, Greg Ungerer <gerg@snapgear.com>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/types.h>
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/kernel_stat.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/irq.h>
  16. #include <linux/seq_file.h>
  17. #include <asm/system.h>
  18. #include <asm/traps.h>
  19. asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
  20. {
  21. struct pt_regs *oldregs = set_irq_regs(regs);
  22. irq_enter();
  23. generic_handle_irq(irq);
  24. irq_exit();
  25. set_irq_regs(oldregs);
  26. }
  27. #if !defined(CONFIG_M520x) && !defined(CONFIG_M523x) && \
  28. !defined(CONFIG_M527x) && !defined(CONFIG_M528x) && \
  29. !defined(CONFIG_M532x)
  30. static struct irq_chip m_irq_chip = {
  31. .name = "M68K-INTC",
  32. .enable = enable_vector,
  33. .disable = disable_vector,
  34. .ack = ack_vector,
  35. };
  36. void __init init_IRQ(void)
  37. {
  38. int irq;
  39. init_vectors();
  40. for (irq = 0; (irq < NR_IRQS); irq++) {
  41. irq_desc[irq].status = IRQ_DISABLED;
  42. irq_desc[irq].action = NULL;
  43. irq_desc[irq].depth = 1;
  44. irq_desc[irq].chip = &m_irq_chip;
  45. }
  46. }
  47. #endif
  48. int show_interrupts(struct seq_file *p, void *v)
  49. {
  50. struct irqaction *ap;
  51. int irq = *((loff_t *) v);
  52. if (irq == 0)
  53. seq_puts(p, " CPU0\n");
  54. if (irq < NR_IRQS) {
  55. ap = irq_desc[irq].action;
  56. if (ap) {
  57. seq_printf(p, "%3d: ", irq);
  58. seq_printf(p, "%10u ", kstat_irqs(irq));
  59. seq_printf(p, "%14s ", irq_desc[irq].chip->name);
  60. seq_printf(p, "%s", ap->name);
  61. for (ap = ap->next; ap; ap = ap->next)
  62. seq_printf(p, ", %s", ap->name);
  63. seq_putc(p, '\n');
  64. }
  65. }
  66. return 0;
  67. }