aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/powerpc/tcb-offsets.sym
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/powerpc/tcb-offsets.sym')
-rw-r--r--nptl/sysdeps/powerpc/tcb-offsets.sym11
1 files changed, 10 insertions, 1 deletions
diff --git a/nptl/sysdeps/powerpc/tcb-offsets.sym b/nptl/sysdeps/powerpc/tcb-offsets.sym
index 58ee030..d6b7560 100644
--- a/nptl/sysdeps/powerpc/tcb-offsets.sym
+++ b/nptl/sysdeps/powerpc/tcb-offsets.sym
@@ -1,4 +1,13 @@
#include <sysdep.h>
#include <tls.h>
-MULTIPLE_THREADS_OFFSET ((void *) &p_multiple_threads ((struct pthread) ((void *) 0 - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)) - (void *) 0)
+--
+
+-- Abuse tls.h macros to derive offsets relative to the thread register.
+# undef __thread_register
+# define __thread_register ((void *) 0)
+# define thread_offsetof(mem) ((void *) &THREAD_SELF->mem - (void *) 0)
+
+#if TLS_MULTIPLE_THREADS_IN_TCB
+MULTIPLE_THREADS_OFFSET thread_offsetof (header.multiple_threads)
+#endif