From 2f953d304e02be9a2f4f6fbd86b41dd6c86ec5db Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 11 Sep 2015 18:34:39 +0200 Subject: cbfstool: prefer fmap data over cbfs master header if it exists Up to now, if both fmap and a master header existed, the master header was used. Now, use the master header only if no fmap is found. Change-Id: Iafbf2c9dc325597e23a9780b495549b5d912e9ad Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/11629 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- util/cbfstool/partitioned_file.h | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'util/cbfstool/partitioned_file.h') diff --git a/util/cbfstool/partitioned_file.h b/util/cbfstool/partitioned_file.h index 45833161e4..3698a19b3a 100644 --- a/util/cbfstool/partitioned_file.h +++ b/util/cbfstool/partitioned_file.h @@ -28,15 +28,6 @@ typedef struct partitioned_file partitioned_file_t; -/** @return Whether the specific existing file should be opened in flat mode. */ -typedef bool (*partitioned_file_flat_decider_t)(struct buffer *buffer); - -/** Pass to partitioned_file_reopen() to force opening as a partitioned file. */ -#define partitioned_file_open_as_partitioned NULL - -/** Pass to partitioned_file_reopen() to force opening as a flat file. */ -extern const partitioned_file_flat_decider_t partitioned_file_open_as_flat; - /** * Create a new filesystem-backed flat buffer. * This backwards-compatibility function creates a new in-memory buffer and @@ -76,22 +67,17 @@ partitioned_file_t *partitioned_file_create(const char *filename, /** * Read a file back in from the disk. - * An in-memory buffer is created and populated with the file's contents. If - * flat_override is NULL and the image contains an FMAP, it will be opened as a - * full partitioned file; otherwise, it will be opened as a flat file as if it - * had been created by partitioned_file_create_flat(). This selection behavior - * is extensible: if a flat_override function is provided, it is invoked before - * searching for an FMAP, and has the option of explicitly instructing the - * module to open the image as a flat file based on its contents. + * An in-memory buffer is created and populated with the file's + * contents. If the image contains an FMAP, it will be opened as a + * full partitioned file; otherwise, it will be opened as a flat file as + * if it had been created by partitioned_file_create_flat(). * The partitioned_file_t returned from this function is separately owned by the * caller, and must later be passed to partitioned_file_close(); * * @param filename Name of the file to read in - * @param flat_override Callback that can decide to open it as flat, or NULL * @return Caller-owned partitioned file, or NULL on error */ -partitioned_file_t *partitioned_file_reopen(const char *filename, - partitioned_file_flat_decider_t flat_override); +partitioned_file_t *partitioned_file_reopen(const char *filename); /** * Write a buffer's contents to its original region within a segmented file. -- cgit v1.2.3