8#ifndef ZEPHYR_INCLUDE_SYS_NOTIFY_H_
9#define ZEPHYR_INCLUDE_SYS_NOTIFY_H_
24#define SYS_NOTIFY_METHOD_COMPLETED 0
34#define SYS_NOTIFY_METHOD_SPINWAIT 1
41#define SYS_NOTIFY_METHOD_SIGNAL 2
48#define SYS_NOTIFY_METHOD_CALLBACK 3
50#define SYS_NOTIFY_METHOD_MASK 0x03U
51#define SYS_NOTIFY_METHOD_POS 0
66#define SYS_NOTIFY_EXTENSION_POS 2
72#define SYS_NOTIFY_EXTENSION_MASK (~BIT_MASK(SYS_NOTIFY_EXTENSION_POS))
240 __ASSERT_NO_MSG(notify != NULL);
241 __ASSERT_NO_MSG(
result != NULL);
266 __ASSERT_NO_MSG(notify != NULL);
295 __ASSERT_NO_MSG(notify != NULL);
296 __ASSERT_NO_MSG(sigp != NULL);
324 __ASSERT_NO_MSG(notify != NULL);
325 __ASSERT_NO_MSG(handler != NULL);
348 __ASSERT_NO_MSG(notify != NULL);
static uint32_t sys_notify_get_method(const struct sys_notify *notify)
Definition: notify.h:178
void(* sys_notify_generic_callback)()
Generic signature used to notify of result completion by callback.
Definition: notify.h:98
static void sys_notify_init_signal(struct sys_notify *notify, struct k_poll_signal *sigp)
Initialize a notify object for (k_poll) signal notification.
Definition: notify.h:292
sys_notify_generic_callback sys_notify_finalize(struct sys_notify *notify, int res)
Record and signal the operation completion.
int sys_notify_validate(struct sys_notify *notify)
Validate and initialize the notify structure.
static int sys_notify_fetch_result(const struct sys_notify *notify, int *result)
Check for and read the result of an asynchronous operation.
Definition: notify.h:237
static bool sys_notify_uses_callback(const struct sys_notify *notify)
Detect whether a particular notification uses a callback.
Definition: notify.h:346
static void sys_notify_init_callback(struct sys_notify *notify, sys_notify_generic_callback handler)
Initialize a notify object for callback notification.
Definition: notify.h:321
static void sys_notify_init_spinwait(struct sys_notify *notify)
Initialize a notify object for spin-wait notification.
Definition: notify.h:264
#define EAGAIN
No more contexts.
Definition: errno.h:50
#define SYS_NOTIFY_METHOD_SPINWAIT
Definition: notify.h:34
#define SYS_NOTIFY_METHOD_CALLBACK
Definition: notify.h:48
#define SYS_NOTIFY_METHOD_MASK
Definition: notify.h:50
#define SYS_NOTIFY_METHOD_POS
Definition: notify.h:51
#define SYS_NOTIFY_METHOD_SIGNAL
Definition: notify.h:41
#define SYS_NOTIFY_METHOD_COMPLETED
Definition: notify.h:24
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Definition: kernel.h:5641
int result
custom result value passed to k_poll_signal_raise() if needed
Definition: kernel.h:5652
State associated with notification for an asynchronous operation.
Definition: notify.h:138
uint32_t volatile flags
Definition: notify.h:165
int volatile result
Definition: notify.h:174
union sys_notify::method method
struct k_poll_signal * signal
Definition: notify.h:145
sys_notify_generic_callback callback
Definition: notify.h:148