diff options
author | Allan Stephens <allan.stephens@windriver.com> | 2016-10-07 13:59:23 -0500 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-10-25 00:10:34 +0000 |
commit | 904cf972632de023cedc49e801c4c071cc35f79d (patch) | |
tree | fc75eb2f7b7d51d791628653a98179b52587f6d4 /kernel | |
parent | 06aefdb6542bb478e76f6670859fcd72ae2fee46 (diff) |
unified: Eliminate thread config structure used by work queues
Reworks k_work_q_start() so that it accepts its 3 configuration
settings directly, rather than forcing the caller to pass in a
configuration data structure.
Change-Id: Ic0bd1b94f1a1c8e0f8a84b3bd3677d59d0708734
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/unified/legacy_offload.c | 11 | ||||
-rw-r--r-- | kernel/unified/work_q.c | 19 |
2 files changed, 12 insertions, 18 deletions
diff --git a/kernel/unified/legacy_offload.c b/kernel/unified/legacy_offload.c index a0e228d27..73e1dfa28 100644 --- a/kernel/unified/legacy_offload.c +++ b/kernel/unified/legacy_offload.c @@ -73,17 +73,14 @@ int task_offload_to_fiber(int (*func)(), void *argp) static char __stack offload_work_q_stack[CONFIG_OFFLOAD_WORKQUEUE_STACK_SIZE]; -static const struct k_thread_config offload_work_q_config = { - .stack = offload_work_q_stack, - .stack_size = sizeof(offload_work_q_stack), - .prio = CONFIG_OFFLOAD_WORKQUEUE_PRIORITY, -}; - static int k_offload_work_q_init(struct device *dev) { ARG_UNUSED(dev); - k_work_q_start(&offload_work_q, &offload_work_q_config); + k_work_q_start(&offload_work_q, + offload_work_q_stack, + sizeof(offload_work_q_stack), + CONFIG_OFFLOAD_WORKQUEUE_PRIORITY); return 0; } diff --git a/kernel/unified/work_q.c b/kernel/unified/work_q.c index 4c3a2bebe..7e71e0a30 100644 --- a/kernel/unified/work_q.c +++ b/kernel/unified/work_q.c @@ -52,14 +52,14 @@ static void work_q_main(void *work_q_ptr, void *p2, void *p3) } } -void k_work_q_start(struct k_work_q *work_q, - const struct k_thread_config *config) +void k_work_q_start(struct k_work_q *work_q, char *stack, + unsigned stack_size, unsigned prio) { k_fifo_init(&work_q->fifo); - k_thread_spawn(config->stack, config->stack_size, + k_thread_spawn(stack, stack_size, work_q_main, work_q, 0, 0, - config->prio, 0, 0); + prio, 0, 0); } #ifdef CONFIG_SYS_CLOCK_EXISTS @@ -152,19 +152,16 @@ int k_delayed_work_cancel(struct k_delayed_work *work) static char __stack sys_work_q_stack[CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE]; -static const struct k_thread_config sys_work_q_config = { - .stack = sys_work_q_stack, - .stack_size = sizeof(sys_work_q_stack), - .prio = CONFIG_SYSTEM_WORKQUEUE_PRIORITY, -}; - struct k_work_q k_sys_work_q; static int k_sys_work_q_init(struct device *dev) { ARG_UNUSED(dev); - k_work_q_start(&k_sys_work_q, &sys_work_q_config); + k_work_q_start(&k_sys_work_q, + sys_work_q_stack, + sizeof(sys_work_q_stack), + CONFIG_SYSTEM_WORKQUEUE_PRIORITY); return 0; } |