ram.h
1 /*
2  * Copyright (C) 2020 Koen Zandberg
3  * 2020 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
31 #ifndef SUIT_STORAGE_RAM_H
32 #define SUIT_STORAGE_RAM_H
33 
34 #include <stdint.h>
35 
36 #include "suit.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
45 #ifndef CONFIG_SUIT_STORAGE_RAM_SIZE
46 #define CONFIG_SUIT_STORAGE_RAM_SIZE (64U)
47 #endif
48 
52 #ifndef CONFIG_SUIT_STORAGE_RAM_REGIONS
53 #define CONFIG_SUIT_STORAGE_RAM_REGIONS (2U)
54 #endif
55 
59 #ifndef CONFIG_SUIT_STORAGE_RAM_ATTR
60 #define CONFIG_SUIT_STORAGE_RAM_ATTR
61 #endif
62 
66 typedef struct {
67  size_t occupied;
70 
80  size_t active_region;
81  uint32_t sequence_no;
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* SUIT_STORAGE_RAM_H */
89 
CONFIG_SUIT_STORAGE_RAM_ATTR::active_region
size_t active_region
Active region to write to.
Definition: ram.h:80
suit_storage_ram_region_t::occupied
size_t occupied
Region space filled.
Definition: ram.h:67
CONFIG_SUIT_STORAGE_RAM_ATTR::regions
suit_storage_ram_region_t regions[CONFIG_SUIT_STORAGE_RAM_REGIONS]
ram storage regions
Definition: ram.h:79
suit_storage_ram_region_t
Single in-memory storage region.
Definition: ram.h:66
suit_storage
Generic storage backend state.
Definition: storage.h:293
CONFIG_SUIT_STORAGE_RAM_ATTR
memory storage state
Definition: ram.h:74
suit_storage_ram_t
struct CONFIG_SUIT_STORAGE_RAM_ATTR suit_storage_ram_t
memory storage state
CONFIG_SUIT_STORAGE_RAM_REGIONS
#define CONFIG_SUIT_STORAGE_RAM_REGIONS
Number of allocated regions.
Definition: ram.h:53
CONFIG_SUIT_STORAGE_RAM_SIZE
#define CONFIG_SUIT_STORAGE_RAM_SIZE
Size of each memory region.
Definition: ram.h:46
CONFIG_SUIT_STORAGE_RAM_ATTR::sequence_no
uint32_t sequence_no
Ephemeral sequence number.
Definition: ram.h:81
CONFIG_SUIT_STORAGE_RAM_ATTR::storage
suit_storage_t storage
parent struct
Definition: ram.h:75