]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ppc64: move stack switching up in interrupt processing
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 9 Nov 2005 02:28:33 +0000 (13:28 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 9 Nov 2005 02:28:33 +0000 (13:28 +1100)
This will make the ppc64 multiplatform irq handling more like
the generic handling.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
arch/powerpc/kernel/misc_64.S
arch/ppc64/kernel/irq.c
arch/ppc64/kernel/misc.S
include/asm-powerpc/irq.h

index ae1433da09b27ea4cd76f0013616a35d38560855..9d09f0ad6efe28c82d35fef94bda3180103516e0 100644 (file)
@@ -89,12 +89,12 @@ _GLOBAL(call_do_softirq)
        mtlr    r0
        blr
 
        mtlr    r0
        blr
 
-_GLOBAL(call_handle_IRQ_event)
+_GLOBAL(call_ppc_irq_dispatch_handler)
        mflr    r0
        std     r0,16(r1)
        mflr    r0
        std     r0,16(r1)
-       stdu    r1,THREAD_SIZE-112(r6)
-       mr      r1,r6
-       bl      .handle_IRQ_event
+       stdu    r1,THREAD_SIZE-112(r5)
+       mr      r1,r5
+       bl      .ppc_irq_dispatch_handler
        ld      r1,0(r1)
        ld      r0,16(r1)
        mtlr    r0
        ld      r1,0(r1)
        ld      r0,16(r1)
        mtlr    r0
index 87474584033fe83774c37ba431b9c252d7d667ab..b61497d5be28f4d7b4882520398187c95ec9a015 100644 (file)
@@ -157,9 +157,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
        int cpu = smp_processor_id();
        irq_desc_t *desc = get_irq_desc(irq);
        irqreturn_t action_ret;
        int cpu = smp_processor_id();
        irq_desc_t *desc = get_irq_desc(irq);
        irqreturn_t action_ret;
-#ifdef CONFIG_IRQSTACKS
-       struct thread_info *curtp, *irqtp;
-#endif
 
        kstat_cpu(cpu).irqs[irq]++;
 
 
        kstat_cpu(cpu).irqs[irq]++;
 
@@ -227,20 +224,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
        for (;;) {
                spin_unlock(&desc->lock);
 
        for (;;) {
                spin_unlock(&desc->lock);
 
-#ifdef CONFIG_IRQSTACKS
-               /* Switch to the irq stack to handle this */
-               curtp = current_thread_info();
-               irqtp = hardirq_ctx[smp_processor_id()];
-               if (curtp != irqtp) {
-                       irqtp->task = curtp->task;
-                       irqtp->flags = 0;
-                       action_ret = call_handle_IRQ_event(irq, regs, action, irqtp);
-                       irqtp->task = NULL;
-                       if (irqtp->flags)
-                               set_bits(irqtp->flags, &curtp->flags);
-               } else
-#endif
-                       action_ret = handle_IRQ_event(irq, regs, action);
+               action_ret = handle_IRQ_event(irq, regs, action);
 
                spin_lock(&desc->lock);
                if (!noirqdebug)
 
                spin_lock(&desc->lock);
                if (!noirqdebug)
@@ -310,6 +294,9 @@ void do_IRQ(struct pt_regs *regs)
 void do_IRQ(struct pt_regs *regs)
 {
        int irq;
 void do_IRQ(struct pt_regs *regs)
 {
        int irq;
+#ifdef CONFIG_IRQSTACKS
+       struct thread_info *curtp, *irqtp;
+#endif
 
        irq_enter();
 
 
        irq_enter();
 
@@ -330,9 +317,22 @@ void do_IRQ(struct pt_regs *regs)
 
        irq = ppc_md.get_irq(regs);
 
 
        irq = ppc_md.get_irq(regs);
 
-       if (irq >= 0)
-               ppc_irq_dispatch_handler(regs, irq);
-       else
+       if (irq >= 0) {
+#ifdef CONFIG_IRQSTACKS
+               /* Switch to the irq stack to handle this */
+               curtp = current_thread_info();
+               irqtp = hardirq_ctx[smp_processor_id()];
+               if (curtp != irqtp) {
+                       irqtp->task = curtp->task;
+                       irqtp->flags = 0;
+                       call_ppc_irq_dispatch_handler(regs, irq, irqtp);
+                       irqtp->task = NULL;
+                       if (irqtp->flags)
+                               set_bits(irqtp->flags, &curtp->flags);
+               } else
+#endif
+                       ppc_irq_dispatch_handler(regs, irq);
+       } else
                /* That's not SMP safe ... but who cares ? */
                ppc_spurious_interrupts++;
 
                /* That's not SMP safe ... but who cares ? */
                ppc_spurious_interrupts++;
 
index 914632ec587d46fea767a47375160b1b0c2a2ab1..d82a30dc26f8f2152ce3fc12f86d549486222914 100644 (file)
@@ -78,12 +78,12 @@ _GLOBAL(call_do_softirq)
        mtlr    r0
        blr
 
        mtlr    r0
        blr
 
-_GLOBAL(call_handle_IRQ_event)
+_GLOBAL(call_ppc_irq_dispatch_handler)
        mflr    r0
        std     r0,16(r1)
        mflr    r0
        std     r0,16(r1)
-       stdu    r1,THREAD_SIZE-112(r6)
-       mr      r1,r6
-       bl      .handle_IRQ_event
+       stdu    r1,THREAD_SIZE-112(r5)
+       mr      r1,r5
+       bl      .ppc_irq_dispatch_handler
        ld      r1,0(r1)
        ld      r0,16(r1)
        mtlr    r0
        ld      r1,0(r1)
        ld      r0,16(r1)
        mtlr    r0
index b3935ea28fff181a4b3a30bb0d485b3eab15e9ad..2a768e096067ec24bb52ff3995378396e5e241ba 100644 (file)
@@ -488,8 +488,8 @@ extern struct thread_info *softirq_ctx[NR_CPUS];
 
 extern void irq_ctx_init(void);
 extern void call_do_softirq(struct thread_info *tp);
 
 extern void irq_ctx_init(void);
 extern void call_do_softirq(struct thread_info *tp);
-extern int call_handle_IRQ_event(int irq, struct pt_regs *regs,
-                       struct irqaction *action, struct thread_info *tp);
+extern int call_ppc_irq_dispatch_handler(struct pt_regs *regs, int irq,
+               struct thread_info *tp);
 
 #define __ARCH_HAS_DO_SOFTIRQ
 
 
 #define __ARCH_HAS_DO_SOFTIRQ