aboutsummaryrefslogtreecommitdiff
path: root/src/include/imd.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-03-24 23:14:46 -0500
committerAaron Durbin <adurbin@chromium.org>2015-04-22 17:54:50 +0200
commitcac50506238507328b8ea0f4abd458869803e6c2 (patch)
tree0f4b6716b90577b9c53df4a22bb8661190884c18 /src/include/imd.h
parent20686d851ce450750039f5f871160d49118a2210 (diff)
coreboot: tiered imd
A tiered imd allows for both small and large allocations. The small allocations are packed into a large region. Utilizing a tiered imd reduces internal fragmentation within the imd. Change-Id: I0bcd6473aacbc714844815b24d77cb5c542abdd0 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8623 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/include/imd.h')
-rw-r--r--src/include/imd.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/include/imd.h b/src/include/imd.h
index 8d5c4522b7..a444b4fbb1 100644
--- a/src/include/imd.h
+++ b/src/include/imd.h
@@ -82,6 +82,18 @@ void imd_handle_init_partial_recovery(struct imd *imd);
int imd_create_empty(struct imd *imd, size_t root_size, size_t entry_align);
/*
+ * Create an empty imd with both large and small allocations. The small
+ * allocations come from a fixed imd stored internally within the large
+ * imd. The region allocated for tracking the smaller allocations is dependent
+ * on the small root_size and the large entry alignment by calculating the
+ * number of entries within the small imd and multiplying that by the small
+ * entry alignment.
+ */
+int imd_create_tiered_empty(struct imd *imd,
+ size_t lg_root_size, size_t lg_entry_align,
+ size_t sm_root_size, size_t sm_entry_align);
+
+/*
* Recover a previously created imd.
*/
int imd_recover(struct imd *imd);
@@ -131,9 +143,13 @@ int imd_print_entries(const struct imd *imd, const struct imd_lookup *lookup,
* NOTE: Do not directly touch any fields within this structure. An imd pointer
* is meant to be opaque, but the fields are exposed for stack allocation.
*/
-struct imd {
+struct imdr {
uintptr_t limit;
void *r;
};
+struct imd {
+ struct imdr lg;
+ struct imdr sm;
+};
#endif /* _IMD_H_ */