Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 Wind River Systems, Inc. |
| 3 | * Copyright (c) 2016 Intel Corporation |
| 4 | * |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 5 | * SPDX-License-Identifier: Apache-2.0 |
Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * @file |
| 10 | * |
| 11 | * System workqueue. |
| 12 | */ |
| 13 | |
| 14 | #include <kernel.h> |
| 15 | #include <init.h> |
| 16 | |
Andrew Boie | b4ce7a7 | 2020-04-26 15:02:31 -0700 | [diff] [blame] | 17 | K_KERNEL_STACK_DEFINE(sys_work_q_stack, CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE); |
Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 18 | |
| 19 | struct k_work_q k_sys_work_q; |
| 20 | |
Tomasz Bursztyka | e18fcbb | 2020-04-30 20:33:38 +0200 | [diff] [blame] | 21 | static int k_sys_work_q_init(const struct device *dev) |
Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 22 | { |
| 23 | ARG_UNUSED(dev); |
| 24 | |
| 25 | k_work_q_start(&k_sys_work_q, |
| 26 | sys_work_q_stack, |
Andrew Boie | b4ce7a7 | 2020-04-26 15:02:31 -0700 | [diff] [blame] | 27 | K_KERNEL_STACK_SIZEOF(sys_work_q_stack), |
Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 28 | CONFIG_SYSTEM_WORKQUEUE_PRIORITY); |
Paul Sokolovsky | d91c11f | 2018-10-12 21:14:48 +0300 | [diff] [blame] | 29 | k_thread_name_set(&k_sys_work_q.thread, "sysworkq"); |
Benjamin Walsh | 8cf56bc | 2016-11-04 15:47:32 -0400 | [diff] [blame] | 30 | |
| 31 | return 0; |
| 32 | } |
| 33 | |
Benjamin Walsh | e0ca210 | 2016-12-16 18:01:13 -0500 | [diff] [blame] | 34 | SYS_INIT(k_sys_work_q_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |