summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/sysdeps/i386/useldt.h
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-05-18 18:41:24 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-05-18 18:41:24 +0200
commit6a8ccc95528f5e86a8770ed15ce89609b5b3dee9 (patch)
treebbd4df35b4d4a6a8b00d7a5e61fb2668b850ad62 /libpthread/linuxthreads/sysdeps/i386/useldt.h
parent398a27a5b323956344b4f831d892fed3bd9813c7 (diff)
remove linuxthreads.new, rename linuxthreads.old
Linuxthreads.new isn't really useful with the existence of NPTL/TLS for well supported architectures. There is no reason to use LT.new for ARM/MIPS or other architectures supporting NPTL/TLS. It is not available for noMMU architectures like Blackfin or FR-V. To simplify the live of the few uClibc-ng developers, LT.new is removed and LT.old is renamed to LT. LINUXTHREADS_OLD -> UCLIBC_HAS_LINUXTHREADS
Diffstat (limited to 'libpthread/linuxthreads/sysdeps/i386/useldt.h')
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/useldt.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/libpthread/linuxthreads/sysdeps/i386/useldt.h b/libpthread/linuxthreads/sysdeps/i386/useldt.h
index 067e5e242..02326729a 100644
--- a/libpthread/linuxthreads/sysdeps/i386/useldt.h
+++ b/libpthread/linuxthreads/sysdeps/i386/useldt.h
@@ -21,7 +21,6 @@
#ifndef __ASSEMBLER__
#include <stddef.h> /* For offsetof. */
#include <stdlib.h> /* For abort(). */
-#include <sysdep.h>
/* We don't want to include the kernel header. So duplicate the
@@ -76,7 +75,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
#ifdef __PIC__
# define USETLS_EBX_ARG "r"
-# define USETLS_LOAD_EBX "xchgl %1, %%ebx\n\t"
+# define USETLS_LOAD_EBX "xchgl %3, %%ebx\n\t"
#else
# define USETLS_EBX_ARG "b"
# define USETLS_LOAD_EBX
@@ -86,7 +85,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
because we inherited the value set up in the main thread by TLS setup.
We need to extract that value and set up the same segment in this
thread. */
-#ifdef __UCLIBC_HAS_TLS__
+#if USE_TLS
# define DO_SET_THREAD_AREA_REUSE(nr) 1
#else
/* Without TLS, we do the initialization of the main thread, where NR == 0. */
@@ -108,10 +107,8 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
"movl %2, %%eax\n\t" \
"int $0x80\n\t" \
USETLS_LOAD_EBX \
- : "=&a" (__result) \
- : USETLS_EBX_ARG (&ldt_entry), "i" (__NR_set_thread_area), \
- "m" (ldt_entry) \
- : "memory"); \
+ : "&a" (__result) \
+ : USETLS_EBX_ARG (&ldt_entry), "i" (__NR_set_thread_area)); \
if (__result == 0) \
__asm__ ("movw %w0, %%gs" :: "q" (__gs)); \
else \
@@ -128,10 +125,8 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
"movl %2, %%eax\n\t" \
"int $0x80\n\t" \
USETLS_LOAD_EBX \
- : "=&a" (__result) \
- : USETLS_EBX_ARG (&ldt_entry), "i" (__NR_set_thread_area), \
- "m" (ldt_entry) \
- : "memory"); \
+ : "&a" (__result) \
+ : USETLS_EBX_ARG (&ldt_entry), "i" (__NR_set_thread_area)); \
if (__result == 0) \
{ \
__gs = (ldt_entry.entry_number << 3) + 3; \
@@ -304,10 +299,8 @@ extern int __have_no_set_thread_area;
})
#endif
-#if __ASSUME_LDT_WORKS > 0
/* We want the OS to assign stack addresses. */
#define FLOATING_STACKS 1
/* Maximum size of the stack if the rlimit is unlimited. */
#define ARCH_STACK_MAX_SIZE 8*1024*1024
-#endif