Lines Matching full:events

13  * This polling mechanism allows waiting on multiple events concurrently,
14 * either events triggered directly, or from kernel objects or other kernel
112 static inline void add_event(sys_dlist_t *events, struct k_poll_event *event, in add_event() argument
117 pending = (struct k_poll_event *)sys_dlist_peek_tail(events); in add_event()
121 sys_dlist_append(events, &event->_node); in add_event()
125 SYS_DLIST_FOR_EACH_CONTAINER(events, pending, _node) { in add_event()
133 sys_dlist_append(events, &event->_node); in add_event()
217 static inline void clear_event_registrations(struct k_poll_event *events, in clear_event_registrations() argument
222 clear_event_registration(&events[num_events]); in clear_event_registrations()
234 static inline int register_events(struct k_poll_event *events, in register_events() argument
246 if (is_condition_met(&events[ii], &state)) { in register_events()
247 set_event_ready(&events[ii], state); in register_events()
250 register_event(&events[ii], poller); in register_events()
254 * catching non-polling events, or is marked for just check, in register_events()
288 int z_impl_k_poll(struct k_poll_event *events, int num_events, in z_impl_k_poll() argument
299 __ASSERT(events != NULL, "NULL events\n"); in z_impl_k_poll()
300 __ASSERT(num_events >= 0, "<0 events\n"); in z_impl_k_poll()
302 SYS_PORT_TRACING_FUNC_ENTER(k_poll_api, poll, events); in z_impl_k_poll()
304 events_registered = register_events(events, num_events, poller, in z_impl_k_poll()
311 * condition is met, either when looping through the events here or in z_impl_k_poll()
312 * because one of the events registered has had its state changed. in z_impl_k_poll()
315 clear_event_registrations(events, events_registered, key); in z_impl_k_poll()
318 SYS_PORT_TRACING_FUNC_EXIT(k_poll_api, poll, events, 0); in z_impl_k_poll()
328 SYS_PORT_TRACING_FUNC_EXIT(k_poll_api, poll, events, -EAGAIN); in z_impl_k_poll()
338 * Clear all event registrations. If events happen while we're in this in z_impl_k_poll()
340 * end up in the list of events that are ready; if we timed out, and in z_impl_k_poll()
341 * events happen while we're in this loop, that is OK as well since in z_impl_k_poll()
343 * added to the list of events that occurred, the user has to check the in z_impl_k_poll()
347 clear_event_registrations(events, events_registered, key); in z_impl_k_poll()
350 SYS_PORT_TRACING_FUNC_EXIT(k_poll_api, poll, events, swap_rc); in z_impl_k_poll()
356 static inline int z_vrfy_k_poll(struct k_poll_event *events, in z_vrfy_k_poll() argument
364 /* Validate the events buffer and make a copy of it in an in z_vrfy_k_poll()
385 if (K_SYSCALL_MEMORY_WRITE(events, bounds)) { in z_vrfy_k_poll()
389 (void)memcpy(events_copy, events, bounds); in z_vrfy_k_poll()
428 (void)memcpy((void *)events, events_copy, bounds); in z_vrfy_k_poll()
467 void z_handle_obj_poll_events(sys_dlist_t *events, uint32_t state) in z_handle_obj_poll_events() argument
472 poll_event = (struct k_poll_event *)sys_dlist_get(events); in z_handle_obj_poll_events()
583 clear_event_registrations(twork->events, in triggered_work_handler()
638 clear_event_registrations(work->events, work->num_events, key); in triggered_work_cancel()
668 struct k_poll_event *events, in k_work_poll_submit_to_queue() argument
677 __ASSERT(events != NULL, "NULL events\n"); in k_work_poll_submit_to_queue()
678 __ASSERT(num_events > 0, "zero events\n"); in k_work_poll_submit_to_queue()
713 /* Save list of events. */ in k_work_poll_submit_to_queue()
714 work->events = events; in k_work_poll_submit_to_queue()
720 /* Register events */ in k_work_poll_submit_to_queue()
721 events_registered = register_events(events, num_events, in k_work_poll_submit_to_queue()
731 "Some events were not registered!\n"); in k_work_poll_submit_to_queue()
768 clear_event_registrations(events, events_registered, key); in k_work_poll_submit_to_queue()
780 struct k_poll_event *events, in k_work_poll_submit() argument
787 events, num_events, timeout); in k_work_poll_submit()