xref: /openbmc/linux/arch/powerpc/boot/xz_config.h (revision 8730046c)
1 #ifndef __XZ_CONFIG_H__
2 #define __XZ_CONFIG_H__
3 
4 /*
5  * most of this is copied from lib/xz/xz_private.h, we can't use their defines
6  * since the boot wrapper is not built in the same environment as the rest of
7  * the kernel.
8  */
9 
10 #include "types.h"
11 #include "swab.h"
12 
13 static inline uint32_t swab32p(void *p)
14 {
15 	uint32_t *q = p;
16 
17 	return swab32(*q);
18 }
19 
20 #ifdef __LITTLE_ENDIAN__
21 #define get_le32(p) (*((uint32_t *) (p)))
22 #else
23 #define get_le32(p) swab32p(p)
24 #endif
25 
26 #define memeq(a, b, size) (memcmp(a, b, size) == 0)
27 #define memzero(buf, size) memset(buf, 0, size)
28 
29 /* prevent the inclusion of the xz-preboot MM headers */
30 #define DECOMPR_MM_H
31 #define memmove memmove
32 #define XZ_EXTERN static
33 
34 /* xz.h needs to be included directly since we need enum xz_mode */
35 #include "../../../include/linux/xz.h"
36 
37 #undef XZ_EXTERN
38 
39 #endif
40