about summary refs log tree commit diff
path: root/nptl/descr.h
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/descr.h')
-rw-r--r--nptl/descr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/nptl/descr.h b/nptl/descr.h
index d423a53bbf..3de9535449 100644
--- a/nptl/descr.h
+++ b/nptl/descr.h
@@ -416,5 +416,11 @@ struct pthread
   (sizeof (struct pthread) - offsetof (struct pthread, end_padding))
 } __attribute ((aligned (TCB_ALIGNMENT)));
 
+/* This yields the pointer that TLS support code calls the thread pointer.  */
+#if TLS_TCB_AT_TP
+# define TLS_TPADJ(pd) (pd)
+#elif TLS_DTV_AT_TP
+# define TLS_TPADJ(pd) ((struct pthread *)((char *) (pd) + TLS_PRE_TCB_SIZE))
+#endif
 
 #endif	/* descr.h */