diff options
Diffstat (limited to 'payloads/libpayload/libcbfs')
-rw-r--r-- | payloads/libpayload/libcbfs/cbfs.c | 5 | ||||
-rw-r--r-- | payloads/libpayload/libcbfs/cbfs_core.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/payloads/libpayload/libcbfs/cbfs.c b/payloads/libpayload/libcbfs/cbfs.c index 49e4941181..a1cc7e443c 100644 --- a/payloads/libpayload/libcbfs/cbfs.c +++ b/payloads/libpayload/libcbfs/cbfs.c @@ -35,11 +35,16 @@ # include <lzma.h> # define CBFS_CORE_WITH_LZMA # endif +# if IS_ENABLED(CONFIG_LP_LZ4) +# include <lz4.h> +# define CBFS_CORE_WITH_LZ4 +# endif # define CBFS_MINI_BUILD #elif defined(__SMM__) # define CBFS_MINI_BUILD #else # define CBFS_CORE_WITH_LZMA +# define CBFS_CORE_WITH_LZ4 # include <lib.h> #endif diff --git a/payloads/libpayload/libcbfs/cbfs_core.c b/payloads/libpayload/libcbfs/cbfs_core.c index ddf0da5f42..c32d262b33 100644 --- a/payloads/libpayload/libcbfs/cbfs_core.c +++ b/payloads/libpayload/libcbfs/cbfs_core.c @@ -34,6 +34,9 @@ * CBFS_CORE_WITH_LZMA (must be #define) * if defined, ulzma() must exist for decompression of data streams * + * CBFS_CORE_WITH_LZ4 (must be #define) + * if defined, ulz4f() must exist for decompression of data streams + * * ERROR(x...) * print an error message x (in printf format) * @@ -330,6 +333,10 @@ int cbfs_decompress(int algo, void *src, void *dst, int len) case CBFS_COMPRESS_LZMA: return ulzma(src, dst); #endif +#ifdef CBFS_CORE_WITH_LZ4 + case CBFS_COMPRESS_LZ4: + return ulz4f(src, dst); +#endif default: ERROR("tried to decompress %d bytes with algorithm #%x," "but that algorithm id is unsupported.\n", len, |