Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
5de813b6 RK |
2 | #define _LINUX_STRING_H_ |
3 | ||
4 | #include <linux/compiler.h> /* for inline */ | |
5 | #include <linux/types.h> /* for size_t */ | |
6 | #include <linux/stddef.h> /* for NULL */ | |
7 | #include <linux/linkage.h> | |
8 | #include <asm/string.h> | |
9 | ||
10 | extern unsigned long free_mem_ptr; | |
11 | extern unsigned long free_mem_end_ptr; | |
12 | extern void error(char *); | |
13 | ||
14 | #define STATIC static | |
b89ebadc | 15 | #define STATIC_RW_DATA /* non-static please */ |
5de813b6 | 16 | |
5de813b6 RK |
17 | /* Diagnostic functions */ |
18 | #ifdef DEBUG | |
19 | # define Assert(cond,msg) {if(!(cond)) error(msg);} | |
20 | # define Trace(x) fprintf x | |
21 | # define Tracev(x) {if (verbose) fprintf x ;} | |
22 | # define Tracevv(x) {if (verbose>1) fprintf x ;} | |
23 | # define Tracec(c,x) {if (verbose && (c)) fprintf x ;} | |
24 | # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} | |
25 | #else | |
26 | # define Assert(cond,msg) | |
27 | # define Trace(x) | |
28 | # define Tracev(x) | |
29 | # define Tracevv(x) | |
30 | # define Tracec(c,x) | |
31 | # define Tracecv(c,x) | |
32 | #endif | |
33 | ||
ef1c2096 RH |
34 | /* Not needed, but used in some headers pulled in by decompressors */ |
35 | extern char * strstr(const char * s1, const char *s2); | |
7b96ddd0 | 36 | extern size_t strlen(const char *s); |
2c6deb01 | 37 | extern int memcmp(const void *cs, const void *ct, size_t count); |
ef1c2096 | 38 | |
5de813b6 RK |
39 | #ifdef CONFIG_KERNEL_GZIP |
40 | #include "../../../../lib/decompress_inflate.c" | |
41 | #endif | |
42 | ||
43 | #ifdef CONFIG_KERNEL_LZO | |
44 | #include "../../../../lib/decompress_unlzo.c" | |
45 | #endif | |
46 | ||
6e8699f7 AT |
47 | #ifdef CONFIG_KERNEL_LZMA |
48 | #include "../../../../lib/decompress_unlzma.c" | |
49 | #endif | |
50 | ||
a7f464f3 IK |
51 | #ifdef CONFIG_KERNEL_XZ |
52 | #define memmove memmove | |
53 | #define memcpy memcpy | |
54 | #include "../../../../lib/decompress_unxz.c" | |
55 | #endif | |
56 | ||
f9b493ac KL |
57 | #ifdef CONFIG_KERNEL_LZ4 |
58 | #include "../../../../lib/decompress_unlz4.c" | |
59 | #endif | |
60 | ||
ccc1c7c6 | 61 | int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)) |
5de813b6 | 62 | { |
2d3862d2 | 63 | return __decompress(input, len, NULL, NULL, output, 0, NULL, error); |
5de813b6 | 64 | } |