Safe API Framework
0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Toggle main menu visibility
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
19
#include "
rte/utils/status/rte_status.h
"
20
#include "
rte/utils/types/rte_types.h
"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
27
RTE_DECLARE_STORAGE
(rte_nvm_storage_t, 64U);
28
30
typedef
struct
rte_nvm_impl_s *
rte_nvm_handle_t
;
31
33
typedef
struct
rte_nvm_config_s
34
{
35
const
char
*
region_name
;
36
size_t
region_size
;
37
}
rte_nvm_config_t
;
38
51
rte_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
67
rte_status_t
rte_nvm_read
(
rte_nvm_handle_t
handle,
68
size_t
offset,
69
void
*out_buffer,
70
size_t
buffer_size);
71
82
rte_status_t
rte_nvm_write
(
rte_nvm_handle_t
handle,
83
size_t
offset,
84
const
void
*buffer,
85
size_t
buffer_size);
86
94
rte_status_t
rte_nvm_sync
(
rte_nvm_handle_t
handle);
95
103
rte_status_t
rte_nvm_close
(
rte_nvm_handle_t
handle);
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_nvm_read
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_nvm_close
rte_status_t rte_nvm_close(rte_nvm_handle_t handle)
Closes an NVM region handle.
Definition
rte_nvm.c:134
rte_nvm_write
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_nvm_sync
rte_status_t rte_nvm_sync(rte_nvm_handle_t handle)
Forces any buffered writes to durable storage.
Definition
rte_nvm.c:117
rte_nvm_handle_t
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_nvm_open
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
rte_status_t
Common result/status codes.
Definition
rte_status.h:27
RTE_DECLARE_STORAGE
#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
rte_status.h
Common status/error codes returned by every Safe API Framework function. Shared across all OS Abstrac...
rte_types.h
Common fixed-width types and the caller-owned-storage handle pattern used by every OAL service (see A...
rte_nvm_config_t
Configuration for rte_nvm_open().
Definition
rte_nvm.h:34
rte_nvm_config_t::region_name
const char * region_name
Definition
rte_nvm.h:35
rte_nvm_config_t::region_size
size_t region_size
Definition
rte_nvm.h:36
include
rte
oal
nvm
rte_nvm.h
Generated by
1.18.0