6#ifndef ZEPHYR_INCLUDE_SYS_P4WQ_H_
7#define ZEPHYR_INCLUDE_SYS_P4WQ_H_
46#define K_P4WQ_QUEUE_PER_THREAD BIT(0)
47#define K_P4WQ_DELAYED_START BIT(1)
48#define K_P4WQ_USER_CPU_MASK BIT(2)
84 struct z_thread_stack_element *
stacks;
99#define K_P4WQ_DEFINE(name, n_threads, stack_sz) \
100 static K_THREAD_STACK_ARRAY_DEFINE(_p4stacks_##name, \
101 n_threads, stack_sz); \
102 static struct k_thread _p4threads_##name[n_threads]; \
103 static struct k_p4wq name; \
104 static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
107 .stack_size = stack_sz, \
108 .threads = _p4threads_##name, \
109 .stacks = &(_p4stacks_##name[0][0]), \
126#define K_P4WQ_ARRAY_DEFINE(name, n_threads, stack_sz, flg) \
127 static K_THREAD_STACK_ARRAY_DEFINE(_p4stacks_##name, \
128 n_threads, stack_sz); \
129 static struct k_thread _p4threads_##name[n_threads]; \
130 static struct k_p4wq name[n_threads]; \
131 static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
134 .stack_size = stack_sz, \
135 .threads = _p4threads_##name, \
136 .stacks = &(_p4stacks_##name[0][0]), \
138 .flags = K_P4WQ_QUEUE_PER_THREAD | flg, \
struct z_thread_stack_element k_thread_stack_t
Typedef of struct z_thread_stack_element.
Definition arch_interface.h:46
static struct k_thread thread[2]
Definition atomic.c:26
ZTEST_BMEM int timeout
Definition main.c:31
struct _dnode sys_dlist_t
Doubly-linked list structure.
Definition dlist.h:50
void k_p4wq_submit(struct k_p4wq *queue, struct k_p4wq_work *item)
Submit work item to a P4 queue.
int k_p4wq_wait(struct k_p4wq_work *work, k_timeout_t timeout)
Regain ownership of the work item, wait for completion if it's synchronous.
void k_p4wq_enable_static_thread(struct k_p4wq *queue, struct k_thread *thread, uint32_t cpu_mask)
void k_p4wq_add_thread(struct k_p4wq *queue, struct k_thread *thread, k_thread_stack_t *stack, size_t stack_size)
Dynamically add a thread object to a P4 Queue pool.
void(* k_p4wq_handler_t)(struct k_p4wq_work *work)
P4 Queue handler callback.
Definition p4wq.h:19
void k_p4wq_init(struct k_p4wq *queue)
Initialize P4 Queue.
bool k_p4wq_cancel(struct k_p4wq *queue, struct k_p4wq_work *item)
Cancel submitted P4 work item.
static struct k_work work[2]
Definition main.c:16
char stack[2048]
Definition main.c:22
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
uint32_t num
Definition p4wq.h:80
struct z_thread_stack_element * stacks
Definition p4wq.h:84
uint32_t flags
Definition p4wq.h:85
struct k_thread * threads
Definition p4wq.h:83
struct k_p4wq * queue
Definition p4wq.h:82
uintptr_t stack_size
Definition p4wq.h:81
P4 Queue Work Item.
Definition p4wq.h:29
bool sync
Definition p4wq.h:34
int32_t deadline
Definition p4wq.h:32
struct k_sem done_sem
Definition p4wq.h:35
struct k_thread * thread
Definition p4wq.h:42
sys_dlist_t dlnode
Definition p4wq.h:40
int32_t priority
Definition p4wq.h:31
k_p4wq_handler_t handler
Definition p4wq.h:33
struct k_p4wq * queue
Definition p4wq.h:43
P4 Queue.
Definition p4wq.h:55
uint32_t flags
Definition p4wq.h:76
_wait_q_t waitq
Definition p4wq.h:67
struct rbtree queue
Definition p4wq.h:70
struct k_spinlock lock
Definition p4wq.h:56
sys_dlist_t active
Definition p4wq.h:73
Kernel Spin Lock.
Definition spinlock.h:45
Thread Structure.
Definition thread.h:259
Kernel timeout type.
Definition sys_clock.h:65
Balanced red/black tree node structure.
Definition rb.h:58
Balanced red/black tree structure.
Definition rb.h:91
static struct k_queue queue
Definition test_mutex_error.c:19