Fix missing compiler barrier in AO_nop_full for uniprocessor ARM
authorIvan Maidanski <ivmai@mail.ru>
Sun, 6 Jan 2013 18:04:48 +0000 (22:04 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 7 Jan 2013 07:36:05 +0000 (11:36 +0400)
* src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_nop_full): Insert
AO_compiler_barrier for AO_UNIPROCESSOR case.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_nop_full): Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h (AO_nop_full): Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h (AO_nop_full): Refine comment.

src/atomic_ops/sysdeps/armcc/arm_v6.h
src/atomic_ops/sysdeps/gcc/arm.h
src/atomic_ops/sysdeps/msftc/arm.h

index 4c965b1..7c3f6e5 100644 (file)
@@ -50,6 +50,8 @@ AO_nop_full(void)
     __asm {
             mcr p15,0,dest,c7,c10,5
             };
+# else
+    AO_compiler_barrier();
 # endif
 }
 #define AO_HAVE_nop_full
index 37bc811..ab0b42f 100644 (file)
@@ -97,6 +97,8 @@ AO_nop_full(void)
       : "=&r"(dest)
       : /* empty */
       : AO_THUMB_SWITCH_CLOBBERS "memory");
+# else
+    AO_compiler_barrier();
 # endif
 }
 #define AO_HAVE_nop_full
index 68727cc..5a96ee7 100644 (file)
 #if _M_ARM >= 6
 /* ARMv6 is the first architecture providing support for simple LL/SC.  */
 
-/* If only a single processor is used, we can define AO_UNIPROCESSOR    */
-/* and do not need to access CP15 for ensuring a DMB at all.            */
+/* If only a single processor is used, we can define AO_UNIPROCESSOR.   */
 #ifdef AO_UNIPROCESSOR
-  AO_INLINE void AO_nop_full(void) {}
+  AO_INLINE void AO_nop_full(void)
+  {
+    AO_compiler_barrier();
+  }
 # define AO_HAVE_nop_full
 #else
 /* AO_nop_full() is emulated using AO_test_and_set_full().              */