summaryrefslogtreecommitdiff
path: root/include/cbfs.h
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-08-11 02:01:08 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:36 -0700
commitf461780a13efe560edf8a16c8df1e7e9b92d7035 (patch)
tree6b34cdb4af6d9f708882e6e91ee18cf699e724ea /include/cbfs.h
parentc13a7dafd73cdce4a65f3ef332267e832ad1080c (diff)
Refactor the CBFS implementation and add a cbfs_file_find_uncached function
If u-boot needs something out of CBFS very early before the heap is configured, it won't be able to use the normal CBFS support which caches some information in memory it allocates from the heap. This change adds a new cbfs_file_find_uncached function which searchs a CBFS instance without touching the heap. It also refactors the implementation of u-boot's CBFS support to avoid code duplication, and allows some functions to be used without CBFS being initialized which sets up the cache on the heap. BUG=chrome-os-partner:5432 TEST=Built x86-alex, verified that the CBFS commands still work, and with later changes verified that the device tree could be loaded from CBFS before the heap is initialized. Signed-off-by: Gabe Black <gabeblack@google.com> Change-Id: Ia57a5c553a0cd524073c05ca964501ccf6c5e025 Reviewed-on: http://gerrit.chromium.org/gerrit/5858 Tested-by: Gabe Black <gabeblack@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cbfs.h')
-rw-r--r--include/cbfs.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/cbfs.h b/include/cbfs.h
index d74759646f..d5d9cbe350 100644
--- a/include/cbfs.h
+++ b/include/cbfs.h
@@ -106,6 +106,22 @@ void file_cbfs_get_next(CbfsFile *file);
*/
CbfsFile file_cbfs_find(const char *name);
+
+/***************************************************************************/
+/* All of the functions below can be used without first initializing CBFS. */
+/***************************************************************************/
+
+/*
+ * Find a file with a particular name in CBFS without using the heap.
+ *
+ * @param end_of_rom Points to the end of the ROM the CBFS should be read
+ * from.
+ * @param name The name to search for.
+ *
+ * @return A handle to the file, or NULL on error.
+ */
+CbfsFile file_cbfs_find_uncached(uintptr_t end_of_rom, const char *name);
+
/*
* Get the name of a file in CBFS.
*