irq.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * linux/arch/m32r/kernel/irq.c
  3. *
  4. * Copyright (c) 2003, 2004 Hitoshi Yamamoto
  5. * Copyright (c) 2004 Hirokazu Takata <takata at linux-m32r.org>
  6. */
  7. /*
  8. * linux/arch/i386/kernel/irq.c
  9. *
  10. * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
  11. *
  12. * This file contains the lowest level m32r-specific interrupt
  13. * entry and irq statistics code. All the remaining irq logic is
  14. * done by the generic kernel/irq/ code and in the
  15. * m32r-specific irq controller code.
  16. */
  17. #include <linux/kernel_stat.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/seq_file.h>
  20. #include <linux/module.h>
  21. #include <asm/uaccess.h>
  22. /*
  23. * Generic, controller-independent functions:
  24. */
  25. int show_interrupts(struct seq_file *p, void *v)
  26. {
  27. int i = *(loff_t *) v, j;
  28. struct irqaction * action;
  29. unsigned long flags;
  30. if (i == 0) {
  31. seq_printf(p, " ");
  32. for_each_online_cpu(j)
  33. seq_printf(p, "CPU%d ",j);
  34. seq_putc(p, '\n');
  35. }
  36. if (i < NR_IRQS) {
  37. spin_lock_irqsave(&irq_desc[i].lock, flags);
  38. action = irq_desc[i].action;
  39. if (!action)
  40. goto skip;
  41. seq_printf(p, "%3d: ",i);
  42. #ifndef CONFIG_SMP
  43. seq_printf(p, "%10u ", kstat_irqs(i));
  44. #else
  45. for_each_online_cpu(j)
  46. seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
  47. #endif
  48. seq_printf(p, " %14s", irq_desc[i].chip->typename);
  49. seq_printf(p, " %s", action->name);
  50. for (action=action->next; action; action = action->next)
  51. seq_printf(p, ", %s", action->name);
  52. seq_putc(p, '\n');
  53. skip:
  54. spin_unlock_irqrestore(&irq_desc[i].lock, flags);
  55. }
  56. return 0;
  57. }
  58. /*
  59. * do_IRQ handles all normal device IRQs (the special
  60. * SMP cross-CPU interrupts have their own specific
  61. * handlers).
  62. */
  63. asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)
  64. {
  65. struct pt_regs *old_regs;
  66. old_regs = set_irq_regs(regs);
  67. irq_enter();
  68. #ifdef CONFIG_DEBUG_STACKOVERFLOW
  69. /* FIXME M32R */
  70. #endif
  71. __do_IRQ(irq);
  72. irq_exit();
  73. set_irq_regs(old_regs);
  74. return 1;
  75. }