summaryrefslogtreecommitdiff
path: root/include/cbfs.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-14 19:56:14 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-08-18 21:54:10 +0800
commit630b2f39ddabd43a27a98f0356b948df18e97d88 (patch)
tree4de393a9f9563d12041f6cd3ff60285d398ffd52 /include/cbfs.h
parentc7f16934749b054ce1f0b75bd664d22af8b7c588 (diff)
cbfs: Add functions to support multiple CBFSs
Sometimes an image has multiple CBFS. The current CBFS API is limited to handling only one at time. Also it keeps track of the CBFS internally in BSS, which does not work before relocation, for example. Add a few new functions to overcome these limitations. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/cbfs.h')
-rw-r--r--include/cbfs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/cbfs.h b/include/cbfs.h
index 742e34e24f..6d4c4d4b06 100644
--- a/include/cbfs.h
+++ b/include/cbfs.h
@@ -135,6 +135,28 @@ void file_cbfs_get_next(const struct cbfs_cachenode **file);
*/
const struct cbfs_cachenode *file_cbfs_find(const char *name);
+struct cbfs_priv *priv;
+
+/**
+ * cbfs_find_file() - Find a file in a given CBFS
+ *
+ * @cbfs: CBFS to look in (use cbfs_init_mem() to set it up)
+ * @name: Filename to look for
+ * @return pointer to CBFS node if found, else NULL
+ */
+const struct cbfs_cachenode *cbfs_find_file(struct cbfs_priv *cbfs,
+ const char *name);
+
+/**
+ * cbfs_init_mem() - Set up a new CBFS
+ *
+ * @base: Base address of CBFS
+ * @size: Size of CBFS in bytes
+ * @cbfsp: Returns a pointer to CBFS on success
+ * @return 0 if OK, -ve on error
+ */
+int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp);
+
/***************************************************************************/
/* All of the functions below can be used without first initializing CBFS. */