blob: 43c3b7d50b06d0f8b0d1f63bb0fa57c2d3e335ff [file] [log] [blame]
Jakub Czapigaa01138b2020-10-05 10:20:29 +02001#ifndef _IMD_PRIVATE_H_
2#define _IMD_PRIVATE_H_
3
4#include <commonlib/bsd/helpers.h>
5
6/* In-memory data structures. */
7struct imd_root_pointer {
8 uint32_t magic;
9 /* Relative to upper limit/offset. */
10 int32_t root_offset;
11} __packed;
12
13struct imd_entry {
14 uint32_t magic;
15 /* start is located relative to imd_root */
16 int32_t start_offset;
17 uint32_t size;
18 uint32_t id;
19} __packed;
20
21struct imd_root {
22 uint32_t max_entries;
23 uint32_t num_entries;
24 uint32_t flags;
25 uint32_t entry_align;
26 /* Used for fixing the size of an imd. Relative to the root. */
27 int32_t max_offset;
28 struct imd_entry entries[0];
29} __packed;
30
31#define IMD_ROOT_PTR_MAGIC 0xc0389481
32#define IMD_ENTRY_MAGIC (~0xc0389481)
33#define SMALL_REGION_ID CBMEM_ID_IMD_SMALL
34#define LIMIT_ALIGN 4096
35
36#define IMD_FLAG_LOCKED 1
37
38#endif /* _IMD_PRIVATE_H */