diff options
author | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
commit | aa11d958d1a6572eda08214d7c6a735804fe48a5 (patch) | |
tree | d025b05270ad1e010660d17eeadc6ac3c1abbd7d /lib/decompress_bunzip2.c | |
parent | 07f6642ee9418e962e54cbc07471cfe2e559c568 (diff) | |
parent | 9799218ae36910af50f002a5db1802d576fffb43 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
arch/microblaze/include/asm/socket.h
Diffstat (limited to 'lib/decompress_bunzip2.c')
-rw-r--r-- | lib/decompress_bunzip2.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/decompress_bunzip2.c b/lib/decompress_bunzip2.c index 708e2a86d87b..600f473a5610 100644 --- a/lib/decompress_bunzip2.c +++ b/lib/decompress_bunzip2.c | |||
@@ -45,12 +45,14 @@ | |||
45 | */ | 45 | */ |
46 | 46 | ||
47 | 47 | ||
48 | #ifndef STATIC | 48 | #ifdef STATIC |
49 | #define PREBOOT | ||
50 | #else | ||
49 | #include <linux/decompress/bunzip2.h> | 51 | #include <linux/decompress/bunzip2.h> |
50 | #endif /* !STATIC */ | 52 | #include <linux/slab.h> |
53 | #endif /* STATIC */ | ||
51 | 54 | ||
52 | #include <linux/decompress/mm.h> | 55 | #include <linux/decompress/mm.h> |
53 | #include <linux/slab.h> | ||
54 | 56 | ||
55 | #ifndef INT_MAX | 57 | #ifndef INT_MAX |
56 | #define INT_MAX 0x7fffffff | 58 | #define INT_MAX 0x7fffffff |
@@ -681,9 +683,7 @@ STATIC int INIT bunzip2(unsigned char *buf, int len, | |||
681 | set_error_fn(error_fn); | 683 | set_error_fn(error_fn); |
682 | if (flush) | 684 | if (flush) |
683 | outbuf = malloc(BZIP2_IOBUF_SIZE); | 685 | outbuf = malloc(BZIP2_IOBUF_SIZE); |
684 | else | 686 | |
685 | len -= 4; /* Uncompressed size hack active in pre-boot | ||
686 | environment */ | ||
687 | if (!outbuf) { | 687 | if (!outbuf) { |
688 | error("Could not allocate output bufer"); | 688 | error("Could not allocate output bufer"); |
689 | return -1; | 689 | return -1; |
@@ -733,4 +733,14 @@ exit_0: | |||
733 | return i; | 733 | return i; |
734 | } | 734 | } |
735 | 735 | ||
736 | #define decompress bunzip2 | 736 | #ifdef PREBOOT |
737 | STATIC int INIT decompress(unsigned char *buf, int len, | ||
738 | int(*fill)(void*, unsigned int), | ||
739 | int(*flush)(void*, unsigned int), | ||
740 | unsigned char *outbuf, | ||
741 | int *pos, | ||
742 | void(*error_fn)(char *x)) | ||
743 | { | ||
744 | return bunzip2(buf, len - 4, fill, flush, outbuf, pos, error_fn); | ||
745 | } | ||
746 | #endif | ||