diff options
author | Alex Rønne Petersen <alexrp@xamarin.com> | 2013-07-15 18:48:13 +0400 |
---|---|---|
committer | Alex Rønne Petersen <alexrp@xamarin.com> | 2013-07-15 18:48:59 +0400 |
commit | 846d80f19e08053c7e1a10e290fac22edb186c0b (patch) | |
tree | 72214bedeb18313facdaec8d49604ff55d20d594 /libgc | |
parent | 8f99af4eecdc833890d349eb60456801086f1274 (diff) |
Avoid using dmb/dsb/dib instructions on ARM v6.
This only worked by accident before the HAVE_ARMV<N>
changes because __ARM_ARCH_6__ is never defined by
any compiler.
Diffstat (limited to 'libgc')
-rw-r--r-- | libgc/include/private/gc_locks.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgc/include/private/gc_locks.h b/libgc/include/private/gc_locks.h index 36ccb8764d0..5cd03552cb9 100644 --- a/libgc/include/private/gc_locks.h +++ b/libgc/include/private/gc_locks.h @@ -231,7 +231,7 @@ # define NACL_ALIGN() # endif inline static int GC_test_and_set(volatile unsigned int *addr) { -#if defined(__native_client__) || defined(HAVE_ARMV6) +#if defined(__native_client__) || defined(HAVE_ARMV7) int ret, tmp; __asm__ __volatile__ ( "1:\n" @@ -262,14 +262,14 @@ } # define GC_TEST_AND_SET_DEFINED inline static void GC_clear(volatile unsigned int *addr) { -#ifdef HAVE_ARMV6 /* Memory barrier */ #if defined(__native_client__) || defined(HAVE_ARMV7) /* NaCl requires ARMv7 CPUs. */ __asm__ __volatile__("dsb" : : : "memory"); -#else +#elif defined(HAVE_ARMV6) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); -#endif +#else + /* No barrier required on pre-v6. */ #endif *(addr) = 0; } |