dyndbg: use the module notifier callbacks
[linux-2.6-block.git] / arch / arm / boot / compressed / decompress.c
CommitLineData
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>
5f8d561f 9#include "misc.h"
5de813b6
RK
10
11#define STATIC static
b89ebadc 12#define STATIC_RW_DATA /* non-static please */
5de813b6 13
5de813b6
RK
14/* Diagnostic functions */
15#ifdef DEBUG
16# define Assert(cond,msg) {if(!(cond)) error(msg);}
17# define Trace(x) fprintf x
18# define Tracev(x) {if (verbose) fprintf x ;}
19# define Tracevv(x) {if (verbose>1) fprintf x ;}
20# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
21# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
22#else
23# define Assert(cond,msg)
24# define Trace(x)
25# define Tracev(x)
26# define Tracevv(x)
27# define Tracec(c,x)
28# define Tracecv(c,x)
29#endif
30
ef1c2096
RH
31/* Not needed, but used in some headers pulled in by decompressors */
32extern char * strstr(const char * s1, const char *s2);
7b96ddd0 33extern size_t strlen(const char *s);
2c6deb01 34extern int memcmp(const void *cs, const void *ct, size_t count);
fb092eb6 35extern char * strchrnul(const char *, int);
ef1c2096 36
5de813b6
RK
37#ifdef CONFIG_KERNEL_GZIP
38#include "../../../../lib/decompress_inflate.c"
39#endif
40
41#ifdef CONFIG_KERNEL_LZO
42#include "../../../../lib/decompress_unlzo.c"
43#endif
44
6e8699f7
AT
45#ifdef CONFIG_KERNEL_LZMA
46#include "../../../../lib/decompress_unlzma.c"
47#endif
48
a7f464f3 49#ifdef CONFIG_KERNEL_XZ
eaf6cc71
AB
50/* Prevent KASAN override of string helpers in decompressor */
51#undef memmove
a7f464f3 52#define memmove memmove
eaf6cc71 53#undef memcpy
a7f464f3
IK
54#define memcpy memcpy
55#include "../../../../lib/decompress_unxz.c"
56#endif
57
f9b493ac
KL
58#ifdef CONFIG_KERNEL_LZ4
59#include "../../../../lib/decompress_unlz4.c"
60#endif
61
ccc1c7c6 62int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
5de813b6 63{
2d3862d2 64 return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
5de813b6 65}