aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorRobbie King <robking@cisco.com>2015-01-14 23:48:26 +0100
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-01-16 17:33:19 +0300
commit38e36ef15500a3517a635a258bba3fea263cc555 (patch)
treee8996aea5d6a527e66d4a58db2ffca05b6e8ecf0 /helper
parent5e47a0cf301367e47a3e1dfefbd6c5b4677916b8 (diff)
helper: linux: use cpumask in linux thread/proc
Move away from specifying a core count and allow the user to specify a mask. 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.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/helper/include/odph_linux.h b/helper/include/odph_linux.h
index 6458fde..146e26c 100644
--- a/helper/include/odph_linux.h
+++ b/helper/include/odph_linux.h
@@ -31,7 +31,6 @@ extern "C" {
typedef struct {
void *(*start_routine) (void *); /**< The function to run */
void *arg; /**< The functions arguemnts */
-
} odp_start_args_t;
/** Linux pthread state information */
@@ -65,19 +64,16 @@ int odph_linux_cpumask_default(odp_cpumask_t *mask, int num);
/**
* Creates and launches pthreads
*
- * Creates, pins and launches num threads to separate CPU's starting from
- * first_cpu.
+ * Creates, pins and launches threads to separate CPU's based on the cpumask.
*
* @param thread_tbl Thread table
- * @param num Number of threads to create
- * @param first_cpu First physical CPU
+ * @param mask CPU mask
* @param start_routine Thread start function
* @param arg Thread argument
*/
void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl,
- int num, int first_cpu,
- void *(*start_routine) (void *), void *arg);
-
+ const odp_cpumask_t *mask,
+ void *(*start_routine) (void *), void *arg);
/**
* Waits pthreads to exit
@@ -111,14 +107,13 @@ int odph_linux_process_fork(odph_linux_process_t *proc, int cpu);
* Forks and sets CPU affinity for child processes
*
* @param proc_tbl Process state info table (for output)
- * @param num Number of processes to create
- * @param first_cpu Destination CPU for the first process
+ * @param mask CPU mask of processes to create
*
* @return On success: 1 for the parent, 0 for the child
* On failure: -1 for the parent, -2 for the child
*/
int odph_linux_process_fork_n(odph_linux_process_t *proc_tbl,
- int num, int first_cpu);
+ const odp_cpumask_t *mask);
/**