summary refs log tree commit diff
path: root/linuxthreads/sysdeps/i386/tls.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-02-23 08:47:54 +0000
committerUlrich Drepper <drepper@redhat.com>2002-02-23 08:47:54 +0000
commit557fab43bd3cf75f87ba7efb65c9f4884e261a6c (patch)
treea45a8e10024f1cd566da25113e7dc2f45b8bd9e3 /linuxthreads/sysdeps/i386/tls.h
parente413826144bcd0a910e8a6f942ec34a368f65613 (diff)
downloadglibc-557fab43bd3cf75f87ba7efb65c9f4884e261a6c.tar.gz
glibc-557fab43bd3cf75f87ba7efb65c9f4884e261a6c.tar.xz
glibc-557fab43bd3cf75f87ba7efb65c9f4884e261a6c.zip
Update.
2002-02-23  Ulrich Drepper  <drepper@redhat.com>

	* 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.
Diffstat (limited to 'linuxthreads/sysdeps/i386/tls.h')
-rw-r--r--linuxthreads/sysdeps/i386/tls.h18
1 files changed, 13 insertions, 5 deletions
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 <linuxthreads/descr.h>
-
-
 /* 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 <linuxthreads/descr.h>
+
 /* 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"						      \