blob: 9deb56a702ce743e1534b55054b7d1ba5685e28c [file] [log] [blame]
Russell King5de813b2010-02-25 12:14:40 +00001#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
9extern unsigned long free_mem_ptr;
10extern unsigned long free_mem_end_ptr;
11extern void error(char *);
12
13#define STATIC static
Russell Kingb89ebad2010-03-15 14:29:22 +000014#define STATIC_RW_DATA /* non-static please */
Russell King5de813b2010-02-25 12:14:40 +000015
16#define ARCH_HAS_DECOMP_WDOG
17
18/* Diagnostic functions */
19#ifdef DEBUG
20# define Assert(cond,msg) {if(!(cond)) error(msg);}
21# define Trace(x) fprintf x
22# define Tracev(x) {if (verbose) fprintf x ;}
23# define Tracevv(x) {if (verbose>1) fprintf x ;}
24# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
25# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
26#else
27# define Assert(cond,msg)
28# define Trace(x)
29# define Tracev(x)
30# define Tracevv(x)
31# define Tracec(c,x)
32# define Tracecv(c,x)
33#endif
34
Rob Herringef1c2092012-08-15 16:28:36 +010035/* Not needed, but used in some headers pulled in by decompressors */
36extern char * strstr(const char * s1, const char *s2);
37
Russell King5de813b2010-02-25 12:14:40 +000038#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
Albin Tonnerre6e8699f2010-04-03 11:40:28 +010046#ifdef CONFIG_KERNEL_LZMA
47#include "../../../../lib/decompress_unlzma.c"
48#endif
49
Imre Kaloza7f464f2012-01-26 13:08:57 +010050#ifdef CONFIG_KERNEL_XZ
51#define memmove memmove
52#define memcpy memcpy
53#include "../../../../lib/decompress_unxz.c"
54#endif
55
Nicolas Pitreccc1c7c2011-04-21 21:59:49 -040056int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
Russell King5de813b2010-02-25 12:14:40 +000057{
Nicolas Pitreccc1c7c2011-04-21 21:59:49 -040058 return decompress(input, len, NULL, NULL, output, NULL, error);
Russell King5de813b2010-02-25 12:14:40 +000059}