From 809fa7b5c2df4bf926753a9e35f4330954ac1426 Mon Sep 17 00:00:00 2001 From: T Michael Turney Date: Thu, 12 Apr 2018 13:36:40 -0700 Subject: cbfs: Add cbfs_boot_load_file() Generalize cbfs_boot_load_struct() by passing in CBFS type Change-Id: I6e5f845cb4ce5b00f01a39619919f85e39028f19 Signed-off-by: T Michael Turney Reviewed-on: https://review.coreboot.org/25648 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Julius Werner --- src/include/cbfs.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/include/cbfs.h') diff --git a/src/include/cbfs.h b/src/include/cbfs.h index 1dac504242..85e25b3d9b 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -37,11 +37,12 @@ void *cbfs_boot_map_with_leak(const char *name, uint32_t type, size_t *size); /* Locate file in a specific region of fmap. Return 0 on success. < 0 on error*/ int cbfs_locate_file_in_region(struct cbfsf *fh, const char *region_name, const char *name, uint32_t *type); -/* Load a struct file from CBFS into a buffer. Returns amount of loaded - * bytes on success or 0 on error. File will get decompressed as necessary. - * Same decompression requirements as cbfs_load_and_decompress(). */ -size_t cbfs_boot_load_struct(const char *name, void *buf, size_t buf_size); - +/* Load an arbitrary type file from CBFS into a buffer. Returns amount of + * loaded bytes on success or 0 on error. File will get decompressed as + * necessary. Same decompression requirements as + * cbfs_load_and_decompress(). */ +size_t cbfs_boot_load_file(const char *name, void *buf, size_t buf_size, + uint32_t type); /* 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. -- cgit v1.2.3