@@ -21,6 +21,7 @@ extern C {
#include <odp/drv/byteorder.h>
#include <odp/drv/compiler.h>
#include <odp/drv/std_types.h>
+#include <odp/drv/sync.h>
#ifdef __cplusplus
}
@@ -94,7 +94,8 @@ odpapiplatinclude_HEADERS = \
odpdrvincludedir = $(includedir)/odp/drv
odpdrvinclude_HEADERS = \
$(srcdir)/include/odp/drv/byteorder.h \
- $(srcdir)/include/odp/drv/compiler.h
+ $(srcdir)/include/odp/drv/compiler.h \
+ $(srcdir)/include/odp/drv/sync.h
odpdrvplatincludedir = $(includedir)/odp/drv/plat
odpdrvplatinclude_HEADERS = \
new file mode 100644
@@ -0,0 +1,49 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODPDRV synchronisation
+ */
+
+#ifndef ODPDRV_PLAT_SYNC_H_
+#define ODPDRV_PLAT_SYNC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odpdrv_barrier
+ * @{
+ */
+
+static inline void odpdrv_mb_release(void)
+{
+ __atomic_thread_fence(__ATOMIC_RELEASE);
+}
+
+static inline void odpdrv_mb_acquire(void)
+{
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+}
+
+static inline void odpdrv_mb_full(void)
+{
+ __atomic_thread_fence(__ATOMIC_SEQ_CST);
+}
+
+/**
+ * @}
+ */
+
+#include <odp/drv/spec/sync.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Based on API interface file. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- include/odp_drv.h | 1 + platform/linux-generic/Makefile.am | 3 +- platform/linux-generic/include/odp/drv/sync.h | 49 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/include/odp/drv/sync.h -- 2.7.4