8#ifndef ZEPHYR_INCLUDE_KVSS_ZMS_H_
9#define ZEPHYR_INCLUDE_KVSS_ZMS_H_
77#if CONFIG_ZMS_LOOKUP_CACHE
79 uint64_t lookup_cache[CONFIG_ZMS_LOOKUP_CACHE_SIZE];
98#if CONFIG_ZMS_ID_64BIT
Main header file for Flash driver API.
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
zms_mount_flags
Mount options for zms_mount and zms_mount_force.
Definition zms.h:35
@ ZMS_MOUNT_FLAG_NO_FORMAT
Do not format erased media during mount.
Definition zms.h:42
ssize_t zms_calc_free_space(struct zms_fs *fs)
Calculate the available free space in the file system.
uint32_t zms_id_t
ID type used in the ZMS API.
Definition zms.h:101
ssize_t zms_write(struct zms_fs *fs, zms_id_t id, const void *data, size_t len)
Write an entry to the file system.
int zms_delete(struct zms_fs *fs, zms_id_t id)
Delete an entry from the file system.
ssize_t zms_read_hist(struct zms_fs *fs, zms_id_t id, void *data, size_t len, uint32_t cnt)
Read a history entry from the file system.
ssize_t zms_active_sector_free_space(struct zms_fs *fs)
Tell how much contiguous free space remains in the currently active ZMS sector.
ssize_t zms_get_data_length(struct zms_fs *fs, zms_id_t id)
Gets the length of the data that is stored in an entry with a given id.
ssize_t zms_read(struct zms_fs *fs, zms_id_t id, void *data, size_t len)
Read an entry from the file system.
int zms_sector_use_next(struct zms_fs *fs)
Close the currently active sector and switch to the next one.
int zms_mount(struct zms_fs *fs)
Mount a ZMS file system onto the device specified in fs.
int zms_mount_force(struct zms_fs *fs)
Mount a ZMS file system onto the device specified in fs, wiping the partition if mounting fails the f...
int zms_clear(struct zms_fs *fs)
Clear the ZMS file system from device.
__SIZE_TYPE__ ssize_t
Definition types.h:28
__INTPTR_TYPE__ off_t
Definition types.h:36
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Kernel mutex structure.
Definition kernel.h:3437
Zephyr Memory Storage file system structure.
Definition zms.h:46
const struct flash_parameters * flash_parameters
Flash memory parameters structure.
Definition zms.h:74
uint64_t data_wra
Data write address.
Definition zms.h:56
const struct device * flash_device
Flash device runtime structure.
Definition zms.h:72
uint32_t mount_flags
Mount behavior flags from zms_mount_flags.
Definition zms.h:64
uint64_t ate_wra
Allocation Table Entry (ATE) write address.
Definition zms.h:54
size_t ate_size
Size of an Allocation Table Entry.
Definition zms.h:76
uint32_t sector_size
Storage system is split into sectors.
Definition zms.h:60
uint8_t sector_cycle
Current cycle counter of the active sector (pointed to by ate_wra).
Definition zms.h:66
uint32_t sector_count
Number of sectors in the file system.
Definition zms.h:62
off_t offset
File system offset in flash.
Definition zms.h:48
bool ready
Flag indicating if the file system is initialized.
Definition zms.h:68
struct k_mutex zms_lock
Mutex used to lock flash writes.
Definition zms.h:70