Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/arm/static_tls.h
Show All 32 Lines | |||||
#ifndef _LIBC_ARM_STATIC_TLS_H | #ifndef _LIBC_ARM_STATIC_TLS_H | ||||
#define _LIBC_ARM_STATIC_TLS_H | #define _LIBC_ARM_STATIC_TLS_H | ||||
static __inline uintptr_t | static __inline uintptr_t | ||||
_libc_get_static_tls_base(size_t offset) | _libc_get_static_tls_base(size_t offset) | ||||
{ | { | ||||
uintptr_t tlsbase; | uintptr_t tlsbase; | ||||
#ifdef ARM_TP_ADDRESS | |||||
tlsbase = *(uintptr_t *)ARM_TP_ADDRESS; | |||||
#else | |||||
__asm __volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (tlsbase)); | __asm __volatile("mrc p15, 0, %0, c13, c0, 3" : "=r" (tlsbase)); | ||||
#endif | |||||
tlsbase += offset; | tlsbase += offset; | ||||
return (tlsbase); | return (tlsbase); | ||||
} | } | ||||
#endif | #endif |