arch/xtensa: set the current reg before print syslog

ensure the semantics of the up_interrupt_context() works as expected

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2021-12-14 18:16:07 +08:00
committed by Xiang Xiao
parent 2fe06ac083
commit 56ef1419dd
+4 -2
View File
@@ -189,6 +189,8 @@ void up_assert(const char *filename, int lineno)
void xtensa_panic(int xptcode, uint32_t *regs)
{
CURRENT_REGS = regs;
/* We get here when a un-dispatch-able, irrecoverable exception occurs */
board_autoled_on(LED_ASSERTION);
@@ -203,7 +205,6 @@ void xtensa_panic(int xptcode, uint32_t *regs)
_alert("Unhandled Exception %d\n", xptcode);
#endif
CURRENT_REGS = regs;
xtensa_assert(); /* Should not return */
for (; ; );
}
@@ -290,6 +291,8 @@ void xtensa_panic(int xptcode, uint32_t *regs)
void xtensa_user_panic(int exccause, uint32_t *regs)
{
CURRENT_REGS = regs;
/* We get here when a un-dispatch-able, irrecoverable exception occurs */
board_autoled_on(LED_ASSERTION);
@@ -305,7 +308,6 @@ void xtensa_user_panic(int exccause, uint32_t *regs)
_alert("User Exception: EXCCAUSE=%04x\n", exccause);
#endif
CURRENT_REGS = regs;
xtensa_assert(); /* Should not return */
for (; ; );
}