util/cse_serger: Replace cse_layout_regions with array of regions

This change replaces `struct cse_layout_regions` with an array of
`struct region` and introduces enums for DP and BP[1-4]. This makes it
easier to loop over the different regions in following changes.

BUG=b:189177186

Change-Id: If3cced4506d26dc534047cb9c385aaa9418d8522
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58214
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Furquan Shaikh
2021-10-09 23:06:09 -07:00
parent 5d8f4badda
commit 8b4ca15d7e
4 changed files with 49 additions and 38 deletions

View File

@ -27,12 +27,13 @@ enum subpart_entry_version {
SUBPART_ENTRY_VERSION_1 = 1,
};
struct cse_layout_regions {
struct region data_partition;
struct region bp1;
struct region bp2;
struct region bp3;
struct region bp4;
enum {
DP,
BP1,
BP2,
BP3,
BP4,
BP_TOTAL,
};
typedef void *cse_layout_ptr;
@ -56,7 +57,7 @@ struct bpdt_ops {
size_t (*get_entry_count)(const bpdt_hdr_ptr ptr);
void (*inc_entry_count)(bpdt_hdr_ptr ptr);
cse_layout_ptr (*create_layout)(const struct cse_layout_regions *regions);
cse_layout_ptr (*create_layout)(const struct region *regions);
void (*print_layout)(const cse_layout_ptr ptr);
cse_layout_ptr (*read_layout)(struct buffer *buff);
int (*write_layout)(struct buffer *buff, const cse_layout_ptr ptr);