summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-09-25 16:03:09 +0300
committerTom Rini <trini@konsulko.com>2021-10-08 22:53:26 +0300
commit94d0a2efc0315e2c5e3b62a7420292f0ce058079 (patch)
tree95b1149bb046581e83582fa375e1248e12f27884 /include/linux
parentc45b7920db21c8e0be89b15ea034ff3e9edb8e1d (diff)
downloadu-boot-94d0a2efc0315e2c5e3b62a7420292f0ce058079.tar.xz
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.h11
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 */