aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2015-03-18 19:41:36 +0530
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-03-24 13:01:38 +0300
commit9393521fe37e39038e042fee1c048c772cc6c6e0 (patch)
tree81b4dc4586b07d8d51421b149497796d137889f4 /platform/linux-generic
parent6c6ffc477398632b6988659cb180022a1ef7c4b8 (diff)
barrier: allow platform to override odp_barrier_t
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Bala Manoharan<bala.manoharan@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r--platform/linux-generic/Makefile.am1
-rw-r--r--platform/linux-generic/include/odp/barrier.h1
-rw-r--r--platform/linux-generic/include/odp/plat/barrier_types.h47
3 files changed, 49 insertions, 0 deletions
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index cef7ecc8b..e5558acab 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -48,6 +48,7 @@ odpinclude_HEADERS = \
odpplatincludedir= $(includedir)/odp/plat
odpplatinclude_HEADERS = \
$(top_srcdir)/platform/linux-generic/include/odp/plat/atomic_types.h \
+ $(top_srcdir)/platform/linux-generic/include/odp/plat/barrier_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/buffer_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/byteorder_types.h \
$(top_srcdir)/platform/linux-generic/include/odp/plat/classification_types.h \
diff --git a/platform/linux-generic/include/odp/barrier.h b/platform/linux-generic/include/odp/barrier.h
index d63c219d8..7ea5a6b99 100644
--- a/platform/linux-generic/include/odp/barrier.h
+++ b/platform/linux-generic/include/odp/barrier.h
@@ -19,6 +19,7 @@ extern "C" {
#include <odp/atomic.h>
#include <odp/plat/shared_memory_types.h>
+#include <odp/plat/barrier_types.h>
/** @ingroup odp_synchronizers
* @{
diff --git a/platform/linux-generic/include/odp/plat/barrier_types.h b/platform/linux-generic/include/odp/plat/barrier_types.h
new file mode 100644
index 000000000..c8c978dca
--- /dev/null
+++ b/platform/linux-generic/include/odp/plat/barrier_types.h
@@ -0,0 +1,47 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP barrier
+ */
+
+#ifndef ODP_BARRIER_TYPES_H_
+#define ODP_BARRIER_TYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/std_types.h>
+#include <odp/atomic.h>
+
+/**
+ * @internal
+ * ODP thread synchronization barrier
+ */
+struct odp_barrier_s {
+ uint32_t count; /**< Thread count */
+ odp_atomic_u32_t bar; /**< Barrier counter */
+};
+
+/** @addtogroup odp_synchronizers
+ * @{
+ */
+
+typedef struct odp_barrier_s odp_barrier_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif