From 215d1d7c9b8fdd94582bdec711e98111d1db5bb7 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Tue, 29 Jan 2013 03:46:02 +0800 Subject: cbfstool: Use cbfs_image API for "locate" command. To support platforms without top-aligned address mapping like ARM, "locate" command now outputs platform independent ROM offset by default. To retrieve x86 style top-aligned virtual address, add "-T". To test: cbfstool coreboot.rom locate -f stage -n stage -a 0x100000 -T # Example output: 0xffffdc10 Change-Id: I474703c4197b36524b75407a91faab1194edc64d Signed-off-by: Hung-Te Lin Reviewed-on: http://review.coreboot.org/2213 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/cbfstool/cbfs_image.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'util/cbfstool/cbfs_image.h') diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h index 73b262da18b7..d99bee851e0c 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -49,6 +49,16 @@ int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, /* Removes an entry from CBFS image. Returns 0 on success, otherwise non-zero. */ int cbfs_remove_entry(struct cbfs_image *image, const char *name); +/* Initializes a new empty (type = NULL) entry with size and name in CBFS image. + * Returns 0 on success, otherwise (ex, not found) non-zero. */ +int cbfs_create_empty_entry(struct cbfs_image *image, struct cbfs_file *entry, + size_t len, const char *name); + +/* Finds a location to put given content in same memory page. + * 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); + /* Callback function used by cbfs_walk. * Returns 0 on success, or non-zero to stop further iteration. */ typedef int (*cbfs_entry_callback)(struct cbfs_image *image, @@ -90,4 +100,9 @@ int cbfs_print_header_info(struct cbfs_image *image); int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry, void *arg); +/* Merge empty entries starting from given entry. + * Returns 0 on success, otherwise non-zero. */ +int cbfs_merge_empty_entry(struct cbfs_image *image, struct cbfs_file *entry, + void *arg); + #endif -- cgit v1.2.3