diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-04-25 22:28:13 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-04-25 22:28:13 +0000 |
commit | 468777e1d0dbd6cb8bcaee244a954824d5c84167 (patch) | |
tree | aabd8c6a9e825ebaed65f3f6ddf7efb07f2e2109 /linuxthreads | |
parent | f24dca48290e4a1c731fc0bee94bc9a1f891b3fa (diff) | |
download | glibc-468777e1d0dbd6cb8bcaee244a954824d5c84167.zip glibc-468777e1d0dbd6cb8bcaee244a954824d5c84167.tar.gz glibc-468777e1d0dbd6cb8bcaee244a954824d5c84167.tar.bz2 |
Update.
* pthread.c (__pthread_initialize_manager): Subtract
TLS_PRE_TCB_SIZE bytes from tcbp to get to descr.
* manager.c (pthread_handle_create): Subtract or add TLS_PRE_TCB_SIZE
instead of sizeof (pthread_descr).
(pthread_free): Add TLS_PRE_TCB_SIZE instead of sizeof (pthread_descr).
* sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define to 0.
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 29 | ||||
-rw-r--r-- | linuxthreads/manager.c | 2 | ||||
-rw-r--r-- | linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym | 9 | ||||
-rw-r--r-- | linuxthreads/sysdeps/powerpc/tcb-offsets.sym | 24 | ||||
-rw-r--r-- | linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 2 |
5 files changed, 32 insertions, 34 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index b8cd228..061f0ad 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,16 +1,11 @@ 2003-04-22 Jakub Jelinek <jakub@redhat.com> - * descr.h (p_multiple_threads): Define as function-like macro. - (struct _pthread_descr_struct) [TLS_MULTIPLE_THREADS_IN_TCB]: - Move multiple_threads to last int in the structure. - * pthread.c (__pthread_initialize_manager): Use p_multiple_threads - macro. Subtract TLS_PRE_TCB_SIZE bytes from tcbp to get to descr. - * manager.c (pthread_handle_create): Use p_multiple_threads macro. - Subtract or add TLS_PRE_TCB_SIZE instead of sizeof (pthread_descr). - (pthread_free): Add TLS_PRE_TCB_SIZE instead of - sizeof (pthread_descr). - * sysdeps/powerpc/tls.h: Don't include tcb-offsets.h. - (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define to 0. + * pthread.c (__pthread_initialize_manager): Subtract + TLS_PRE_TCB_SIZE bytes from tcbp to get to descr. + * manager.c (pthread_handle_create): Subtract or add TLS_PRE_TCB_SIZE + instead of sizeof (pthread_descr). + (pthread_free): Add TLS_PRE_TCB_SIZE instead of sizeof (pthread_descr). + * sysdeps/powerpc/tls.h (TLS_INIT_TCB_SIZE, TLS_TCB_SIZE): Define to 0. (TLS_INIT_TCB_ALIGN, TLS_TCB_ALIGN): Define to alignment of pthread_descr. (TLS_PRE_TCB_SIZE): Increase to cover tcbhead_t preceeded by pad @@ -20,18 +15,6 @@ (TLS_INIT_TP, THREAD_SELF, INIT_THREAD_SELF): Don't add TLS_TCB_SIZE unneccessarily. (NO_TLS_OFFSET): Define. - * sysdeps/powerpc/powerpc32/tcb-offsets.sym: New file. - * sysdeps/powerpc/tcb-offsets.sym: Removed. - * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Include - tcb-offsets.h if __ASSEMBLER__. - (SINGLE_THREAD_P): Use p_multiple_threads macro. - * sysdeps/ia64/tcb-offsets.sym (MULTIPLE_THREADS): Define to - -sizeof(int). - * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (SINGLE_THREAD_P): - Use p_multiple_threads macro. - * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P): - Likewise. - * sysdeps/sh/tcb-offsets.sym (MULTIPLE_THREADS): Likewise. 2003-04-22 Roland McGrath <roland@redhat.com> diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index b4893c1..91620a2 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -643,7 +643,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr, new_thread->p_header.data.self = new_thread; #endif #if TLS_MULTIPLE_THREADS_IN_TCB || !defined USE_TLS || !TLS_DTV_AT_TP - p_multiple_threads (new_thread) = 1; + new_thread->p_multiple_threads = 1; #endif new_thread->p_tid = new_thread_id; new_thread->p_lock = &(__pthread_handles[sseg].h_lock); diff --git a/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym b/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym deleted file mode 100644 index 8c6bddb..0000000 --- a/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym +++ /dev/null @@ -1,9 +0,0 @@ -#include <sysdep.h> -#include <tls.h> - --- -#ifdef USE_TLS -MULTIPLE_THREADS_OFFSET ((void *) &p_multiple_threads ((pthread_descr) ((void *) 0 - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)) - (void *) 0) -#else -MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) -#endif diff --git a/linuxthreads/sysdeps/powerpc/tcb-offsets.sym b/linuxthreads/sysdeps/powerpc/tcb-offsets.sym new file mode 100644 index 0000000..bb4226f --- /dev/null +++ b/linuxthreads/sysdeps/powerpc/tcb-offsets.sym @@ -0,0 +1,24 @@ +#include <sysdep.h> +#include <tls.h> + +-- + +-- 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 diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h index 7982d27..af45b19 100644 --- a/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h +++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h @@ -101,7 +101,7 @@ __syscall_error_##args: \ # ifndef __ASSEMBLER__ # define SINGLE_THREAD_P \ - __builtin_expect (p_multiple_threads (THREAD_SELF) == 0, 1) + __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1) # else # define SINGLE_THREAD_P \ adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14 |