diff options
author | Bernhard Walle <bwalle@suse.de> | 2007-10-19 02:40:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:49 -0400 |
commit | d62cc47163ba2acad6a3c7edec7d522b9e89f0d2 (patch) | |
tree | a391a8e3f217ecf1bd1084157b584a86c332ff04 /arch/x86/kernel/setup_32.c | |
parent | cba63c3089fe57bfafff56239a67ac26bfe027a0 (diff) |
Use extended crashkernel command line on i386
This patch removes the crashkernel parsing from
arch/i386/kernel/machine_kexec.c and calls the generic function, introduced in
the last patch, in setup_bootmem_allocator().
This is necessary because the amount of System RAM must be known in this
function now because of the new syntax.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index b87a6fd5ba48..978dc0196a0f 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -378,6 +378,49 @@ extern unsigned long __init setup_memory(void); | |||
378 | extern void zone_sizes_init(void); | 378 | extern void zone_sizes_init(void); |
379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 379 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
380 | 380 | ||
381 | static inline unsigned long long get_total_mem(void) | ||
382 | { | ||
383 | unsigned long long total; | ||
384 | |||
385 | total = max_low_pfn - min_low_pfn; | ||
386 | #ifdef CONFIG_HIGHMEM | ||
387 | total += highend_pfn - highstart_pfn; | ||
388 | #endif | ||
389 | |||
390 | return total << PAGE_SHIFT; | ||
391 | } | ||
392 | |||
393 | #ifdef CONFIG_KEXEC | ||
394 | static void __init reserve_crashkernel(void) | ||
395 | { | ||
396 | unsigned long long total_mem; | ||
397 | unsigned long long crash_size, crash_base; | ||
398 | int ret; | ||
399 | |||
400 | total_mem = get_total_mem(); | ||
401 | |||
402 | ret = parse_crashkernel(boot_command_line, total_mem, | ||
403 | &crash_size, &crash_base); | ||
404 | if (ret == 0 && crash_size > 0) { | ||
405 | if (crash_base > 0) { | ||
406 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
407 | "for crashkernel (System RAM: %ldMB)\n", | ||
408 | (unsigned long)(crash_size >> 20), | ||
409 | (unsigned long)(crash_base >> 20), | ||
410 | (unsigned long)(total_mem >> 20)); | ||
411 | crashk_res.start = crash_base; | ||
412 | crashk_res.end = crash_base + crash_size - 1; | ||
413 | reserve_bootmem(crash_base, crash_size); | ||
414 | } else | ||
415 | printk(KERN_INFO "crashkernel reservation failed - " | ||
416 | "you have to specify a base address\n"); | ||
417 | } | ||
418 | } | ||
419 | #else | ||
420 | static inline void __init reserve_crashkernel(void) | ||
421 | {} | ||
422 | #endif | ||
423 | |||
381 | void __init setup_bootmem_allocator(void) | 424 | void __init setup_bootmem_allocator(void) |
382 | { | 425 | { |
383 | unsigned long bootmap_size; | 426 | unsigned long bootmap_size; |
@@ -453,11 +496,7 @@ void __init setup_bootmem_allocator(void) | |||
453 | } | 496 | } |
454 | } | 497 | } |
455 | #endif | 498 | #endif |
456 | #ifdef CONFIG_KEXEC | 499 | reserve_crashkernel(); |
457 | if (crashk_res.start != crashk_res.end) | ||
458 | reserve_bootmem(crashk_res.start, | ||
459 | crashk_res.end - crashk_res.start + 1); | ||
460 | #endif | ||
461 | } | 500 | } |
462 | 501 | ||
463 | /* | 502 | /* |