summaryrefslogtreecommitdiff
path: root/include/gzip.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-09-25 16:03:13 +0300
committerTom Rini <trini@konsulko.com>2021-10-08 22:53:26 +0300
commit5a4f10d71bfe2b7a5646cf1f96b298805b36df7a (patch)
tree69d26ef5c2dd88d04f7700e2c0542fedc12cf01a /include/gzip.h
parent02ace2cd4942da507414b23645cd7bec99f23174 (diff)
downloadu-boot-5a4f10d71bfe2b7a5646cf1f96b298805b36df7a.tar.xz
gzip: Avoid use of u64
The gzip API uses the u64 type in it, which is not available in the host build. This makes it impossible to include the header file. We could make this type available, but it seems unnecessary. Limiting the compression size to that of the 'unsigned long' type seems good enough. On 32-bit machines the limit then becomes 4GB, which likely exceeds available RAM anyway, therefore it should be sufficient. On 64-bit machines this is effectively u64 anyway. Update the header file and implementation to use 'ulong' instead of 'u64'. Add a definition of u32 for the cases that seem to need exactly that length. This should be safe enough. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/gzip.h')
-rw-r--r--include/gzip.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/gzip.h b/include/gzip.h
index 783acbb60d..cb4db3d70f 100644
--- a/include/gzip.h
+++ b/include/gzip.h
@@ -54,11 +54,11 @@ int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp,
* gzwrite_progress_finish called at end of loop to
* indicate success (retcode=0) or failure
*/
-void gzwrite_progress_init(u64 expected_size);
+void gzwrite_progress_init(ulong expected_size);
-void gzwrite_progress(int iteration, u64 bytes_written, u64 total_bytes);
+void gzwrite_progress(int iteration, ulong bytes_written, ulong total_bytes);
-void gzwrite_progress_finish(int retcode, u64 totalwritten, u64 totalsize,
+void gzwrite_progress_finish(int retcode, ulong totalwritten, ulong totalsize,
u32 expected_crc, u32 calculated_crc);
/**
@@ -74,7 +74,7 @@ void gzwrite_progress_finish(int retcode, u64 totalwritten, u64 totalsize,
* @return 0 if OK, -1 on error
*/
int gzwrite(unsigned char *src, int len, struct blk_desc *dev, ulong szwritebuf,
- u64 startoffs, u64 szexpected);
+ ulong startoffs, ulong szexpected);
/**
* gzip()- Compress data into a buffer using the gzip algorithm