summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-07-15 16:40:44 +0200
committerPatrick Georgi <pgeorgi@google.com>2015-07-16 17:38:19 +0200
commit5dc01ac5067abe6da340d8eadcb3b2aed8ab6fa7 (patch)
tree1794fbb346aca2e10e5a023d24b9851de2de0dbc /util/cbfstool
parent1d14b3e926c15027f9272f1e80b8913fef8cf25d (diff)
downloadcoreboot-5dc01ac5067abe6da340d8eadcb3b2aed8ab6fa7.tar.xz
cbfstool: improve specification of struct cbfs_file
Lock down its size and document some of the fields Change-Id: I09fd6c80185345da0ae17d0f4498b50995fd1ec5 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10927 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/cbfs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs.h b/util/cbfstool/cbfs.h
index 14a7a37b2b..6286effb10 100644
--- a/util/cbfstool/cbfs.h
+++ b/util/cbfstool/cbfs.h
@@ -71,12 +71,16 @@ struct cbfs_header {
struct cbfs_file {
uint8_t magic[8];
+ /* length of file data */
uint32_t len;
uint32_t type;
uint32_t checksum;
+ /* length of header incl. variable data */
uint32_t offset;
} __PACKED;
+_Static_assert(sizeof(struct cbfs_file) == 24, "cbfs_file size mismatch");
+
struct cbfs_stage {
uint32_t compression;
uint64_t entry;