This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
FreeRTOS-Kernel/include
Gaurav-Aggarwal-AWS 95669cc1a1
Generalize Thread Local Storage (TLS) support (#540)
* Generalize Thread Local Storage (TLS) support

FreeRTOS's Thread Local Storage (TLS) support used variables and
functions from newlib, thereby making the TLS support specific to
newlib. This commit generalizes the TLS support so that it can be used
with other c-runtime libraries also. The default behavior for newlib
support is still kept same for backward compatibility.

The application writer would need to set configUSE_C_RUNTIME_TLS_SUPPORT
to 1 in their FreeRTOSConfig.h and define the following macros to
support TLS for a c-runtime library:

1. configTLS_BLOCK_TYPE - Type used to define the TLS block in TCB.
2. configINIT_TLS_BLOCK( xTLSBlock ) - Allocate and initialize memory
   block for the task's TLS Block.
3. configSET_TLS_BLOCK( xTLSBlock ) - Switch C-Runtime's TLS Block to
   point to xTLSBlock.
4. configDEINIT_TLS_BLOCK( xTLSBlock ) - Free up the memory allocated
   for the task's TLS Block.

The following is an example to support TLS for picolibc:

 #define configUSE_C_RUNTIME_TLS_SUPPORT        1
 #define configTLS_BLOCK_TYPE                   void*
 #define configINIT_TLS_BLOCK( xTLSBlock )      _init_tls( xTLSBlock )
 #define configSET_TLS_BLOCK( xTLSBlock )       _set_tls( xTLSBlock )
 #define configDEINIT_TLS_BLOCK( xTLSBlock )

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2022-08-08 21:23:29 +05:30
..
atomic.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
croutine.h Replace <pre> with @code - remaining files (#388) 2021-09-07 12:03:12 -07:00
deprecated_definitions.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
event_groups.h Fix some warnings in doxygen comments (#453) 2022-02-10 11:36:42 -08:00
FreeRTOS.h Generalize Thread Local Storage (TLS) support (#540) 2022-08-08 21:23:29 +05:30
list.h Add configUSE_MINI_LIST_ITEM configuration option to enable the MiniListItem_t type. (#433) 2022-01-19 13:12:57 -08:00
message_buffer.h Change type of message buffer handle (#537) 2022-08-04 10:07:49 -07:00
mpu_prototypes.h Add callback overrides for stream buffer and message buffers (#437) 2022-06-20 17:48:34 -07:00
mpu_wrappers.h Correct spelling mistake in mpu_wrappers.h 2022-04-14 10:16:10 -07:00
portable.h Declare vApplicationMallocFailedHook function in task.h instead in each C heap file (#483) 2022-04-13 10:44:14 -07:00
projdefs.h Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
queue.h queue.h: cTaskWokenByPost -> xTaskWokenByReceive (#491) 2022-04-25 14:11:51 -07:00
semphr.h Add configUSE_MUTEXES to function declarations in header (#504) 2022-06-21 16:04:52 +05:30
stack_macros.h Run uncrustify with github workflows (#369) 2021-07-28 17:53:10 -07:00
StackMacros.h Fix warning message error. (#443) 2022-01-21 10:10:22 -08:00
stdint.readme Normalize files with mixed line endings (introduced in commit 3a413d1) 2021-06-01 17:55:18 -07:00
stream_buffer.h Add callback overrides for stream buffer and message buffers (#437) 2022-06-20 17:48:34 -07:00
task.h Update documentation of uxTaskGetTaskNumber function (#460) 2022-02-22 10:44:05 -08:00
timers.h Clean some spell check words. (#439) 2022-01-07 10:45:58 -08:00