ram.h
1 /*
2  * SPDX-FileCopyrightText: 2020 Koen Zandberg
3  * SPDX-FileCopyrightText: 2020 Inria
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
31 #include <stdint.h>
32 
33 #include "suit.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
42 #ifndef CONFIG_SUIT_STORAGE_RAM_SIZE
43 #define CONFIG_SUIT_STORAGE_RAM_SIZE (64U)
44 #endif
45 
49 #ifndef CONFIG_SUIT_STORAGE_RAM_REGIONS
50 #define CONFIG_SUIT_STORAGE_RAM_REGIONS (2U)
51 #endif
52 
56 #ifndef CONFIG_SUIT_STORAGE_RAM_ATTR
57 #define CONFIG_SUIT_STORAGE_RAM_ATTR
58 #endif
59 
63 #ifndef CONFIG_SUIT_STORAGE_RAM_LOCATION_SEPARATOR
64 #define CONFIG_SUIT_STORAGE_RAM_LOCATION_SEPARATOR '.'
65 #endif
66 
72 #ifndef CONFIG_SUIT_STORAGE_RAM_LOCATION_PREFIX
73 #define CONFIG_SUIT_STORAGE_RAM_LOCATION_PREFIX ".ram."
74 #endif
75 
79 typedef struct {
80  size_t occupied;
83 
93  size_t active_region;
94  uint32_t sequence_no;
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
#define CONFIG_SUIT_STORAGE_RAM_REGIONS
Number of allocated regions.
Definition: ram.h:50
#define CONFIG_SUIT_STORAGE_RAM_SIZE
Size of each memory region.
Definition: ram.h:43
struct CONFIG_SUIT_STORAGE_RAM_ATTR suit_storage_ram_t
memory storage state
memory storage state
Definition: ram.h:87
suit_storage_ram_region_t regions[CONFIG_SUIT_STORAGE_RAM_REGIONS]
ram storage regions
Definition: ram.h:92
uint32_t sequence_no
Ephemeral sequence number.
Definition: ram.h:94
suit_storage_t storage
parent struct
Definition: ram.h:88
size_t active_region
Active region to write to.
Definition: ram.h:93
Single in-memory storage region.
Definition: ram.h:79
size_t occupied
Region space filled.
Definition: ram.h:80
Generic storage backend state.
Definition: storage.h:290