diff --git a/src/kernel/emulation/linux/machdep/tls.c b/src/kernel/emulation/linux/machdep/tls.c index 4b97ae713..d9b8156a4 100644 --- a/src/kernel/emulation/linux/machdep/tls.c +++ b/src/kernel/emulation/linux/machdep/tls.c @@ -37,7 +37,7 @@ void sys_thread_set_tsd_base(void* ptr, int unk) LINUX_SYSCALL(__NR_set_thread_area, &desc); entry_number = desc.entry_number; - __asm__ ("movl %0, %%gs" :: "r" (desc.entry_number*8 + 3)); + __asm__ ("movl %0, %%fs" :: "r" (desc.entry_number*8 + 3)); #endif } diff --git a/src/kernel/libsyscall/os/tsd.h b/src/kernel/libsyscall/os/tsd.h index f591b376d..b2a2c305b 100644 --- a/src/kernel/libsyscall/os/tsd.h +++ b/src/kernel/libsyscall/os/tsd.h @@ -66,7 +66,7 @@ _os_tsd_get_direct(unsigned long slot) { void *ret; #if defined(__i386__) - __asm__("mov %%gs:%1, %0" : "=r" (ret) : "m" (*(void **)(slot * sizeof(void *)))); + __asm__("mov %%fs:%1, %0" : "=r" (ret) : "m" (*(void **)(slot * sizeof(void *)))); #else __asm__("mov %%gs:%1, %0" : "=r" (ret) : "m" (*(void **)(slot * sizeof(void *)))); #endif @@ -78,9 +78,9 @@ static __inline__ int _os_tsd_set_direct(unsigned long slot, void *val) { #if defined(__i386__) && defined(__PIC__) - __asm__("movl %1, %%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "rn" (val)); + __asm__("movl %1, %%fs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "rn" (val)); #elif defined(__i386__) && !defined(__PIC__) - __asm__("movl %1, %%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "ri" (val)); + __asm__("movl %1, %%fs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "ri" (val)); #else __asm__("movq %1, %%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "rn" (val)); #endif