aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2014-08-29 00:05:40 +0400
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-09-02 12:48:56 +0400
commit8e1bf298be449b8f91f25b96870732c433f4ddc0 (patch)
tree3e47682672062bd34754d80e781aba86a12c9c37
parent17581b102a6be77b1cd17400b32c2ec8f4186fc4 (diff)
arm: do not use dmb for armv5
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>
-rw-r--r--platform/linux-generic/include/api/odp_sync.h9
1 files changed, 8 insertions, 1 deletions
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__