diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
commit | 24a77daf3d80bddcece044e6dc3675e427eef3f3 (patch) | |
tree | 2c5e0b0bea394d6fe62c5d5857c252e83e48ac48 /arch/powerpc/boot/gunzip_util.h | |
parent | e389f9aec689209724105ae80a6c91fd2e747bc9 (diff) | |
parent | f900e9777fc9b65140cb9570438597bc8fae56ab (diff) |
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
[POWERPC] remove kernel module option for booke wdt
[POWERPC] Avoid putting cpu node twice
[POWERPC] Spinlock initializer cleanup
[POWERPC] ppc4xx_sgdma needs dma-mapping.h
[POWERPC] arch/powerpc/sysdev/timer.c build fix
[POWERPC] get_property cleanups
[POWERPC] Remove the unused HTDMSOUND driver
[POWERPC] cell: cbe_cpufreq cleanup and crash fix
[POWERPC] Declare enable_kernel_spe in a header
[POWERPC] Add dt_xlate_addr() to bootwrapper
[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
[POWERPC] Add uartlite boot console driver for the zImage wrapper
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
[POWERPC] Merge common virtex header files
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
[POWERPC] Clean up cpufreq Kconfig dependencies
...
Diffstat (limited to 'arch/powerpc/boot/gunzip_util.h')
-rw-r--r-- | arch/powerpc/boot/gunzip_util.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/powerpc/boot/gunzip_util.h b/arch/powerpc/boot/gunzip_util.h new file mode 100644 index 000000000000..b3dfa6e87b3a --- /dev/null +++ b/arch/powerpc/boot/gunzip_util.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Decompression convenience functions | ||
3 | * | ||
4 | * Copyright 2007 David Gibson, IBM Corporation. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | #ifndef _PPC_BOOT_GUNZIP_UTIL_H_ | ||
11 | #define _PPC_BOOT_GUNZIP_UTIL_H_ | ||
12 | |||
13 | #include "zlib.h" | ||
14 | |||
15 | /* | ||
16 | * These functions are designed to make life easy for decompressing | ||
17 | * kernel images, initrd images or any other gzip compressed image, | ||
18 | * particularly if its useful to decompress part of the image (e.g. to | ||
19 | * examine headers) before decompressing the remainder. | ||
20 | * | ||
21 | * To use: | ||
22 | * - declare a gunzip_state structure | ||
23 | * - use gunzip_start() to initialize the state, associating it | ||
24 | * with a stream of compressed data | ||
25 | * - use gunzip_partial(), gunzip_exactly() and gunzip_discard() | ||
26 | * in any combination to extract pieces of data from the stream | ||
27 | * - Finally use gunzip_finish() to extract the tail of the | ||
28 | * compressed stream and wind up zlib | ||
29 | */ | ||
30 | |||
31 | /* scratch space for gunzip; 46912 is from zlib_inflate_workspacesize() */ | ||
32 | #define GUNZIP_SCRATCH_SIZE 46912 | ||
33 | |||
34 | struct gunzip_state { | ||
35 | z_stream s; | ||
36 | char scratch[46912]; | ||
37 | }; | ||
38 | |||
39 | void gunzip_start(struct gunzip_state *state, void *src, int srclen); | ||
40 | int gunzip_partial(struct gunzip_state *state, void *dst, int dstlen); | ||
41 | void gunzip_exactly(struct gunzip_state *state, void *dst, int len); | ||
42 | void gunzip_discard(struct gunzip_state *state, int len); | ||
43 | int gunzip_finish(struct gunzip_state *state, void *dst, int len); | ||
44 | |||
45 | #endif /* _PPC_BOOT_GUNZIP_UTIL_H_ */ | ||