diff mbox series

[v3,1/4] api: feature: add odp feature bits

Message ID 1509998406-12706-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/4] api: feature: add odp feature bits | expand

Commit Message

Github ODP bot Nov. 6, 2017, 8 p.m. UTC
From: Bill Fischofer <bill.fischofer@linaro.org>


Add new odp_feature_t bits that permit other APIs/components to
refer to various ODP features.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 278 (muvarov:next2)
 ** https://github.com/Linaro/odp/pull/278
 ** Patch: https://github.com/Linaro/odp/pull/278.patch
 ** Base sha: f318c88f26b15140dda243e6a1d27e3c8f9d275b
 ** Merge commit sha: 7b1bdbd556cad7a42550ae18152f2f9281b6930e
 **/
 include/Makefile.am                              |  1 +
 include/odp/api/spec/feature.h                   | 69 ++++++++++++++++++++++++
 include/odp_api.h                                |  1 +
 platform/linux-generic/Makefile.am               |  1 +
 platform/linux-generic/include/odp/api/feature.h | 34 ++++++++++++
 5 files changed, 106 insertions(+)
 create mode 100644 include/odp/api/spec/feature.h
 create mode 100644 platform/linux-generic/include/odp/api/feature.h
diff mbox series

Patch

diff --git a/include/Makefile.am b/include/Makefile.am
index a3a7e1658..746b5975f 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -17,6 +17,7 @@  odpapispecinclude_HEADERS = \
 		  odp/api/spec/debug.h \
 		  odp/api/spec/errno.h \
 		  odp/api/spec/event.h \
+		  odp/api/spec/feature.h \
 		  odp/api/spec/hash.h \
 		  odp/api/spec/hints.h \
 		  odp/api/spec/init.h \
diff --git a/include/odp/api/spec/feature.h b/include/odp/api/spec/feature.h
new file mode 100644
index 000000000..0cfc141db
--- /dev/null
+++ b/include/odp/api/spec/feature.h
@@ -0,0 +1,69 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP features.
+ * Define various ODP feature sets that can be referenced by other
+ * components.
+ */
+
+#ifndef ODP_API_FEATURE_H_
+#define ODP_API_FEATURE_H_
+#include <odp/visibility_begin.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+
+/** @defgroup odp_features ODP_FEATURE
+ *  ODP feature definitions
+ *  @{
+ */
+
+/** Definition of ODP features */
+typedef union odp_feature_t {
+	/** All features */
+	uint32_t all_feat;
+
+	/** Individual feature bits */
+	struct {
+		/** Classifier APIs, e.g., odp_cls_xxx(), odp_cos_xxx() */
+		uint32_t cls:1;
+
+		/** Crypto APIs, e.g., odp_crypto_xxx() */
+		uint32_t crypto:1;
+
+		/** IPsec APIs, e.g., odp_ipsec_xxx() */
+		uint32_t ipsec:1;
+
+		/** Scheduler APIs, e.g., odp_schedule_xxx() */
+		uint32_t schedule:1;
+
+		/** Time APIs are, e.g., odp_time_xxx() */
+		uint32_t time:1;
+
+		/** Timer APIs, e.g., odp_timer_xxx(), odp_timeout_xxx()  */
+		uint32_t timer:1;
+
+		/** Traffic Manager APIs, e.g., odp_tm_xxx() */
+		uint32_t tm:1;
+	} feat;
+} odp_feature_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <odp/visibility_end.h>
+#endif
diff --git a/include/odp_api.h b/include/odp_api.h
index 060ec888b..3a03a05b8 100644
--- a/include/odp_api.h
+++ b/include/odp_api.h
@@ -32,6 +32,7 @@  extern "C" {
 #include <odp/api/barrier.h>
 #include <odp/api/spinlock.h>
 #include <odp/api/atomic.h>
+#include <odp/api/feature.h>
 #include <odp/api/init.h>
 #include <odp/api/system_info.h>
 #include <odp/api/thread.h>
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 0b29e613c..356f229bb 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -35,6 +35,7 @@  odpapiinclude_HEADERS = \
 		  include/odp/api/deprecated.h \
 		  include/odp/api/errno.h \
 		  include/odp/api/event.h \
+		  include/odp/api/feature.h \
 		  include/odp/api/hash.h \
 		  include/odp/api/hints.h \
 		  include/odp/api/init.h \
diff --git a/platform/linux-generic/include/odp/api/feature.h b/platform/linux-generic/include/odp/api/feature.h
new file mode 100644
index 000000000..55a86a831
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/feature.h
@@ -0,0 +1,34 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP features.
+ */
+
+#ifndef ODP_PLAT_FEATURE_H_
+#define ODP_PLAT_FEATURE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odp_feature
+ *  @{
+ */
+
+/**
+ * @}
+ */
+
+#include <odp/api/spec/feature.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif