From 557fab43bd3cf75f87ba7efb65c9f4884e261a6c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 23 Feb 2002 08:47:54 +0000 Subject: Update. 2002-02-23 Ulrich Drepper * csu/set-init.c: Moved to... * sysdeps/mach/hurd/set-init.c: ...here. New file. * csu/Makefile: Don't compile set-init. * sysdeps/mach/hurd/Makefile: Compile set-init for subdir csu. * sysdeps/mach/hurd/i386/init-first.c: Call __init_misc in addition to __libc_init. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/mach/hurd/powerpc/init-first.c: Likewise. * sysdeps/unix/sysv/linux/init-first.c: Call __init_misc instead of __libc_init. * misc/init-misc.c: Always export __init_misc. Don't define hooks for __libc_subinit. --- linuxthreads/sysdeps/i386/tls.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'linuxthreads/sysdeps') diff --git a/linuxthreads/sysdeps/i386/tls.h b/linuxthreads/sysdeps/i386/tls.h index 8e1d4698b0..d1975b2017 100644 --- a/linuxthreads/sysdeps/i386/tls.h +++ b/linuxthreads/sysdeps/i386/tls.h @@ -32,15 +32,13 @@ typedef union dtv typedef struct { - void *tcb; + void *tcb; /* Pointer to the TCB. Not necessary the + thread descriptor used by libpthread. */ dtv_t *dtv; + void *self; /* Pointer to the thread descriptor. */ } tcbhead_t; -/* Get the thread descriptor definition. */ -#include - - /* We can support TLS only if the floating-stack support is available. */ #if defined FLOATING_STACKS && defined HAVE_TLS_SUPPORT @@ -50,6 +48,10 @@ typedef struct /* Signal that TLS support is available. */ # define USE_TLS 1 + +/* Get the thread descriptor definition. */ +# include + /* This is the size of the initial TCB. */ # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) @@ -77,6 +79,10 @@ typedef struct ({ struct _pthread_descr_struct *__descr; \ THREAD_SETMEM (__descr, p_header.data.dtvp, dtv); }) +/* Return dtv of given thread descriptor. */ +# define GET_DTV(descr) \ + (((tcbhead_t *) descr)->dtv) + /* Code to initially initialize the thread pointer. This might need special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ @@ -89,6 +95,8 @@ typedef struct tcbhead_t *head = _descr; \ \ head->tcb = _descr; \ + /* For now the thread descriptor isat the same address. */ \ + head->self = _descr; \ \ asm ("pushl %%ebx\n\t" \ "movl $1, %%ebx\n\t" \ -- cgit v1.2.3