Merge branch 'fix/fix_enter_first_task_error' into 'master'

Fix entering first stack cover wrong memory

See merge request sdk/ESP8266_RTOS_SDK!529
This commit is contained in:
Dong Heng
2018-09-28 11:42:06 +08:00
3 changed files with 26 additions and 1 deletions

View File

@ -236,6 +236,8 @@ bool interrupt_is_disable(void);
/* Get tick rate per second */
uint32_t xPortGetTickRateHz(void);
void _xt_enter_first_task(void);
#ifdef __cplusplus
}
#endif

View File

@ -444,3 +444,26 @@ _xt_clear_ints:
RET(16)
.section .text._xt_enter_first_task, "ax"
.globl _xt_enter_first_task
.type _xt_enter_first_task, @function
.align 4
_xt_enter_first_task:
movi sp, pxCurrentTCB
l32i sp, sp, 0
l32i sp, sp, 0
movi a14, pxCurrentTCB
l32i a14, a14, 0
addi a15, sp, XT_STK_FRMSZ
s32i a15, a14 ,0
movi a0, _xt_context_restore
callx0 a0
l32i a14, sp, XT_STK_A14
l32i a15, sp, XT_STK_A15
l32i a0, sp, XT_STK_EXIT
ret

View File

@ -210,7 +210,7 @@ portBASE_TYPE xPortStartScheduler(void)
vTaskSwitchContext();
/* Restore the context of the first task that is going to run. */
XT_RTOS_INT_EXIT();
_xt_enter_first_task();
/* Should not get here as the tasks are now running! */
return pdTRUE;