diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-05-25 13:00:09 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2008-05-27 04:20:12 -0400 |
commit | 3945e2c9abf8e00c2edc4aa29215ddfad1cd8cf7 (patch) | |
tree | d742cc7da9cb52db00b100a78b9330e09e74b45b /arch/x86/kernel/setup_32.c | |
parent | 85cc35fa7255d113b5383a9c8536c363274bb475 (diff) |
x86: extend e820 ealy_res support 32bit - fix #2
remove extra -1 in reseve_early calling
panic if can not find space for new RAMDISK
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index c04e8c91daf7..08b47a2f7af0 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -479,7 +479,7 @@ static void __init reserve_initrd(void) | |||
479 | initrd_start = 0; | 479 | initrd_start = 0; |
480 | 480 | ||
481 | if (ramdisk_size >= end_of_lowmem/2) { | 481 | if (ramdisk_size >= end_of_lowmem/2) { |
482 | free_early(ramdisk_image, ramdisk_image + ramdisk_size - 1); | 482 | free_early(ramdisk_image, ramdisk_end); |
483 | printk(KERN_ERR "initrd too large to handle, " | 483 | printk(KERN_ERR "initrd too large to handle, " |
484 | "disabling initrd\n"); | 484 | "disabling initrd\n"); |
485 | return; | 485 | return; |
@@ -501,9 +501,13 @@ static void __init reserve_initrd(void) | |||
501 | end_of_lowmem, ramdisk_size, | 501 | end_of_lowmem, ramdisk_size, |
502 | PAGE_SIZE); | 502 | PAGE_SIZE); |
503 | 503 | ||
504 | if (ramdisk_here == -1ULL) | ||
505 | panic("Cannot find place for new RAMDISK of size %lld\n", | ||
506 | ramdisk_size); | ||
507 | |||
504 | /* Note: this includes all the lowmem currently occupied by | 508 | /* Note: this includes all the lowmem currently occupied by |
505 | the initrd, we rely on that fact to keep the data intact. */ | 509 | the initrd, we rely on that fact to keep the data intact. */ |
506 | reserve_early(ramdisk_here, ramdisk_here + ramdisk_size - 1, | 510 | reserve_early(ramdisk_here, ramdisk_here + ramdisk_size, |
507 | "NEW RAMDISK"); | 511 | "NEW RAMDISK"); |
508 | initrd_start = ramdisk_here + PAGE_OFFSET; | 512 | initrd_start = ramdisk_here + PAGE_OFFSET; |
509 | initrd_end = initrd_start + ramdisk_size; | 513 | initrd_end = initrd_start + ramdisk_size; |
@@ -579,15 +583,15 @@ void __init setup_bootmem_allocator(void) | |||
579 | PAGE_SIZE); | 583 | PAGE_SIZE); |
580 | if (bootmap == -1L) | 584 | if (bootmap == -1L) |
581 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); | 585 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); |
582 | reserve_early(bootmap, bootmap + bootmap_size - 1, "BOOTMAP"); | 586 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); |
583 | #ifdef CONFIG_BLK_DEV_INITRD | 587 | #ifdef CONFIG_BLK_DEV_INITRD |
584 | reserve_initrd(); | 588 | reserve_initrd(); |
585 | #endif | 589 | #endif |
586 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); | 590 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); |
587 | printk(KERN_INFO " low ram: %08lx - %08lx\n", | 591 | printk(KERN_INFO " low ram: %08lx - %08lx\n", |
588 | min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT); | 592 | min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT); |
589 | printk(KERN_INFO " bootmap [%08lx - %08lx]\n", | 593 | printk(KERN_INFO " bootmap %08lx - %08lx\n", |
590 | bootmap, bootmap + bootmap_size - 1); | 594 | bootmap, bootmap + bootmap_size); |
591 | register_bootmem_low_pages(max_low_pfn); | 595 | register_bootmem_low_pages(max_low_pfn); |
592 | early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT); | 596 | early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT); |
593 | 597 | ||