diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 04:31:51 -0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-17 04:31:51 -0400 |
| commit | 3d44ae402a4e35cf88784d443046c8fbe25c674b (patch) | |
| tree | 631f641937c654dcdab9802e6f8cc8bf1d1c144f | |
| parent | a88403335a9ffc66a0a1b46b6d303512eddde846 (diff) | |
sh: Convert to generic show_interrupts.
Trivial conversion, simply encapsulate the NMI stats in the arch code.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| -rw-r--r-- | arch/sh/Kconfig | 1 | ||||
| -rw-r--r-- | arch/sh/kernel/irq.c | 61 |
2 files changed, 3 insertions, 59 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ca649d32a843..2d264fa84959 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -25,6 +25,7 @@ config SUPERH | |||
| 25 | select GENERIC_ATOMIC64 | 25 | select GENERIC_ATOMIC64 |
| 26 | # Support the deprecated APIs until MFD and GPIOLIB catch up. | 26 | # Support the deprecated APIs until MFD and GPIOLIB catch up. |
| 27 | select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB | 27 | select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB |
| 28 | select GENERIC_IRQ_SHOW | ||
| 28 | help | 29 | help |
| 29 | The SuperH is a RISC processor targeted for use in embedded systems | 30 | The SuperH is a RISC processor targeted for use in embedded systems |
| 30 | and consumer electronics; it was also used in the Sega Dreamcast | 31 | and consumer electronics; it was also used in the Sega Dreamcast |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 68ecbe6c881a..64ea0b165399 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
| @@ -34,9 +34,9 @@ void ack_bad_irq(unsigned int irq) | |||
| 34 | 34 | ||
| 35 | #if defined(CONFIG_PROC_FS) | 35 | #if defined(CONFIG_PROC_FS) |
| 36 | /* | 36 | /* |
| 37 | * /proc/interrupts printing: | 37 | * /proc/interrupts printing for arch specific interrupts |
| 38 | */ | 38 | */ |
| 39 | static int show_other_interrupts(struct seq_file *p, int prec) | 39 | int arch_show_interrupts(struct seq_file *p, int prec) |
| 40 | { | 40 | { |
| 41 | int j; | 41 | int j; |
| 42 | 42 | ||
| @@ -49,63 +49,6 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
| 49 | 49 | ||
| 50 | return 0; | 50 | return 0; |
| 51 | } | 51 | } |
| 52 | |||
| 53 | int show_interrupts(struct seq_file *p, void *v) | ||
| 54 | { | ||
| 55 | unsigned long flags, any_count = 0; | ||
| 56 | int i = *(loff_t *)v, j, prec; | ||
| 57 | struct irqaction *action; | ||
| 58 | struct irq_desc *desc; | ||
| 59 | struct irq_data *data; | ||
| 60 | struct irq_chip *chip; | ||
| 61 | |||
| 62 | if (i > nr_irqs) | ||
| 63 | return 0; | ||
| 64 | |||
| 65 | for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec) | ||
| 66 | j *= 10; | ||
| 67 | |||
| 68 | if (i == nr_irqs) | ||
| 69 | return show_other_interrupts(p, prec); | ||
| 70 | |||
| 71 | if (i == 0) { | ||
| 72 | seq_printf(p, "%*s", prec + 8, ""); | ||
| 73 | for_each_online_cpu(j) | ||
| 74 | seq_printf(p, "CPU%-8d", j); | ||
| 75 | seq_putc(p, '\n'); | ||
| 76 | } | ||
| 77 | |||
| 78 | desc = irq_to_desc(i); | ||
| 79 | if (!desc) | ||
| 80 | return 0; | ||
| 81 | |||
| 82 | data = irq_get_irq_data(i); | ||
| 83 | chip = irq_data_get_irq_chip(data); | ||
| 84 | |||
| 85 | raw_spin_lock_irqsave(&desc->lock, flags); | ||
| 86 | for_each_online_cpu(j) | ||
| 87 | any_count |= kstat_irqs_cpu(i, j); | ||
| 88 | action = desc->action; | ||
| 89 | if (!action && !any_count) | ||
| 90 | goto out; | ||
| 91 | |||
| 92 | seq_printf(p, "%*d: ", prec, i); | ||
| 93 | for_each_online_cpu(j) | ||
| 94 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
| 95 | seq_printf(p, " %14s", chip->name); | ||
| 96 | seq_printf(p, "-%-8s", desc->name); | ||
| 97 | |||
| 98 | if (action) { | ||
| 99 | seq_printf(p, " %s", action->name); | ||
| 100 | while ((action = action->next) != NULL) | ||
| 101 | seq_printf(p, ", %s", action->name); | ||
| 102 | } | ||
| 103 | |||
| 104 | seq_putc(p, '\n'); | ||
| 105 | out: | ||
| 106 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
| 107 | return 0; | ||
| 108 | } | ||
| 109 | #endif | 52 | #endif |
| 110 | 53 | ||
| 111 | #ifdef CONFIG_IRQSTACKS | 54 | #ifdef CONFIG_IRQSTACKS |
