38 return lifecycle_status;
48 if ((storage == NULL) || (config == NULL) || (out_handle == NULL))
73 if ((handle == NULL) || (out_buffer == NULL) || (buffer_size == 0U))
85 return s_backend->
read(handle, offset, out_buffer, buffer_size);
93 if ((handle == NULL) || (buffer == NULL) || (buffer_size == 0U))
sapi_status_t sapi_lifecycle_check_setup_allowed(void)
Convenience check for a setup-only constructor: call this as one of the first checks in any function ...
sapi_status_t sapi_nvm_register_backend(const sapi_nvm_backend_t *backend)
Registers the backend implementation used by every sapi_nvm_* call (ADR-005 section 2....
sapi_status_t sapi_nvm_open(sapi_nvm_storage_t *storage, const sapi_nvm_config_t *config, sapi_nvm_handle_t *out_handle)
Opens (creating if necessary) a named NVM region.
sapi_status_t sapi_nvm_sync(sapi_nvm_handle_t handle)
Forces any buffered writes to durable storage.
sapi_status_t sapi_nvm_close(sapi_nvm_handle_t handle)
Closes an NVM region handle.
sapi_status_t sapi_nvm_read(sapi_nvm_handle_t handle, size_t offset, void *out_buffer, size_t buffer_size)
Reads and integrity-checks data from an NVM region.
struct sapi_nvm_impl_s * sapi_nvm_handle_t
Opaque handle to an open NVM region, returned by sapi_nvm_open().
sapi_status_t sapi_nvm_write(sapi_nvm_handle_t handle, size_t offset, const void *buffer, size_t buffer_size)
Writes data and its integrity metadata to an NVM region.
sapi_status_t
Common result/status codes.
@ SAPI_STATUS_NOT_SUPPORTED
@ SAPI_STATUS_INVALID_PARAM
@ SAPI_STATUS_NOT_INITIALIZED
static const sapi_clocksync_backend_t * s_backend
Process-wide application setup-phase lock (ADR-026).
OS Abstraction Layer - Non-Volatile Memory service.
OS-backend adaptation surface for the NVM service (ADR-005, ADR-021).
Backend vtable: an integrator's implementation of the NVM service for a specific storage medium (ADR-...
sapi_status_t(*) write(sapi_nvm_handle_t handle, size_t offset, const void *buffer, size_t buffer_size)
Backend implementation of sapi_nvm_write(). May be NULL.
sapi_status_t(*) close(sapi_nvm_handle_t handle)
Backend implementation of sapi_nvm_close(). May be NULL.
sapi_status_t(*) sync(sapi_nvm_handle_t handle)
Backend implementation of sapi_nvm_sync(). May be NULL.
sapi_status_t(*) read(sapi_nvm_handle_t handle, size_t offset, void *out_buffer, size_t buffer_size)
Backend implementation of sapi_nvm_read(). May be NULL.
sapi_status_t(*) open(sapi_nvm_storage_t *storage, const sapi_nvm_config_t *config, sapi_nvm_handle_t *out_handle)
Backend implementation of sapi_nvm_open(). May be NULL.
Configuration for sapi_nvm_open().