Merge branch 'bugfix/panic_switch_back_to_user_mode' into 'master'

CPU switch from kernel to user mode

See merge request sdk/ESP8266_RTOS_SDK!306
This commit is contained in:
Wu Jian Gang
2018-07-19 19:44:50 +08:00

View File

@ -1521,9 +1521,15 @@ _xt_ext_panic:
*
* Todo: Close NMI
*/
rsil a0, XCHAL_EXCM_LEVEL
rsil a0, PS_INTLEVEL(5)
wsr a0, EXCSAVE_2
/*
* CPU must switch from kernel mode to user mode
*/
movi a0, PS_INTLEVEL(5) | PS_UM
wsr a0, PS
/* Allocate exception frame and save minimal context. */
mov a0, sp
movi sp, _chip_interrupt_tmp