forked from espressif/esp-idf
refactor(freertos): Remove portCLEAN_UP_COPROC()
portCLEAN_UP_COPROC() was an IDF specific addition to FreeRTOS, where the macro was called from prvDeleteTCB() to clean up the coprocessor context of a deleted task. This commit removes portCLEAN_UP_COPROC(). The coprocessor cleanup routine (i.e., vPortCleanUpCoprocArea()) is now called via portCLEAN_UP_TCB()-> vPortTCBPreDeleteHook(). This removes a minor code difference between IDF FreeRTOS and upstream.
This commit is contained in:
@@ -647,13 +647,6 @@ FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void)
|
|||||||
* - These are not part of the FreeRTOS porting interface, but are used by other FreeRTOS dependent components
|
* - These are not part of the FreeRTOS porting interface, but are used by other FreeRTOS dependent components
|
||||||
* ------------------------------------------------------------------------------------------------------------------ */
|
* ------------------------------------------------------------------------------------------------------------------ */
|
||||||
|
|
||||||
// -------------------- Co-Processor -----------------------
|
|
||||||
|
|
||||||
#if XCHAL_CP_NUM > 0
|
|
||||||
void vPortCleanUpCoprocArea(void *pvTCB);
|
|
||||||
#define portCLEAN_UP_COPROC(pvTCB) vPortCleanUpCoprocArea(pvTCB)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -------------------- Heap Related -----------------------
|
// -------------------- Heap Related -----------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -607,6 +607,25 @@ void vPortSetStackWatchpoint( void *pxStackStart )
|
|||||||
|
|
||||||
// --------------------- TCB Cleanup -----------------------
|
// --------------------- TCB Cleanup -----------------------
|
||||||
|
|
||||||
|
#if ( XCHAL_CP_NUM > 0 )
|
||||||
|
static void vPortCleanUpCoprocArea(void *pvTCB)
|
||||||
|
{
|
||||||
|
UBaseType_t uxCoprocArea;
|
||||||
|
BaseType_t xTargetCoreID;
|
||||||
|
|
||||||
|
/* Get a pointer to the task's coprocessor save area */
|
||||||
|
uxCoprocArea = ( UBaseType_t ) ( ( ( StaticTask_t * ) pvTCB )->pxDummy8 ); /* Get TCB_t.pxEndOfStack */
|
||||||
|
uxCoprocArea = STACKPTR_ALIGN_DOWN(16, uxCoprocArea - XT_CP_SIZE);
|
||||||
|
|
||||||
|
/* Get xTargetCoreID from the TCB.xCoreID */
|
||||||
|
xTargetCoreID = ( ( StaticTask_t * ) pvTCB )->xDummyCoreID;
|
||||||
|
|
||||||
|
/* If task has live floating point registers somewhere, release them */
|
||||||
|
void _xt_coproc_release(volatile void *coproc_sa_base, BaseType_t xTargetCoreID);
|
||||||
|
_xt_coproc_release( (void *)uxCoprocArea, xTargetCoreID );
|
||||||
|
}
|
||||||
|
#endif /* XCHAL_CP_NUM > 0 */
|
||||||
|
|
||||||
void vPortTCBPreDeleteHook( void *pxTCB )
|
void vPortTCBPreDeleteHook( void *pxTCB )
|
||||||
{
|
{
|
||||||
#if ( CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK )
|
#if ( CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK )
|
||||||
@@ -624,26 +643,9 @@ void vPortTCBPreDeleteHook( void *pxTCB )
|
|||||||
extern void vPortCleanUpTCB( void * pxTCB );
|
extern void vPortCleanUpTCB( void * pxTCB );
|
||||||
vPortCleanUpTCB( pxTCB );
|
vPortCleanUpTCB( pxTCB );
|
||||||
#endif /* CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP */
|
#endif /* CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP */
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------- Co-Processor -----------------------
|
#if ( XCHAL_CP_NUM > 0 )
|
||||||
|
/* Cleanup coproc save area */
|
||||||
#if XCHAL_CP_NUM > 0
|
vPortCleanUpCoprocArea( pxTCB );
|
||||||
void _xt_coproc_release(volatile void *coproc_sa_base, BaseType_t xTargetCoreID);
|
|
||||||
|
|
||||||
void vPortCleanUpCoprocArea(void *pvTCB)
|
|
||||||
{
|
|
||||||
UBaseType_t uxCoprocArea;
|
|
||||||
BaseType_t xTargetCoreID;
|
|
||||||
|
|
||||||
/* Get a pointer to the task's coprocessor save area */
|
|
||||||
uxCoprocArea = ( UBaseType_t ) ( ( ( StaticTask_t * ) pvTCB )->pxDummy8 ); /* Get TCB_t.pxEndOfStack */
|
|
||||||
uxCoprocArea = STACKPTR_ALIGN_DOWN(16, uxCoprocArea - XT_CP_SIZE);
|
|
||||||
|
|
||||||
/* Get xTargetCoreID from the TCB.xCoreID */
|
|
||||||
xTargetCoreID = ( ( StaticTask_t * ) pvTCB )->xDummyCoreID;
|
|
||||||
|
|
||||||
/* If task has live floating point registers somewhere, release them */
|
|
||||||
_xt_coproc_release( (void *)uxCoprocArea, xTargetCoreID );
|
|
||||||
}
|
|
||||||
#endif /* XCHAL_CP_NUM > 0 */
|
#endif /* XCHAL_CP_NUM > 0 */
|
||||||
|
}
|
||||||
|
@@ -4951,10 +4951,6 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
|||||||
vPortReleaseTaskMPUSettings( &( pxTCB->xMPUSettings ) );
|
vPortReleaseTaskMPUSettings( &( pxTCB->xMPUSettings ) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef portCLEAN_UP_COPROC
|
|
||||||
portCLEAN_UP_COPROC( ( void * ) pxTCB );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( portUSING_MPU_WRAPPERS == 0 ) )
|
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( portUSING_MPU_WRAPPERS == 0 ) )
|
||||||
{
|
{
|
||||||
/* The task can only have been allocated dynamically - free both
|
/* The task can only have been allocated dynamically - free both
|
||||||
|
@@ -233,9 +233,10 @@ entries:
|
|||||||
port:xPortStartScheduler (default)
|
port:xPortStartScheduler (default)
|
||||||
port:vPortEndScheduler (default)
|
port:vPortEndScheduler (default)
|
||||||
port:pxPortInitialiseStack (default)
|
port:pxPortInitialiseStack (default)
|
||||||
|
port:xPortGetTickRateHz (default)
|
||||||
if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S3 = y :
|
if IDF_TARGET_ESP32 = y || IDF_TARGET_ESP32S3 = y :
|
||||||
port:vPortCleanUpCoprocArea (default)
|
port:vPortCleanUpCoprocArea (default)
|
||||||
port:xPortGetTickRateHz (default)
|
port:vPortTCBPreDeleteHook (default)
|
||||||
# --------------------------------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------------------------------
|
||||||
# portable/riscv/port.c
|
# portable/riscv/port.c
|
||||||
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
# - Most functions are called from an ISR context, except for scheduler/task init/deinit functions
|
||||||
@@ -245,3 +246,4 @@ entries:
|
|||||||
port:vPortEndScheduler (default)
|
port:vPortEndScheduler (default)
|
||||||
port:pxPortInitialiseStack (default)
|
port:pxPortInitialiseStack (default)
|
||||||
port:xPortGetTickRateHz (default)
|
port:xPortGetTickRateHz (default)
|
||||||
|
port:vPortTCBPreDeleteHook (default)
|
||||||
|
Reference in New Issue
Block a user