From d4f64e1ad7d7836fbd9b01f9c5d410db930c38ce Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 10 Mar 2003 08:50:36 +0000 Subject: 2003-03-10 Roland McGrath * allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]: Instead of setting PD->multiple_threads, set globals __pthread_multiple_threads and __libc_multiple_threads. * sysdeps/pthread/createthread.c (create_thread): Likewise. * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it. * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise. * descr.h (struct pthread): Conditionalize first member on [!TLS_DTV_AT_TP]. Replace the `header' member with an anonymous union containing an anonymous tcbhead_t. Move `list' member out. [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member. * allocatestack.c: Remove use of `header.data.' prefix. * pthread_create.c: Likewise. * init.c (__pthread_initialize_minimal_internal): Likewise. * sysdeps/pthread/createthread.c (create_thread): Likewise. * sysdeps/i386/tls.h (INSTALL_DTV): Add parens. (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix. * sysdeps/x86_64/tls.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P): Likewise. * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member. * sysdeps/s390/tls.h (tcbhead_t): Likewise. --- nptl/descr.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'nptl/descr.h') diff --git a/nptl/descr.h b/nptl/descr.h index f189a6ed7b..cbaa38fc3c 100644 --- a/nptl/descr.h +++ b/nptl/descr.h @@ -31,6 +31,7 @@ #include #include #include "../nptl_db/thread_db.h" +#include #ifndef TCB_ALIGNMENT @@ -56,25 +57,19 @@ /* Thread descriptor data structure. */ struct pthread { - /* XXX Remove this union for IA-64 style TLS module */ +#if !TLS_DTV_AT_TP + /* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */ union { - /* It is very important to always append new elements. The offsets - of some of the elements of the struct are used in assembler code. */ - struct - { - void *tcb; /* Pointer to the TCB. This is not always - the address of this thread descriptor. */ - union dtv *dtvp; - struct pthread *self; /* Pointer to this structure */ - int multiple_threads; -#ifdef NEED_DL_SYSINFO - uintptr_t sysinfo; -#endif - list_t list; - } data; + tcbhead_t; void *__padding[16]; - } header; + }; +#elif TLS_MULTIPLE_THREADS_IN_TCB + int multiple_threads; +#endif + + /* This descriptor's link on the `stack_used' or `__stack_user' list. */ + list_t list; /* Thread ID - which is also a 'is this thread descriptor (and therefore stack) used' flag. */ -- cgit v1.2.3