diff options
author | Bernhard Walle <bwalle@suse.de> | 2008-06-20 09:38:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:45:44 -0400 |
commit | 1ecd27657b735128a728ebf0c31fce5e1456718a (patch) | |
tree | f49fba5bd4a7a640b738a0f225ff3304ab9af877 /arch/x86/kernel/setup_32.c | |
parent | 6236af82d8a989e150a02800c210eb61cb1e17be (diff) |
x86: unify crashkernel reservation for 32 and 64 bit
This patch moves the reserve_crashkernel() to setup.c and removes the
architecture-specific version. Both versions were more or less the same.
I tested it on both x86-64 and i386, with CONFIG_KEXEC on and off (so
that it compiles).
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: yhlu.kernel@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index a9b19ad24edb..369d0fe1ff9c 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -429,59 +429,6 @@ extern unsigned long __init setup_memory(void); | |||
429 | extern void zone_sizes_init(void); | 429 | extern void zone_sizes_init(void); |
430 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 430 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
431 | 431 | ||
432 | static inline unsigned long long get_total_mem(void) | ||
433 | { | ||
434 | unsigned long long total; | ||
435 | |||
436 | total = max_low_pfn - min_low_pfn; | ||
437 | #ifdef CONFIG_HIGHMEM | ||
438 | total += highend_pfn - highstart_pfn; | ||
439 | #endif | ||
440 | |||
441 | return total << PAGE_SHIFT; | ||
442 | } | ||
443 | |||
444 | #ifdef CONFIG_KEXEC | ||
445 | static void __init reserve_crashkernel(void) | ||
446 | { | ||
447 | unsigned long long total_mem; | ||
448 | unsigned long long crash_size, crash_base; | ||
449 | int ret; | ||
450 | |||
451 | total_mem = get_total_mem(); | ||
452 | |||
453 | ret = parse_crashkernel(boot_command_line, total_mem, | ||
454 | &crash_size, &crash_base); | ||
455 | if (ret == 0 && crash_size > 0) { | ||
456 | if (crash_base <= 0) { | ||
457 | printk(KERN_INFO "crashkernel reservation failed - " | ||
458 | "you have to specify a base address\n"); | ||
459 | return; | ||
460 | } | ||
461 | |||
462 | if (reserve_bootmem_generic(crash_base, crash_size, | ||
463 | BOOTMEM_EXCLUSIVE) < 0) { | ||
464 | printk(KERN_INFO "crashkernel reservation failed - " | ||
465 | "memory is in use\n"); | ||
466 | return; | ||
467 | } | ||
468 | |||
469 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | ||
470 | "for crashkernel (System RAM: %ldMB)\n", | ||
471 | (unsigned long)(crash_size >> 20), | ||
472 | (unsigned long)(crash_base >> 20), | ||
473 | (unsigned long)(total_mem >> 20)); | ||
474 | |||
475 | crashk_res.start = crash_base; | ||
476 | crashk_res.end = crash_base + crash_size - 1; | ||
477 | insert_resource(&iomem_resource, &crashk_res); | ||
478 | } | ||
479 | } | ||
480 | #else | ||
481 | static inline void __init reserve_crashkernel(void) | ||
482 | {} | ||
483 | #endif | ||
484 | |||
485 | #ifdef CONFIG_BLK_DEV_INITRD | 432 | #ifdef CONFIG_BLK_DEV_INITRD |
486 | 433 | ||
487 | static bool do_relocate_initrd = false; | 434 | static bool do_relocate_initrd = false; |