diff options
author | Simon Glass <sjg@chromium.org> | 2021-09-25 07:03:09 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-08 15:53:26 -0400 |
commit | 94d0a2efc0315e2c5e3b62a7420292f0ce058079 (patch) | |
tree | 95b1149bb046581e83582fa375e1248e12f27884 /include/linux | |
parent | c45b7920db21c8e0be89b15ea034ff3e9edb8e1d (diff) | |
download | u-boot-94d0a2efc0315e2c5e3b62a7420292f0ce058079.tar.gz u-boot-94d0a2efc0315e2c5e3b62a7420292f0ce058079.tar.bz2 u-boot-94d0a2efc0315e2c5e3b62a7420292f0ce058079.zip |
zstd: Create a function for use from U-Boot
The existing zstd API requires the same sequence of calls to perform its
task. Create a helper for U-Boot, to avoid code duplication, as is done
with other compression algorithms. Make use of of this from the image
code.
Note that the zstd code lacks a test in test/compression.c and this should
be added by the maintainer.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/zstd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/zstd.h b/include/linux/zstd.h index 724f69350e..35ba4c90aa 100644 --- a/include/linux/zstd.h +++ b/include/linux/zstd.h @@ -1144,4 +1144,15 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, size_t ZSTD_insertBlock(ZSTD_DCtx *dctx, const void *blockStart, size_t blockSize); +struct abuf; + +/** + * zstd_decompress() - Decompress Zstandard data + * + * @in: Input buffer to decompress + * @out: Output buffer to hold the results (must be large enough) + * @return size of the decompressed data, or -ve on error + */ +int zstd_decompress(struct abuf *in, struct abuf *out); + #endif /* ZSTD_H */ |