diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-10-16 05:32:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 10:53:29 -0400 |
commit | 6b39ba771e3c78d00e0abcebad270bd4212b28bc (patch) | |
tree | 98c0b1598eff3882faaef3b0f2ee72dcbe2f0ea0 /arch/x86/kernel/irq_64.c | |
parent | c0c168ca26b54a4a6ad34fc813fe00f275fbc94c (diff) |
x86: unify show_interrupts() and proc helpers
show_interrupts() and proc helpers are basically the same for
32 and 64 bit. Move them to a shared source file.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/irq_64.c')
-rw-r--r-- | arch/x86/kernel/irq_64.c | 132 |
1 files changed, 0 insertions, 132 deletions
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index 4f374294f292..39ef7feb9ea4 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -18,8 +18,6 @@ | |||
18 | #include <asm/idle.h> | 18 | #include <asm/idle.h> |
19 | #include <asm/smp.h> | 19 | #include <asm/smp.h> |
20 | 20 | ||
21 | atomic_t irq_err_count; | ||
22 | |||
23 | /* | 21 | /* |
24 | * 'what should we do if we get a hw irq event on an illegal vector'. | 22 | * 'what should we do if we get a hw irq event on an illegal vector'. |
25 | * each architecture has to answer this themselves. | 23 | * each architecture has to answer this themselves. |
@@ -65,136 +63,6 @@ static inline void stack_overflow_check(struct pt_regs *regs) | |||
65 | #endif | 63 | #endif |
66 | 64 | ||
67 | /* | 65 | /* |
68 | * Generic, controller-independent functions: | ||
69 | */ | ||
70 | |||
71 | static int show_other_interrupts(struct seq_file *p) | ||
72 | { | ||
73 | int j; | ||
74 | |||
75 | seq_printf(p, "NMI: "); | ||
76 | for_each_online_cpu(j) | ||
77 | seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); | ||
78 | seq_printf(p, " Non-maskable interrupts\n"); | ||
79 | seq_printf(p, "LOC: "); | ||
80 | for_each_online_cpu(j) | ||
81 | seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs); | ||
82 | seq_printf(p, " Local timer interrupts\n"); | ||
83 | #ifdef CONFIG_SMP | ||
84 | seq_printf(p, "RES: "); | ||
85 | for_each_online_cpu(j) | ||
86 | seq_printf(p, "%10u ", cpu_pda(j)->irq_resched_count); | ||
87 | seq_printf(p, " Rescheduling interrupts\n"); | ||
88 | seq_printf(p, "CAL: "); | ||
89 | for_each_online_cpu(j) | ||
90 | seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count); | ||
91 | seq_printf(p, " Function call interrupts\n"); | ||
92 | seq_printf(p, "TLB: "); | ||
93 | for_each_online_cpu(j) | ||
94 | seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count); | ||
95 | seq_printf(p, " TLB shootdowns\n"); | ||
96 | #endif | ||
97 | #ifdef CONFIG_X86_MCE | ||
98 | seq_printf(p, "TRM: "); | ||
99 | for_each_online_cpu(j) | ||
100 | seq_printf(p, "%10u ", cpu_pda(j)->irq_thermal_count); | ||
101 | seq_printf(p, " Thermal event interrupts\n"); | ||
102 | seq_printf(p, "THR: "); | ||
103 | for_each_online_cpu(j) | ||
104 | seq_printf(p, "%10u ", cpu_pda(j)->irq_threshold_count); | ||
105 | seq_printf(p, " Threshold APIC interrupts\n"); | ||
106 | #endif | ||
107 | seq_printf(p, "SPU: "); | ||
108 | for_each_online_cpu(j) | ||
109 | seq_printf(p, "%10u ", cpu_pda(j)->irq_spurious_count); | ||
110 | seq_printf(p, " Spurious interrupts\n"); | ||
111 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); | ||
112 | |||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | int show_interrupts(struct seq_file *p, void *v) | ||
117 | { | ||
118 | unsigned long flags, any_count = 0; | ||
119 | int i = *(loff_t *) v, j; | ||
120 | struct irqaction *action; | ||
121 | struct irq_desc *desc; | ||
122 | |||
123 | if (i > nr_irqs) | ||
124 | return 0; | ||
125 | |||
126 | if (i == nr_irqs) | ||
127 | return show_other_interrupts(p); | ||
128 | |||
129 | /* print header */ | ||
130 | if (i == 0) { | ||
131 | seq_printf(p, " "); | ||
132 | for_each_online_cpu(j) | ||
133 | seq_printf(p, "CPU%-8d",j); | ||
134 | seq_putc(p, '\n'); | ||
135 | } | ||
136 | |||
137 | desc = irq_to_desc(i); | ||
138 | spin_lock_irqsave(&desc->lock, flags); | ||
139 | #ifndef CONFIG_SMP | ||
140 | any_count = kstat_irqs(i); | ||
141 | #else | ||
142 | for_each_online_cpu(j) | ||
143 | any_count |= kstat_irqs_cpu(i, j); | ||
144 | #endif | ||
145 | action = desc->action; | ||
146 | if (!action && !any_count) | ||
147 | goto out; | ||
148 | |||
149 | seq_printf(p, "%3d: ", i); | ||
150 | #ifndef CONFIG_SMP | ||
151 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
152 | #else | ||
153 | for_each_online_cpu(j) | ||
154 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | ||
155 | #endif | ||
156 | seq_printf(p, " %8s", desc->chip->name); | ||
157 | seq_printf(p, "-%-8s", desc->name); | ||
158 | |||
159 | if (action) { | ||
160 | seq_printf(p, " %s", action->name); | ||
161 | while ((action = action->next) != NULL) | ||
162 | seq_printf(p, ", %s", action->name); | ||
163 | } | ||
164 | |||
165 | seq_putc(p, '\n'); | ||
166 | out: | ||
167 | spin_unlock_irqrestore(&desc->lock, flags); | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | /* | ||
172 | * /proc/stat helpers | ||
173 | */ | ||
174 | u64 arch_irq_stat_cpu(unsigned int cpu) | ||
175 | { | ||
176 | u64 sum = cpu_pda(cpu)->__nmi_count; | ||
177 | |||
178 | sum += cpu_pda(cpu)->apic_timer_irqs; | ||
179 | #ifdef CONFIG_SMP | ||
180 | sum += cpu_pda(cpu)->irq_resched_count; | ||
181 | sum += cpu_pda(cpu)->irq_call_count; | ||
182 | sum += cpu_pda(cpu)->irq_tlb_count; | ||
183 | #endif | ||
184 | #ifdef CONFIG_X86_MCE | ||
185 | sum += cpu_pda(cpu)->irq_thermal_count; | ||
186 | sum += cpu_pda(cpu)->irq_threshold_count; | ||
187 | #endif | ||
188 | sum += cpu_pda(cpu)->irq_spurious_count; | ||
189 | return sum; | ||
190 | } | ||
191 | |||
192 | u64 arch_irq_stat(void) | ||
193 | { | ||
194 | return atomic_read(&irq_err_count); | ||
195 | } | ||
196 | |||
197 | /* | ||
198 | * do_IRQ handles all normal device IRQ's (the special | 66 | * do_IRQ handles all normal device IRQ's (the special |
199 | * SMP cross-CPU interrupts have their own specific | 67 | * SMP cross-CPU interrupts have their own specific |
200 | * handlers). | 68 | * handlers). |