summaryrefslogtreecommitdiff
path: root/src/include/cbfs_core.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-06-27 15:06:02 -0500
committerMarc Jones <marc.jones@se-eng.com>2015-01-13 21:29:53 +0100
commitb312b7f4660d6e32d08659ebb5fe0d3bb5635916 (patch)
tree99c6f73257c64da1f9f3aefb139780adbae1f95f /src/include/cbfs_core.h
parent01f5396bdce2cd69e91c54ef120b11e457ab2694 (diff)
downloadcoreboot-b312b7f4660d6e32d08659ebb5fe0d3bb5635916.tar.xz
cbfs: add cbfs_locate_file()
cbfs_locate_file() can be used to locate the data within the cbfs file. Based on the offset and length of the file it can then be read into any address without bringing the contents into another buffer (platforms without memory-mapped access to entire contents of cbfs at once). BUG=chrome-os-partner:29922 BRANCH=None TEST=Built and booted rush into romstage (stage load still works). Original-Change-Id: I2932f66478c74511ec1c876b09794d9a22a526b3 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/206000 Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> (cherry picked from commit 56c958facd379ca0eeebe1b689e3b80d5e692699) Signed-off-by: Marc Jones <marc.jones@se-eng.com> Change-Id: I0c4964132af615a069258c0eb37153bd84fbbfae Reviewed-on: http://review.coreboot.org/8180 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/include/cbfs_core.h')
-rw-r--r--src/include/cbfs_core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/cbfs_core.h b/src/include/cbfs_core.h
index e74d618d92..3cef9031ab 100644
--- a/src/include/cbfs_core.h
+++ b/src/include/cbfs_core.h
@@ -217,6 +217,13 @@ struct cbfs_media {
int (*close)(struct cbfs_media *media);
};
+/*
+ * Locate file by name and fill in cbfs_file in host byte order. Returns
+ * < 0 on error, else the offset of the file data.
+ */
+ssize_t cbfs_locate_file(struct cbfs_media *media, struct cbfs_file *file,
+ const char *name);
+
/* returns pointer to a file entry inside CBFS or NULL */
struct cbfs_file *cbfs_get_file(struct cbfs_media *media, const char *name);