From c32c8dc8af9e971f91feaee145f1e8d6f114cad6 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sun, 16 Jun 2019 19:46:46 +0200 Subject: layout: Introduce flashrom_layout_new() It initializes an empty layout. Currently the maximum number of entries has to be specified, which will vanish once we use dynamic allocation per entry. We replace the two special cases `single_layout` and `ich_layout` with dynamically allocated layouts. As a result, we have to take care to release the `default_layout` in a flashctx once we are done with it. Change-Id: I2ae7246493ff592e631cce924777925c7825e398 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/flashrom/+/33543 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Angel Pons --- ich_descriptors.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'ich_descriptors.h') diff --git a/ich_descriptors.h b/ich_descriptors.h index 727a31ba8..7683ed0f5 100644 --- a/ich_descriptors.h +++ b/ich_descriptors.h @@ -564,11 +564,6 @@ struct ich_descriptors { struct ich_desc_upper_map upper; }; -struct ich_layout { - struct flashrom_layout base; - struct romentry entries[MAX_NUM_FLREGS]; -}; - ssize_t ich_number_of_regions(enum ich_chipset cs, const struct ich_desc_content *content); ssize_t ich_number_of_masters(enum ich_chipset cs, const struct ich_desc_content *content); @@ -587,6 +582,6 @@ int read_ich_descriptors_from_dump(const uint32_t *dump, size_t len, enum ich_ch int read_ich_descriptors_via_fdo(enum ich_chipset cs, void *spibar, struct ich_descriptors *desc); int getFCBA_component_density(enum ich_chipset cs, const struct ich_descriptors *desc, uint8_t idx); -int layout_from_ich_descriptors(struct ich_layout *, const void *dump, size_t len); +int layout_from_ich_descriptors(struct flashrom_layout **, const void *dump, size_t len); #endif /* __ICH_DESCRIPTORS_H__ */ -- cgit v1.2.3