Skip to content

Commit 003ec79

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 5460f04 commit 003ec79

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. */
@@ -3065,7 +3065,7 @@ void vTaskSwitchContext( void )
30653065
}
30663066
#endif
30673067

3068-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
3068+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
30693069
{
30703070
/* Switch C-Runtime's TLS Block to point to the TLS
30713071
* Block specific to this task. */
@@ -3946,7 +3946,7 @@ static void prvCheckTasksWaitingTermination( void )
39463946
* want to allocate and clean RAM statically. */
39473947
portCLEAN_UP_TCB( pxTCB );
39483948

3949-
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
3949+
#if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 )
39503950
{
39513951
/* Free up the memory allocated for the task's TLS Block. */
39523952
configDEINIT_TLS_BLOCK( pxCurrentTCB->xTLSBlock );

0 commit comments

Comments
 (0)