diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2015-07-09 16:46:20 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-07-23 19:21:51 +0300 |
commit | 270af813121dd3ba67ce3ed082b49489c3c2dd35 (patch) | |
tree | ab8509f296dcb87036f730b704f7ca49955980d3 /helper | |
parent | f97e134e3c599d03d56dd6a9820442374ef2f5a3 (diff) |
api: helper: deleted odph_linux_cpumask_default
The linux specific helper was replaced by default cpumask
calls (odp_cpumask_def_worker()) in the cpumask API.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Christophe Milard <christophe.milard@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Conflicts:
helper/linux.c
Diffstat (limited to 'helper')
-rw-r--r-- | helper/include/odp/helper/linux.h | 11 | ||||
-rw-r--r-- | helper/linux.c | 31 | ||||
-rw-r--r-- | helper/test/odp_process.c | 2 | ||||
-rw-r--r-- | helper/test/odp_thread.c | 2 |
4 files changed, 2 insertions, 44 deletions
diff --git a/helper/include/odp/helper/linux.h b/helper/include/odp/helper/linux.h index 44ee787a0..ce61fdf64 100644 --- a/helper/include/odp/helper/linux.h +++ b/helper/include/odp/helper/linux.h @@ -51,17 +51,6 @@ typedef struct { } 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 * * Creates, pins and launches threads to separate CPU's based on the cpumask. diff --git a/helper/linux.c b/helper/linux.c index a2eacc199..4256f4315 100644 --- a/helper/linux.c +++ b/helper/linux.c @@ -22,37 +22,6 @@ #include <odp/system_info.h> #include "odph_debug.h" -int odph_linux_cpumask_default(odp_cpumask_t *mask, int num) -{ - int ret, cpu, i; - cpu_set_t cpuset; - - ret = pthread_getaffinity_np(pthread_self(), - sizeof(cpu_set_t), &cpuset); - if (ret != 0) - ODPH_ABORT("failed to read CPU affinity value\n"); - - odp_cpumask_zero(mask); - - /* - * If no user supplied number or it's too large, then attempt - * to use all CPUs - */ - if (0 == num || CPU_SETSIZE < num) - num = CPU_COUNT(&cpuset); - - /* build the mask, allocating down from highest numbered CPU */ - for (cpu = 0, i = CPU_SETSIZE-1; i >= 0 && cpu < num; --i) { - if (CPU_ISSET(i, &cpuset)) { - odp_cpumask_set(mask, i); - cpu++; - } - } - - return cpu; -} - - static void *odp_run_start_routine(void *arg) { odp_start_args_t *start_args = arg; diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c index 97f46691d..d3a594353 100644 --- a/helper/test/odp_process.c +++ b/helper/test/odp_process.c @@ -39,7 +39,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) } /* discover how many processes this system can support */ - num_workers = odph_linux_cpumask_default(&cpu_mask, NUMBER_WORKERS); + num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); if (num_workers < NUMBER_WORKERS) { printf("System can only support %d processes and not the %d requested\n", num_workers, NUMBER_WORKERS); diff --git a/helper/test/odp_thread.c b/helper/test/odp_thread.c index 634be9621..1de30ab67 100644 --- a/helper/test/odp_thread.c +++ b/helper/test/odp_thread.c @@ -40,7 +40,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED) } /* discover how many threads this system can support */ - num_workers = odph_linux_cpumask_default(&cpu_mask, NUMBER_WORKERS); + num_workers = odp_cpumask_def_worker(&cpu_mask, NUMBER_WORKERS); if (num_workers < NUMBER_WORKERS) { printf("System can only support %d threads and not the %d requested\n", num_workers, NUMBER_WORKERS); |