@@ -31,6 +31,7 @@ extern "C" {
#include <odp/std_types.h>
#include <odp/hints.h>
#include <odp/thread.h>
+#include <odp/cpumask.h>
/** @defgroup odp_initialization ODP INITIALIZATION
* Initialisation operations.
@@ -118,6 +119,40 @@ 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.
+ Valid range for mask is from 0 to platform specific maximum CPU.
+ Initialize to a NULL pointer to use default cpu mapping and
+ default isolation setup (or the lack of isolation) for
+ worker CPUs.
+ If worker CPUs are expected to provide isolated runtime
+ environments for worker threads, then the contents of this cpumask
+ should be unique for each ODP instance running concurrently
+ on the underlying platform, and should not contain any
+ control CPUs.
+ This cpumask is used only to convey externally supplied
+ information regarding worker CPU resources available to this
+ ODP instance during initialization. Applications code must call
+ odp_cpumask_default_worker() to obtain information as to the
+ CPU resources available for worker threads. */
+ odp_cpumask_t *worker_cpus;
+ /** Pointer to bit mask mapping CPUs available to this ODP instance
+ for running control threads.
+ Valid range for mask is from 0 to platform specific maximum CPU.
+ Initialize to a NULL pointer to use default cpu mapping for
+ control CPUs.
+ Control CPUs are expected to provide shared, non-isolated
+ runtime environments for control threads.
+ It must therefore be anticipated that this cpumask may be
+ identical for all ODP instances running concurrently
+ on the underlying platform and may specify CPU resources
+ to be shared among all concurrent ODP instances.
+ This cpumask is used only to convey externally supplied
+ information regarding control CPU resources available to this
+ ODP instance during initialization. Applications code must call
+ odp_cpumask_default_control() to obtain information as to the
+ CPU resources available for control threads. */
+ odp_cpumask_t *control_cpus;
/** Replacement for the default log fn */
odp_log_func_t log_fn;
/** Replacement for the default abort fn */
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> --- include/odp/api/init.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)