mirror of
https://github.com/apache/nuttx.git
synced 2026-03-27 02:29:15 +08:00
arch/xtensa: set PS.EXCM initial value to 1 while new thread created
To avoid level-1 interrupt break retrieve PC/A0/SP/A2 register, PS.EXCM set to 1 by CPU HW while handling exception/interrupt. But if context switching happens and new thread created, the thread initial value of PS.EXCM is used. Same behevior as ESP-IDF code: https://github.com/espressif/esp-idf/blob/master/ components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c#L366 Signed-off-by: Gao Feng <Feng.Gao@sony.com>
This commit is contained in:
@@ -235,11 +235,11 @@ void up_initial_state(struct tcb_s *tcb)
|
||||
/* Set initial PS to int level 0, user mode. */
|
||||
|
||||
#ifdef __XTENSA_CALL0_ABI__
|
||||
xcp->regs[REG_PS] = PS_UM;
|
||||
xcp->regs[REG_PS] = PS_UM | PS_EXCM;
|
||||
|
||||
#else
|
||||
/* For windowed ABI set WOE and CALLINC (pretend task was 'call4'd). */
|
||||
|
||||
xcp->regs[REG_PS] = PS_UM | PS_WOE | PS_CALLINC(1);
|
||||
xcp->regs[REG_PS] = PS_UM | PS_EXCM | PS_WOE | PS_CALLINC(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user