From 468777e1d0dbd6cb8bcaee244a954824d5c84167 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 25 Apr 2003 22:28:13 +0000 Subject: 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. --- .../sysdeps/powerpc/powerpc32/tcb-offsets.sym | 9 -------- linuxthreads/sysdeps/powerpc/tcb-offsets.sym | 24 ++++++++++++++++++++++ .../sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) delete mode 100644 linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym create mode 100644 linuxthreads/sysdeps/powerpc/tcb-offsets.sym (limited to 'linuxthreads/sysdeps') diff --git a/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym b/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym deleted file mode 100644 index 8c6bddb456..0000000000 --- a/linuxthreads/sysdeps/powerpc/powerpc32/tcb-offsets.sym +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - --- -#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 0000000000..bb4226fb3a --- /dev/null +++ b/linuxthreads/sysdeps/powerpc/tcb-offsets.sym @@ -0,0 +1,24 @@ +#include +#include + +-- + +-- 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 7982d272d8..af45b19356 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 -- cgit v1.2.3-70-g09d2