aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-25 12:04:59 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-29 08:48:13 -0400
commit433c9c67c53cc42b2824532d3abb7ac62970d3fb (patch)
tree9f3f5e28670d700c3374663ac1b4ba2e624d6d5d /arch
parentec775d0e70eb6b7116406b3441cb8501c2849dd2 (diff)
powerpc: Use generic show_interrupts()
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig2
-rw-r--r--arch/powerpc/kernel/irq.c61
2 files changed, 3 insertions, 60 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3584e4d4a4ad..d0e8a1dbf822 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -139,6 +139,8 @@ config PPC
139 select HAVE_SPARSE_IRQ 139 select HAVE_SPARSE_IRQ
140 select IRQ_PER_CPU 140 select IRQ_PER_CPU
141 select GENERIC_HARDIRQS_NO_DEPRECATED 141 select GENERIC_HARDIRQS_NO_DEPRECATED
142 select GENERIC_IRQ_SHOW
143 select GENERIC_IRQ_SHOW_LEVEL
142 144
143config EARLY_PRINTK 145config EARLY_PRINTK
144 bool 146 bool
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index a155dfde9ac3..63625e0650b5 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -195,7 +195,7 @@ notrace void arch_local_irq_restore(unsigned long en)
195EXPORT_SYMBOL(arch_local_irq_restore); 195EXPORT_SYMBOL(arch_local_irq_restore);
196#endif /* CONFIG_PPC64 */ 196#endif /* CONFIG_PPC64 */
197 197
198static int show_other_interrupts(struct seq_file *p, int prec) 198int arch_show_interrupts(struct seq_file *p, int prec)
199{ 199{
200 int j; 200 int j;
201 201
@@ -231,65 +231,6 @@ static int show_other_interrupts(struct seq_file *p, int prec)
231 return 0; 231 return 0;
232} 232}
233 233
234int show_interrupts(struct seq_file *p, void *v)
235{
236 unsigned long flags, any_count = 0;
237 int i = *(loff_t *) v, j, prec;
238 struct irqaction *action;
239 struct irq_desc *desc;
240 struct irq_chip *chip;
241
242 if (i > nr_irqs)
243 return 0;
244
245 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
246 j *= 10;
247
248 if (i == nr_irqs)
249 return show_other_interrupts(p, prec);
250
251 /* print header */
252 if (i == 0) {
253 seq_printf(p, "%*s", prec + 8, "");
254 for_each_online_cpu(j)
255 seq_printf(p, "CPU%-8d", j);
256 seq_putc(p, '\n');
257 }
258
259 desc = irq_to_desc(i);
260 if (!desc)
261 return 0;
262
263 raw_spin_lock_irqsave(&desc->lock, flags);
264 for_each_online_cpu(j)
265 any_count |= kstat_irqs_cpu(i, j);
266 action = desc->action;
267 if (!action && !any_count)
268 goto out;
269
270 seq_printf(p, "%*d: ", prec, i);
271 for_each_online_cpu(j)
272 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
273
274 chip = get_irq_desc_chip(desc);
275 if (chip)
276 seq_printf(p, " %-16s", chip->name);
277 else
278 seq_printf(p, " %-16s", "None");
279 seq_printf(p, " %-8s", (irqd_is_level_type(&desc->irq_data) ? "Level" : "Edge");
280
281 if (action) {
282 seq_printf(p, " %s", action->name);
283 while ((action = action->next) != NULL)
284 seq_printf(p, ", %s", action->name);
285 }
286
287 seq_putc(p, '\n');
288out:
289 raw_spin_unlock_irqrestore(&desc->lock, flags);
290 return 0;
291}
292
293/* 234/*
294 * /proc/stat helpers 235 * /proc/stat helpers
295 */ 236 */