Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dedicated_workq.h File Reference

Macros for declaring and defining dedicated workqueues. More...

#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util_macro.h>

Go to the source code of this file.

Macros

#define K_DEDICATED_WORK_QUEUE_DECLARE(_prefix, _module)
 Declare workqueue helper functions for a subsystem.
#define K_DEDICATED_WORK_QUEUE_DEFINE(_prefix, _module)
 Define a dedicated workqueue and helper functions for a subsystem.

Detailed Description

Macros for declaring and defining dedicated workqueues.

Macro Definition Documentation

◆ K_DEDICATED_WORK_QUEUE_DECLARE

#define K_DEDICATED_WORK_QUEUE_DECLARE ( _prefix,
_module )
Value:
COND_CODE_1(CONFIG_##_module##_DEDICATED_WORKQUEUE, \
(Z_DEDICATED_WORK_QUEUE_DECLARE_DEDICATED(_prefix)), \
(Z_DEDICATED_WORK_QUEUE_DECLARE_SYSTEM(_prefix)))
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:221

Declare workqueue helper functions for a subsystem.

Declares <_prefix>_work_submit(), <_prefix>_work_schedule(), and <_prefix>_work_reschedule(). When CONFIG_<_module>_DEDICATED_WORKQUEUE is enabled, these are declared as external functions backed by a dedicated workqueue; otherwise they are defined as static inline wrappers around the system workqueue functions.

Parameters
_prefixLowercase subsystem prefix used for function names.
_moduleUppercase module prefix matching the Kconfig option CONFIG_<_module>_DEDICATED_WORKQUEUE.

◆ K_DEDICATED_WORK_QUEUE_DEFINE

#define K_DEDICATED_WORK_QUEUE_DEFINE ( _prefix,
_module )
Value:
IF_ENABLED(CONFIG_##_module##_DEDICATED_WORKQUEUE, \
(Z_DEDICATED_WORK_QUEUE_DEFINE(_prefix, _module)))
#define IF_ENABLED(_flag, _code)
Insert code if _flag is defined and equals 1.
Definition util_macro.h:290

Define a dedicated workqueue and helper functions for a subsystem.

When CONFIG_<_module>_DEDICATED_WORKQUEUE is enabled, defines the static workqueue object, kernel stack sized by CONFIG_<_module>_DEDICATED_WORKQUEUE_STACK_SIZE, POST_KERNEL startup initialization at priority CONFIG_<_module>_DEDICATED_WORKQUEUE_PRIORITY, and the <_prefix>_work_submit(), <_prefix>_work_schedule(), and <_prefix>_work_reschedule() functions. Expands to nothing when CONFIG_<_module>_DEDICATED_WORKQUEUE is disabled.

Parameters
_prefixLowercase subsystem prefix used for function and thread names.
_moduleUppercase module prefix matching the Kconfig options CONFIG_<_module>_DEDICATED_WORKQUEUE*.