From 2090854cd2f228bab546f2718ccdbe1664830d3c Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 24 Jul 2019 19:37:54 -0700 Subject: common: Move bootm_decomp_image() to image.c (as image_decomp()) Upcoming patches want to add decompression to use cases that are no longer directly related to booting. It makes sense to retain a single decompression routine, but it should no longer be in bootm.c (which is not compiled for all configurations). This patch moves bootm_decomp_image() to image.c and renames it to image_decomp() in preparation of those upcoming patches. Signed-off-by: Julius Werner Reviewed-by: Simon Goldschmidt [trini: Fix warning around handle_decomp_error being unused] Signed-off-by: Tom Rini --- include/image.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/image.h') diff --git a/include/image.h b/include/image.h index 5f821949513..27d7cb9d1e8 100644 --- a/include/image.h +++ b/include/image.h @@ -849,6 +849,23 @@ static inline int image_check_target_arch(const image_header_t *hdr) } #endif /* USE_HOSTCC */ +/** + * image_decomp() - decompress an image + * + * @comp: Compression algorithm that is used (IH_COMP_...) + * @load: Destination load address in U-Boot memory + * @image_start Image start address (where we are decompressing from) + * @type: OS type (IH_OS_...) + * @load_bug: Place to decompress to + * @image_buf: Address to decompress from + * @image_len: Number of bytes in @image_buf to decompress + * @unc_len: Available space for decompression + * @return 0 if OK, -ve on error (BOOTM_ERR_...) + */ +int image_decomp(int comp, ulong load, ulong image_start, int type, + void *load_buf, void *image_buf, ulong image_len, + uint unc_len, ulong *load_end); + /** * Set up properties in the FDT * -- cgit v1.2.3