Thread-local storage (TLS) support.
More...
|
file | tls.h |
| Thread-Local Storage (TLS)
|
|
|
char | _TLS_Data_begin [] |
|
char | _TLS_Data_end [] |
|
char | _TLS_Data_size [] |
|
char | _TLS_BSS_begin [] |
|
char | _TLS_BSS_end [] |
|
char | _TLS_BSS_size [] |
|
char | _TLS_Size [] |
|
char | _TLS_Alignment [] |
| The TLS section alignment. More...
|
|
Thread-local storage (TLS) support.
Variants I and II are according to Ulrich Drepper, "ELF Handling For
Thread-Local Storage".
◆ _TLS_Copy_and_clear()
static void* _TLS_Copy_and_clear |
( |
void * |
tls_area | ) |
|
|
inlinestatic |
Copies TLS size bytes from the address tls_area and returns a pointer to the start of the area after clearing it.
- Parameters
-
tls_area | The starting address of the area to clear. |
- Returns
- The pointer to the beginning of the cleared section.
Definition at line 167 of file tls.h.
◆ _TLS_Get_allocation_size()
uintptr_t _TLS_Get_allocation_size |
( |
void |
| ) |
|
Return the TLS area allocation size.
- Returns
- The TLS area allocation size.
Definition at line 38 of file tlsallocsize.c.
◆ _TLS_Get_size()
static uintptr_t _TLS_Get_size |
( |
void |
| ) |
|
|
inlinestatic |
Gets the TLS size.
- Returns
- The TLS size.
Definition at line 108 of file tls.h.
◆ _TLS_Get_thread_control_block_area_size()
static uintptr_t _TLS_Get_thread_control_block_area_size |
( |
uintptr_t |
alignment | ) |
|
|
inlinestatic |
Returns the size of the thread control block area size for this alignment, or the minimum size if alignment is too small.
- Parameters
-
alignment | The alignment for the operation. |
- Returns
- The size of the thread control block area.
Definition at line 144 of file tls.h.
◆ _TLS_Heap_align_up()
static uintptr_t _TLS_Heap_align_up |
( |
uintptr_t |
val | ) |
|
|
inlinestatic |
Returns the value aligned up to the heap alignment.
- Parameters
-
- Returns
- The value aligned to the heap alignment.
Definition at line 129 of file tls.h.
◆ _TLS_Initialize()
Initializes the dynamic thread vector.
- Parameters
-
| tls_block | The tls block for dtv. |
| tcb | The thread control block for dtv. |
[out] | dtv | The dynamic thread vector to initialize. |
- Returns
- Pointer to an area that was copied and cleared from tls_block onwards (
- See also
- _TLS_Copy_and_clear).
Definition at line 196 of file tls.h.
◆ _TLS_TCB_after_TLS_block_initialize()
static void* _TLS_TCB_after_TLS_block_initialize |
( |
void * |
tls_area | ) |
|
|
inlinestatic |
Initializes a dynamic thread vector with the area after a given starting address as thread control block.
Use Variant II
- Parameters
-
tls_area | The tls area for the initialization. |
- Returns
- Pointer to an area that was copied and cleared from tls_block onwards (
- See also
- _TLS_Copy_and_clear).
Definition at line 272 of file tls.h.
◆ _TLS_TCB_at_area_begin_initialize()
static void* _TLS_TCB_at_area_begin_initialize |
( |
void * |
tls_area | ) |
|
|
inlinestatic |
Initializes a dynamic thread vector beginning at the given starting address.
Use Variant I, TLS offsets emitted by linker takes the TCB into account.
- Parameters
-
tls_area | The tls area for the initialization. |
- Returns
- Pointer to an area that was copied and cleared from tls_block onwards (
- See also
- _TLS_Copy_and_clear).
Definition at line 225 of file tls.h.
◆ _TLS_TCB_before_TLS_block_initialize()
static void* _TLS_TCB_before_TLS_block_initialize |
( |
void * |
tls_area | ) |
|
|
inlinestatic |
Initializes a dynamic thread vector with the area before a given starting address as thread control block.
Use Variant I, TLS offsets emitted by linker neglects the TCB.
- Parameters
-
tls_area | The tls area for the initialization. |
- Returns
- Pointer to an area that was copied and cleared from tls_block onwards (
- See also
- _TLS_Copy_and_clear).
Definition at line 248 of file tls.h.
◆ _TLS_Alignment
The TLS section alignment.
This symbol is provided by the linker command file as the maximum alignment of the .tdata and .tbss sections. The linker ensures that the first TLS output section is aligned to the maximum alignment of all TLS output sections, see function _bfd_elf_tls_setup() in bfd/elflink.c of the GNU Binutils sources. The linker command file must take into account the case that the .tdata section is empty and the .tbss section is non-empty.