converted exclusion to affinity

This commit is contained in:
Joseph Julicher 2021-05-13 17:20:41 -07:00
parent b9a17479a0
commit d59bfca4f9
4 changed files with 55 additions and 44 deletions

View file

@ -240,8 +240,8 @@
#define configUSE_TASK_PREEMPTION_DISABLE 0
#endif
#ifndef configUSE_CORE_EXCLUSION
#define configUSE_CORE_EXCLUSION 0
#ifndef configUSE_CORE_AFFINITY
#define configUSE_CORE_AFFINITY 0
#endif
#ifndef configUSE_ALTERNATIVE_API
@ -948,7 +948,7 @@
#error configUSE_MUTEXES must be set to 1 to use recursive mutexes
#endif
#if( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configUSE_CORE_EXCLUSION != 0 ) )
#if( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configUSE_CORE_AFFINITY != 0 ) )
#error configRUN_MULTIPLE_PRIORITIES must be set to 1 to use core exclusion
#endif
@ -1209,8 +1209,9 @@ typedef struct xSTATIC_TCB
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
BaseType_t xDummy24;
#endif
#if ( configUSE_CORE_EXCLUSION == 1 )
#if ( configUSE_CORE_AFFINITY == 1 && configNUM_CORES > 1 )
UBaseType_t uxDummy25;
UBaseType_t uxDummy26;
#endif
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
void * pxDummy8;

View file

@ -170,6 +170,14 @@ typedef enum
*/
#define tskIDLE_PRIORITY ( ( UBaseType_t ) 0U )
/**
* Defines affinity to all available cores.
*
*/
#define tskNO_AFFINITY ( ( UBaseType_t ) -1U )
/**
* task. h
*
@ -1235,8 +1243,10 @@ void vTaskResume( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
*/
BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
void vTaskCoreExclusionSet( const TaskHandle_t xTask, UBaseType_t uxCoreExclude );
UBaseType_t vTaskCoreExclusionGet( const TaskHandle_t xTask );
#if ( configUSE_CORE_AFFINITY == 1)
void vTaskCoreAffinitySet( const TaskHandle_t xTask, UBaseType_t uxCoreAffinityMask );
UBaseType_t vTaskCoreAffinityGet( const TaskHandle_t xTask );
#endif
void vTaskPreemptionDisable( const TaskHandle_t xTask );
void vTaskPreemptionEnable( const TaskHandle_t xTask );