ARM: entry: re-allocate registers in irq entry assembly macros
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 26 Jun 2011 09:34:02 +0000 (10:34 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 2 Jul 2011 09:56:10 +0000 (10:56 +0100)
This avoids the irq entry assembly corrupting r5, thereby allowing it
to be preserved through to the svc exit code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/entry-macro-multi.S
arch/arm/kernel/entry-armv.S

index 2da8547de6d6203c605759a9326f1b1a8d259d08..2f1e2098dfe778211e9209ea0285e089020e5745 100644 (file)
@@ -4,8 +4,8 @@
  * Interrupt handling.  Preserves r7, r8, r9
  */
        .macro  arch_irq_handler_default
-       get_irqnr_preamble r5, lr
-1:     get_irqnr_and_base r0, r6, r5, lr
+       get_irqnr_preamble r6, lr
+1:     get_irqnr_and_base r0, r2, r6, lr
        movne   r1, sp
        @
        @ routine called with r0 = irq number, r1 = struct pt_regs *
        /*
         * XXX
         *
-        * this macro assumes that irqstat (r6) and base (r5) are
+        * this macro assumes that irqstat (r2) and base (r6) are
         * preserved from get_irqnr_and_base above
         */
-       ALT_SMP(test_for_ipi r0, r6, r5, lr)
+       ALT_SMP(test_for_ipi r0, r2, r6, lr)
        ALT_UP_B(9997f)
        movne   r1, sp
        adrne   lr, BSYM(1b)
        bne     do_IPI
 
 #ifdef CONFIG_LOCAL_TIMERS
-       test_for_ltirq r0, r6, r5, lr
+       test_for_ltirq r0, r2, r6, lr
        movne   r0, sp
        adrne   lr, BSYM(1b)
        bne     do_local_timer
@@ -40,7 +40,7 @@
        .align  5
        .global \symbol_name
 \symbol_name:
-       mov     r4, lr
+       mov     r8, lr
        arch_irq_handler_default
-       mov     pc, r4
+       mov     pc, r8
        .endm
index a5b2c40d44e84e1327010537b176edede6d02faa..b17e57949d3b59faa42982158a34b27a30708d40 100644 (file)
 #include <asm/entry-macro-multi.S>
 
 /*
- * Interrupt handling.  Preserves r7, r8, r9
+ * Interrupt handling.
  */
        .macro  irq_handler
 #ifdef CONFIG_MULTI_IRQ_HANDLER
-       ldr     r5, =handle_arch_irq
+       ldr     r1, =handle_arch_irq
        mov     r0, sp
-       ldr     r5, [r5]
+       ldr     r1, [r1]
        adr     lr, BSYM(9997f)
-       teq     r5, #0
-       movne   pc, r5
+       teq     r1, #0
+       movne   pc, r1
 #endif
        arch_irq_handler_default
 9997: