summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/system.h
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-07-26 20:44:26 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-07-26 20:44:26 +0200
commit6d9b37a3a80195d317887ff81aad6a58a66954b5 (patch)
tree98d1c96416b660070b1fd37dbbc0c80d39c55b98 /include/asm-arm/system.h
parent[PATCH] ARM SMP: Use exclusive load/store for __xchg (diff)
downloadlinux-6d9b37a3a80195d317887ff81aad6a58a66954b5.tar.xz
linux-6d9b37a3a80195d317887ff81aad6a58a66954b5.zip
[PATCH] ARM SMP: Add ARMv6 memory barriers
Convert explicit gcc asm-based memory barriers into smp_mb() calls. These change between barrier() and the ARMv6 data memory barrier instruction depending on whether ARMv6 SMP is enabled. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/system.h')
-rw-r--r--include/asm-arm/system.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 3f9c3626a73c..8efa4ebdcacb 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -139,7 +139,12 @@ extern unsigned int user_debug;
#define vectors_high() (0)
#endif
+#if __LINUX_ARM_ARCH__ >= 6
+#define mb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
+ : : "r" (0) : "memory")
+#else
#define mb() __asm__ __volatile__ ("" : : : "memory")
+#endif
#define rmb() mb()
#define wmb() mb()
#define read_barrier_depends() do { } while(0)