aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/spec/init.h
diff options
context:
space:
mode:
authorGary S. Robertson <gary.robertson@linaro.org>2016-03-31 08:08:13 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-04-21 18:54:41 +0300
commit76c3bd1dcc229fee95e54f04ab4e68a7eb0be6a5 (patch)
tree7dc3659865ae74ce0f36f0cfafe2e94fed5141c4 /include/odp/api/spec/init.h
parentf3a45df31cbe6821499c054c2c66fea16a54014f (diff)
api: init: add control/worker cpumasks to init data
Adds pointers to externally supplied cpumasks for control and worker CPUs to the ODP global init data which is passed as an argument to odp_init_global. The intent is to allow an external entity to pass in lists of the CPU resources available to the current ODP application. It is assumed that these pointers would be NULL unless explicitly populated prior to calling odp_init_global. odp_init_global would respond to NULL pointers here by ensuring that odp_cpumask_default_control and odp_cpumask_default_worker would return the platform-specific default CPU configurations. If these pointers were not NULL when odp_init_global was called, then the above functions would return cpumasks reflecting the (possibly amended) contents of the referenced cpumasks instead of the platform defaults. Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/spec/init.h')
-rw-r--r--include/odp/api/spec/init.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h
index 47ebd5475..8560663da 100644
--- a/include/odp/api/spec/init.h
+++ b/include/odp/api/spec/init.h
@@ -31,6 +31,7 @@ extern "C" {
#include <odp/api/std_types.h>
#include <odp/api/hints.h>
#include <odp/api/thread.h>
+#include <odp/api/cpumask.h>
/** @defgroup odp_initialization ODP INITIALIZATION
* Initialisation operations.
@@ -123,6 +124,32 @@ typedef struct odp_init_t {
Valid range is from 0 to platform specific maximum. Set both
num_worker and num_control to zero for default number of threads. */
int num_control;
+ /** Pointer to bit mask mapping CPUs available to this ODP instance
+ for running worker threads.
+ Initialize to a NULL pointer to use default CPU mapping.
+ When the mask is defined, odp_cpumask_default_worker()
+ uses it instead of returning a default mask.
+ Applications code should not access this cpumask directly.
+ Valid range of CPUs and optimal CPU selection
+ are platform specific, but generally it is recommended that:
+ * worker CPUs are dedicated to run only ODP worker threads
+ (one thread per CPU)
+ * worker and control masks do not overlap
+ * different ODP instances do not specify overlapping
+ worker masks
+ */
+ const odp_cpumask_t *worker_cpus;
+ /** Pointer to bit mask mapping CPUs available to this ODP instance
+ for running control threads.
+ Initialize to a NULL pointer to use default CPU mapping.
+ When the mask is defined, odp_cpumask_default_control()
+ uses it instead of returning a default mask.
+ Applications code should not access this cpumask directly.
+ Valid range of CPUs and optimal CPU selection
+ are platform specific, but generally it is recommended that
+ worker and control masks do not overlap.
+ */
+ const odp_cpumask_t *control_cpus;
/** Replacement for the default log fn */
odp_log_func_t log_fn;
/** Replacement for the default abort fn */