6#ifndef ZEPHYR_INCLUDE_SYS_P4WQ_H_
7#define ZEPHYR_INCLUDE_SYS_P4WQ_H_
45#define K_P4WQ_QUEUE_PER_THREAD BIT(0)
46#define K_P4WQ_DELAYED_START BIT(1)
47#define K_P4WQ_USER_CPU_MASK BIT(2)
83 struct z_thread_stack_element *
stacks;
98#define K_P4WQ_DEFINE(name, n_threads, stack_sz) \
99 static K_THREAD_STACK_ARRAY_DEFINE(_p4stacks_##name, \
100 n_threads, stack_sz); \
101 static struct k_thread _p4threads_##name[n_threads]; \
102 static struct k_p4wq name; \
103 static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
106 .stack_size = stack_sz, \
107 .threads = _p4threads_##name, \
108 .stacks = &(_p4stacks_##name[0][0]), \
125#define K_P4WQ_ARRAY_DEFINE(name, n_threads, stack_sz, flg) \
126 static K_THREAD_STACK_ARRAY_DEFINE(_p4stacks_##name, \
127 n_threads, stack_sz); \
128 static struct k_thread _p4threads_##name[n_threads]; \
129 static struct k_p4wq name[n_threads]; \
130 static const STRUCT_SECTION_ITERABLE(k_p4wq_initparam, \
133 .stack_size = stack_sz, \
134 .threads = _p4threads_##name, \
135 .stacks = &(_p4stacks_##name[0][0]), \
137 .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:44
static struct k_thread thread[2]
Definition: atomic.c:22
ZTEST_BMEM int timeout
Definition: main.c:31
void
Definition: eswifi_shell.c:15
struct _dnode sys_dlist_t
Definition: dlist.h:48
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)
Definition: p4wq.h:18
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
struct k_stack stack
Definition: test_stack_contexts.c:18
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__INT32_TYPE__ int32_t
Definition: stdint.h:44
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:75
uint32_t num
Definition: p4wq.h:79
struct z_thread_stack_element * stacks
Definition: p4wq.h:83
uint32_t flags
Definition: p4wq.h:84
struct k_thread * threads
Definition: p4wq.h:82
struct k_p4wq * queue
Definition: p4wq.h:81
uintptr_t stack_size
Definition: p4wq.h:80
P4 Queue Work Item.
Definition: p4wq.h:28
bool sync
Definition: p4wq.h:33
int32_t deadline
Definition: p4wq.h:31
struct k_sem done_sem
Definition: p4wq.h:34
struct k_thread * thread
Definition: p4wq.h:41
sys_dlist_t dlnode
Definition: p4wq.h:39
int32_t priority
Definition: p4wq.h:30
k_p4wq_handler_t handler
Definition: p4wq.h:32
struct k_p4wq * queue
Definition: p4wq.h:42
P4 Queue.
Definition: p4wq.h:54
uint32_t flags
Definition: p4wq.h:75
_wait_q_t waitq
Definition: p4wq.h:66
struct rbtree queue
Definition: p4wq.h:69
struct k_spinlock lock
Definition: p4wq.h:55
sys_dlist_t active
Definition: p4wq.h:72
Kernel Spin Lock.
Definition: spinlock.h:29
Kernel timeout type.
Definition: sys_clock.h:65
struct k_queue queue
Definition: test_queue_contexts.c:17