summaryrefslogtreecommitdiff
path: root/src/include/cbfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/cbfs.h')
-rw-r--r--src/include/cbfs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index 0d95387940..2d1921898a 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -35,6 +35,14 @@ int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type);
* the mapping and sets the size of the file. */
void *cbfs_boot_map_with_leak(const char *name, uint32_t type, size_t *size);
+/* Load |in_size| bytes from |rdev| at |offset| to the |buffer_size| bytes
+ * large |buffer|, decompressing it according to |compression| in the process.
+ * Returns the decompressed file size, or 0 on error.
+ * LZMA files will be mapped for decompression. LZ4 files will be decompressed
+ * in-place with the buffer size requirements outlined in compression.h. */
+size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset,
+ size_t in_size, void *buffer, size_t buffer_size, uint32_t compression);
+
/* Load stage into memory filling in prog. Return 0 on success. < 0 on error. */
int cbfs_prog_stage_load(struct prog *prog);