Jakub Czapiga | a01138b | 2020-10-05 10:20:29 +0200 | [diff] [blame] | 1 | #ifndef _IMD_PRIVATE_H_ |
| 2 | #define _IMD_PRIVATE_H_ |
| 3 | |
| 4 | #include <commonlib/bsd/helpers.h> |
| 5 | |
| 6 | /* In-memory data structures. */ |
| 7 | struct imd_root_pointer { |
| 8 | uint32_t magic; |
| 9 | /* Relative to upper limit/offset. */ |
| 10 | int32_t root_offset; |
| 11 | } __packed; |
| 12 | |
| 13 | struct 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 | |
| 21 | struct 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 */ |