aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irq_64.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:50:20 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:51 -0400
commit52b17329d6d0a4824b89206803a430915031ff23 (patch)
tree714884d90d67a771eef01863a677d502b2d758fc /arch/x86/kernel/irq_64.c
parenta2f9f43858db64cb8b45c4f6746d7a52b80d4dcb (diff)
x86_64: make /proc/interrupts work with dyn irq_desc
loop with irq_desc list Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/irq_64.c')
-rw-r--r--arch/x86/kernel/irq_64.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 5d5976e0311a..7bd841a9c640 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -70,9 +70,27 @@ static inline void stack_overflow_check(struct pt_regs *regs)
70 70
71int show_interrupts(struct seq_file *p, void *v) 71int show_interrupts(struct seq_file *p, void *v)
72{ 72{
73 int i = *(loff_t *) v, j; 73 int i, j;
74 struct irqaction * action; 74 struct irqaction * action;
75 unsigned long flags; 75 unsigned long flags;
76 unsigned int entries;
77 struct irq_desc *desc;
78 int tail = 0;
79
80#ifdef CONFIG_HAVE_SPARSE_IRQ
81 desc = (struct irq_desc *)v;
82 entries = -1U;
83 i = desc->irq;
84 if (!desc->next)
85 tail = 1;
86#else
87 entries = nr_irqs - 1;
88 i = *(loff_t *) v;
89 if (i == nr_irqs)
90 tail = 1;
91 else
92 desc = irq_to_desc(i);
93#endif
76 94
77 if (i == 0) { 95 if (i == 0) {
78 seq_printf(p, " "); 96 seq_printf(p, " ");
@@ -81,12 +99,8 @@ int show_interrupts(struct seq_file *p, void *v)
81 seq_putc(p, '\n'); 99 seq_putc(p, '\n');
82 } 100 }
83 101
84 if (i < nr_irqs) { 102 if (i <= entries) {
85 unsigned any_count = 0; 103 unsigned any_count = 0;
86 struct irq_desc *desc = irq_to_desc(i);
87
88 if (!desc)
89 return 0;
90 104
91 spin_lock_irqsave(&desc->lock, flags); 105 spin_lock_irqsave(&desc->lock, flags);
92#ifndef CONFIG_SMP 106#ifndef CONFIG_SMP
@@ -116,7 +130,9 @@ int show_interrupts(struct seq_file *p, void *v)
116 seq_putc(p, '\n'); 130 seq_putc(p, '\n');
117skip: 131skip:
118 spin_unlock_irqrestore(&desc->lock, flags); 132 spin_unlock_irqrestore(&desc->lock, flags);
119 } else if (i == nr_irqs) { 133 }
134
135 if (tail) {
120 seq_printf(p, "NMI: "); 136 seq_printf(p, "NMI: ");
121 for_each_online_cpu(j) 137 for_each_online_cpu(j)
122 seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); 138 seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count);
@@ -155,6 +171,7 @@ skip:
155 seq_printf(p, " Spurious interrupts\n"); 171 seq_printf(p, " Spurious interrupts\n");
156 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); 172 seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count));
157 } 173 }
174
158 return 0; 175 return 0;
159} 176}
160 177