From d66f1da846f8e524a6211518c46a993d563b4ffc Mon Sep 17 00:00:00 2001 From: Daisuke Nojiri Date: Thu, 9 Jul 2015 15:07:45 -0700 Subject: libpayload: allow compression at file header level Decompression is handled transparently within cbfs_get_file_content: const char *name = "foo.bmp"; void *dst = cbfs_get_file_content(media, name, type, NULL); To keep things consistent, a couple of API changes were necessary: - cbfs_get_file_content always returns a copy of the data, even for uncompressed files. It's the callers responsibility to free the memory. - same for cbfs_load_payload and cbfs_find_file. - cbfs_load_optionrom doesn't take a "dest" argument anymore but always returns a copy of the data, for compressed and uncompressed files. Like with cbfs_get_file_content, the caller is responsible to free it. It also decompresses based on extended file attributes instead of the cbfs_optionrom subheader that libpayload specified but that (AFAIK) nobody ever used, given that there's not even tooling for that. Change-Id: If959e3dff9b93c6ae45ec7358afcc7840bc17218 Signed-off-by: Daisuke Nojiri Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/10938 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- payloads/libpayload/include/cbfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads/libpayload/include/cbfs.h') diff --git a/payloads/libpayload/include/cbfs.h b/payloads/libpayload/include/cbfs.h index 59c31dbb93..f57dce0bdd 100644 --- a/payloads/libpayload/include/cbfs.h +++ b/payloads/libpayload/include/cbfs.h @@ -59,7 +59,7 @@ void *cbfs_find_file(const char *name, int type); int cbfs_execute_stage(struct cbfs_media *media, const char *name); void *cbfs_load_optionrom(struct cbfs_media *media, uint16_t vendor, - uint16_t device, void * dest); + uint16_t device); void *cbfs_load_payload(struct cbfs_media *media, const char *name); void *cbfs_load_stage(struct cbfs_media *media, const char *name); -- cgit v1.2.3