X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=include%2Furcu%2Farch.h;h=d3914da27d41e9caf5158b2351ccc78b4b4b8ee8;hb=5ee141704eaf9f77795fd573873d4bea5f136c71;hp=c4b8bc2307028a70fe62174b00d6b30fcecb6136;hpb=c966839e39761d1dcf9fc17450630fdb317ec156;p=urcu.git diff --git a/include/urcu/arch.h b/include/urcu/arch.h index c4b8bc2..d3914da 100644 --- a/include/urcu/arch.h +++ b/include/urcu/arch.h @@ -41,6 +41,7 @@ * URCU_ARCH_ALPHA : All DEC Alpha variants * URCU_ARCH_IA64 : All Intel Itanium variants * URCU_ARCH_ARM : All ARM 32 bits variants + * URCU_ARCH_ARMV7 : All ARMv7 ISA variants * URCU_ARCH_AARCH64 : All ARM 64 bits variants * URCU_ARCH_MIPS : All MIPS variants * URCU_ARCH_NIOS2 : All Intel / Altera NIOS II variants @@ -63,15 +64,25 @@ #define URCU_ARCH_AMD64 1 #include -#elif (defined(__i486__) || defined(__i586__) || defined(__i686__)) - -#define URCU_ARCH_X86 1 -#include - #elif (defined(__i386__) || defined(__i386)) #define URCU_ARCH_X86 1 + +/* + * URCU_ARCH_X86_NO_CAS enables a compat layer that will detect the presence of + * the cmpxchg instructions at runtime and provide a compat mode based on a + * pthread mutex when it isn't. + * + * __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 was introduced in GCC 4.3 and Clang 3.3, + * building with older compilers will result in the compat layer always being + * used on x86-32. + */ +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define URCU_ARCH_X86_NO_CAS 1 +/* For backwards compat */ #define URCU_ARCH_I386 1 +#endif + #include #elif (defined(__powerpc64__) || defined(__ppc64__)) @@ -105,6 +116,12 @@ #define URCU_ARCH_IA64 1 #include +#elif (defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__)) + +#define URCU_ARCH_ARMV7 1 +#define URCU_ARCH_ARM 1 +#include + #elif (defined(__arm__) || defined(__arm)) #define URCU_ARCH_ARM 1