Skip to content

Commit 991cf18

Browse files
author
Keith Packard
committed
Make TLS code depend only on configUSE_C_RUNTIME_TLS_SUPPORT
Remove reference to configUSE_NEWLIB_REENTRANT as that only works when using newlib. configUSE_C_RUNTIME_TLS_SUPPORT is always set when configUSE_NEWLIB_REENTRANT is set, so using both was redundant in that case. Signed-off-by: Keith Packard <[email protected]>
1 parent a366ed8 commit 991cf18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

include/FreeRTOS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
#define configUSE_C_RUNTIME_TLS_SUPPORT 0
104104
#endif
105105

106-
#if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
106+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
107107

108108
#ifndef configTLS_BLOCK_TYPE
109109
#error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
@@ -120,7 +120,7 @@
120120
#ifndef configDEINIT_TLS_BLOCK
121121
#error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
122122
#endif
123-
#endif /* if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) ) */
123+
#endif /* if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) */
124124

125125
/*
126126
* Check all the required application specific macros have been defined.
@@ -1280,7 +1280,7 @@ typedef struct xSTATIC_TCB
12801280
#if ( configGENERATE_RUN_TIME_STATS == 1 )
12811281
configRUN_TIME_COUNTER_TYPE ulDummy16;
12821282
#endif
1283-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
1283+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
12841284
configTLS_BLOCK_TYPE xDummy17;
12851285
#endif
12861286
#if ( configUSE_TASK_NOTIFICATIONS == 1 )

tasks.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
300300
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /**< Stores the amount of time the task has spent in the Running state. */
301301
#endif
302302

303-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
303+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
304304
configTLS_BLOCK_TYPE xTLSBlock; /**< Memory block used as Thread Local Storage (TLS) Block for the task. */
305305
#endif
306306

@@ -955,7 +955,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
955955
}
956956
#endif
957957

958-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
958+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
959959
{
960960
/* Allocate and initialize memory for the task's TLS Block. */
961961
configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock, pxTopOfStack );
@@ -2030,7 +2030,7 @@ void vTaskStartScheduler( void )
20302030
* starts to run. */
20312031
portDISABLE_INTERRUPTS();
20322032

2033-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
2033+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
20342034
{
20352035
/* Switch C-Runtime's TLS Block to point to the TLS
20362036
* block specific to the task that will run first. */
@@ -3074,7 +3074,7 @@ void vTaskSwitchContext( void )
30743074
}
30753075
#endif
30763076

3077-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
3077+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
30783078
{
30793079
/* Switch C-Runtime's TLS Block to point to the TLS
30803080
* Block specific to this task. */
@@ -3950,7 +3950,7 @@ static void prvCheckTasksWaitingTermination( void )
39503950
* want to allocate and clean RAM statically. */
39513951
portCLEAN_UP_TCB( pxTCB );
39523952

3953-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
3953+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
39543954
{
39553955
/* Free up the memory allocated for the task's TLS Block. */
39563956
configDEINIT_TLS_BLOCK( pxCurrentTCB->xTLSBlock );

0 commit comments

Comments
 (0)