File indexing completed on 2025-01-30 09:44:51
0001 #ifndef BOOST_LEAF_CONFIG_TLS_FREERTOS_HPP_INCLUDED
0002 #define BOOST_LEAF_CONFIG_TLS_FREERTOS_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010 #include <task.h>
0011
0012 #ifndef BOOST_LEAF_USE_TLS_ARRAY
0013 # define BOOST_LEAF_USE_TLS_ARRAY
0014 #endif
0015
0016 #ifndef BOOST_LEAF_CFG_TLS_ARRAY_SIZE
0017 # define BOOST_LEAF_CFG_TLS_ARRAY_SIZE configNUM_THREAD_LOCAL_STORAGE_POINTERS
0018 #endif
0019
0020 static_assert((BOOST_LEAF_CFG_TLS_ARRAY_SIZE) <= configNUM_THREAD_LOCAL_STORAGE_POINTERS,
0021 "Bad BOOST_LEAF_CFG_TLS_ARRAY_SIZE");
0022
0023 namespace boost { namespace leaf {
0024
0025 namespace tls
0026 {
0027
0028
0029 inline void * read_void_ptr( int tls_index ) noexcept
0030 {
0031 return pvTaskGetThreadLocalStoragePointer(0, tls_index);
0032 }
0033
0034 inline void write_void_ptr( int tls_index, void * p ) noexcept
0035 {
0036 vTaskSetThreadLocalStoragePointer(0, tls_index, p);
0037 }
0038 }
0039
0040 } }
0041
0042 #endif