Skip to content

Commit 89fa181

Browse files
authored
Rename config num cores (FreeRTOS#48)
* Rename configNUM_CORES to configNUMBER_OF_CORES
1 parent 31a7e85 commit 89fa181

File tree

9 files changed

+259
-259
lines changed

9 files changed

+259
-259
lines changed

event_groups.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
258258
{
259259
if( xAlreadyYielded == pdFALSE )
260260
{
261-
#if ( configNUM_CORES == 1 )
261+
#if ( configNUMBER_OF_CORES == 1 )
262262
{
263263
portYIELD_WITHIN_API();
264264
}
265-
#else /* #if ( configNUM_CORES == 1 ) */
265+
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
266266
{
267267
vTaskYieldWithinAPI();
268268
}
269-
#endif /* #if ( configNUM_CORES == 1 ) */
269+
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
270270
}
271271
else
272272
{
@@ -418,15 +418,15 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
418418
{
419419
if( xAlreadyYielded == pdFALSE )
420420
{
421-
#if ( configNUM_CORES == 1 )
421+
#if ( configNUMBER_OF_CORES == 1 )
422422
{
423423
portYIELD_WITHIN_API();
424424
}
425-
#else /* #if ( configNUM_CORES == 1 ) */
425+
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
426426
{
427427
vTaskYieldWithinAPI();
428428
}
429-
#endif /* #if ( configNUM_CORES == 1 ) */
429+
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
430430
}
431431
else
432432
{

include/FreeRTOS.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
#error Missing definition: configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
152152
#endif
153153

154-
#if ( configNUM_CORES > 1 )
154+
#if ( configNUMBER_OF_CORES > 1 )
155155
#ifndef configUSE_MINIMAL_IDLE_HOOK
156156
#error Missing definition: configUSE_MINIMAL_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
157157
#endif
@@ -348,8 +348,8 @@
348348
#define portSOFTWARE_BARRIER()
349349
#endif
350350

351-
#ifndef configNUM_CORES
352-
#define configNUM_CORES 1
351+
#ifndef configNUMBER_OF_CORES
352+
#define configNUMBER_OF_CORES 1
353353
#endif
354354

355355
#ifndef configRUN_MULTIPLE_PRIORITIES
@@ -358,43 +358,43 @@
358358

359359
#ifndef portGET_CORE_ID
360360

361-
#if ( configNUM_CORES == 1 )
361+
#if ( configNUMBER_OF_CORES == 1 )
362362
#define portGET_CORE_ID() 0
363363
#else
364-
#error configNUM_CORES is set to more than 1 then portGET_CORE_ID must also be defined.
365-
#endif /* configNUM_CORES */
364+
#error configNUMBER_OF_CORES is set to more than 1 then portGET_CORE_ID must also be defined.
365+
#endif /* configNUMBER_OF_CORES */
366366

367367
#endif /* portGET_CORE_ID */
368368

369369
#ifndef portYIELD_CORE
370370

371-
#if ( configNUM_CORES == 1 )
371+
#if ( configNUMBER_OF_CORES == 1 )
372372
#define portYIELD_CORE( x ) portYIELD()
373373
#else
374-
#error configNUM_CORES is set to more than 1 then portYIELD_CORE must also be defined.
375-
#endif /* configNUM_CORES */
374+
#error configNUMBER_OF_CORES is set to more than 1 then portYIELD_CORE must also be defined.
375+
#endif /* configNUMBER_OF_CORES */
376376

377377
#endif /* portYIELD_CORE */
378378

379379
#ifndef portSET_INTERRUPT_MASK
380380

381-
#if ( configNUM_CORES > 1 )
381+
#if ( configNUMBER_OF_CORES > 1 )
382382
#error portSET_INTERRUPT_MASK is required in SMP
383383
#endif
384384

385385
#endif /* portSET_INTERRUPT_MASK */
386386

387387
#ifndef portCLEAR_INTERRUPT_MASK
388388

389-
#if ( configNUM_CORES > 1 )
389+
#if ( configNUMBER_OF_CORES > 1 )
390390
#error portCLEAR_INTERRUPT_MASK is required in SMP
391391
#endif
392392

393393
#endif /* portCLEAR_INTERRUPT_MASK */
394394

395395
#ifndef portRELEASE_TASK_LOCK
396396

397-
#if ( configNUM_CORES == 1 )
397+
#if ( configNUMBER_OF_CORES == 1 )
398398
#define portRELEASE_TASK_LOCK()
399399
#else
400400
#error portRELEASE_TASK_LOCK is required in SMP
@@ -404,7 +404,7 @@
404404

405405
#ifndef portGET_TASK_LOCK
406406

407-
#if ( configNUM_CORES == 1 )
407+
#if ( configNUMBER_OF_CORES == 1 )
408408
#define portGET_TASK_LOCK()
409409
#else
410410
#error portGET_TASK_LOCK is required in SMP
@@ -414,7 +414,7 @@
414414

415415
#ifndef portRELEASE_ISR_LOCK
416416

417-
#if ( configNUM_CORES == 1 )
417+
#if ( configNUMBER_OF_CORES == 1 )
418418
#define portRELEASE_ISR_LOCK()
419419
#else
420420
#error portRELEASE_ISR_LOCK is required in SMP
@@ -424,7 +424,7 @@
424424

425425
#ifndef portGET_ISR_LOCK
426426

427-
#if ( configNUM_CORES == 1 )
427+
#if ( configNUMBER_OF_CORES == 1 )
428428
#define portGET_ISR_LOCK()
429429
#else
430430
#error portGET_ISR_LOCK is required in SMP
@@ -434,23 +434,23 @@
434434

435435
#ifndef portCHECK_IF_IN_ISR
436436

437-
#if ( configNUM_CORES > 1 )
437+
#if ( configNUMBER_OF_CORES > 1 )
438438
#error portCHECK_IF_IN_ISR is required in SMP
439439
#endif
440440

441441
#endif /* portCHECK_IF_IN_ISR */
442442

443443
#ifndef portENTER_CRITICAL_FROM_ISR
444444

445-
#if ( configNUM_CORES > 1 )
445+
#if ( configNUMBER_OF_CORES > 1 )
446446
#error portENTER_CRITICAL_FROM_ISR is required in SMP
447447
#endif
448448

449449
#endif
450450

451451
#ifndef portEXIT_CRITICAL_FROM_ISR
452452

453-
#if ( configNUM_CORES > 1 )
453+
#if ( configNUMBER_OF_CORES > 1 )
454454
#error portEXIT_CRITICAL_FROM_ISR is required in SMP
455455
#endif
456456

@@ -1133,7 +1133,7 @@
11331133
#error configUSE_PREEMPTION must be set to 1 to use task preemption disable
11341134
#endif
11351135

1136-
#if ( ( configNUM_CORES == 1 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
1136+
#if ( ( configNUMBER_OF_CORES == 1 ) && ( configUSE_TASK_PREEMPTION_DISABLE != 0 ) )
11371137
#error configUSE_TASK_PREEMPTION_DISABLE is not supported in single core FreeRTOS
11381138
#endif
11391139

@@ -1392,13 +1392,13 @@ typedef struct xSTATIC_TCB
13921392
#if ( portUSING_MPU_WRAPPERS == 1 )
13931393
xMPU_SETTINGS xDummy2;
13941394
#endif
1395-
#if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUM_CORES > 1 )
1395+
#if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 )
13961396
UBaseType_t uxDummy26;
13971397
#endif
13981398
StaticListItem_t xDummy3[ 2 ];
13991399
UBaseType_t uxDummy5;
14001400
void * pxDummy6;
1401-
#if ( configNUM_CORES > 1 )
1401+
#if ( configNUMBER_OF_CORES > 1 )
14021402
BaseType_t xDummy23;
14031403
UBaseType_t uxDummy24;
14041404
#endif

include/task.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ typedef struct xTASK_STATUS
166166
StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
167167
#endif
168168
configSTACK_DEPTH_TYPE usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
169-
#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUM_CORES > 1 ) )
169+
#if ( ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
170170
UBaseType_t uxCoreAffinityMask; /* The core affinity mask for the task */
171171
#endif
172172
} TaskStatus_t;
@@ -218,7 +218,7 @@ typedef enum
218218
* \ingroup SchedulerControl
219219
*/
220220
#define taskENTER_CRITICAL() portENTER_CRITICAL()
221-
#if ( configNUM_CORES == 1 )
221+
#if ( configNUMBER_OF_CORES == 1 )
222222
#define taskENTER_CRITICAL_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
223223
#else
224224
#define taskENTER_CRITICAL_FROM_ISR() portENTER_CRITICAL_FROM_ISR()
@@ -237,7 +237,7 @@ typedef enum
237237
* \ingroup SchedulerControl
238238
*/
239239
#define taskEXIT_CRITICAL() portEXIT_CRITICAL()
240-
#if ( configNUM_CORES == 1 )
240+
#if ( configNUMBER_OF_CORES == 1 )
241241
#define taskEXIT_CRITICAL_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( x )
242242
#else
243243
#define taskEXIT_CRITICAL_FROM_ISR( x ) portEXIT_CRITICAL_FROM_ISR( x )
@@ -271,7 +271,7 @@ typedef enum
271271
#define taskSCHEDULER_RUNNING ( ( BaseType_t ) 2 )
272272

273273
/* Checks if core ID is valid. */
274-
#define taskVALID_CORE_ID( xCoreID ) ( ( BaseType_t ) ( ( 0 <= xCoreID ) && ( xCoreID < configNUM_CORES ) ) )
274+
#define taskVALID_CORE_ID( xCoreID ) ( ( BaseType_t ) ( ( 0 <= xCoreID ) && ( xCoreID < configNUMBER_OF_CORES ) ) )
275275

276276
/*-----------------------------------------------------------
277277
* TASK CREATION API
@@ -380,7 +380,7 @@ typedef enum
380380
TaskHandle_t * const pxCreatedTask ) PRIVILEGED_FUNCTION;
381381
#endif
382382

383-
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
383+
#if ( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
384384
BaseType_t xTaskCreateAffinitySet( TaskFunction_t pxTaskCode,
385385
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
386386
const configSTACK_DEPTH_TYPE usStackDepth,
@@ -508,7 +508,7 @@ typedef enum
508508
StaticTask_t * const pxTaskBuffer ) PRIVILEGED_FUNCTION;
509509
#endif /* configSUPPORT_STATIC_ALLOCATION */
510510

511-
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
511+
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
512512
TaskHandle_t xTaskCreateStaticAffinitySet( TaskFunction_t pxTaskCode,
513513
const char * const pcName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
514514
const uint32_t ulStackDepth,
@@ -597,7 +597,7 @@ typedef enum
597597
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
598598
#endif
599599

600-
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
600+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
601601
BaseType_t xTaskCreateRestrictedAffinitySet( const TaskParameters_t * const pxTaskDefinition,
602602
UBaseType_t uxCoreAffinityMask,
603603
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
@@ -693,7 +693,7 @@ typedef enum
693693
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
694694
#endif
695695

696-
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
696+
#if ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configNUMBER_OF_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
697697
BaseType_t xTaskCreateRestrictedStaticAffinitySet( const TaskParameters_t * const pxTaskDefinition,
698698
UBaseType_t uxCoreAffinityMask,
699699
TaskHandle_t * pxCreatedTask ) PRIVILEGED_FUNCTION;
@@ -1288,7 +1288,7 @@ BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
12881288
* Passing NULL will set the core affinity mask for the calling task.
12891289
*
12901290
* @param uxCoreAffinityMask A bitwise value that indicates the cores on
1291-
* which the task can run. Cores are numbered from 0 to configNUM_CORES - 1.
1291+
* which the task can run. Cores are numbered from 0 to configNUMBER_OF_CORES - 1.
12921292
* For example, to ensure that a task can run on core 0 and core 1, set
12931293
* uxCoreAffinityMask to 0x03.
12941294
*
@@ -1328,7 +1328,7 @@ BaseType_t xTaskResumeFromISR( TaskHandle_t xTaskToResume ) PRIVILEGED_FUNCTION;
13281328
*
13291329
* @return The core affinity mask which is a bitwise value that indicates
13301330
* the cores on which a task can run. Cores are numbered from 0 to
1331-
* configNUM_CORES - 1. For example, if a task can run on core 0 and core 1,
1331+
* configNUMBER_OF_CORES - 1. For example, if a task can run on core 0 and core 1,
13321332
* the core affinity mask is 0x03.
13331333
*
13341334
* Example usage:
@@ -3222,7 +3222,7 @@ void vTaskRemoveFromUnorderedEventList( ListItem_t * pxEventListItem,
32223222
* Sets the pointer to the current TCB to the TCB of the highest priority task
32233223
* that is ready to run.
32243224
*/
3225-
#if ( configNUM_CORES == 1 )
3225+
#if ( configNUMBER_OF_CORES == 1 )
32263226
portDONT_DISCARD void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;
32273227
#else
32283228
portDONT_DISCARD void vTaskSwitchContext( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;

portable/ThirdParty/GCC/RP2040/include/portmacro.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,20 +110,20 @@
110110

111111
/* Multi-core */
112112
#define portMAX_CORE_COUNT 2
113-
#ifndef configNUM_CORES
114-
#define configNUM_CORES 2
113+
#ifndef configNUMBER_OF_CORES
114+
#define configNUMBER_OF_CORES 2
115115
#endif
116116

117117
/* Check validity of number of cores specified in config */
118-
#if ( configNUM_CORES < 1 || portMAX_CORE_COUNT < configNUM_CORES )
118+
#if ( configNUMBER_OF_CORES < 1 || portMAX_CORE_COUNT < configNUMBER_OF_CORES )
119119
#error "Invalid number of cores specified in config!"
120120
#endif
121121

122-
#if ( configTICK_CORE < 0 || configTICK_CORE > configNUM_CORES )
122+
#if ( configTICK_CORE < 0 || configTICK_CORE > configNUMBER_OF_CORES )
123123
#error "Invalid tick core specified in config!"
124124
#endif
125125
/* FreeRTOS core id is always zero based, so always 0 if we're running on only one core */
126-
#if configNUM_CORES == portMAX_CORE_COUNT
126+
#if configNUMBER_OF_CORES == portMAX_CORE_COUNT
127127
#define portGET_CORE_ID() get_core_num()
128128
#else
129129
#define portGET_CORE_ID() 0
@@ -141,7 +141,7 @@
141141
/*-----------------------------------------------------------*/
142142

143143
/* Critical nesting count management. */
144-
extern UBaseType_t uxCriticalNestings[ configNUM_CORES ];
144+
extern UBaseType_t uxCriticalNestings[ configNUMBER_OF_CORES ];
145145
#define portGET_CRITICAL_NESTING_COUNT() ( uxCriticalNestings[ portGET_CORE_ID() ] )
146146
#define portSET_CRITICAL_NESTING_COUNT( x ) ( uxCriticalNestings[ portGET_CORE_ID() ] = ( x ) )
147147
#define portINCREMENT_CRITICAL_NESTING_COUNT() ( uxCriticalNestings[ portGET_CORE_ID() ]++ )
@@ -169,7 +169,7 @@
169169
extern void vPortEnableInterrupts();
170170
#define portENABLE_INTERRUPTS() vPortEnableInterrupts()
171171

172-
#if ( configNUM_CORES == 1 )
172+
#if ( configNUMBER_OF_CORES == 1 )
173173
extern void vPortEnterCritical( void );
174174
extern void vPortExitCritical( void );
175175
#define portENTER_CRITICAL() vPortEnterCritical()
@@ -225,7 +225,7 @@
225225
}
226226
}
227227

228-
#if ( configNUM_CORES == 1 )
228+
#if ( configNUMBER_OF_CORES == 1 )
229229
#define portGET_ISR_LOCK()
230230
#define portRELEASE_ISR_LOCK()
231231
#define portGET_TASK_LOCK()

portable/ThirdParty/GCC/RP2040/include/rp2040_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extern "C" {
6363
#endif
6464
#endif
6565

66-
#if ( configNUM_CORES > 1 )
66+
#if ( configNUMBER_OF_CORES > 1 )
6767
/* configTICK_CORE indicates which core should handle the SysTick
6868
* interrupts */
6969
#ifndef configTICK_CORE

0 commit comments

Comments
 (0)