ARC: K/U SP saved from one location in stack switching macro
authorVineet Gupta <vgupta@synopsys.com>
Mon, 27 May 2013 13:21:27 +0000 (18:51 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Sat, 22 Jun 2013 13:53:25 +0000 (19:23 +0530)
This paves way for further simplifications.

There's an overhead of 1 insn for the non-common case of interrupt taken
from kernel mode.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/entry.h

index 5191945f3d39bbe54e70cb36c7c191b45befed76..2cf6aa08cfca5b9eec1207bd70f346d10835c8e5 100644 (file)
         * safe-keeping not really needed, but it keeps the epilogue code
         * (SP restore) simpler/uniform.
         */
-       b.d     77f
-
-       st.a    sp, [sp, -12]   ; Make room for orig_r0 and orig_r8
+       b.d     66f
+       mov     r9, sp
 
 88: /*------Intr/Ecxp happened in user mode, "switch" stack ------ */
 
        /* With current tsk in r9, get it's kernel mode stack base */
        GET_TSK_STACK_BASE  r9, r9
 
+66:
        /* Save Pre Intr/Exception User SP on kernel stack */
        st.a    sp, [r9, -12]   ; Make room for orig_r0 and orig_r8
 
        /* set SP to point to kernel mode stack */
        mov sp, r9
 
-77: /* ----- Stack Switched to kernel Mode, Now save REG FILE ----- */
+       /* ----- Stack Switched to kernel Mode, Now save REG FILE ----- */
 
 .endm