Lines Matching refs:event

52 void z_impl_k_event_init(struct k_event *event)  in z_impl_k_event_init()  argument
54 event->events = 0; in z_impl_k_event_init()
55 event->lock = (struct k_spinlock) {}; in z_impl_k_event_init()
57 SYS_PORT_TRACING_OBJ_INIT(k_event, event); in z_impl_k_event_init()
59 z_waitq_init(&event->wait_q); in z_impl_k_event_init()
61 k_object_init(event); in z_impl_k_event_init()
64 k_obj_core_init_and_link(K_OBJ_CORE(event), &obj_type_event); in z_impl_k_event_init()
69 void z_vrfy_k_event_init(struct k_event *event) in z_vrfy_k_event_init() argument
71 K_OOPS(K_SYSCALL_OBJ_NEVER_INIT(event, K_OBJ_EVENT)); in z_vrfy_k_event_init()
72 z_impl_k_event_init(event); in z_vrfy_k_event_init()
131 static uint32_t k_event_post_internal(struct k_event *event, uint32_t events, in k_event_post_internal() argument
140 key = k_spin_lock(&event->lock); in k_event_post_internal()
142 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, post, event, events, in k_event_post_internal()
145 previous_events = event->events & events_mask; in k_event_post_internal()
146 events = (event->events & ~events_mask) | in k_event_post_internal()
148 event->events = events; in k_event_post_internal()
160 z_sched_waitq_walk(&event->wait_q, event_walk_op, &data); in k_event_post_internal()
174 z_reschedule(&event->lock, key); in k_event_post_internal()
176 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, post, event, events, in k_event_post_internal()
182 uint32_t z_impl_k_event_post(struct k_event *event, uint32_t events) in z_impl_k_event_post() argument
184 return k_event_post_internal(event, events, events); in z_impl_k_event_post()
188 uint32_t z_vrfy_k_event_post(struct k_event *event, uint32_t events) in z_vrfy_k_event_post() argument
190 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_post()
191 return z_impl_k_event_post(event, events); in z_vrfy_k_event_post()
196 uint32_t z_impl_k_event_set(struct k_event *event, uint32_t events) in z_impl_k_event_set() argument
198 return k_event_post_internal(event, events, ~0); in z_impl_k_event_set()
202 uint32_t z_vrfy_k_event_set(struct k_event *event, uint32_t events) in z_vrfy_k_event_set() argument
204 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_set()
205 return z_impl_k_event_set(event, events); in z_vrfy_k_event_set()
210 uint32_t z_impl_k_event_set_masked(struct k_event *event, uint32_t events, in z_impl_k_event_set_masked() argument
213 return k_event_post_internal(event, events, events_mask); in z_impl_k_event_set_masked()
217 uint32_t z_vrfy_k_event_set_masked(struct k_event *event, uint32_t events, in z_vrfy_k_event_set_masked() argument
220 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_set_masked()
221 return z_impl_k_event_set_masked(event, events, events_mask); in z_vrfy_k_event_set_masked()
226 uint32_t z_impl_k_event_clear(struct k_event *event, uint32_t events) in z_impl_k_event_clear() argument
228 return k_event_post_internal(event, 0, events); in z_impl_k_event_clear()
232 uint32_t z_vrfy_k_event_clear(struct k_event *event, uint32_t events) in z_vrfy_k_event_clear() argument
234 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_clear()
235 return z_impl_k_event_clear(event, events); in z_vrfy_k_event_clear()
240 static uint32_t k_event_wait_internal(struct k_event *event, uint32_t events, in k_event_wait_internal() argument
250 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, wait, event, events, in k_event_wait_internal()
254 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, wait, event, events, 0); in k_event_wait_internal()
261 k_spinlock_key_t key = k_spin_lock(&event->lock); in k_event_wait_internal()
264 event->events = 0; in k_event_wait_internal()
269 if (are_wait_conditions_met(events, event->events, wait_condition)) { in k_event_wait_internal()
270 rv = event->events; in k_event_wait_internal()
272 k_spin_unlock(&event->lock, key); in k_event_wait_internal()
279 k_spin_unlock(&event->lock, key); in k_event_wait_internal()
291 SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_event, wait, event, events, in k_event_wait_internal()
294 if (z_pend_curr(&event->lock, key, &event->wait_q, timeout) == 0) { in k_event_wait_internal()
300 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, wait, event, in k_event_wait_internal()
309 uint32_t z_impl_k_event_wait(struct k_event *event, uint32_t events, in z_impl_k_event_wait() argument
314 return k_event_wait_internal(event, events, options, timeout); in z_impl_k_event_wait()
317 uint32_t z_vrfy_k_event_wait(struct k_event *event, uint32_t events, in z_vrfy_k_event_wait() argument
320 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_wait()
321 return z_impl_k_event_wait(event, events, reset, timeout); in z_vrfy_k_event_wait()
329 uint32_t z_impl_k_event_wait_all(struct k_event *event, uint32_t events, in z_impl_k_event_wait_all() argument
335 return k_event_wait_internal(event, events, options, timeout); in z_impl_k_event_wait_all()
339 uint32_t z_vrfy_k_event_wait_all(struct k_event *event, uint32_t events, in z_vrfy_k_event_wait_all() argument
342 K_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT)); in z_vrfy_k_event_wait_all()
343 return z_impl_k_event_wait_all(event, events, reset, timeout); in z_vrfy_k_event_wait_all()
358 STRUCT_SECTION_FOREACH(k_event, event) { in init_event_obj_core_list()
359 k_obj_core_init_and_link(K_OBJ_CORE(event), &obj_type_event); in init_event_obj_core_list()