arch: xtensa: save current SP before overwrting in dispatch_c_isr.

In levelx(2,3,4,5)_handler, first need to save sp in a12,
then after dispatch_c_isr we can restore sp from a12.

Change-Id: Idb6b64a782da866670a4db80b33435a9b63f02c3
This commit is contained in:
zhuyanlin 2021-07-27 15:15:14 +08:00 committed by Xiang Xiao
parent 91264ba704
commit 51d13df317

View File

@ -416,6 +416,13 @@ _xtensa_level2_handler:
mov a2, sp /* Address of state save on stack */
call0 _xtensa_context_save /* Save full register state */
/* Save current SP before (possibly) overwriting it, it's the register save
* area. This value will be used later by dispatch_c_isr to retrieve the
* register save area.
*/
mov a12, sp
/* Set up PS for C, enable interrupts above this level and clear EXCM. */
ps_setup 2 a0
@ -481,6 +488,13 @@ _xtensa_level3_handler:
mov a2, sp /* Address of state save on stack */
call0 _xtensa_context_save /* Save full register state */
/* Save current SP before (possibly) overwriting it, it's the register save
* area. This value will be used later by dispatch_c_isr to retrieve the
* register save area.
*/
mov a12, sp
/* Set up PS for C, enable interrupts above this level and clear EXCM. */
ps_setup 3 a0
@ -546,6 +560,13 @@ _xtensa_level4_handler:
mov a2, sp /* Address of state save on stack */
call0 _xtensa_context_save /* Save full register state */
/* Save current SP before (possibly) overwriting it, it's the register save
* area. This value will be used later by dispatch_c_isr to retrieve the
* register save area.
*/
mov a12, sp
/* Set up PS for C, enable interrupts above this level and clear EXCM. */
ps_setup 4 a0
@ -611,6 +632,13 @@ _xtensa_level5_handler:
mov a2, sp /* Address of state save on stack */
call0 _xtensa_context_save /* Save full register state */
/* Save current SP before (possibly) overwriting it, it's the register save
* area. This value will be used later by dispatch_c_isr to retrieve the
* register save area.
*/
mov a12, sp
/* Set up PS for C, enable interrupts above this level and clear EXCM. */
ps_setup 5 a0
@ -676,6 +704,13 @@ _xtensa_level6_handler:
mov a2, sp /* Address of state save on stack */
call0 _xtensa_context_save /* Save full register state */
/* Save current SP before (possibly) overwriting it, it's the register save
* area. This value will be used later by dispatch_c_isr to retrieve the
* register save area.
*/
mov a12, sp
/* Set up PS for C, enable interrupts above this level and clear EXCM. */
ps_setup 6 a0