Skip to content

Commit

Permalink
ARC: K/U SP saved from one location in stack switching macro
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vineetgarc committed Jun 22, 2013
1 parent 147aece commit ba3558c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arc/include/asm/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@
* 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 ------ */

Expand All @@ -311,6 +310,7 @@
/* 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

Expand All @@ -323,7 +323,7 @@
/* 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

Expand Down

0 comments on commit ba3558c

Please sign in to comment.