Use 32-bit operations when handling segment registers.
authordrepper <drepper>
Tue, 20 Aug 2002 11:07:33 +0000 (11:07 +0000)
committerdrepper <drepper>
Tue, 20 Aug 2002 11:07:33 +0000 (11:07 +0000)
No need to mask upper 16 bits in this case.

linuxthreads/sysdeps/i386/tls.h

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;                                                                    \