forked from Minki/linux
c762c69e10
This patch adds an option to use XZ compression for the kernel image. Currently this is only enabled for 64-bit Book3S targets, which is roughly equivalent to the platforms that use the kernel's zImage wrapper, and that have been tested. The bulk of the 32-bit platforms and 64-bit BookE use uboot images, which relies on uboot implementing XZ. In future we can enable XZ support for those targets once someone has tested it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
40 lines
825 B
C
40 lines
825 B
C
#ifndef __XZ_CONFIG_H__
|
|
#define __XZ_CONFIG_H__
|
|
|
|
/*
|
|
* most of this is copied from lib/xz/xz_private.h, we can't use their defines
|
|
* since the boot wrapper is not built in the same environment as the rest of
|
|
* the kernel.
|
|
*/
|
|
|
|
#include "types.h"
|
|
#include "swab.h"
|
|
|
|
static inline uint32_t swab32p(void *p)
|
|
{
|
|
uint32_t *q = p;
|
|
|
|
return swab32(*q);
|
|
}
|
|
|
|
#ifdef __LITTLE_ENDIAN__
|
|
#define get_le32(p) (*((uint32_t *) (p)))
|
|
#else
|
|
#define get_le32(p) swab32p(p)
|
|
#endif
|
|
|
|
#define memeq(a, b, size) (memcmp(a, b, size) == 0)
|
|
#define memzero(buf, size) memset(buf, 0, size)
|
|
|
|
/* prevent the inclusion of the xz-preboot MM headers */
|
|
#define DECOMPR_MM_H
|
|
#define memmove memmove
|
|
#define XZ_EXTERN static
|
|
|
|
/* xz.h needs to be included directly since we need enum xz_mode */
|
|
#include "../../../include/linux/xz.h"
|
|
|
|
#undef XZ_EXTERN
|
|
|
|
#endif
|