diff options
| author | Elliott Hughes <enh@google.com> | 2013-12-13 23:42:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-12-13 23:42:21 +0000 |
| commit | 003be7104b5cb075632b0ff98d8ab4d3d182ed8c (patch) | |
| tree | 19284d085959218931f4fe5e3ea71e2f8e8d1ad3 /libc/private/bionic_atomic_arm.h | |
| parent | 8623bf7b4da802ee56618f575e92290499011df9 (diff) | |
| parent | c54ca40aef48009e7b0e5b2b3069aad62ffd3453 (diff) | |
Merge "Clean up some ARMv4/ARMv5 cruft."
Diffstat (limited to 'libc/private/bionic_atomic_arm.h')
| -rw-r--r-- | libc/private/bionic_atomic_arm.h | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/libc/private/bionic_atomic_arm.h b/libc/private/bionic_atomic_arm.h index 3bb639e0e5..e94129ca67 100644 --- a/libc/private/bionic_atomic_arm.h +++ b/libc/private/bionic_atomic_arm.h @@ -82,47 +82,21 @@ */ #if defined(ANDROID_SMP) && ANDROID_SMP == 1 -/* Sanity check, multi-core is only supported starting from ARMv6 */ -# if __ARM_ARCH__ < 6 -# error ANDROID_SMP should not be set to 1 for an ARM architecture less than 6 -# endif - -# ifdef __ARM_HAVE_DMB /* For ARMv7-A, we can use the 'dmb' instruction directly */ -__ATOMIC_INLINE__ void -__bionic_memory_barrier(void) -{ +__ATOMIC_INLINE__ void __bionic_memory_barrier(void) { /* Note: we always build in ARM or Thumb-2 on ARMv7-A, so don't * bother with __ATOMIC_SWITCH_TO_ARM */ __asm__ __volatile__ ( "dmb" : : : "memory" ); } -# else /* !__ARM_HAVE_DMB */ -/* Otherwise, i.e. for multi-core ARMv6, we need to use the coprocessor, - * which requires the use of a general-purpose register, which is slightly - * less efficient. - */ -__ATOMIC_INLINE__ void -__bionic_memory_barrier(void) -{ - __asm__ __volatile__ ( - __SWITCH_TO_ARM - "mcr p15, 0, %0, c7, c10, 5" - __SWITCH_TO_THUMB - : : "r" (0) : __ATOMIC_CLOBBERS "memory"); -} -# endif /* !__ARM_HAVE_DMB */ + #else /* !ANDROID_SMP */ -__ATOMIC_INLINE__ void -__bionic_memory_barrier(void) -{ + +__ATOMIC_INLINE__ void __bionic_memory_barrier(void) { /* A simple compiler barrier */ __asm__ __volatile__ ( "" : : : "memory" ); } -#endif /* !ANDROID_SMP */ -#ifndef __ARM_HAVE_LDREX_STREX -#error Only ARM devices which have LDREX / STREX are supported -#endif +#endif /* !ANDROID_SMP */ /* Compare-and-swap, without any explicit barriers. Note that this functions * returns 0 on success, and 1 on failure. The opposite convention is typically |
