Nexus Embedded Platform 1.0.0
Statically assembled reusable embedded mechanisms
Loading...
Searching...
No Matches
file_flash.h
Go to the documentation of this file.
1
10#ifndef NEXUS_FILE_FLASH_H
11#define NEXUS_FILE_FLASH_H
13#ifdef __cplusplus
14extern "C" {
15#endif
16/* Native POSIX flash model, not a hardware driver. Exclusive file ownership,
17 * exact persistent geometry, 1->0 programming and caller-controlled failures.
18 * fail_after counts programmed/erased bytes and sync attempts, including bytes
19 * whose value remains unchanged. Negative disables it.
20 * A zero budget simulates a powered-off device until explicitly cleared. */
21typedef struct {
22 int fd;
24 int64_t fail_after;
27
40 size_t size, size_t erase_size,
41 size_t program_size);
55void nx_file_flash_fail_after(nx_file_flash_t* flash, int64_t events);
56#ifdef __cplusplus
57}
58#endif
59#endif
nx_storage_status_t nx_file_flash_open(nx_file_flash_t *flash, const char *path, size_t size, size_t erase_size, size_t program_size)
Open an exclusively locked persistent host Flash model.
void nx_file_flash_fail_after(nx_file_flash_t *flash, int64_t events)
Set an explicit model interruption boundary.
void nx_file_flash_close(nx_file_flash_t *flash)
Close the host file after all store users have quiesced.
Two-bank durable blob storage over an explicit narrow port.
nx_storage_status_t
Storage errors expose retry/reopen/recovery decisions.
Definition storage.h:17
int64_t fail_after
Definition file_flash.h:24
uint64_t mutation_events
Definition file_flash.h:25
nx_storage_port_t port
Definition file_flash.h:23
Synchronous settled persistent Flash port.
Definition storage.h:38