diff mbox series

[v3,2/4] api: init: add support for unused features

Message ID 1509998406-12706-3-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 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>

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/odp/api/spec/init.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 154cdf8f3..e8ec41136 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
  *