diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-11-08 21:28:33 -0500 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-11-08 21:28:33 -0500 |
commit | b709c0832824da20a32a3119911b9f0cf6970452 (patch) | |
tree | 1bf6e461f754aee5dbd870072080b5e5f2c1ee8c /arch/ppc64 | |
parent | 66ba135c5a398df5c3a4b43d84d9df80cbc87c61 (diff) |
ppc64: move stack switching up in interrupt processing
This will make the ppc64 multiplatform irq handling more like
the generic handling.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/irq.c | 40 | ||||
-rw-r--r-- | arch/ppc64/kernel/misc.S | 8 |
2 files changed, 24 insertions, 24 deletions
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c index 87474584033f..b61497d5be28 100644 --- a/arch/ppc64/kernel/irq.c +++ b/arch/ppc64/kernel/irq.c | |||
@@ -157,9 +157,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) | |||
157 | int cpu = smp_processor_id(); | 157 | int cpu = smp_processor_id(); |
158 | irq_desc_t *desc = get_irq_desc(irq); | 158 | irq_desc_t *desc = get_irq_desc(irq); |
159 | irqreturn_t action_ret; | 159 | irqreturn_t action_ret; |
160 | #ifdef CONFIG_IRQSTACKS | ||
161 | struct thread_info *curtp, *irqtp; | ||
162 | #endif | ||
163 | 160 | ||
164 | kstat_cpu(cpu).irqs[irq]++; | 161 | kstat_cpu(cpu).irqs[irq]++; |
165 | 162 | ||
@@ -227,20 +224,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) | |||
227 | for (;;) { | 224 | for (;;) { |
228 | spin_unlock(&desc->lock); | 225 | spin_unlock(&desc->lock); |
229 | 226 | ||
230 | #ifdef CONFIG_IRQSTACKS | 227 | action_ret = handle_IRQ_event(irq, regs, action); |
231 | /* Switch to the irq stack to handle this */ | ||
232 | curtp = current_thread_info(); | ||
233 | irqtp = hardirq_ctx[smp_processor_id()]; | ||
234 | if (curtp != irqtp) { | ||
235 | irqtp->task = curtp->task; | ||
236 | irqtp->flags = 0; | ||
237 | action_ret = call_handle_IRQ_event(irq, regs, action, irqtp); | ||
238 | irqtp->task = NULL; | ||
239 | if (irqtp->flags) | ||
240 | set_bits(irqtp->flags, &curtp->flags); | ||
241 | } else | ||
242 | #endif | ||
243 | action_ret = handle_IRQ_event(irq, regs, action); | ||
244 | 228 | ||
245 | spin_lock(&desc->lock); | 229 | spin_lock(&desc->lock); |
246 | if (!noirqdebug) | 230 | if (!noirqdebug) |
@@ -310,6 +294,9 @@ void do_IRQ(struct pt_regs *regs) | |||
310 | void do_IRQ(struct pt_regs *regs) | 294 | void do_IRQ(struct pt_regs *regs) |
311 | { | 295 | { |
312 | int irq; | 296 | int irq; |
297 | #ifdef CONFIG_IRQSTACKS | ||
298 | struct thread_info *curtp, *irqtp; | ||
299 | #endif | ||
313 | 300 | ||
314 | irq_enter(); | 301 | irq_enter(); |
315 | 302 | ||
@@ -330,9 +317,22 @@ void do_IRQ(struct pt_regs *regs) | |||
330 | 317 | ||
331 | irq = ppc_md.get_irq(regs); | 318 | irq = ppc_md.get_irq(regs); |
332 | 319 | ||
333 | if (irq >= 0) | 320 | if (irq >= 0) { |
334 | ppc_irq_dispatch_handler(regs, irq); | 321 | #ifdef CONFIG_IRQSTACKS |
335 | else | 322 | /* Switch to the irq stack to handle this */ |
323 | curtp = current_thread_info(); | ||
324 | irqtp = hardirq_ctx[smp_processor_id()]; | ||
325 | if (curtp != irqtp) { | ||
326 | irqtp->task = curtp->task; | ||
327 | irqtp->flags = 0; | ||
328 | call_ppc_irq_dispatch_handler(regs, irq, irqtp); | ||
329 | irqtp->task = NULL; | ||
330 | if (irqtp->flags) | ||
331 | set_bits(irqtp->flags, &curtp->flags); | ||
332 | } else | ||
333 | #endif | ||
334 | ppc_irq_dispatch_handler(regs, irq); | ||
335 | } else | ||
336 | /* That's not SMP safe ... but who cares ? */ | 336 | /* That's not SMP safe ... but who cares ? */ |
337 | ppc_spurious_interrupts++; | 337 | ppc_spurious_interrupts++; |
338 | 338 | ||
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 914632ec587d..d82a30dc26f8 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S | |||
@@ -78,12 +78,12 @@ _GLOBAL(call_do_softirq) | |||
78 | mtlr r0 | 78 | mtlr r0 |
79 | blr | 79 | blr |
80 | 80 | ||
81 | _GLOBAL(call_handle_IRQ_event) | 81 | _GLOBAL(call_ppc_irq_dispatch_handler) |
82 | mflr r0 | 82 | mflr r0 |
83 | std r0,16(r1) | 83 | std r0,16(r1) |
84 | stdu r1,THREAD_SIZE-112(r6) | 84 | stdu r1,THREAD_SIZE-112(r5) |
85 | mr r1,r6 | 85 | mr r1,r5 |
86 | bl .handle_IRQ_event | 86 | bl .ppc_irq_dispatch_handler |
87 | ld r1,0(r1) | 87 | ld r1,0(r1) |
88 | ld r0,16(r1) | 88 | ld r0,16(r1) |
89 | mtlr r0 | 89 | mtlr r0 |