37#ifndef _RTEMS_SCORE_TLS_H
38#define _RTEMS_SCORE_TLS_H
40#include <rtems/score/cpuimpl.h>
113 uint32_t generation_number;
119#if defined(__i386__) || defined(__x86_64__)
127#if CPU_SIZEOF_POINTER == 4 || defined(AARCH64_MULTILIB_ARCH_V8)
145static inline uintptr_t _TLS_Get_thread_control_block_area_size(
149#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
152 alignment = (uintptr_t)
config->alignment;
176static inline void _TLS_Copy_and_clear(
186 (uintptr_t)
config->bss_begin - (uintptr_t)
config->data_begin,
188 (uintptr_t)
config->bss_size
201static inline void _TLS_Initialize_TCB_and_DTV(
207#if defined(__i386__) || defined(__x86_64__)
212 dtv->generation_number = 1;
226static inline void *_TLS_Initialize_area(
void *tls_area )
234#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
237#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 20
239 uintptr_t alignment_2;
243 alignment = (uintptr_t)
config->alignment;
245#
if defined(__i386__) || defined(__x86_64__)
249 tls_area = (
char *) tls_area +
sizeof( *dtv );
252#if CPU_THREAD_LOCAL_STORAGE_VARIANT == 10
254 RTEMS_ALIGN_UP( (uintptr_t) tls_area +
sizeof( *tcb ), alignment );
257#elif CPU_THREAD_LOCAL_STORAGE_VARIANT == 11
263#elif CPU_THREAD_LOCAL_STORAGE_VARIANT == 20
265 tls_area = (
void *)
RTEMS_ALIGN_UP( (uintptr_t) tls_area, alignment_2 );
266 size = (uintptr_t)
config->size;
272#error "unexpected CPU_THREAD_LOCAL_STORAGE_VARIANT value"
275 _TLS_Initialize_TCB_and_DTV(
tls_data, tcb, dtv );
#define RTEMS_ALIGN_UP(_value, _alignment)
Aligns up the value to the alignment.
Definition: basedefs.h:141
const volatile TLS_Configuration _TLS_Configuration
Provides the TLS configuration.
Definition: tlsallocsize.c:67
uintptr_t _TLS_Get_allocation_size(void)
Gets the allocation size of the thread-local storage area in bytes.
Definition: tlsallocsize.c:78
Represents the TLS configuration.
Definition: tls.h:65
const char * size
This member is initialized to _TLS_Size.
Definition: tls.h:89
const char * alignment
This member is initialized to _TLS_Alignment.
Definition: tls.h:94
const char * data_begin
This member is initialized to _TLS_Data_begin.
Definition: tls.h:69
const char * bss_size
This member is initialized to _TLS_BSS_size.
Definition: tls.h:84
const char * bss_begin
This member is initialized to _TLS_BSS_begin.
Definition: tls.h:79
const char * data_size
This member is initialized to _TLS_Data_size.
Definition: tls.h:74
Definition: deflate.c:114
Definition: rtl-mdreloc-aarch64.c:86