forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
85cc35fa72
commit
3945e2c9ab
@ -479,7 +479,7 @@ static void __init reserve_initrd(void)
|
|||||||
initrd_start = 0;
|
initrd_start = 0;
|
||||||
|
|
||||||
if (ramdisk_size >= end_of_lowmem/2) {
|
if (ramdisk_size >= end_of_lowmem/2) {
|
||||||
free_early(ramdisk_image, ramdisk_image + ramdisk_size - 1);
|
free_early(ramdisk_image, ramdisk_end);
|
||||||
printk(KERN_ERR "initrd too large to handle, "
|
printk(KERN_ERR "initrd too large to handle, "
|
||||||
"disabling initrd\n");
|
"disabling initrd\n");
|
||||||
return;
|
return;
|
||||||
@ -501,9 +501,13 @@ static void __init reserve_initrd(void)
|
|||||||
end_of_lowmem, ramdisk_size,
|
end_of_lowmem, ramdisk_size,
|
||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
|
|
||||||
|
if (ramdisk_here == -1ULL)
|
||||||
|
panic("Cannot find place for new RAMDISK of size %lld\n",
|
||||||
|
ramdisk_size);
|
||||||
|
|
||||||
/* Note: this includes all the lowmem currently occupied by
|
/* Note: this includes all the lowmem currently occupied by
|
||||||
the initrd, we rely on that fact to keep the data intact. */
|
the initrd, we rely on that fact to keep the data intact. */
|
||||||
reserve_early(ramdisk_here, ramdisk_here + ramdisk_size - 1,
|
reserve_early(ramdisk_here, ramdisk_here + ramdisk_size,
|
||||||
"NEW RAMDISK");
|
"NEW RAMDISK");
|
||||||
initrd_start = ramdisk_here + PAGE_OFFSET;
|
initrd_start = ramdisk_here + PAGE_OFFSET;
|
||||||
initrd_end = initrd_start + ramdisk_size;
|
initrd_end = initrd_start + ramdisk_size;
|
||||||
@ -579,15 +583,15 @@ void __init setup_bootmem_allocator(void)
|
|||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
if (bootmap == -1L)
|
if (bootmap == -1L)
|
||||||
panic("Cannot find bootmem map of size %ld\n", bootmap_size);
|
panic("Cannot find bootmem map of size %ld\n", bootmap_size);
|
||||||
reserve_early(bootmap, bootmap + bootmap_size - 1, "BOOTMAP");
|
reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP");
|
||||||
#ifdef CONFIG_BLK_DEV_INITRD
|
#ifdef CONFIG_BLK_DEV_INITRD
|
||||||
reserve_initrd();
|
reserve_initrd();
|
||||||
#endif
|
#endif
|
||||||
bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn);
|
bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn);
|
||||||
printk(KERN_INFO " low ram: %08lx - %08lx\n",
|
printk(KERN_INFO " low ram: %08lx - %08lx\n",
|
||||||
min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT);
|
min_low_pfn<<PAGE_SHIFT, max_low_pfn<<PAGE_SHIFT);
|
||||||
printk(KERN_INFO " bootmap [%08lx - %08lx]\n",
|
printk(KERN_INFO " bootmap %08lx - %08lx\n",
|
||||||
bootmap, bootmap + bootmap_size - 1);
|
bootmap, bootmap + bootmap_size);
|
||||||
register_bootmem_low_pages(max_low_pfn);
|
register_bootmem_low_pages(max_low_pfn);
|
||||||
early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT);
|
early_res_to_bootmem(0, max_low_pfn<<PAGE_SHIFT);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user