Skip to content

Commit ba3558c

Browse files
committed
ARC: K/U SP saved from one location in stack switching macro
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]>
1 parent 147aece commit ba3558c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/arc/include/asm/entry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,8 @@
290290
* safe-keeping not really needed, but it keeps the epilogue code
291291
* (SP restore) simpler/uniform.
292292
*/
293-
b.d 77f
294-
295-
st.a sp, [sp, -12] ; Make room for orig_r0 and orig_r8
293+
b.d 66f
294+
mov r9, sp
296295

297296
88: /*------Intr/Ecxp happened in user mode, "switch" stack ------ */
298297

@@ -311,6 +310,7 @@
311310
/* With current tsk in r9, get it's kernel mode stack base */
312311
GET_TSK_STACK_BASE r9, r9
313312

313+
66:
314314
/* Save Pre Intr/Exception User SP on kernel stack */
315315
st.a sp, [r9, -12] ; Make room for orig_r0 and orig_r8
316316

@@ -323,7 +323,7 @@
323323
/* set SP to point to kernel mode stack */
324324
mov sp, r9
325325

326-
77: /* ----- Stack Switched to kernel Mode, Now save REG FILE ----- */
326+
/* ----- Stack Switched to kernel Mode, Now save REG FILE ----- */
327327

328328
.endm
329329

0 commit comments

Comments
 (0)