summaryrefslogtreecommitdiff
path: root/util/cbfstool/partitioned_file.h
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-09-11 18:34:39 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-09-28 10:13:33 +0000
commit2f953d304e02be9a2f4f6fbd86b41dd6c86ec5db (patch)
tree5653a8068aa81a15d5ef3a8b462137526a0d85e4 /util/cbfstool/partitioned_file.h
parent6dd99fcafe83fed2632a90821de6373516c14a0c (diff)
downloadcoreboot-2f953d304e02be9a2f4f6fbd86b41dd6c86ec5db.tar.xz
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 <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/11629 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util/cbfstool/partitioned_file.h')
-rw-r--r--util/cbfstool/partitioned_file.h24
1 files changed, 5 insertions, 19 deletions
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.