diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:43:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-14 16:43:24 -0400 |
commit | a3da5bf84a97d48cfaf66c6842470fc403da5121 (patch) | |
tree | cdf66c0cff8c61eedd60601fc9dffdd1ed39b880 /arch/x86/boot/compressed/misc.c | |
parent | 3b23e665b68387f5ee7b21f7b75ceea4d9acae4a (diff) | |
parent | d59fdcf2ac501de99c3dfb452af5e254d4342886 (diff) |
Merge branch 'x86/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (821 commits)
x86: make 64bit hpet_set_mapping to use ioremap too, v2
x86: get x86_phys_bits early
x86: max_low_pfn_mapped fix #4
x86: change _node_to_cpumask_ptr to return const ptr
x86: I/O APIC: remove an IRQ2-mask hack
x86: fix numaq_tsc_disable calling
x86, e820: remove end_user_pfn
x86: max_low_pfn_mapped fix, #3
x86: max_low_pfn_mapped fix, #2
x86: max_low_pfn_mapped fix, #1
x86_64: fix delayed signals
x86: remove conflicting nx6325 and nx6125 quirks
x86: Recover timer_ack lost in the merge of the NMI watchdog
x86: I/O APIC: Never configure IRQ2
x86: L-APIC: Always fully configure IRQ0
x86: L-APIC: Set IRQ0 as edge-triggered
x86: merge dwarf2 headers
x86: use AS_CFI instead of UNWIND_INFO
x86: use ignore macro instead of hash comment
x86: use matching CFI_ENDPROC
...
Diffstat (limited to 'arch/x86/boot/compressed/misc.c')
-rw-r--r-- | arch/x86/boot/compressed/misc.c | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index 90456cee47c3..bc5553b496f7 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | #include <asm/page.h> | 31 | #include <asm/page.h> |
32 | #include <asm/boot.h> | 32 | #include <asm/boot.h> |
33 | #include <asm/bootparam.h> | ||
33 | 34 | ||
34 | /* WARNING!! | 35 | /* WARNING!! |
35 | * This code is compiled with -fPIC and it is relocated dynamically | 36 | * This code is compiled with -fPIC and it is relocated dynamically |
@@ -187,13 +188,8 @@ static void gzip_release(void **); | |||
187 | /* | 188 | /* |
188 | * This is set up by the setup-routine at boot-time | 189 | * This is set up by the setup-routine at boot-time |
189 | */ | 190 | */ |
190 | static unsigned char *real_mode; /* Pointer to real-mode data */ | 191 | static struct boot_params *real_mode; /* Pointer to real-mode data */ |
191 | 192 | static int quiet; | |
192 | #define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2)) | ||
193 | #ifndef STANDARD_MEMORY_BIOS_CALL | ||
194 | #define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0)) | ||
195 | #endif | ||
196 | #define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0)) | ||
197 | 193 | ||
198 | extern unsigned char input_data[]; | 194 | extern unsigned char input_data[]; |
199 | extern int input_len; | 195 | extern int input_len; |
@@ -206,7 +202,8 @@ static void free(void *where); | |||
206 | static void *memset(void *s, int c, unsigned n); | 202 | static void *memset(void *s, int c, unsigned n); |
207 | static void *memcpy(void *dest, const void *src, unsigned n); | 203 | static void *memcpy(void *dest, const void *src, unsigned n); |
208 | 204 | ||
209 | static void putstr(const char *); | 205 | static void __putstr(int, const char *); |
206 | #define putstr(__x) __putstr(0, __x) | ||
210 | 207 | ||
211 | #ifdef CONFIG_X86_64 | 208 | #ifdef CONFIG_X86_64 |
212 | #define memptr long | 209 | #define memptr long |
@@ -221,10 +218,6 @@ static char *vidmem; | |||
221 | static int vidport; | 218 | static int vidport; |
222 | static int lines, cols; | 219 | static int lines, cols; |
223 | 220 | ||
224 | #ifdef CONFIG_X86_NUMAQ | ||
225 | void *xquad_portio; | ||
226 | #endif | ||
227 | |||
228 | #include "../../../../lib/inflate.c" | 221 | #include "../../../../lib/inflate.c" |
229 | 222 | ||
230 | static void *malloc(int size) | 223 | static void *malloc(int size) |
@@ -270,18 +263,24 @@ static void scroll(void) | |||
270 | vidmem[i] = ' '; | 263 | vidmem[i] = ' '; |
271 | } | 264 | } |
272 | 265 | ||
273 | static void putstr(const char *s) | 266 | static void __putstr(int error, const char *s) |
274 | { | 267 | { |
275 | int x, y, pos; | 268 | int x, y, pos; |
276 | char c; | 269 | char c; |
277 | 270 | ||
271 | #ifndef CONFIG_X86_VERBOSE_BOOTUP | ||
272 | if (!error) | ||
273 | return; | ||
274 | #endif | ||
275 | |||
278 | #ifdef CONFIG_X86_32 | 276 | #ifdef CONFIG_X86_32 |
279 | if (RM_SCREEN_INFO.orig_video_mode == 0 && lines == 0 && cols == 0) | 277 | if (real_mode->screen_info.orig_video_mode == 0 && |
278 | lines == 0 && cols == 0) | ||
280 | return; | 279 | return; |
281 | #endif | 280 | #endif |
282 | 281 | ||
283 | x = RM_SCREEN_INFO.orig_x; | 282 | x = real_mode->screen_info.orig_x; |
284 | y = RM_SCREEN_INFO.orig_y; | 283 | y = real_mode->screen_info.orig_y; |
285 | 284 | ||
286 | while ((c = *s++) != '\0') { | 285 | while ((c = *s++) != '\0') { |
287 | if (c == '\n') { | 286 | if (c == '\n') { |
@@ -302,8 +301,8 @@ static void putstr(const char *s) | |||
302 | } | 301 | } |
303 | } | 302 | } |
304 | 303 | ||
305 | RM_SCREEN_INFO.orig_x = x; | 304 | real_mode->screen_info.orig_x = x; |
306 | RM_SCREEN_INFO.orig_y = y; | 305 | real_mode->screen_info.orig_y = y; |
307 | 306 | ||
308 | pos = (x + cols * y) * 2; /* Update cursor position */ | 307 | pos = (x + cols * y) * 2; /* Update cursor position */ |
309 | outb(14, vidport); | 308 | outb(14, vidport); |
@@ -366,9 +365,9 @@ static void flush_window(void) | |||
366 | 365 | ||
367 | static void error(char *x) | 366 | static void error(char *x) |
368 | { | 367 | { |
369 | putstr("\n\n"); | 368 | __putstr(1, "\n\n"); |
370 | putstr(x); | 369 | __putstr(1, x); |
371 | putstr("\n\n -- System halted"); | 370 | __putstr(1, "\n\n -- System halted"); |
372 | 371 | ||
373 | while (1) | 372 | while (1) |
374 | asm("hlt"); | 373 | asm("hlt"); |
@@ -395,7 +394,8 @@ static void parse_elf(void *output) | |||
395 | return; | 394 | return; |
396 | } | 395 | } |
397 | 396 | ||
398 | putstr("Parsing ELF... "); | 397 | if (!quiet) |
398 | putstr("Parsing ELF... "); | ||
399 | 399 | ||
400 | phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); | 400 | phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); |
401 | if (!phdrs) | 401 | if (!phdrs) |
@@ -430,7 +430,10 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
430 | { | 430 | { |
431 | real_mode = rmode; | 431 | real_mode = rmode; |
432 | 432 | ||
433 | if (RM_SCREEN_INFO.orig_video_mode == 7) { | 433 | if (real_mode->hdr.loadflags & QUIET_FLAG) |
434 | quiet = 1; | ||
435 | |||
436 | if (real_mode->screen_info.orig_video_mode == 7) { | ||
434 | vidmem = (char *) 0xb0000; | 437 | vidmem = (char *) 0xb0000; |
435 | vidport = 0x3b4; | 438 | vidport = 0x3b4; |
436 | } else { | 439 | } else { |
@@ -438,8 +441,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
438 | vidport = 0x3d4; | 441 | vidport = 0x3d4; |
439 | } | 442 | } |
440 | 443 | ||
441 | lines = RM_SCREEN_INFO.orig_video_lines; | 444 | lines = real_mode->screen_info.orig_video_lines; |
442 | cols = RM_SCREEN_INFO.orig_video_cols; | 445 | cols = real_mode->screen_info.orig_video_cols; |
443 | 446 | ||
444 | window = output; /* Output buffer (Normally at 1M) */ | 447 | window = output; /* Output buffer (Normally at 1M) */ |
445 | free_mem_ptr = heap; /* Heap */ | 448 | free_mem_ptr = heap; /* Heap */ |
@@ -465,9 +468,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, | |||
465 | #endif | 468 | #endif |
466 | 469 | ||
467 | makecrc(); | 470 | makecrc(); |
468 | putstr("\nDecompressing Linux... "); | 471 | if (!quiet) |
472 | putstr("\nDecompressing Linux... "); | ||
469 | gunzip(); | 473 | gunzip(); |
470 | parse_elf(output); | 474 | parse_elf(output); |
471 | putstr("done.\nBooting the kernel.\n"); | 475 | if (!quiet) |
476 | putstr("done.\nBooting the kernel.\n"); | ||
472 | return; | 477 | return; |
473 | } | 478 | } |