xref: /linux/arch/arm/boot/compressed/decompress.c (revision 8b1935e6a36b0967efc593d67ed3aebbfbc1f5b1)
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 
15 #define ARCH_HAS_DECOMP_WDOG
16 
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 
34 #ifdef CONFIG_KERNEL_GZIP
35 #include "../../../../lib/decompress_inflate.c"
36 #endif
37 
38 #ifdef CONFIG_KERNEL_LZO
39 #include "../../../../lib/decompress_unlzo.c"
40 #endif
41 
42 void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
43 {
44 	decompress(input, len, NULL, NULL, output, NULL, error);
45 }
46