2003-03-01 Roland McGrath <roland@redhat.com>
authorroland <roland>
Sun, 2 Mar 2003 11:44:10 +0000 (11:44 +0000)
committerroland <roland>
Sun, 2 Mar 2003 11:44:10 +0000 (11:44 +0000)
* sysdeps/powerpc/tls.h [! USE_TLS && !__powerpc64__]: Define
tcbhead_t with multiple_threads member.
[USE_TLS] (tcbhead_t): Define minimal one-word version.
[USE_TLS && !__powerpc64__] (TLS_MULTIPLE_THREADS_IN_TCB): Define.
* sysdeps/powerpc/tcb-offsets.sym [USE_TLS]: Use tls.h macros to
derive thread register offset of p_multiple_threads member.

linuxthreads/sysdeps/powerpc/tcb-offsets.sym

index aee6be2..bb4226f 100644 (file)
@@ -1,4 +1,24 @@
 #include <sysdep.h>
 #include <tls.h>
 
 #include <sysdep.h>
 #include <tls.h>
 
-MULTIPLE_THREADS_OFFSET                offsetof (tcbhead_t, multiple_threads)
+--
+
+-- This could go into powerpc32/ instead and conditionalize #include of it.
+#ifndef __powerpc64__
+
+# ifdef USE_TLS
+
+-- 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->p_##mem - (void *) 0)
+
+# else
+
+#  define thread_offsetof(mem) offsetof (tcbhead_t, mem)
+
+# endif
+
+MULTIPLE_THREADS_OFFSET                thread_offsetof (multiple_threads)
+
+#endif