diff options
author | Patrick Georgi <pgeorgi@google.com> | 2015-08-11 15:16:24 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-08-13 16:09:03 +0200 |
commit | f82049793890cf615e7f7604720f3f8603aced87 (patch) | |
tree | 9afe3cac38012f113669b578e2a9b1b155ddf992 /util | |
parent | 4110abca7213b926b6fa08e6b0f6f613ebb7c264 (diff) | |
download | coreboot-f82049793890cf615e7f7604720f3f8603aced87.tar.xz |
cbfstool: allow file data converters to modify the header size
The idea is that they can at some point add extended attributes to the header.
That also needs to be passed, but let's start simple.
Change-Id: I80359843078b149ac433ee3d739ea192592e16e7
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: http://review.coreboot.org/11216
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/cbfstool/cbfstool.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 57db97c6e3..bf51956578 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -115,7 +115,8 @@ static unsigned convert_to_from_top_aligned(const struct buffer *region, return image_size - region->offset - offset; } -typedef int (*convert_buffer_t)(struct buffer *buffer, uint32_t *offset); +typedef int (*convert_buffer_t)(struct buffer *buffer, uint32_t *offset, + uint32_t *header_size); static int cbfs_add_integer_component(const char *name, uint64_t u64val, @@ -203,7 +204,7 @@ static int cbfs_add_component(const char *filename, uint32_t header_size = cbfs_calculate_file_header_size(name); - if (convert && convert(&buffer, &offset) != 0) { + if (convert && convert(&buffer, &offset, &header_size) != 0) { ERROR("Failed to parse file '%s'.\n", filename); buffer_delete(&buffer); return 1; @@ -224,7 +225,8 @@ static int cbfs_add_component(const char *filename, return 0; } -static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset) +static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset, + unused uint32_t *header_size) { struct buffer output; int ret; @@ -239,7 +241,7 @@ static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset) } static int cbfstool_convert_mkpayload(struct buffer *buffer, - unused uint32_t *offset) + unused uint32_t *offset, unused uint32_t *header_size) { struct buffer output; int ret; @@ -269,7 +271,7 @@ static int cbfstool_convert_mkpayload(struct buffer *buffer, } static int cbfstool_convert_mkflatpayload(struct buffer *buffer, - unused uint32_t *offset) + unused uint32_t *offset, unused uint32_t *header_size) { struct buffer output; if (parse_flat_binary_to_payload(buffer, &output, |