Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_nvm.h
Go to the documentation of this file.
1
16#ifndef RTE_OS_NVM_H
17#define RTE_OS_NVM_H
18
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
27RTE_DECLARE_STORAGE(rte_nvm_storage_t, 64U);
28
30typedef struct rte_nvm_impl_s *rte_nvm_handle_t;
31
33typedef struct rte_nvm_config_s
34{
35 const char *region_name;
36 size_t region_size;
38
51rte_status_t rte_nvm_open(rte_nvm_storage_t *storage,
52 const rte_nvm_config_t *config,
53 rte_nvm_handle_t *out_handle);
54
68 size_t offset,
69 void *out_buffer,
70 size_t buffer_size);
71
83 size_t offset,
84 const void *buffer,
85 size_t buffer_size);
86
95
104
105/*
106 * The OSAdapter vtable (rte_osadapter_nvm_t) and rte_osadapter_nvm_register()
107 * live in rte_osadapter/nvm/rte_osadapter_nvm.h, not here (ADR-021).
108 * This header is the consumer-facing surface only.
109 */
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif /* RTE_OS_NVM_H */
116 /* NVM */
rte_status_t rte_nvm_read(rte_nvm_handle_t handle, size_t offset, void *out_buffer, size_t buffer_size)
Reads and integrity-checks data from an NVM region.
Definition rte_nvm.c:77
rte_status_t rte_nvm_close(rte_nvm_handle_t handle)
Closes an NVM region handle.
Definition rte_nvm.c:134
rte_status_t rte_nvm_write(rte_nvm_handle_t handle, size_t offset, const void *buffer, size_t buffer_size)
Writes data and its integrity metadata to an NVM region.
Definition rte_nvm.c:97
rte_status_t rte_nvm_sync(rte_nvm_handle_t handle)
Forces any buffered writes to durable storage.
Definition rte_nvm.c:117
struct rte_nvm_impl_s * rte_nvm_handle_t
Opaque handle to an open NVM region, returned by rte_nvm_open().
Definition rte_nvm.h:30
rte_status_t rte_nvm_open(rte_nvm_storage_t *storage, const rte_nvm_config_t *config, rte_nvm_handle_t *out_handle)
Opens (creating if necessary) a named NVM region.
Definition rte_nvm.c:44
rte_status_t
Common result/status codes.
Definition rte_status.h:27
#define RTE_DECLARE_STORAGE(type_name, byte_size)
Declares an opaque, fixed-size, aligned storage type for a service's handle. The real internal layout...
Definition rte_types.h:69
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
Configuration for rte_nvm_open().
Definition rte_nvm.h:34
const char * region_name
Definition rte_nvm.h:35
size_t region_size
Definition rte_nvm.h:36