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 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | /** |
| 19 | * @file |
| 20 | * |
| 21 | * System workqueue. |
| 22 | */ |
| 23 | |
| 24 | #include <kernel.h> |
| 25 | #include <init.h> |
| 26 | |
| 27 | static char __stack sys_work_q_stack[CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE]; |
| 28 | |
| 29 | struct k_work_q k_sys_work_q; |
| 30 | |
| 31 | static int k_sys_work_q_init(struct device *dev) |
| 32 | { |
| 33 | ARG_UNUSED(dev); |
| 34 | |
| 35 | k_work_q_start(&k_sys_work_q, |
| 36 | sys_work_q_stack, |
| 37 | sizeof(sys_work_q_stack), |
| 38 | CONFIG_SYSTEM_WORKQUEUE_PRIORITY); |
| 39 | |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | SYS_INIT(k_sys_work_q_init, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |