diff mbox series

[API-NEXT,PATCHv4,2/5] api: init: add support for unused features

Message ID 20170612194205.8592-2-bill.fischofer@linaro.org
State Superseded
Headers show
Series [API-NEXT,PATCHv4,1/5] api: feature: add odp feature bits | expand

Commit Message

Bill Fischofer June 12, 2017, 7:42 p.m. UTC
Add the not_used field to odp_init_t to permit applications to
specify that they will not use various ODP features. This may
allow implementations to provide optimized behavior.

Also add the odp_init_param_init() API to initialize odp_init_t
to default values.

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

---
 include/odp/api/spec/init.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.11.0
diff mbox series

Patch

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f..e8ec4113 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -29,6 +29,7 @@  extern "C" {
 
 #include <odp/api/std_types.h>
 #include <odp/api/hints.h>
+#include <odp/api/feature.h>
 #include <odp/api/thread.h>
 #include <odp/api/cpumask.h>
 
@@ -153,9 +154,23 @@  typedef struct odp_init_t {
 	odp_log_func_t log_fn;
 	/** Replacement for the default abort fn */
 	odp_abort_func_t abort_fn;
+	/** Unused features. These are hints to the ODP implementation that
+	 * the application will not use any APIs associated with these
+	 * features. Implementations may use this information to provide
+	 * optimized behavior. Results are undefined if applications assert
+	 * that a feature will not be used and it is used anyway.
+	 */
+	odp_feature_t not_used;
 } odp_init_t;
 
 /**
+ * Initialize the odp_init_t to default values for all fields
+ *
+ * @param[out] param Address of the odp_init_t to be initialized
+ */
+void odp_init_param_init(odp_init_t *param);
+
+/**
  * @typedef odp_platform_init_t
  * ODP platform initialization data
  *