From feb9f08cfe8ddd1fd4fb62265e17ee35147ab268 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 20 Mar 2016 17:58:35 +0100 Subject: arm: simplify handling of Thumb related options Currently, the Thumb support on ARM has three related Config.in options, which are not trivial for users to understand, and are in fact not needed: - The USE_BX option is not needed: knowing whether BX is available or not is easy. If you have an ARM > v4 or ARMv4T, then BX is available, otherwise it's not. This is the logic used in glibc. - The USE_LDREXSTREX option is not needed: whenever Thumb2 is available, ldrex/strex are available, so we can simply rely on __thumb2__ to determine whether ldrex/strex should be used, without requiring a Config.in option. - Once USE_BX and USE_LDREXSTREX are removed, the only thing left that COMPILE_IN_THUMB does is to set -mthumb. This makes the option unnecessary, as on ARM at least, the user is already supposed to pass -march= or other compiler options tuning the library for a specific ARM variant. There is no reason to do otherwise for Thumb, which allows to get rid of the COMPILE_IN_THUMB option. Signed-off-by: Thomas Petazzoni --- libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libpthread') diff --git a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h index 2b877f980..fc17e9bc7 100644 --- a/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h +++ b/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h @@ -28,8 +28,7 @@ # define PT_EI __extern_always_inline #endif -#if defined(__thumb__) -#if defined(__USE_LDREXSTREX__) +#if defined(__thumb2__) PT_EI long int ldrex(int *spinlock) { long int ret; @@ -63,7 +62,7 @@ testandset (int *spinlock) return ret; } -#else /* __USE_LDREXSTREX__ */ +#elif defined(__thumb__) /* This will not work on ARM1 or ARM2 because SWP is lacking on those machines. Unfortunately we have no way to detect this at compile @@ -88,7 +87,7 @@ PT_EI long int testandset (int *spinlock) : "0"(1), "r"(spinlock)); return ret; } -#endif + #else /* __thumb__ */ PT_EI long int testandset (int *spinlock); -- cgit v1.2.3