diff mbox

[PATCHv2] arm: do not use dmb for armv5

Message ID 1409256340-12104-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 8e1bf298be449b8f91f25b96870732c433f4ddc0
Headers show

Commit Message

Maxim Uvarov Aug. 28, 2014, 8:05 p.m. UTC
Original bug:
https://bugs.linaro.org/show_bug.cgi?id=355
Armv5 fails on compilation dmb instuction.
Use the same thing like linux kernel does.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-and-Tested-by: Yao Zhao <yao.zhao@windriver.com>
---
 v2: add missing ;

 platform/linux-generic/include/api/odp_sync.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_sync.h b/platform/linux-generic/include/api/odp_sync.h
index 9cf4d46..fbf9abd 100644
--- a/platform/linux-generic/include/api/odp_sync.h
+++ b/platform/linux-generic/include/api/odp_sync.h
@@ -31,9 +31,16 @@  static inline void odp_sync_stores(void)
 
 	__asm__  __volatile__ ("sfence\n" : : : "memory");
 
-#elif defined __arm__ || defined __aarch64__
+#elif defined(__arm__)
+#if __ARM_ARCH == 6
+	__asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
+			: : "r" (0) : "memory");
+#elif __ARM_ARCH >= 7 || defined __aarch64__
 
 	__asm__ __volatile__ ("dmb st" : : : "memory");
+#else
+	__asm__ __volatile__ ("" : : : "memory");
+#endif
 
 #elif defined __OCTEON__