muteki
Loading...
Searching...
No Matches
utls.h File Reference

Userspace TLS (UTLS) control. More...

#include <muteki/threading.h>

Go to the source code of this file.

Data Structures

struct  osdep_utls_stats_s
 Statistics of TLS allocation. More...
 

Typedefs

typedef struct osdep_utls_stats_s osdep_utls_stats_t
 Statistics of TLS allocation.
 

Functions

void osdep_utls_cinit (void)
 Manually initialize UTLS container.
 
void osdep_utls_cfini (void)
 Manually destroy the UTLS container.
 
void * osdep_utls_peek (const thread_t *thr)
 Get the TLS space by thread descriptor pointer.
 
void osdep_utls_get_stats (osdep_utls_stats_t *stats)
 Get statistics of TLS allocation.
 

Detailed Description

Userspace TLS (UTLS) control.

A hash-table-backed TLS storage emulator local to the current module. Include this header to control the lifecycle of UTLS.

Function Documentation

◆ osdep_utls_cfini()

void osdep_utls_cfini ( void  )
extern

Manually destroy the UTLS container.

Call this from the destructor code on module unload when not stay resident.

Parameters
None.

Returns
None.

◆ osdep_utls_cinit()

void osdep_utls_cinit ( void  )
extern

Manually initialize UTLS container.

This is normally not needed as the __aeabi_read_tp() implementation will automatically call this on first use of any TLS space.

Parameters
None.

Returns
None.

◆ osdep_utls_get_stats()

void osdep_utls_get_stats ( osdep_utls_stats_t stats)
extern

Get statistics of TLS allocation.

Parameters
statsThe output stats buffer.

Returns
None.

◆ osdep_utls_peek()

void * osdep_utls_peek ( const thread_t thr)
extern

Get the TLS space by thread descriptor pointer.

Note
This does not allocate extra space when thr does not already have TLS allocated for it.
Parameters
thrThread pointer.
Returns
TLS space, or NULL if not yet allocated.