diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-07 03:34:02 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-05-07 03:34:02 -0400 |
commit | 7b76415375ba91f5a06f8d5179278c03d6151d16 (patch) | |
tree | 11f156309efb05174906954efc5159a15b202437 /arch/arm/boot/compressed/misc.c | |
parent | c93212f387fdf5180d9d13cc207419abd5b3ec17 (diff) | |
parent | 8d7e4cc2c8ea1d180d32d902eb899f27d3ee53d7 (diff) |
Merge branch 'zImage_fixes' of git://git.linaro.org/people/nico/linux into devel-stable
Diffstat (limited to 'arch/arm/boot/compressed/misc.c')
-rw-r--r-- | arch/arm/boot/compressed/misc.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c index 2df38263124..832d37236c5 100644 --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c | |||
@@ -26,8 +26,6 @@ unsigned int __machine_arch_type; | |||
26 | #include <linux/linkage.h> | 26 | #include <linux/linkage.h> |
27 | #include <asm/string.h> | 27 | #include <asm/string.h> |
28 | 28 | ||
29 | #include <asm/unaligned.h> | ||
30 | |||
31 | 29 | ||
32 | static void putstr(const char *ptr); | 30 | static void putstr(const char *ptr); |
33 | extern void error(char *x); | 31 | extern void error(char *x); |
@@ -139,13 +137,12 @@ void *memcpy(void *__dest, __const void *__src, size_t __n) | |||
139 | } | 137 | } |
140 | 138 | ||
141 | /* | 139 | /* |
142 | * gzip delarations | 140 | * gzip declarations |
143 | */ | 141 | */ |
144 | extern char input_data[]; | 142 | extern char input_data[]; |
145 | extern char input_data_end[]; | 143 | extern char input_data_end[]; |
146 | 144 | ||
147 | unsigned char *output_data; | 145 | unsigned char *output_data; |
148 | unsigned long output_ptr; | ||
149 | 146 | ||
150 | unsigned long free_mem_ptr; | 147 | unsigned long free_mem_ptr; |
151 | unsigned long free_mem_end_ptr; | 148 | unsigned long free_mem_end_ptr; |
@@ -170,15 +167,15 @@ asmlinkage void __div0(void) | |||
170 | error("Attempting division by 0!"); | 167 | error("Attempting division by 0!"); |
171 | } | 168 | } |
172 | 169 | ||
173 | extern void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)); | 170 | extern int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)); |
174 | 171 | ||
175 | 172 | ||
176 | unsigned long | 173 | void |
177 | decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, | 174 | decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, |
178 | unsigned long free_mem_ptr_end_p, | 175 | unsigned long free_mem_ptr_end_p, |
179 | int arch_id) | 176 | int arch_id) |
180 | { | 177 | { |
181 | unsigned char *tmp; | 178 | int ret; |
182 | 179 | ||
183 | output_data = (unsigned char *)output_start; | 180 | output_data = (unsigned char *)output_start; |
184 | free_mem_ptr = free_mem_ptr_p; | 181 | free_mem_ptr = free_mem_ptr_p; |
@@ -187,12 +184,11 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, | |||
187 | 184 | ||
188 | arch_decomp_setup(); | 185 | arch_decomp_setup(); |
189 | 186 | ||
190 | tmp = (unsigned char *) (((unsigned long)input_data_end) - 4); | ||
191 | output_ptr = get_unaligned_le32(tmp); | ||
192 | |||
193 | putstr("Uncompressing Linux..."); | 187 | putstr("Uncompressing Linux..."); |
194 | do_decompress(input_data, input_data_end - input_data, | 188 | ret = do_decompress(input_data, input_data_end - input_data, |
195 | output_data, error); | 189 | output_data, error); |
196 | putstr(" done, booting the kernel.\n"); | 190 | if (ret) |
197 | return output_ptr; | 191 | error("decompressor returned an error"); |
192 | else | ||
193 | putstr(" done, booting the kernel.\n"); | ||
198 | } | 194 | } |