fix task_self delete bug on esp32
@@ -47,7 +47,12 @@ void *cpu_task_stack_init(cpu_stack_t *stack_base, size_t stack_size,
/* Explicitly initialize certain saved registers */
frame->pc = (uint32_t) entry; /* task entrypoint */
- frame->a0 = 0; /* to terminate GDB backtrace */
+
+ #ifdef __XTENSA_CALL0_ABI__
+ frame->a0 = (uint32_t)krhino_task_deathbed; /* to terminate GDB backtrace */
+ #else
+ frame->a4 = (uint32_t)krhino_task_deathbed; /* to terminate GDB backtrace */
+ #endif
frame->a1 = (uint32_t) sp + XT_STK_FRMSZ; /* physical top of stack frame */
frame->exit = (uint32_t) _xt_user_exit; /* user exception exit dispatcher */
