diff options
author | Paul Mackerras <paulus@samba.org> | 2005-11-09 21:08:55 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-09 21:08:55 -0500 |
commit | e130bedb7ce718a8eb6b56a3806b96281f618111 (patch) | |
tree | da5676a4291a79b06da6fe2b005e0058ec03cc2c /arch/powerpc | |
parent | 00557b59c69ce284e5a61bcfcdbcc3dc867cb2da (diff) | |
parent | 756e7104fefc82e3ebaa5f1da5ba6659c9c1cae5 (diff) |
Merge git://oak/home/sfr/kernels/iseries/work
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 478 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup.h | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_32.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/irq.c | 24 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pic.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/xics.c | 1 |
10 files changed, 518 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 103cb8128ef4..92cfabf929bc 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -12,7 +12,7 @@ CFLAGS_btext.o += -fPIC | |||
12 | endif | 12 | endif |
13 | 13 | ||
14 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ | 14 | obj-y := semaphore.o cputable.o ptrace.o syscalls.o \ |
15 | signal_32.o pmc.o | 15 | irq.o signal_32.o pmc.o |
16 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ | 16 | obj-$(CONFIG_PPC64) += setup_64.o binfmt_elf32.o sys_ppc32.o \ |
17 | signal_64.o ptrace32.o systbl.o \ | 17 | signal_64.o ptrace32.o systbl.o \ |
18 | paca.o ioctl32.o cpu_setup_power4.o \ | 18 | paca.o ioctl32.o cpu_setup_power4.o \ |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c new file mode 100644 index 000000000000..4b7940693f3d --- /dev/null +++ b/arch/powerpc/kernel/irq.c | |||
@@ -0,0 +1,478 @@ | |||
1 | /* | ||
2 | * arch/ppc/kernel/irq.c | ||
3 | * | ||
4 | * Derived from arch/i386/kernel/irq.c | ||
5 | * Copyright (C) 1992 Linus Torvalds | ||
6 | * Adapted from arch/i386 by Gary Thomas | ||
7 | * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) | ||
8 | * Updated and modified by Cort Dougan <cort@fsmlabs.com> | ||
9 | * Copyright (C) 1996-2001 Cort Dougan | ||
10 | * Adapted for Power Macintosh by Paul Mackerras | ||
11 | * Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au) | ||
12 | * Amiga/APUS changes by Jesper Skov (jskov@cygnus.co.uk). | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version | ||
17 | * 2 of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This file contains the code used by various IRQ handling routines: | ||
20 | * asking for different IRQ's should be done through these routines | ||
21 | * instead of just grabbing them. Thus setups with different IRQ numbers | ||
22 | * shouldn't result in any weird surprises, and installing new handlers | ||
23 | * should be easier. | ||
24 | * | ||
25 | * The MPC8xx has an interrupt mask in the SIU. If a bit is set, the | ||
26 | * interrupt is _enabled_. As expected, IRQ0 is bit 0 in the 32-bit | ||
27 | * mask register (of which only 16 are defined), hence the weird shifting | ||
28 | * and complement of the cached_irq_mask. I want to be able to stuff | ||
29 | * this right into the SIU SMASK register. | ||
30 | * Many of the prep/chrp functions are conditional compiled on CONFIG_8xx | ||
31 | * to reduce code space and undefined function references. | ||
32 | */ | ||
33 | |||
34 | #include <linux/errno.h> | ||
35 | #include <linux/module.h> | ||
36 | #include <linux/threads.h> | ||
37 | #include <linux/kernel_stat.h> | ||
38 | #include <linux/signal.h> | ||
39 | #include <linux/sched.h> | ||
40 | #include <linux/ptrace.h> | ||
41 | #include <linux/ioport.h> | ||
42 | #include <linux/interrupt.h> | ||
43 | #include <linux/timex.h> | ||
44 | #include <linux/config.h> | ||
45 | #include <linux/init.h> | ||
46 | #include <linux/slab.h> | ||
47 | #include <linux/pci.h> | ||
48 | #include <linux/delay.h> | ||
49 | #include <linux/irq.h> | ||
50 | #include <linux/proc_fs.h> | ||
51 | #include <linux/random.h> | ||
52 | #include <linux/seq_file.h> | ||
53 | #include <linux/cpumask.h> | ||
54 | #include <linux/profile.h> | ||
55 | #include <linux/bitops.h> | ||
56 | #ifdef CONFIG_PPC64 | ||
57 | #include <linux/kallsyms.h> | ||
58 | #endif | ||
59 | |||
60 | #include <asm/uaccess.h> | ||
61 | #include <asm/system.h> | ||
62 | #include <asm/io.h> | ||
63 | #include <asm/pgtable.h> | ||
64 | #include <asm/irq.h> | ||
65 | #include <asm/cache.h> | ||
66 | #include <asm/prom.h> | ||
67 | #include <asm/ptrace.h> | ||
68 | #include <asm/machdep.h> | ||
69 | #ifdef CONFIG_PPC64 | ||
70 | #include <asm/iseries/it_lp_queue.h> | ||
71 | #include <asm/paca.h> | ||
72 | #endif | ||
73 | |||
74 | static int ppc_spurious_interrupts; | ||
75 | |||
76 | #if defined(CONFIG_PPC_ISERIES) && defined(CONFIG_SMP) | ||
77 | extern void iSeries_smp_message_recv(struct pt_regs *); | ||
78 | #endif | ||
79 | |||
80 | #ifdef CONFIG_PPC32 | ||
81 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | ||
82 | |||
83 | unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; | ||
84 | atomic_t ppc_n_lost_interrupts; | ||
85 | |||
86 | #ifdef CONFIG_TAU_INT | ||
87 | extern int tau_initialized; | ||
88 | extern int tau_interrupts(int); | ||
89 | #endif | ||
90 | |||
91 | #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) | ||
92 | extern atomic_t ipi_recv; | ||
93 | extern atomic_t ipi_sent; | ||
94 | #endif | ||
95 | #endif /* CONFIG_PPC32 */ | ||
96 | |||
97 | #ifdef CONFIG_PPC64 | ||
98 | EXPORT_SYMBOL(irq_desc); | ||
99 | |||
100 | int distribute_irqs = 1; | ||
101 | int __irq_offset_value; | ||
102 | u64 ppc64_interrupt_controller; | ||
103 | #endif /* CONFIG_PPC64 */ | ||
104 | |||
105 | int show_interrupts(struct seq_file *p, void *v) | ||
106 | { | ||
107 | int i = *(loff_t *)v, j; | ||
108 | struct irqaction *action; | ||
109 | irq_desc_t *desc; | ||
110 | unsigned long flags; | ||
111 | |||
112 | if (i == 0) { | ||
113 | seq_puts(p, " "); | ||
114 | for_each_online_cpu(j) | ||
115 | seq_printf(p, "CPU%d ", j); | ||
116 | seq_putc(p, '\n'); | ||
117 | } | ||
118 | |||
119 | if (i < NR_IRQS) { | ||
120 | desc = get_irq_desc(i); | ||
121 | spin_lock_irqsave(&desc->lock, flags); | ||
122 | action = desc->action; | ||
123 | if (!action || !action->handler) | ||
124 | goto skip; | ||
125 | seq_printf(p, "%3d: ", i); | ||
126 | #ifdef CONFIG_SMP | ||
127 | for_each_online_cpu(j) | ||
128 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | ||
129 | #else | ||
130 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
131 | #endif /* CONFIG_SMP */ | ||
132 | if (desc->handler) | ||
133 | seq_printf(p, " %s ", desc->handler->typename); | ||
134 | else | ||
135 | seq_puts(p, " None "); | ||
136 | seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge "); | ||
137 | seq_printf(p, " %s", action->name); | ||
138 | for (action = action->next; action; action = action->next) | ||
139 | seq_printf(p, ", %s", action->name); | ||
140 | seq_putc(p, '\n'); | ||
141 | skip: | ||
142 | spin_unlock_irqrestore(&desc->lock, flags); | ||
143 | } else if (i == NR_IRQS) { | ||
144 | #ifdef CONFIG_PPC32 | ||
145 | #ifdef CONFIG_TAU_INT | ||
146 | if (tau_initialized){ | ||
147 | seq_puts(p, "TAU: "); | ||
148 | for (j = 0; j < NR_CPUS; j++) | ||
149 | if (cpu_online(j)) | ||
150 | seq_printf(p, "%10u ", tau_interrupts(j)); | ||
151 | seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n"); | ||
152 | } | ||
153 | #endif | ||
154 | #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) | ||
155 | /* should this be per processor send/receive? */ | ||
156 | seq_printf(p, "IPI (recv/sent): %10u/%u\n", | ||
157 | atomic_read(&ipi_recv), atomic_read(&ipi_sent)); | ||
158 | #endif | ||
159 | #endif /* CONFIG_PPC32 */ | ||
160 | seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts); | ||
161 | } | ||
162 | return 0; | ||
163 | } | ||
164 | |||
165 | #ifdef CONFIG_HOTPLUG_CPU | ||
166 | void fixup_irqs(cpumask_t map) | ||
167 | { | ||
168 | unsigned int irq; | ||
169 | static int warned; | ||
170 | |||
171 | for_each_irq(irq) { | ||
172 | cpumask_t mask; | ||
173 | |||
174 | if (irq_desc[irq].status & IRQ_PER_CPU) | ||
175 | continue; | ||
176 | |||
177 | cpus_and(mask, irq_affinity[irq], map); | ||
178 | if (any_online_cpu(mask) == NR_CPUS) { | ||
179 | printk("Breaking affinity for irq %i\n", irq); | ||
180 | mask = map; | ||
181 | } | ||
182 | if (irq_desc[irq].handler->set_affinity) | ||
183 | irq_desc[irq].handler->set_affinity(irq, mask); | ||
184 | else if (irq_desc[irq].action && !(warned++)) | ||
185 | printk("Cannot set affinity for irq %i\n", irq); | ||
186 | } | ||
187 | |||
188 | local_irq_enable(); | ||
189 | mdelay(1); | ||
190 | local_irq_disable(); | ||
191 | } | ||
192 | #endif | ||
193 | |||
194 | #ifdef CONFIG_PPC_ISERIES | ||
195 | void do_IRQ(struct pt_regs *regs) | ||
196 | { | ||
197 | struct paca_struct *lpaca; | ||
198 | |||
199 | irq_enter(); | ||
200 | |||
201 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | ||
202 | /* Debugging check for stack overflow: is there less than 2KB free? */ | ||
203 | { | ||
204 | long sp; | ||
205 | |||
206 | sp = __get_SP() & (THREAD_SIZE-1); | ||
207 | |||
208 | if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { | ||
209 | printk("do_IRQ: stack overflow: %ld\n", | ||
210 | sp - sizeof(struct thread_info)); | ||
211 | dump_stack(); | ||
212 | } | ||
213 | } | ||
214 | #endif | ||
215 | |||
216 | lpaca = get_paca(); | ||
217 | #ifdef CONFIG_SMP | ||
218 | if (lpaca->lppaca.int_dword.fields.ipi_cnt) { | ||
219 | lpaca->lppaca.int_dword.fields.ipi_cnt = 0; | ||
220 | iSeries_smp_message_recv(regs); | ||
221 | } | ||
222 | #endif /* CONFIG_SMP */ | ||
223 | if (hvlpevent_is_pending()) | ||
224 | process_hvlpevents(regs); | ||
225 | |||
226 | irq_exit(); | ||
227 | |||
228 | if (lpaca->lppaca.int_dword.fields.decr_int) { | ||
229 | lpaca->lppaca.int_dword.fields.decr_int = 0; | ||
230 | /* Signal a fake decrementer interrupt */ | ||
231 | timer_interrupt(regs); | ||
232 | } | ||
233 | } | ||
234 | |||
235 | #else /* CONFIG_PPC_ISERIES */ | ||
236 | |||
237 | void do_IRQ(struct pt_regs *regs) | ||
238 | { | ||
239 | int irq; | ||
240 | #ifdef CONFIG_IRQSTACKS | ||
241 | struct thread_info *curtp, *irqtp; | ||
242 | #endif | ||
243 | |||
244 | irq_enter(); | ||
245 | |||
246 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | ||
247 | /* Debugging check for stack overflow: is there less than 2KB free? */ | ||
248 | { | ||
249 | long sp; | ||
250 | |||
251 | sp = __get_SP() & (THREAD_SIZE-1); | ||
252 | |||
253 | if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { | ||
254 | printk("do_IRQ: stack overflow: %ld\n", | ||
255 | sp - sizeof(struct thread_info)); | ||
256 | dump_stack(); | ||
257 | } | ||
258 | } | ||
259 | #endif | ||
260 | |||
261 | /* | ||
262 | * Every platform is required to implement ppc_md.get_irq. | ||
263 | * This function will either return an irq number or -1 to | ||
264 | * indicate there are no more pending. | ||
265 | * The value -2 is for buggy hardware and means that this IRQ | ||
266 | * has already been handled. -- Tom | ||
267 | */ | ||
268 | irq = ppc_md.get_irq(regs); | ||
269 | |||
270 | if (irq >= 0) { | ||
271 | #ifdef CONFIG_IRQSTACKS | ||
272 | /* Switch to the irq stack to handle this */ | ||
273 | curtp = current_thread_info(); | ||
274 | irqtp = hardirq_ctx[smp_processor_id()]; | ||
275 | if (curtp != irqtp) { | ||
276 | irqtp->task = curtp->task; | ||
277 | irqtp->flags = 0; | ||
278 | call___do_IRQ(irq, regs, irqtp); | ||
279 | irqtp->task = NULL; | ||
280 | if (irqtp->flags) | ||
281 | set_bits(irqtp->flags, &curtp->flags); | ||
282 | } else | ||
283 | #endif | ||
284 | __do_IRQ(irq, regs); | ||
285 | } else | ||
286 | #ifdef CONFIG_PPC32 | ||
287 | if (irq != -2) | ||
288 | #endif | ||
289 | /* That's not SMP safe ... but who cares ? */ | ||
290 | ppc_spurious_interrupts++; | ||
291 | irq_exit(); | ||
292 | } | ||
293 | |||
294 | #endif /* CONFIG_PPC_ISERIES */ | ||
295 | |||
296 | void __init init_IRQ(void) | ||
297 | { | ||
298 | #ifdef CONFIG_PPC64 | ||
299 | static int once = 0; | ||
300 | |||
301 | if (once) | ||
302 | return; | ||
303 | |||
304 | once++; | ||
305 | |||
306 | #endif | ||
307 | ppc_md.init_IRQ(); | ||
308 | #ifdef CONFIG_PPC64 | ||
309 | irq_ctx_init(); | ||
310 | #endif | ||
311 | } | ||
312 | |||
313 | #ifdef CONFIG_PPC64 | ||
314 | #ifndef CONFIG_PPC_ISERIES | ||
315 | /* | ||
316 | * Virtual IRQ mapping code, used on systems with XICS interrupt controllers. | ||
317 | */ | ||
318 | |||
319 | #define UNDEFINED_IRQ 0xffffffff | ||
320 | unsigned int virt_irq_to_real_map[NR_IRQS]; | ||
321 | |||
322 | /* | ||
323 | * Don't use virtual irqs 0, 1, 2 for devices. | ||
324 | * The pcnet32 driver considers interrupt numbers < 2 to be invalid, | ||
325 | * and 2 is the XICS IPI interrupt. | ||
326 | * We limit virtual irqs to 17 less than NR_IRQS so that when we | ||
327 | * offset them by 16 (to reserve the first 16 for ISA interrupts) | ||
328 | * we don't end up with an interrupt number >= NR_IRQS. | ||
329 | */ | ||
330 | #define MIN_VIRT_IRQ 3 | ||
331 | #define MAX_VIRT_IRQ (NR_IRQS - NUM_ISA_INTERRUPTS - 1) | ||
332 | #define NR_VIRT_IRQS (MAX_VIRT_IRQ - MIN_VIRT_IRQ + 1) | ||
333 | |||
334 | void | ||
335 | virt_irq_init(void) | ||
336 | { | ||
337 | int i; | ||
338 | for (i = 0; i < NR_IRQS; i++) | ||
339 | virt_irq_to_real_map[i] = UNDEFINED_IRQ; | ||
340 | } | ||
341 | |||
342 | /* Create a mapping for a real_irq if it doesn't already exist. | ||
343 | * Return the virtual irq as a convenience. | ||
344 | */ | ||
345 | int virt_irq_create_mapping(unsigned int real_irq) | ||
346 | { | ||
347 | unsigned int virq, first_virq; | ||
348 | static int warned; | ||
349 | |||
350 | if (ppc64_interrupt_controller == IC_OPEN_PIC) | ||
351 | return real_irq; /* no mapping for openpic (for now) */ | ||
352 | |||
353 | if (ppc64_interrupt_controller == IC_CELL_PIC) | ||
354 | return real_irq; /* no mapping for iic either */ | ||
355 | |||
356 | /* don't map interrupts < MIN_VIRT_IRQ */ | ||
357 | if (real_irq < MIN_VIRT_IRQ) { | ||
358 | virt_irq_to_real_map[real_irq] = real_irq; | ||
359 | return real_irq; | ||
360 | } | ||
361 | |||
362 | /* map to a number between MIN_VIRT_IRQ and MAX_VIRT_IRQ */ | ||
363 | virq = real_irq; | ||
364 | if (virq > MAX_VIRT_IRQ) | ||
365 | virq = (virq % NR_VIRT_IRQS) + MIN_VIRT_IRQ; | ||
366 | |||
367 | /* search for this number or a free slot */ | ||
368 | first_virq = virq; | ||
369 | while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) { | ||
370 | if (virt_irq_to_real_map[virq] == real_irq) | ||
371 | return virq; | ||
372 | if (++virq > MAX_VIRT_IRQ) | ||
373 | virq = MIN_VIRT_IRQ; | ||
374 | if (virq == first_virq) | ||
375 | goto nospace; /* oops, no free slots */ | ||
376 | } | ||
377 | |||
378 | virt_irq_to_real_map[virq] = real_irq; | ||
379 | return virq; | ||
380 | |||
381 | nospace: | ||
382 | if (!warned) { | ||
383 | printk(KERN_CRIT "Interrupt table is full\n"); | ||
384 | printk(KERN_CRIT "Increase NR_IRQS (currently %d) " | ||
385 | "in your kernel sources and rebuild.\n", NR_IRQS); | ||
386 | warned = 1; | ||
387 | } | ||
388 | return NO_IRQ; | ||
389 | } | ||
390 | |||
391 | /* | ||
392 | * In most cases will get a hit on the very first slot checked in the | ||
393 | * virt_irq_to_real_map. Only when there are a large number of | ||
394 | * IRQs will this be expensive. | ||
395 | */ | ||
396 | unsigned int real_irq_to_virt_slowpath(unsigned int real_irq) | ||
397 | { | ||
398 | unsigned int virq; | ||
399 | unsigned int first_virq; | ||
400 | |||
401 | virq = real_irq; | ||
402 | |||
403 | if (virq > MAX_VIRT_IRQ) | ||
404 | virq = (virq % NR_VIRT_IRQS) + MIN_VIRT_IRQ; | ||
405 | |||
406 | first_virq = virq; | ||
407 | |||
408 | do { | ||
409 | if (virt_irq_to_real_map[virq] == real_irq) | ||
410 | return virq; | ||
411 | |||
412 | virq++; | ||
413 | |||
414 | if (virq >= MAX_VIRT_IRQ) | ||
415 | virq = 0; | ||
416 | |||
417 | } while (first_virq != virq); | ||
418 | |||
419 | return NO_IRQ; | ||
420 | |||
421 | } | ||
422 | |||
423 | #endif /* CONFIG_PPC_ISERIES */ | ||
424 | |||
425 | #ifdef CONFIG_IRQSTACKS | ||
426 | struct thread_info *softirq_ctx[NR_CPUS]; | ||
427 | struct thread_info *hardirq_ctx[NR_CPUS]; | ||
428 | |||
429 | void irq_ctx_init(void) | ||
430 | { | ||
431 | struct thread_info *tp; | ||
432 | int i; | ||
433 | |||
434 | for_each_cpu(i) { | ||
435 | memset((void *)softirq_ctx[i], 0, THREAD_SIZE); | ||
436 | tp = softirq_ctx[i]; | ||
437 | tp->cpu = i; | ||
438 | tp->preempt_count = SOFTIRQ_OFFSET; | ||
439 | |||
440 | memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); | ||
441 | tp = hardirq_ctx[i]; | ||
442 | tp->cpu = i; | ||
443 | tp->preempt_count = HARDIRQ_OFFSET; | ||
444 | } | ||
445 | } | ||
446 | |||
447 | void do_softirq(void) | ||
448 | { | ||
449 | unsigned long flags; | ||
450 | struct thread_info *curtp, *irqtp; | ||
451 | |||
452 | if (in_interrupt()) | ||
453 | return; | ||
454 | |||
455 | local_irq_save(flags); | ||
456 | |||
457 | if (local_softirq_pending()) { | ||
458 | curtp = current_thread_info(); | ||
459 | irqtp = softirq_ctx[smp_processor_id()]; | ||
460 | irqtp->task = curtp->task; | ||
461 | call_do_softirq(irqtp); | ||
462 | irqtp->task = NULL; | ||
463 | } | ||
464 | |||
465 | local_irq_restore(flags); | ||
466 | } | ||
467 | EXPORT_SYMBOL(do_softirq); | ||
468 | |||
469 | #endif /* CONFIG_IRQSTACKS */ | ||
470 | |||
471 | static int __init setup_noirqdistrib(char *str) | ||
472 | { | ||
473 | distribute_irqs = 0; | ||
474 | return 1; | ||
475 | } | ||
476 | |||
477 | __setup("noirqdistrib", setup_noirqdistrib); | ||
478 | #endif /* CONFIG_PPC64 */ | ||
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index ae1433da09b2..ae48a002f81a 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S | |||
@@ -89,12 +89,12 @@ _GLOBAL(call_do_softirq) | |||
89 | mtlr r0 | 89 | mtlr r0 |
90 | blr | 90 | blr |
91 | 91 | ||
92 | _GLOBAL(call_handle_IRQ_event) | 92 | _GLOBAL(call___do_IRQ) |
93 | mflr r0 | 93 | mflr r0 |
94 | std r0,16(r1) | 94 | std r0,16(r1) |
95 | stdu r1,THREAD_SIZE-112(r6) | 95 | stdu r1,THREAD_SIZE-112(r5) |
96 | mr r1,r6 | 96 | mr r1,r5 |
97 | bl .handle_IRQ_event | 97 | bl .__do_IRQ |
98 | ld r1,0(r1) | 98 | ld r1,0(r1) |
99 | ld r0,16(r1) | 99 | ld r0,16(r1) |
100 | mtlr r0 | 100 | mtlr r0 |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 26bb1fe6384b..17c46a2e356d 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <asm/lmb.h> | 53 | #include <asm/lmb.h> |
54 | #include <asm/xmon.h> | 54 | #include <asm/xmon.h> |
55 | 55 | ||
56 | #include "setup.h" | ||
57 | |||
56 | #undef DEBUG | 58 | #undef DEBUG |
57 | 59 | ||
58 | #ifdef DEBUG | 60 | #ifdef DEBUG |
diff --git a/arch/powerpc/kernel/setup.h b/arch/powerpc/kernel/setup.h new file mode 100644 index 000000000000..2ebba755272e --- /dev/null +++ b/arch/powerpc/kernel/setup.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _POWERPC_KERNEL_SETUP_H | ||
2 | #define _POWERPC_KERNEL_SETUP_H | ||
3 | |||
4 | void check_for_initrd(void); | ||
5 | |||
6 | #endif /* _POWERPC_KERNEL_SETUP_H */ | ||
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 0fbc73f7f828..55f485f78c00 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <asm/xmon.h> | 40 | #include <asm/xmon.h> |
41 | #include <asm/time.h> | 41 | #include <asm/time.h> |
42 | 42 | ||
43 | #include "setup.h" | ||
44 | |||
43 | #define DBG(fmt...) | 45 | #define DBG(fmt...) |
44 | 46 | ||
45 | #if defined CONFIG_KGDB | 47 | #if defined CONFIG_KGDB |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 54c606f680b3..fe39aac4f24d 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -61,6 +61,8 @@ | |||
61 | #include <asm/xmon.h> | 61 | #include <asm/xmon.h> |
62 | #include <asm/udbg.h> | 62 | #include <asm/udbg.h> |
63 | 63 | ||
64 | #include "setup.h" | ||
65 | |||
64 | #ifdef DEBUG | 66 | #ifdef DEBUG |
65 | #define DBG(fmt...) udbg_printf(fmt) | 67 | #define DBG(fmt...) udbg_printf(fmt) |
66 | #else | 68 | #else |
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index a06603d84a45..01090e9ce0cf 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c | |||
@@ -103,6 +103,9 @@ static void intReceived(struct XmPciLpEvent *eventParm, | |||
103 | struct pt_regs *regsParm) | 103 | struct pt_regs *regsParm) |
104 | { | 104 | { |
105 | int irq; | 105 | int irq; |
106 | #ifdef CONFIG_IRQSTACKS | ||
107 | struct thread_info *curtp, *irqtp; | ||
108 | #endif | ||
106 | 109 | ||
107 | ++Pci_Interrupt_Count; | 110 | ++Pci_Interrupt_Count; |
108 | 111 | ||
@@ -110,7 +113,20 @@ static void intReceived(struct XmPciLpEvent *eventParm, | |||
110 | case XmPciLpEvent_SlotInterrupt: | 113 | case XmPciLpEvent_SlotInterrupt: |
111 | irq = eventParm->hvLpEvent.xCorrelationToken; | 114 | irq = eventParm->hvLpEvent.xCorrelationToken; |
112 | /* Dispatch the interrupt handlers for this irq */ | 115 | /* Dispatch the interrupt handlers for this irq */ |
113 | ppc_irq_dispatch_handler(regsParm, irq); | 116 | #ifdef CONFIG_IRQSTACKS |
117 | /* Switch to the irq stack to handle this */ | ||
118 | curtp = current_thread_info(); | ||
119 | irqtp = hardirq_ctx[smp_processor_id()]; | ||
120 | if (curtp != irqtp) { | ||
121 | irqtp->task = curtp->task; | ||
122 | irqtp->flags = 0; | ||
123 | call___do_IRQ(irq, regsParm, irqtp); | ||
124 | irqtp->task = NULL; | ||
125 | if (irqtp->flags) | ||
126 | set_bits(irqtp->flags, &curtp->flags); | ||
127 | } else | ||
128 | #endif | ||
129 | __do_IRQ(irq, regsParm); | ||
114 | HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber, | 130 | HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber, |
115 | eventParm->eventData.slotInterrupt.subBusNumber, | 131 | eventParm->eventData.slotInterrupt.subBusNumber, |
116 | eventParm->eventData.slotInterrupt.deviceId); | 132 | eventParm->eventData.slotInterrupt.deviceId); |
@@ -310,10 +326,8 @@ static void iSeries_disable_IRQ(unsigned int irq) | |||
310 | } | 326 | } |
311 | 327 | ||
312 | /* | 328 | /* |
313 | * Need to define this so ppc_irq_dispatch_handler will NOT call | 329 | * This does nothing because there is not enough information |
314 | * enable_IRQ at the end of interrupt handling. However, this does | 330 | * provided to do the EOI HvCall. This is done by XmPciLpEvent.c |
315 | * nothing because there is not enough information provided to do | ||
316 | * the EOI HvCall. This is done by XmPciLpEvent.c | ||
317 | */ | 331 | */ |
318 | static void iSeries_end_IRQ(unsigned int irq) | 332 | static void iSeries_end_IRQ(unsigned int irq) |
319 | { | 333 | { |
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index 83a49e80ac29..90040c49494d 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c | |||
@@ -74,6 +74,9 @@ static DEFINE_SPINLOCK(pmac_pic_lock); | |||
74 | #define GATWICK_IRQ_POOL_SIZE 10 | 74 | #define GATWICK_IRQ_POOL_SIZE 10 |
75 | static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE]; | 75 | static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE]; |
76 | 76 | ||
77 | #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) | ||
78 | static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; | ||
79 | |||
77 | /* | 80 | /* |
78 | * Mark an irq as "lost". This is only used on the pmac | 81 | * Mark an irq as "lost". This is only used on the pmac |
79 | * since it can lose interrupts (see pmac_set_irq_mask). | 82 | * since it can lose interrupts (see pmac_set_irq_mask). |
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index c72c86f05cb6..405c4f3229b3 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c | |||
@@ -567,6 +567,7 @@ nextnode: | |||
567 | 567 | ||
568 | xics_8259_pic.enable = i8259_pic.enable; | 568 | xics_8259_pic.enable = i8259_pic.enable; |
569 | xics_8259_pic.disable = i8259_pic.disable; | 569 | xics_8259_pic.disable = i8259_pic.disable; |
570 | xics_8259_pic.end = i8259_pic.end; | ||
570 | for (i = 0; i < 16; ++i) | 571 | for (i = 0; i < 16; ++i) |
571 | get_irq_desc(i)->handler = &xics_8259_pic; | 572 | get_irq_desc(i)->handler = &xics_8259_pic; |
572 | for (; i < NR_IRQS; ++i) | 573 | for (; i < NR_IRQS; ++i) |