mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add configUSE_CORE_AFFINITY bits check (#776)
* Add core affinity bits check * Add taskBITS_PER_BYTES
This commit is contained in:
parent
c93d3865f7
commit
f7565c2d5e
|
@ -1165,6 +1165,10 @@
|
|||
#error configUSE_TASK_PREEMPTION_DISABLE is not supported in single core FreeRTOS
|
||||
#endif
|
||||
|
||||
#if ( ( configNUMBER_OF_CORES == 1 ) && ( configUSE_CORE_AFFINITY != 0 ) )
|
||||
#error configUSE_CORE_AFFINITY is not supported in single core FreeRTOS
|
||||
#endif
|
||||
|
||||
#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PORT_OPTIMISED_TASK_SELECTION != 0 ) )
|
||||
#error configUSE_PORT_OPTIMISED_TASK_SELECTION is not supported in SMP FreeRTOS
|
||||
#endif
|
||||
|
|
12
tasks.c
12
tasks.c
|
@ -288,6 +288,8 @@
|
|||
#define INFINITE_LOOP() 1
|
||||
#endif
|
||||
|
||||
#define taskBITS_PER_BYTE ( ( size_t ) 8 )
|
||||
|
||||
/*
|
||||
* Task control block. A task control block (TCB) is allocated for each task,
|
||||
* and stores task state information, including a pointer to the task's context
|
||||
|
@ -302,7 +304,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
|
|||
#endif
|
||||
|
||||
#if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
|
||||
UBaseType_t uxCoreAffinityMask; /*< Used to link the task to certain cores. UBaseType_t must have greater than or equal to the number of bits as confNUM_CORES. */
|
||||
UBaseType_t uxCoreAffinityMask; /**< Used to link the task to certain cores. UBaseType_t must have greater than or equal to the number of bits as configNUMBER_OF_CORES. */
|
||||
#endif
|
||||
|
||||
ListItem_t xStateListItem; /**< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */
|
||||
|
@ -3249,6 +3251,14 @@ void vTaskStartScheduler( void )
|
|||
{
|
||||
BaseType_t xReturn;
|
||||
|
||||
#if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
|
||||
{
|
||||
/* Sanity check that the UBaseType_t must have greater than or equal to
|
||||
* the number of bits as confNUMBER_OF_CORES. */
|
||||
configASSERT( ( sizeof( UBaseType_t ) * taskBITS_PER_BYTE ) >= configNUMBER_OF_CORES );
|
||||
}
|
||||
#endif /* #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) */
|
||||
|
||||
xReturn = prvCreateIdleTasks();
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
|
Loading…
Reference in a new issue