diff mbox

[RFC,15/17] Split out platform-specific part of odp_sync.h

Message ID 1398685276-4610-16-git-send-email-taras.kondratiuk@linaro.org
State RFC
Headers show

Commit Message

Taras Kondratiuk April 28, 2014, 11:41 a.m. UTC
---
 include/odp_sync.h                             |   28 ++-------------
 platform/linux-generic/include/plat/odp_sync.h |   43 ++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 26 deletions(-)
 create mode 100644 platform/linux-generic/include/plat/odp_sync.h
diff mbox

Patch

diff --git a/include/odp_sync.h b/include/odp_sync.h
index cf56faa..e085c3e 100644
--- a/include/odp_sync.h
+++ b/include/odp_sync.h
@@ -18,6 +18,7 @@ 
 extern "C" {
 #endif
 
+#include <plat/odp_sync.h>
 
 /**
  * Synchronise stores
@@ -25,35 +26,10 @@  extern "C" {
  * Ensures that all CPU store operations that precede the odp_sync_stores()
  * call are globally visible before any store operation that follows it.
  */
-static inline void odp_sync_stores(void)
-{
-#if defined __x86_64__ || defined __i386__
-
-	__asm__  __volatile__ ("sfence\n" : : : "memory");
-
-#elif defined __arm__
-
-	__asm__ __volatile__ ("dmb st" : : : "memory");
-
-#elif defined __OCTEON__
-
-	__asm__  __volatile__ ("syncws\n" : : : "memory");
-
-#else
-	__sync_synchronize();
-#endif
-}
-
+void odp_sync_stores(void);
 
 #ifdef __cplusplus
 }
 #endif
 
 #endif
-
-
-
-
-
-
-
diff --git a/platform/linux-generic/include/plat/odp_sync.h b/platform/linux-generic/include/plat/odp_sync.h
new file mode 100644
index 0000000..b551f08
--- /dev/null
+++ b/platform/linux-generic/include/plat/odp_sync.h
@@ -0,0 +1,43 @@ 
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP synchronisation
+ */
+
+#ifndef ODP_SYNC_H_
+#error This file should be included only into corresponding top level header
+#else
+
+/**
+ * Synchronise stores
+ *
+ * Ensures that all CPU store operations that precede the odp_sync_stores()
+ * call are globally visible before any store operation that follows it.
+ */
+static inline void odp_sync_stores(void)
+{
+#if defined __x86_64__ || defined __i386__
+
+	__asm__  __volatile__ ("sfence\n" : : : "memory");
+
+#elif defined __arm__
+
+	__asm__ __volatile__ ("dmb st" : : : "memory");
+
+#elif defined __OCTEON__
+
+	__asm__  __volatile__ ("syncws\n" : : : "memory");
+
+#else
+	__sync_synchronize();
+#endif
+}
+
+#endif