Merge branch 'master' into fix_coproc_area

This commit is contained in:
Carl Lundin 2020-10-26 11:07:49 -07:00 committed by GitHub
commit 5e23b17229
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,16 +92,19 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
{ {
StackType_t * sp, * tp; StackType_t * sp, * tp;
XtExcFrame * frame; XtExcFrame * frame;
#if XCHAL_CP_NUM > 0 #if XCHAL_CP_NUM > 0
uint32_t * p; uint32_t * p;
#endif #endif
/* Create interrupt stack frame aligned to 16 byte boundary */ /* Create interrupt stack frame aligned to 16 byte boundary */
sp = (StackType_t *) (((UBaseType_t)(pxTopOfStack + 1) - XT_CP_SIZE - XT_STK_FRMSZ) & ~0xf); sp = ( StackType_t * ) ( ( ( UBaseType_t ) pxTopOfStack - XT_CP_SIZE - XT_STK_FRMSZ ) & ~0xf );
/* Clear the entire frame (do not use memset() because we don't depend on C library) */ /* Clear the entire frame (do not use memset() because we don't depend on C library) */
for( tp = sp; tp <= pxTopOfStack; ++tp ) for( tp = sp; tp <= pxTopOfStack; ++tp )
{
*tp = 0; *tp = 0;
}
frame = ( XtExcFrame * ) sp; frame = ( XtExcFrame * ) sp;
@ -129,10 +132,12 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
#if XCHAL_CP_NUM > 0 #if XCHAL_CP_NUM > 0
/* Init the coprocessor save area (see xtensa_context.h) */ /* Init the coprocessor save area (see xtensa_context.h) */
/* No access to TCB here, so derive indirectly. Stack growth is top to bottom. /* No access to TCB here, so derive indirectly. Stack growth is top to bottom.
* //p = (uint32_t *) xMPUSettings->coproc_area; * //p = (uint32_t *) xMPUSettings->coproc_area;
*/ */
p = ( uint32_t * ) ( ( ( uint32_t ) pxTopOfStack - XT_CP_SIZE ) & ~0xf ); p = ( uint32_t * ) ( ( ( uint32_t ) pxTopOfStack - XT_CP_SIZE ) & ~0xf );
configASSERT( ( uint32_t ) p >= frame->a1 );
p[ 0 ] = 0; p[ 0 ] = 0;
p[ 1 ] = 0; p[ 1 ] = 0;
p[ 2 ] = ( ( ( uint32_t ) p ) + 12 + XCHAL_TOTAL_SA_ALIGN - 1 ) & -XCHAL_TOTAL_SA_ALIGN; p[ 2 ] = ( ( ( uint32_t ) p ) + 12 + XCHAL_TOTAL_SA_ALIGN - 1 ) & -XCHAL_TOTAL_SA_ALIGN;