1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #ifndef BOOST_LEAF_CONFIG_TLS_FREERTOS_HPP_INCLUDED
- #define BOOST_LEAF_CONFIG_TLS_FREERTOS_HPP_INCLUDED
- #include <task.h>
- #ifndef BOOST_LEAF_USE_TLS_ARRAY
- # define BOOST_LEAF_USE_TLS_ARRAY
- #endif
- #ifndef BOOST_LEAF_CFG_TLS_ARRAY_SIZE
- # define BOOST_LEAF_CFG_TLS_ARRAY_SIZE configNUM_THREAD_LOCAL_STORAGE_POINTERS
- #endif
- static_assert((BOOST_LEAF_CFG_TLS_ARRAY_SIZE) <= configNUM_THREAD_LOCAL_STORAGE_POINTERS,
- "Bad BOOST_LEAF_CFG_TLS_ARRAY_SIZE");
- namespace boost { namespace leaf {
- namespace tls
- {
-
- inline void * read_void_ptr( int tls_index ) noexcept
- {
- return pvTaskGetThreadLocalStoragePointer(0, tls_index);
- }
- inline void write_void_ptr( int tls_index, void * p ) noexcept
- {
- vTaskSetThreadLocalStoragePointer(0, tls_index, p);
- }
- }
- } }
- #endif
|