aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/irq.c')
-rw-r--r--arch/sh/kernel/irq.c77
1 files changed, 55 insertions, 22 deletions
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 3f1372eb0091..3d09062f4682 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -31,39 +31,64 @@ void ack_bad_irq(unsigned int irq)
31} 31}
32 32
33#if defined(CONFIG_PROC_FS) 33#if defined(CONFIG_PROC_FS)
34/*
35 * /proc/interrupts printing:
36 */
37static int show_other_interrupts(struct seq_file *p, int prec)
38{
39 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
40 return 0;
41}
42
34int show_interrupts(struct seq_file *p, void *v) 43int show_interrupts(struct seq_file *p, void *v)
35{ 44{
36 int i = *(loff_t *) v, j; 45 unsigned long flags, any_count = 0;
37 struct irqaction * action; 46 int i = *(loff_t *)v, j, prec;
38 unsigned long flags; 47 struct irqaction *action;
48 struct irq_desc *desc;
49
50 if (i > nr_irqs)
51 return 0;
52
53 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
54 j *= 10;
55
56 if (i == nr_irqs)
57 return show_other_interrupts(p, prec);
39 58
40 if (i == 0) { 59 if (i == 0) {
41 seq_puts(p, " "); 60 seq_printf(p, "%*s", prec + 8, "");
42 for_each_online_cpu(j) 61 for_each_online_cpu(j)
43 seq_printf(p, "CPU%d ",j); 62 seq_printf(p, "CPU%-8d", j);
44 seq_putc(p, '\n'); 63 seq_putc(p, '\n');
45 } 64 }
46 65
47 if (i < sh_mv.mv_nr_irqs) { 66 desc = irq_to_desc(i);
48 spin_lock_irqsave(&irq_desc[i].lock, flags); 67 if (!desc)
49 action = irq_desc[i].action; 68 return 0;
50 if (!action) 69
51 goto unlock; 70 spin_lock_irqsave(&desc->lock, flags);
52 seq_printf(p, "%3d: ",i); 71 for_each_online_cpu(j)
53 for_each_online_cpu(j) 72 any_count |= kstat_irqs_cpu(i, j);
54 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 73 action = desc->action;
55 seq_printf(p, " %14s", irq_desc[i].chip->name); 74 if (!action && !any_count)
56 seq_printf(p, "-%-8s", irq_desc[i].name); 75 goto out;
57 seq_printf(p, " %s", action->name); 76
77 seq_printf(p, "%*d: ", prec, i);
78 for_each_online_cpu(j)
79 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
80 seq_printf(p, " %14s", desc->chip->name);
81 seq_printf(p, "-%-8s", desc->name);
58 82
59 for (action=action->next; action; action = action->next) 83 if (action) {
84 seq_printf(p, " %s", action->name);
85 while ((action = action->next) != NULL)
60 seq_printf(p, ", %s", action->name); 86 seq_printf(p, ", %s", action->name);
61 seq_putc(p, '\n'); 87 }
62unlock:
63 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
64 } else if (i == sh_mv.mv_nr_irqs)
65 seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
66 88
89 seq_putc(p, '\n');
90out:
91 spin_unlock_irqrestore(&desc->lock, flags);
67 return 0; 92 return 0;
68} 93}
69#endif 94#endif
@@ -254,3 +279,11 @@ void __init init_IRQ(void)
254 279
255 irq_ctx_init(smp_processor_id()); 280 irq_ctx_init(smp_processor_id());
256} 281}
282
283#ifdef CONFIG_SPARSE_IRQ
284int __init arch_probe_nr_irqs(void)
285{
286 nr_irqs = sh_mv.mv_nr_irqs;
287 return 0;
288}
289#endif