cbfstool: provide metadata size to cbfs_locate_entry()

The cbfs_locate_entry() function had a hack in there which
assumed a struct cbfs_stage data was being added in addition
to the struct cbfs_file and name. Move that logic out to the
callers while still maintaining the logic for consistency.
The only impacted commands cbfs_add and cbfs_locate, but
those are using the default 'always adding struct cbfs_stage'
in addition to cbfs_file + name. Eventually those should be
removed when cbfs_locate is removed as cbfs_add has no smarts
related to the cbfs file type provided.

BUG=chrome-os-partner:44827
BRANCH=None
TEST=Built rambi.

Change-Id: I2771116ea1ff439ea53b8886e1f33e0e637a79d4
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/11668
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Aaron Durbin
2015-09-15 12:50:14 -05:00
parent b39a974d75
commit d7339411a9
3 changed files with 37 additions and 31 deletions

View File

@@ -112,8 +112,8 @@ int cbfs_create_empty_entry(struct cbfs_file *entry, int type,
* "page_size" limits the content to fit on same memory page, and
* "align" specifies starting address alignment.
* Returns a valid offset, or -1 on failure. */
int32_t cbfs_locate_entry(struct cbfs_image *image, const char *name,
uint32_t size, uint32_t page_size, uint32_t align);
int32_t cbfs_locate_entry(struct cbfs_image *image, size_t size,
size_t page_size, size_t align, size_t metadata_size);
/* Callback function used by cbfs_walk.
* Returns 0 on success, or non-zero to stop further iteration. */