From a01138b7a4c5c4d6078d5995d81f5f3c31364db2 Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Mon, 5 Oct 2020 10:20:29 +0200 Subject: lib/imd: move struct definitions to a new header file Make IMD private structures definitions accessible by other units. To test IMD API correctness there is a need to access its internal structure. It is only possible when private implementation is visible in testing scope. Signed-off-by: Jakub Czapiga Change-Id: Iff87cc1990426bee6ac3cc1dfa6f85a787334976 Reviewed-on: https://review.coreboot.org/c/coreboot/+/46216 Tested-by: build bot (Jenkins) Reviewed-by: Paul Fagerburg --- src/include/imd_private.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/include/imd_private.h (limited to 'src/include/imd_private.h') diff --git a/src/include/imd_private.h b/src/include/imd_private.h new file mode 100644 index 0000000000..43c3b7d50b --- /dev/null +++ b/src/include/imd_private.h @@ -0,0 +1,38 @@ +#ifndef _IMD_PRIVATE_H_ +#define _IMD_PRIVATE_H_ + +#include + +/* In-memory data structures. */ +struct imd_root_pointer { + uint32_t magic; + /* Relative to upper limit/offset. */ + int32_t root_offset; +} __packed; + +struct imd_entry { + uint32_t magic; + /* start is located relative to imd_root */ + int32_t start_offset; + uint32_t size; + uint32_t id; +} __packed; + +struct imd_root { + uint32_t max_entries; + uint32_t num_entries; + uint32_t flags; + uint32_t entry_align; + /* Used for fixing the size of an imd. Relative to the root. */ + int32_t max_offset; + struct imd_entry entries[0]; +} __packed; + +#define IMD_ROOT_PTR_MAGIC 0xc0389481 +#define IMD_ENTRY_MAGIC (~0xc0389481) +#define SMALL_REGION_ID CBMEM_ID_IMD_SMALL +#define LIMIT_ALIGN 4096 + +#define IMD_FLAG_LOCKED 1 + +#endif /* _IMD_PRIVATE_H */ -- cgit v1.2.3