Skip to content

Commit 762f30b

Browse files
author
Keith Packard
committed
Pass top of stack to configINIT_TLS_BLOCK
Picolibc wants to allocate the per-task TLS block within the stack segment, so it will need to modify the top of stack value. Pass the pxTopOfStack variable to make this explicit. Signed-off-by: Keith Packard <keithpac@amazon.com>
1 parent 0a70ecb commit 762f30b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/FreeRTOS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
#endif
114114

115115
#ifndef configINIT_TLS_BLOCK
116-
#define configINIT_TLS_BLOCK( xTLSBlock ) _REENT_INIT_PTR( &( xTLSBlock ) )
116+
#define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) )
117117
#endif
118118

119119
#ifndef configSET_TLS_BLOCK

tasks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
958958
#if ( ( configUSE_NEWLIB_REENTRANT == 1 ) || ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) )
959959
{
960960
/* Allocate and initialize memory for the task's TLS Block. */
961-
configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock );
961+
configINIT_TLS_BLOCK( pxNewTCB->xTLSBlock, pxTopOfStack );
962962
}
963963
#endif
964964

0 commit comments

Comments
 (0)