Merge tag 'omap-for-v4.14/fixes-not-urgent-dt-signed' of git://git.kernel.org/pub...
[sfrench/cifs-2.6.git] / arch / arm / boot / compressed / decompress.c
1 #define _LINUX_STRING_H_
2
3 #include <linux/compiler.h>     /* for inline */
4 #include <linux/types.h>        /* for size_t */
5 #include <linux/stddef.h>       /* for NULL */
6 #include <linux/linkage.h>
7 #include <asm/string.h>
8
9 extern unsigned long free_mem_ptr;
10 extern unsigned long free_mem_end_ptr;
11 extern void error(char *);
12
13 #define STATIC static
14 #define STATIC_RW_DATA  /* non-static please */
15
16 /* Diagnostic functions */
17 #ifdef DEBUG
18 #  define Assert(cond,msg) {if(!(cond)) error(msg);}
19 #  define Trace(x) fprintf x
20 #  define Tracev(x) {if (verbose) fprintf x ;}
21 #  define Tracevv(x) {if (verbose>1) fprintf x ;}
22 #  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
23 #  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
24 #else
25 #  define Assert(cond,msg)
26 #  define Trace(x)
27 #  define Tracev(x)
28 #  define Tracevv(x)
29 #  define Tracec(c,x)
30 #  define Tracecv(c,x)
31 #endif
32
33 /* Not needed, but used in some headers pulled in by decompressors */
34 extern char * strstr(const char * s1, const char *s2);
35 extern size_t strlen(const char *s);
36 extern int memcmp(const void *cs, const void *ct, size_t count);
37
38 #ifdef CONFIG_KERNEL_GZIP
39 #include "../../../../lib/decompress_inflate.c"
40 #endif
41
42 #ifdef CONFIG_KERNEL_LZO
43 #include "../../../../lib/decompress_unlzo.c"
44 #endif
45
46 #ifdef CONFIG_KERNEL_LZMA
47 #include "../../../../lib/decompress_unlzma.c"
48 #endif
49
50 #ifdef CONFIG_KERNEL_XZ
51 #define memmove memmove
52 #define memcpy memcpy
53 #include "../../../../lib/decompress_unxz.c"
54 #endif
55
56 #ifdef CONFIG_KERNEL_LZ4
57 #include "../../../../lib/decompress_unlz4.c"
58 #endif
59
60 int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
61 {
62         return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
63 }