Linux Audio

Check our new training course

Loading...
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0
 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#include "misc.h"
 
 
 
10
11#define STATIC static
12#define STATIC_RW_DATA	/* non-static please */
13
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
31/* Not needed, but used in some headers pulled in by decompressors */
32extern char * strstr(const char * s1, const char *s2);
33extern size_t strlen(const char *s);
34extern int strcmp(const char *cs, const char *ct);
35extern int memcmp(const void *cs, const void *ct, size_t count);
36extern char * strchrnul(const char *, int);
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/* Prevent KASAN override of string helpers in decompressor */
52#undef memmove
53#define memmove memmove
54#undef memcpy
55#define memcpy memcpy
56#include "../../../../lib/decompress_unxz.c"
57#endif
58
59#ifdef CONFIG_KERNEL_LZ4
60#include "../../../../lib/decompress_unlz4.c"
61#endif
62
63int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
64{
65	return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
66}
v4.10.11
 
 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
 9extern unsigned long free_mem_ptr;
10extern unsigned long free_mem_end_ptr;
11extern 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 */
34extern char * strstr(const char * s1, const char *s2);
 
 
 
 
35
36#ifdef CONFIG_KERNEL_GZIP
37#include "../../../../lib/decompress_inflate.c"
38#endif
39
40#ifdef CONFIG_KERNEL_LZO
41#include "../../../../lib/decompress_unlzo.c"
42#endif
43
44#ifdef CONFIG_KERNEL_LZMA
45#include "../../../../lib/decompress_unlzma.c"
46#endif
47
48#ifdef CONFIG_KERNEL_XZ
 
 
49#define memmove memmove
 
50#define memcpy memcpy
51#include "../../../../lib/decompress_unxz.c"
52#endif
53
54#ifdef CONFIG_KERNEL_LZ4
55#include "../../../../lib/decompress_unlz4.c"
56#endif
57
58int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
59{
60	return __decompress(input, len, NULL, NULL, output, 0, NULL, error);
61}