File indexing completed on 2025-10-31 08:43:14
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 
0011 
0012 
0013 
0014 
0015 #include <task.h>
0016 
0017 #ifndef BOOST_LEAF_USE_TLS_ARRAY
0018 #   define BOOST_LEAF_USE_TLS_ARRAY
0019 #endif
0020 
0021 #ifndef BOOST_LEAF_CFG_TLS_ARRAY_SIZE
0022 #   define BOOST_LEAF_CFG_TLS_ARRAY_SIZE configNUM_THREAD_LOCAL_STORAGE_POINTERS
0023 #endif
0024 
0025 static_assert((BOOST_LEAF_CFG_TLS_ARRAY_SIZE) <= configNUM_THREAD_LOCAL_STORAGE_POINTERS,
0026     "Bad BOOST_LEAF_CFG_TLS_ARRAY_SIZE");
0027 
0028 namespace boost { namespace leaf {
0029 
0030 namespace tls
0031 {
0032     
0033 
0034     inline void * read_void_ptr( int tls_index ) noexcept
0035     {
0036         return pvTaskGetThreadLocalStoragePointer(0, tls_index);
0037     }
0038 
0039     inline void write_void_ptr( int tls_index, void * p ) noexcept
0040     {
0041         vTaskSetThreadLocalStoragePointer(0, tls_index, p);
0042     }
0043 }
0044 
0045 } }
0046 
0047 #endif