Xtensa port: Fixed memory corruption in interrupt handler exit function.

The a3 register was supposed to hold the _thread pointer but it seems that it
does not in all cases. Safe to restore it from _kernel structure.

Change-Id: Ie2ff6c3faf0fe70de4c5877ab59433d0c165145b
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
Mazen NEIFER 2017-02-04 11:59:23 +01:00 committed by Andrew Boie
commit b06115aa7c

View file

@ -175,6 +175,7 @@ _zxt_int_exit:
#endif #endif
#if XCHAL_CP_NUM > 0 #if XCHAL_CP_NUM > 0
l32i a3, a2, KERNEL_OFFSET(current) /* _thread := _kernel->current */
l32i a4, a3, THREAD_OFFSET(cpStack) l32i a4, a3, THREAD_OFFSET(cpStack)
rsr a5, CPENABLE rsr a5, CPENABLE
s16i a5, a4, XT_CPENABLE /* cp_state->cpenable = CPENABLE; */ s16i a5, a4, XT_CPENABLE /* cp_state->cpenable = CPENABLE; */