Skip to content

Commit 08dbdef

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 <[email protected]>
1 parent 44e02bf commit 08dbdef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/FreeRTOS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
#endif
9191

9292
#ifndef configINIT_TLS_BLOCK
93-
#define configINIT_TLS_BLOCK( xTLSBlock ) _REENT_INIT_PTR( &( xTLSBlock ) )
93+
#define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) )
9494
#endif
9595

9696
#ifndef configSET_TLS_BLOCK

tasks.c

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

0 commit comments

Comments
 (0)