Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 20 Aug 2002 11:10:37 +0000 (11:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 20 Aug 2002 11:10:37 +0000 (11:10 +0000)
* include/unistd.h: Don't hide _exit.

ChangeLog
include/unistd.h
linuxthreads/ChangeLog
linuxthreads/sysdeps/i386/tls.h
linuxthreads/sysdeps/i386/useldt.h

index 6116116..402ba95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
 
+       * include/unistd.h: Don't hide _exit.
+
        * elf/rtld.c (_dl_start): Pass extra argument 1 to TLS_INIT_TP.
        (dl_main): Padd extra argument 0 to TLS_INIT_TP.
        * sysdeps/generic/libc-tls.c (__libc_setup_tls): Pass extra
index ec600af..289eb4b 100644 (file)
@@ -1,7 +1,10 @@
 #ifndef _UNISTD_H
 # include <posix/unistd.h>
 
-libc_hidden_proto (_exit)
+// XXX Normally we should be able to hide _exit.  But in the thread library
+// XXX we might need to overload this function so that all threads can be
+// XXX killed.
+// libc_hidden_proto (_exit)
 libc_hidden_proto (alarm)
 libc_hidden_proto (confstr)
 libc_hidden_proto (execl)
index 93a71d7..86848a6 100644 (file)
@@ -1,5 +1,11 @@
 2002-08-20  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/i386/tls.h: Use 32-bit operations when handling segment
+       registers.  No need to mask upper 16 bits in this case.
+       * sysdeps/i386/useldt.h: Likewise.
+       (DO_SET_THREAD_AREA): We have to load %gs again even if the value
+       is the same since the GDT content changed.
+
        * sysdeps/i386/tls.h (TLS_INIT_TP): Add new parameter and pass it on
        to TLS_SETUP_GS_SEGMENT.
        (TLS_SETUP_GS_SEGMENT): Add new parameter and pass it on to
index 098b11c..39b4b63 100644 (file)
@@ -123,8 +123,8 @@ typedef struct
   int result;                                                                \
   if (!firstcall)                                                            \
     ldt_entry.entry_number = ({ int _gs;                                     \
-                               asm ("movw %%gs, %w0" : "=q" (_gs));          \
-                               (_gs & 0xffff) >> 3; });                      \
+                               asm ("movl %%gs, %0" : "=q" (_gs));           \
+                               _gs >> 3; });                                 \
   asm volatile (TLS_LOAD_EBX                                                 \
                "int $0x80\n\t"                                               \
                TLS_LOAD_EBX                                                  \
@@ -164,7 +164,7 @@ typedef struct
     __gs = TLS_SETUP_GS_SEGMENT (_descr, firstcall);                         \
     if (__builtin_expect (__gs, 7) != -1)                                    \
       {                                                                              \
-       asm ("movw %w0, %%gs" : : "q" (__gs));                                \
+       asm ("movl %0, %%gs" : : "q" (__gs));                                 \
        __gs = 0;                                                             \
       }                                                                              \
     __gs;                                                                    \
index c028533..ff42853 100644 (file)
@@ -72,7 +72,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
       1, 0, 0, 0, 0, 1, 0 };                                                 \
   if (__modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0)                 \
     abort ();                                                                \
-  asm ("movw %w0, %%gs" : : "q" (nr * 8 + 7));                               \
+  asm ("movl %0, %%gs" : : "q" (nr * 8 + 7));                                \
 })
 
 /* When using the new set_thread_area call, we don't need to change %gs
@@ -83,11 +83,15 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
 ({                                                                           \
   int __gs;                                                                  \
   struct modify_ldt_ldt_s ldt_entry =                                        \
-    { ({ asm ("movw %%gs, %w0" : "=q" (__gs)); __gs >> 3; }),                \
+    { ({ asm ("movl %%gs, %0" : "=q" (__gs)); __gs >> 3; }),                 \
       (unsigned long int) descr, sizeof (struct _pthread_descr_struct),              \
       1, 0, 0, 0, 0, 1, 0 };                                                 \
-  __builtin_expect (INLINE_SYSCALL (set_thread_area, 1, &ldt_entry) == 0, 1)  \
-  ? __gs : -1;                                                               \
+  if (__builtin_expect (INLINE_SYSCALL (set_thread_area, 1, &ldt_entry) == 0, \
+                       1))                                                   \
+    asm ("movl %0, %%gs" :: "q" (__gs));                                     \
+  else                                                               \
+    __gs = -1;                                                               \
+  __gs;                                                                              \
 })
 
 #if defined __ASSUME_SET_THREAD_AREA_SYSCALL && defined HAVE_TLS_SUPPORT
@@ -113,7 +117,7 @@ extern int __have_no_set_thread_area;
 #define FREE_THREAD(descr, nr) \
 {                                                                            \
   int __gs;                                                                  \
-  __asm__ __volatile__ ("movw %%gs, %w0" : "=q" (__gs));                     \
+  __asm__ __volatile__ ("movl %%gs, %0" : "=q" (__gs));                              \
   if (__builtin_expect (__gs & 4, 0))                                        \
     {                                                                        \
       struct modify_ldt_ldt_s ldt_entry =                                    \