irq.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. int show_interrupts(struct seq_file *p, void *v)
  28. {
  29. struct irqaction *ap;
  30. int irq = *((loff_t *) v);
  31. if (irq == 0)
  32. seq_puts(p, " CPU0\n");
  33. if (irq < NR_IRQS) {
  34. ap = irq_desc[irq].action;
  35. if (ap) {
  36. seq_printf(p, "%3d: ", irq);
  37. seq_printf(p, "%10u ", kstat_irqs(irq));
  38. seq_printf(p, "%14s ", irq_desc[irq].chip->name);
  39. seq_printf(p, "%s", ap->name);
  40. for (ap = ap->next; ap; ap = ap->next)
  41. seq_printf(p, ", %s", ap->name);
  42. seq_putc(p, '\n');
  43. }
  44. }
  45. return 0;
  46. }