Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_nvm.h File Reference

OS Abstraction Layer - Non-Volatile Memory service. More...

Include dependency graph for sapi_nvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sapi_nvm_config_t
 Configuration for sapi_nvm_open(). More...

Typedefs

typedef struct sapi_nvm_impl_s * sapi_nvm_handle_t
 Opaque handle to an open NVM region, returned by sapi_nvm_open().

Functions

 SAFEAPI_DECLARE_STORAGE (sapi_nvm_storage_t, 64U)
 Caller-owned, fixed-size storage backing one sapi_nvm_handle_t.
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_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.
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 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.

Detailed Description

OS Abstraction Layer - Non-Volatile Memory service.

Persistent storage for safety-related data (e.g. train/track database state) with mandatory integrity checking on read. See ADR-001.

REQ-OAL-NVM-001: every read shall be integrity-checked (e.g. CRC or redundant-copy voting) before data is returned to the caller. REQ-OAL-NVM-002: no dynamic allocation; caller supplies storage/buffers.

Definition in file sapi_nvm.h.