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/.github
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
..
actions Check: improve verbosity of url verifier (#260) 2021-02-10 16:04:08 -08:00
ISSUE_TEMPLATE Update feature_request.md (#500) 2022-06-08 22:39:39 +05:30
scripts Add RP2040 support (#341) 2021-06-30 13:20:54 -07:00
workflows Update codecov action to v3.1.0 2022-08-03 11:42:42 -07:00
CODEOWNERS Added CODEOWNERS file (#209) 2020-10-26 13:24:55 -07:00
CONTRIBUTING.md Run uncrustify with github workflows (#369) 2021-07-28 17:53:10 -07:00
lexicon.txt Generalize Thread Local Storage (TLS) support (#540) 2022-08-08 21:23:29 +05:30
pull_request_template.md Create pull_request_template.md 2020-03-17 13:11:11 -07:00
SECURITY.md Move markdown files and lexicon into .github directory (#205) 2020-10-21 18:40:43 -07:00
uncrustify.cfg Update uncrustify configuration to 0.69 (#445) 2022-01-28 10:48:03 -08:00