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 #ifndef CONFIG_SUIT_STORAGE_RAM_LOCATION_SEPARATOR
67 #define CONFIG_SUIT_STORAGE_RAM_LOCATION_SEPARATOR '.'
68 #endif
69 
75 #ifndef CONFIG_SUIT_STORAGE_RAM_LOCATION_PREFIX
76 #define CONFIG_SUIT_STORAGE_RAM_LOCATION_PREFIX ".ram."
77 #endif
78 
82 typedef struct {
83  size_t occupied;
86 
96  size_t active_region;
97  uint32_t sequence_no;
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* SUIT_STORAGE_RAM_H */
#define CONFIG_SUIT_STORAGE_RAM_REGIONS
Number of allocated regions.
Definition: ram.h:53
#define CONFIG_SUIT_STORAGE_RAM_SIZE
Size of each memory region.
Definition: ram.h:46
struct CONFIG_SUIT_STORAGE_RAM_ATTR suit_storage_ram_t
memory storage state
memory storage state
Definition: ram.h:90
suit_storage_ram_region_t regions[CONFIG_SUIT_STORAGE_RAM_REGIONS]
ram storage regions
Definition: ram.h:95
uint32_t sequence_no
Ephemeral sequence number.
Definition: ram.h:97
suit_storage_t storage
parent struct
Definition: ram.h:91
size_t active_region
Active region to write to.
Definition: ram.h:96
Single in-memory storage region.
Definition: ram.h:82
size_t occupied
Region space filled.
Definition: ram.h:83
Generic storage backend state.
Definition: storage.h:293