mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
xtensa: Move saving of a0 register to match upstream
Upstream xtensa exception handling will save PS, PC, and a0 registers together when saving a minimal context. This commit ppdates the xtensa exception handling to match upstream behavior.
This commit is contained in:
parent
b092fa0730
commit
3336b057d6
@ -20,6 +20,8 @@ _xt_gdbstub_int:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_1 /* save interruptee's PC */
|
rsr a0, EPC_1 /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -32,12 +34,6 @@ _xt_gdbstub_int:
|
|||||||
rsr a0, EXCVADDR
|
rsr a0, EXCVADDR
|
||||||
s32i a0, sp, XT_STK_EXCVADDR
|
s32i a0, sp, XT_STK_EXCVADDR
|
||||||
|
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
|
||||||
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
mov a6,sp
|
mov a6,sp
|
||||||
movi a3, gdbstub_handle_uart_int
|
movi a3, gdbstub_handle_uart_int
|
||||||
callx0 a3
|
callx0 a3
|
||||||
|
@ -35,6 +35,8 @@ _xt_panic:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_1 /* save interruptee's PC */
|
rsr a0, EPC_1 /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -48,11 +50,6 @@ _xt_panic:
|
|||||||
rsr a0, EXCVADDR
|
rsr a0, EXCVADDR
|
||||||
s32i a0, sp, XT_STK_EXCVADDR
|
s32i a0, sp, XT_STK_EXCVADDR
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
|
||||||
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
||||||
movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM | PS_WOE
|
movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM | PS_WOE
|
||||||
wsr a0, PS
|
wsr a0, PS
|
||||||
|
@ -228,6 +228,8 @@ xt_highintx:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_X /* save interruptee's PC */
|
rsr a0, EPC_X /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_X /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -279,11 +281,6 @@ xt_highintx:
|
|||||||
/* Found the reason, now save it. */
|
/* Found the reason, now save it. */
|
||||||
s32i a0, sp, XT_STK_EXCCAUSE
|
s32i a0, sp, XT_STK_EXCCAUSE
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_X /* save interruptee's a0 */
|
|
||||||
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
||||||
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
||||||
wsr a0, PS
|
wsr a0, PS
|
||||||
|
@ -47,6 +47,8 @@ xt_highint4:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_4 /* save interruptee's PC */
|
rsr a0, EPC_4 /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_4 /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -77,11 +79,6 @@ xt_highint4:
|
|||||||
/* Found the reason, now save it. */
|
/* Found the reason, now save it. */
|
||||||
s32i a0, sp, XT_STK_EXCCAUSE
|
s32i a0, sp, XT_STK_EXCCAUSE
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_4 /* save interruptee's a0 */
|
|
||||||
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
||||||
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
||||||
wsr a0, PS
|
wsr a0, PS
|
||||||
|
@ -63,6 +63,8 @@ xt_highint4:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_4 /* save interruptee's PC */
|
rsr a0, EPC_4 /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_4 /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -105,11 +107,6 @@ xt_highint4:
|
|||||||
/* Found the reason, now save it. */
|
/* Found the reason, now save it. */
|
||||||
s32i a0, sp, XT_STK_EXCCAUSE
|
s32i a0, sp, XT_STK_EXCCAUSE
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_4 /* save interruptee's a0 */
|
|
||||||
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
|
||||||
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
movi a0, PS_INTLEVEL(5) | PS_UM | PS_WOE
|
||||||
wsr a0, PS
|
wsr a0, PS
|
||||||
|
@ -622,6 +622,8 @@ _xt_user_exc:
|
|||||||
s32i a0, sp, XT_STK_PS
|
s32i a0, sp, XT_STK_PS
|
||||||
rsr a0, EPC_1 /* save interruptee's PC */
|
rsr a0, EPC_1 /* save interruptee's PC */
|
||||||
s32i a0, sp, XT_STK_PC
|
s32i a0, sp, XT_STK_PC
|
||||||
|
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
||||||
|
s32i a0, sp, XT_STK_A0
|
||||||
#if XCHAL_HAVE_WINDOWED
|
#if XCHAL_HAVE_WINDOWED
|
||||||
s32e a0, sp, -16 /* for debug backtrace */
|
s32e a0, sp, -16 /* for debug backtrace */
|
||||||
#endif
|
#endif
|
||||||
@ -635,10 +637,6 @@ _xt_user_exc:
|
|||||||
rsr a0, EXCVADDR
|
rsr a0, EXCVADDR
|
||||||
s32i a0, sp, XT_STK_EXCVADDR
|
s32i a0, sp, XT_STK_EXCVADDR
|
||||||
|
|
||||||
/* _xt_context_save seems to save the current a0, but we need the interuptees a0. Fix this. */
|
|
||||||
rsr a0, EXCSAVE_1 /* save interruptee's a0 */
|
|
||||||
s32i a0, sp, XT_STK_A0
|
|
||||||
|
|
||||||
/* Set up PS for C, reenable debug and NMI interrupts, and clear EXCM. */
|
/* Set up PS for C, reenable debug and NMI interrupts, and clear EXCM. */
|
||||||
#ifdef __XTENSA_CALL0_ABI__
|
#ifdef __XTENSA_CALL0_ABI__
|
||||||
movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM
|
movi a0, PS_INTLEVEL(XCHAL_DEBUGLEVEL - 2) | PS_UM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user