diff options
author | Robbie King <robking@cisco.com> | 2015-01-14 23:48:25 +0100 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-01-16 17:33:14 +0300 |
commit | 5e47a0cf301367e47a3e1dfefbd6c5b4677916b8 (patch) | |
tree | cfadee3455af17f8d58fcccfd4a81cf0b7307a0b /helper | |
parent | 7af97975609758b93db24bcdbf5342a310c60335 (diff) |
helper: linux: add odph_linux_cpumask_default
A default cpumask based on number of requested CPUs and bounded by
number of CPUs in the system.
Signed-off-by: Robbie King <robking@cisco.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/include/odph_linux.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/helper/include/odph_linux.h b/helper/include/odph_linux.h index 26ff278..6458fde 100644 --- a/helper/include/odph_linux.h +++ b/helper/include/odph_linux.h @@ -22,6 +22,7 @@ extern "C" { #endif +#include <odp.h> #include <pthread.h> #include <sys/types.h> @@ -50,6 +51,16 @@ typedef struct { int status; /**< Process state change status */ } odph_linux_process_t; +/** + * Creates default pthread/process cpumask + * + * Creates cpumask based on starting count, actual value returned + * + * @param mask CPU mask to initialize + * @param num Number of threads to create, zero for all available + * @return Actual values of CPUs used to create mask + */ +int odph_linux_cpumask_default(odp_cpumask_t *mask, int num); /** * Creates and launches pthreads |