2016-11-05 03:47:32 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Wind River Systems, Inc.
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-11-05 03:47:32 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* System workqueue.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <init.h>
|
|
|
|
|
2020-10-29 00:24:05 +08:00
|
|
|
static K_KERNEL_STACK_DEFINE(sys_work_q_stack,
|
|
|
|
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE);
|
2016-11-05 03:47:32 +08:00
|
|
|
|
|
|
|
struct k_work_q k_sys_work_q;
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static int k_sys_work_q_init(const struct device *dev)
|
2016-11-05 03:47:32 +08:00
|
|
|
{
|
|
|
|
ARG_UNUSED(dev);
|
2020-10-29 00:24:05 +08:00
|
|
|
struct k_work_queue_config cfg = {
|
|
|
|
.name = "sysworkq",
|
|
|
|
.no_yield = IS_ENABLED(CONFIG_SYSTEM_WORKQUEUE_NO_YIELD),
|
|
|
|
};
|
2016-11-05 03:47:32 +08:00
|
|
|
|
2020-10-29 00:24:05 +08:00
|
|
|
k_work_queue_start(&k_sys_work_q,
|
|
|
|
sys_work_q_stack,
|
|
|
|
K_KERNEL_STACK_SIZEOF(sys_work_q_stack),
|
|
|
|
CONFIG_SYSTEM_WORKQUEUE_PRIORITY, &cfg);
|
2016-11-05 03:47:32 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-12-17 07:01:13 +08:00
|
|
|
SYS_INIT(k_sys_work_q_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|