Skip to content

Commit 4dc3f0f

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 d5a7bd3 commit 4dc3f0f

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
@@ -80,7 +80,7 @@
8080
#define configUSE_C_RUNTIME_TLS_SUPPORT 0
8181
#endif
8282

83-
#if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
83+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
8484

8585
#ifndef configTLS_BLOCK_TYPE
8686
#error Missing definition: configTLS_BLOCK_TYPE must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
@@ -97,7 +97,7 @@
9797
#ifndef configDEINIT_TLS_BLOCK
9898
#error Missing definition: configDEINIT_TLS_BLOCK must be defined in FreeRTOSConfig.h when configUSE_C_RUNTIME_TLS_SUPPORT is set to 1.
9999
#endif
100-
#endif /* if ( ( configUSE_NEWLIB_REENTRANT == 0 ) && ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) ) */
100+
#endif /* if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) */
101101

102102
/*
103103
* Check all the required application specific macros have been defined.
@@ -1258,7 +1258,7 @@ typedef struct xSTATIC_TCB
12581258
#if ( configGENERATE_RUN_TIME_STATS == 1 )
12591259
configRUN_TIME_COUNTER_TYPE ulDummy16;
12601260
#endif
1261-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
1261+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
12621262
configTLS_BLOCK_TYPE xDummy17;
12631263
#endif
12641264
#if ( configUSE_TASK_NOTIFICATIONS == 1 )

tasks.c

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

299-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
299+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
300300
configTLS_BLOCK_TYPE xTLSBlock; /*< Memory block used as Thread Local Storage (TLS) Block for the task. */
301301
#endif
302302

@@ -951,7 +951,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
951951
}
952952
#endif
953953

954-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
954+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
955955
{
956956
/* Allocate and initialize memory for the task's TLS Block. */
957957
configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock, pxTopOfStack );
@@ -2025,7 +2025,7 @@ void vTaskStartScheduler( void )
20252025
* starts to run. */
20262026
portDISABLE_INTERRUPTS();
20272027

2028-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
2028+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
20292029
{
20302030
/* Switch C-Runtime's TLS Block to point to the TLS
20312031
* block specific to the task that will run first. */
@@ -3069,7 +3069,7 @@ void vTaskSwitchContext( void )
30693069
}
30703070
#endif
30713071

3072-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
3072+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
30733073
{
30743074
/* Switch C-Runtime's TLS Block to point to the TLS
30753075
* 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)