summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfs_image.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2013-01-29 03:46:02 +0800
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-02-05 22:27:03 +0100
commit215d1d7c9b8fdd94582bdec711e98111d1db5bb7 (patch)
tree20dea02266a2ca010e57f3379e958e83134043d9 /util/cbfstool/cbfs_image.h
parent49fcd75564e8308d695cf44f54e0e92d693df69b (diff)
downloadcoreboot-215d1d7c9b8fdd94582bdec711e98111d1db5bb7.tar.xz
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 <hungte@chromium.org> Reviewed-on: http://review.coreboot.org/2213 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r--util/cbfstool/cbfs_image.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h
index 73b262da18..d99bee851e 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