diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2011-01-12 20:01:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:25 -0500 |
commit | 3ebe12439ba7fc62e1d6ecb569b7287771716ca1 (patch) | |
tree | 65945a63ad1474489d80c8ca1fb1c1c8091fb7a2 /include/linux/decompress/unxz.h | |
parent | 24fa0402a9b6a537e87e38341e78b7da86486846 (diff) |
decompressors: add boot-time XZ support
This implements the API defined in <linux/decompress/generic.h> which is
used for kernel, initramfs, and initrd decompression. This patch together
with the first patch is enough for XZ-compressed initramfs and initrd;
XZ-compressed kernel will need arch-specific changes.
The buffering requirements described in decompress_unxz.c are stricter
than with gzip, so the relevant changes should be done to the
arch-specific code when adding support for XZ-compressed kernel.
Similarly, the heap size in arch-specific pre-boot code may need to be
increased (30 KiB is enough).
The XZ decompressor needs memmove(), memeq() (memcmp() == 0), and
memzero() (memset(ptr, 0, size)), which aren't available in all
arch-specific pre-boot environments. I'm including simple versions in
decompress_unxz.c, but a cleaner solution would naturally be nicer.
Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alain Knaff <alain@knaff.lu>
Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/decompress/unxz.h')
-rw-r--r-- | include/linux/decompress/unxz.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h new file mode 100644 index 000000000000..41728fc6c8a1 --- /dev/null +++ b/include/linux/decompress/unxz.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd | ||
3 | * | ||
4 | * Author: Lasse Collin <lasse.collin@tukaani.org> | ||
5 | * | ||
6 | * This file has been put into the public domain. | ||
7 | * You can do whatever you want with this file. | ||
8 | */ | ||
9 | |||
10 | #ifndef DECOMPRESS_UNXZ_H | ||
11 | #define DECOMPRESS_UNXZ_H | ||
12 | |||
13 | int unxz(unsigned char *in, int in_size, | ||
14 | int (*fill)(void *dest, unsigned int size), | ||
15 | int (*flush)(void *src, unsigned int size), | ||
16 | unsigned char *out, int *in_used, | ||
17 | void (*error)(char *x)); | ||
18 | |||
19 | #endif | ||