Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
notify.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/types.h>

Go to the source code of this file.

Data Structures

struct  sys_notify
 State associated with notification for an asynchronous operation. More...
 
union  sys_notify::method
 

Macros

#define SYS_NOTIFY_METHOD_COMPLETED   0
 
#define SYS_NOTIFY_METHOD_SPINWAIT   1
 
#define SYS_NOTIFY_METHOD_SIGNAL   2
 
#define SYS_NOTIFY_METHOD_CALLBACK   3
 
#define SYS_NOTIFY_METHOD_MASK   0x03U
 
#define SYS_NOTIFY_METHOD_POS   0
 
#define SYS_NOTIFY_EXTENSION_POS   2
 Identify the region of sys_notify flags available for containing services.
 
#define SYS_NOTIFY_EXTENSION_MASK   (~BIT_MASK(SYS_NOTIFY_EXTENSION_POS))
 

Typedefs

typedef void(* sys_notify_generic_callback) ()
 Generic signature used to notify of result completion by callback.
 

Functions

static uint32_t sys_notify_get_method (const struct sys_notify *notify)
 
int sys_notify_validate (struct sys_notify *notify)
 Validate and initialize the notify structure.
 
sys_notify_generic_callback sys_notify_finalize (struct sys_notify *notify, int res)
 Record and signal the operation completion.
 
static int sys_notify_fetch_result (const struct sys_notify *notify, int *result)
 Check for and read the result of an asynchronous operation.
 
static void sys_notify_init_spinwait (struct sys_notify *notify)
 Initialize a notify object for spin-wait notification.
 
static void sys_notify_init_signal (struct sys_notify *notify, struct k_poll_signal *sigp)
 Initialize a notify object for (k_poll) signal notification.
 
static void sys_notify_init_callback (struct sys_notify *notify, sys_notify_generic_callback handler)
 Initialize a notify object for callback notification.
 
static bool sys_notify_uses_callback (const struct sys_notify *notify)
 Detect whether a particular notification uses a callback.
 

Macro Definition Documentation

◆ SYS_NOTIFY_EXTENSION_MASK

#define SYS_NOTIFY_EXTENSION_MASK   (~BIT_MASK(SYS_NOTIFY_EXTENSION_POS))

◆ SYS_NOTIFY_EXTENSION_POS

#define SYS_NOTIFY_EXTENSION_POS   2

Identify the region of sys_notify flags available for containing services.

Bits of the flags field of the sys_notify structure at and above this position may be used by extensions to the sys_notify structure.

These bits are intended for use by containing service implementations to record client-specific information. The bits are cleared by sys_notify_validate(). Use of these does not imply that the flags field becomes public API.

◆ SYS_NOTIFY_METHOD_CALLBACK

#define SYS_NOTIFY_METHOD_CALLBACK   3

◆ SYS_NOTIFY_METHOD_COMPLETED

#define SYS_NOTIFY_METHOD_COMPLETED   0

◆ SYS_NOTIFY_METHOD_MASK

#define SYS_NOTIFY_METHOD_MASK   0x03U

◆ SYS_NOTIFY_METHOD_POS

#define SYS_NOTIFY_METHOD_POS   0

◆ SYS_NOTIFY_METHOD_SIGNAL

#define SYS_NOTIFY_METHOD_SIGNAL   2

◆ SYS_NOTIFY_METHOD_SPINWAIT

#define SYS_NOTIFY_METHOD_SPINWAIT   1