Xtensa port: _thread_entry shall use call4 to start the thread.

The function _new_thread sets the CALLINC for _thread_entry when calling the
new thread entry point. This should be CALLINC(1) (call4) instead of previous
one CALLINC(2) (call8).

This change allows resolving a crash when starting the first thread.

Change-Id: Ie97c95c87d1219342fed09f670fcae8a6230cefe
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
Mazen NEIFER 2017-01-27 19:43:52 +01:00 committed by Andrew Boie
commit fddb1aa016

View file

@ -126,12 +126,12 @@ void _new_thread(char *pStack, size_t stackSize,
pInitCtx->a5 = (uint32_t)p3; pInitCtx->a5 = (uint32_t)p3;
pInitCtx->ps = PS_UM | PS_EXCM; pInitCtx->ps = PS_UM | PS_EXCM;
#else #else
/* For windowed ABI set also WOE and CALLINC (pretend task is 'call8'). */ /* For windowed ABI set also WOE and CALLINC (pretend task is 'call4'). */
pInitCtx->a6 = (uint32_t)pEntry; pInitCtx->a6 = (uint32_t)pEntry;
pInitCtx->a7 = (uint32_t)p1; pInitCtx->a7 = (uint32_t)p1;
pInitCtx->a8 = (uint32_t)p2; pInitCtx->a8 = (uint32_t)p2;
pInitCtx->a9 = (uint32_t)p3; pInitCtx->a9 = (uint32_t)p3;
pInitCtx->ps = PS_UM | PS_EXCM | PS_WOE | PS_CALLINC(2); pInitCtx->ps = PS_UM | PS_EXCM | PS_WOE | PS_CALLINC(1);
#endif #endif
tcs->callee_saved.topOfStack = pInitCtx; tcs->callee_saved.topOfStack = pInitCtx;
tcs->arch.flags = 0; tcs->arch.flags = 0;