summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-15 18:00:13 +1300
committerSimon Glass <sjg@chromium.org>2021-03-27 13:59:37 +1300
commitc4f5b5dcc31b5aee37dabbadc998fcf695885157 (patch)
tree95f2a352718472e21ae4fbede8e1e2de7c472d35 /fs
parent5536f1285fd2f9ec3e177d6e74b7eb73c6821c8b (diff)
downloadu-boot-c4f5b5dcc31b5aee37dabbadc998fcf695885157.tar.gz
u-boot-c4f5b5dcc31b5aee37dabbadc998fcf695885157.tar.xz
u-boot-c4f5b5dcc31b5aee37dabbadc998fcf695885157.zip
cbfs: Allow file traversal with any CBFS
The file traversal functions currently use a single global CBFS. In some cases we need to access multiple CBFSs to obtain different files. Add new functions to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cbfs/cbfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index 13a74e6ed4..aed4026d65 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -325,6 +325,17 @@ const struct cbfs_header *file_cbfs_get_header(void)
}
}
+const struct cbfs_cachenode *cbfs_get_first(const struct cbfs_priv *priv)
+{
+ return priv->file_cache;
+}
+
+void cbfs_get_next(const struct cbfs_cachenode **filep)
+{
+ if (*filep)
+ *filep = (*filep)->next;
+}
+
const struct cbfs_cachenode *file_cbfs_get_first(void)
{
struct cbfs_priv *priv = &cbfs_s;