aboutsummaryrefslogtreecommitdiffstats
path: root/libflashrom.h
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-06-16 19:46:46 +0200
committerNico Huber <nico.h@gmx.de>2021-06-26 15:54:51 +0000
commitc32c8dc8af9e971f91feaee145f1e8d6f114cad6 (patch)
tree08094ba25f338f3ab83451edec8352333fdc9c5e /libflashrom.h
parentf394fcec0da2fd4a9d1bd7a7911065344e67ce34 (diff)
downloadflashrom-c32c8dc8af9e971f91feaee145f1e8d6f114cad6.tar.gz
flashrom-c32c8dc8af9e971f91feaee145f1e8d6f114cad6.tar.bz2
flashrom-c32c8dc8af9e971f91feaee145f1e8d6f114cad6.zip
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 <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33543 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'libflashrom.h')
-rw-r--r--libflashrom.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libflashrom.h b/libflashrom.h
index d04eeb66..b13b3fb8 100644
--- a/libflashrom.h
+++ b/libflashrom.h
@@ -106,6 +106,7 @@ int flashrom_image_write(struct flashrom_flashctx *, void *buffer, size_t buffer
int flashrom_image_verify(struct flashrom_flashctx *, const void *buffer, size_t buffer_len);
struct flashrom_layout;
+int flashrom_layout_new(struct flashrom_layout **, unsigned int count);
int flashrom_layout_read_from_ifd(struct flashrom_layout **, struct flashrom_flashctx *, const void *dump, size_t len);
int flashrom_layout_read_fmap_from_rom(struct flashrom_layout **,
struct flashrom_flashctx *, off_t offset, size_t length);