diff options
author | Simon Glass <sjg@chromium.org> | 2019-11-14 12:57:25 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-02 18:23:11 -0500 |
commit | 6c03f9e618f4a94900bdd5857117811e21ffb959 (patch) | |
tree | aefbfc95146d87ee4c50775259fe8246d2cfab1c /include | |
parent | b03e0510d769381ce3cda5a494889bfee5042c59 (diff) | |
download | u-boot-6c03f9e618f4a94900bdd5857117811e21ffb959.zip u-boot-6c03f9e618f4a94900bdd5857117811e21ffb959.tar.gz u-boot-6c03f9e618f4a94900bdd5857117811e21ffb959.tar.bz2 |
common: Add a new lz4.h header file
Add a header file to house the lz4 compression function. Add a comment
while we are here, since it not even clear from the name what the function
actuall does.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 3 | ||||
-rw-r--r-- | include/lz4.h | 24 |
2 files changed, 24 insertions, 3 deletions
diff --git a/include/common.h b/include/common.h index f433db1..1e77ed3 100644 --- a/include/common.h +++ b/include/common.h @@ -292,9 +292,6 @@ void wait_ticks (unsigned long); ulong usec2ticks (unsigned long usec); ulong ticks2usec (unsigned long ticks); -/* lib/lz4_wrapper.c */ -int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); - /* lib/uuid.c */ #include <uuid.h> diff --git a/include/lz4.h b/include/lz4.h new file mode 100644 index 0000000..1276fb9 --- /dev/null +++ b/include/lz4.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2019 Google LLC + */ + +#ifndef __LZ4_H +#define __LZ4_H + +/** + * ulz4fn() - Decompress LZ4 data + * + * @src: Source data to decompress + * @srcn: Length of source data + * @dst: Destination for uncompressed data + * @dstn: Returns length of uncompressed data + * @return 0 if OK, -EPROTONOSUPPORT if the magic number or version number are + * not recognised or independent blocks are used, -EINVAL if the reserved + * fields are non-zero, or input is overrun, -EENOBUFS if the destination + * buffer is overrun, -EEPROTO if the compressed data causes an error in + * the decompression algorithm + */ +int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); + +#endif |