about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--linuxthreads/ChangeLog7
-rw-r--r--linuxthreads/manager.c4
-rw-r--r--linuxthreads/sysdeps/i386/i686/pt-machine.h2
-rw-r--r--linuxthreads/sysdeps/i386/useldt.h15
4 files changed, 17 insertions, 11 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 304b2fd18c..0934404371 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,10 @@
+2000-04-24  Ulrich Drepper  <drepper@redhat.com>
+
+	* manager.c (pthread_free): Use FREE_THREAD not FREE_THREAD_SELF.
+	* sysdeps/i386/useldt.h: Use "q" constraint instead of "r" where
+	necessary.
+	* sysdeps/i386/i686/pt-machine.h: Include "../useldt.h".
+
 2000-04-24  Mark Kettenis  <kettenis@gnu.org>
 
 	* join.c (pthread_exit): Set p_terminated after reporting the
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 5d7014ab72..33c791cdbb 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -510,8 +510,8 @@ static void pthread_free(pthread_descr th)
   handle->h_descr = NULL;
   handle->h_bottom = (char *)(-1L);
   __pthread_spin_unlock(&handle->h_lock);
-#ifdef FREE_THREAD_SELF
-  FREE_THREAD_SELF(th, th->p_nr);
+#ifdef FREE_THREAD
+  FREE_THREAD(th, th->p_nr);
 #endif
   /* One fewer threads in __pthread_handles */
   __pthread_handles_num--;
diff --git a/linuxthreads/sysdeps/i386/i686/pt-machine.h b/linuxthreads/sysdeps/i386/i686/pt-machine.h
index 8d9ea709bc..97fa7113e8 100644
--- a/linuxthreads/sysdeps/i386/i686/pt-machine.h
+++ b/linuxthreads/sysdeps/i386/i686/pt-machine.h
@@ -64,4 +64,4 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
 
 
 /* Use the LDT implementation only if the kernel is fixed.  */
-//#include "../useldt.h"
+#include "../useldt.h"
diff --git a/linuxthreads/sysdeps/i386/useldt.h b/linuxthreads/sysdeps/i386/useldt.h
index 1a789e2e0a..e6055e0128 100644
--- a/linuxthreads/sysdeps/i386/useldt.h
+++ b/linuxthreads/sysdeps/i386/useldt.h
@@ -1,6 +1,6 @@
 /* Special definitions for ix86 machine using segment register based
    thread descriptor.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>.
 
@@ -65,15 +65,14 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
     { nr, (unsigned long int) descr, sizeof (*descr), 1, 0, 0, 0, 0, 1, 0 };  \
   if (__modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0)		      \
     abort ();								      \
-  __asm__ __volatile__ ("movw %w0, %%gs" : : "r" (nr * 8 + 7));		      \
+  __asm__ __volatile__ ("movw %w0, %%gs" : : "q" (nr * 8 + 7));		      \
 }
 
 /* Free resources associated with thread descriptor.  */
-#define FREE_THREAD_SELF(descr, nr) \
+#define FREE_THREAD(descr, nr) \
 {									      \
   struct modify_ldt_ldt_s ldt_entry =					      \
     { nr, 0, 0, 0, 0, 1, 0, 1, 0, 0 };					      \
-  __asm__ __volatile__ ("movw %w0,%%gs" : : "r" (0));			      \
   __modify_ldt (1, &ldt_entry, sizeof (ldt_entry));			      \
 }
 
@@ -83,7 +82,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
   __typeof__ (descr->member) __value;					      \
   if (sizeof (__value) == 1)						      \
     __asm__ __volatile__ ("movb %%gs:%P2,%b0"				      \
-			  : "=r" (__value)				      \
+			  : "=q" (__value)				      \
 			  : "0" (0),					      \
 			    "i" (offsetof (struct _pthread_descr_struct,      \
 					   member)));			      \
@@ -107,7 +106,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
   __typeof__ (descr->member) __value;					      \
   if (sizeof (__value) == 1)						      \
     __asm__ __volatile__ ("movb %%gs:(%2),%b0"				      \
-			  : "=r" (__value)				      \
+			  : "=q" (__value)				      \
 			  : "0" (0),					      \
 			    "r" (offsetof (struct _pthread_descr_struct,      \
 					   member)));			      \
@@ -131,7 +130,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
   __typeof__ (descr->member) __value = (value);				      \
   if (sizeof (__value) == 1)						      \
     __asm__ __volatile__ ("movb %0,%%gs:%P1" :				      \
-			  : "r" (__value),				      \
+			  : "q" (__value),				      \
 			    "i" (offsetof (struct _pthread_descr_struct,      \
 					   member)));			      \
   else									      \
@@ -153,7 +152,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
   __typeof__ (descr->member) __value = (value);				      \
   if (sizeof (__value) == 1)						      \
     __asm__ __volatile__ ("movb %0,%%gs:(%1)" :				      \
-			  : "r" (__value),				      \
+			  : "q" (__value),				      \
 			    "r" (offsetof (struct _pthread_descr_struct,      \
 					   member)));			      \
   else									      \