summaryrefslogtreecommitdiffstats
path: root/libc/private/bionic_tls.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/private/bionic_tls.h')
-rw-r--r--libc/private/bionic_tls.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index da34344..742ef8c 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -60,6 +60,13 @@ __BEGIN_DECLS
#define TLS_SLOT_OPENGL_API 3
#define TLS_SLOT_OPENGL 4
+/* this slot is only used to pass information from the dynamic linker to
+ * libc.so when the C library is loaded in to memory. The C runtime init
+ * function will then clear it. Since its use is extremely temporary,
+ * we reuse an existing location.
+ */
+#define TLS_SLOT_BIONIC_PREINIT (TLS_SLOT_ERRNO+1)
+
/* small technical note: it is not possible to call pthread_setspecific
* on keys that are <= TLS_SLOT_MAX_WELL_KNOWN, which is why it is set to
* TLS_SLOT_ERRNO.
@@ -80,8 +87,10 @@ extern void __init_tls(void** tls, void* thread_info);
extern int __set_tls(void *ptr);
/* get the TLS */
+/* Linux kernel helpers for its TLS implementation */
#ifdef __arm__
-# define __get_tls() ( *((volatile void **) 0xffff0ff0) )
+typedef void* (__kernel_get_tls_t)(void);
+#define __get_tls (*(__kernel_get_tls_t *)0xffff0fe0)
#else
extern void* __get_tls( void );
#endif