diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-22 05:46:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:50:16 -0400 |
commit | 225c37d71bc8b97eb2063e8eda153b383328b20b (patch) | |
tree | 912185a6db6753a62842966db180ebecfce32fc6 /arch/x86 | |
parent | b2ac82a0909aea0d2620ba4c189f37c567c21fe5 (diff) |
x86: introduce reserve_initrd
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 16 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 190546bd3bd3..90b51047ce63 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -336,7 +336,7 @@ void __init reserve_initrd(void) | |||
336 | * in i386_start_kernel | 336 | * in i386_start_kernel |
337 | */ | 337 | */ |
338 | initrd_start = ramdisk_image + PAGE_OFFSET; | 338 | initrd_start = ramdisk_image + PAGE_OFFSET; |
339 | initrd_end = initrd_start+ramdisk_size; | 339 | initrd_end = initrd_start + ramdisk_size; |
340 | return; | 340 | return; |
341 | } | 341 | } |
342 | 342 | ||
@@ -363,7 +363,7 @@ void __init reserve_initrd(void) | |||
363 | 363 | ||
364 | #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) | 364 | #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) |
365 | 365 | ||
366 | static void __init relocate_initrd(void) | 366 | static void __init post_reserve_initrd(void) |
367 | { | 367 | { |
368 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; | 368 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; |
369 | u64 ramdisk_size = boot_params.hdr.ramdisk_size; | 369 | u64 ramdisk_size = boot_params.hdr.ramdisk_size; |
@@ -417,7 +417,13 @@ static void __init relocate_initrd(void) | |||
417 | /* need to free that, otherwise init highmem will reserve it again */ | 417 | /* need to free that, otherwise init highmem will reserve it again */ |
418 | free_early(ramdisk_image, ramdisk_image+ramdisk_size); | 418 | free_early(ramdisk_image, ramdisk_image+ramdisk_size); |
419 | } | 419 | } |
420 | 420 | #else | |
421 | void __init reserve_initrd(void) | ||
422 | { | ||
423 | } | ||
424 | static void __init post_reserve_initrd(void) | ||
425 | { | ||
426 | } | ||
421 | #endif /* CONFIG_BLK_DEV_INITRD */ | 427 | #endif /* CONFIG_BLK_DEV_INITRD */ |
422 | 428 | ||
423 | /* | 429 | /* |
@@ -632,9 +638,7 @@ void __init setup_arch(char **cmdline_p) | |||
632 | * NOTE: at this point the bootmem allocator is fully available. | 638 | * NOTE: at this point the bootmem allocator is fully available. |
633 | */ | 639 | */ |
634 | 640 | ||
635 | #ifdef CONFIG_BLK_DEV_INITRD | 641 | post_reserve_initrd(); |
636 | relocate_initrd(); | ||
637 | #endif | ||
638 | 642 | ||
639 | remapped_pgdat_init(); | 643 | remapped_pgdat_init(); |
640 | sparse_init(); | 644 | sparse_init(); |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 9bc8607d7980..98080782ee47 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -597,8 +597,6 @@ void __init zone_sizes_init(void) | |||
597 | } | 597 | } |
598 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 598 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
599 | 599 | ||
600 | extern void reserve_initrd(void); | ||
601 | |||
602 | void __init setup_bootmem_allocator(void) | 600 | void __init setup_bootmem_allocator(void) |
603 | { | 601 | { |
604 | int i; | 602 | int i; |
@@ -613,9 +611,9 @@ void __init setup_bootmem_allocator(void) | |||
613 | if (bootmap == -1L) | 611 | if (bootmap == -1L) |
614 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); | 612 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); |
615 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); | 613 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); |
616 | #ifdef CONFIG_BLK_DEV_INITRD | 614 | |
617 | reserve_initrd(); | 615 | reserve_initrd(); |
618 | #endif | 616 | |
619 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); | 617 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); |
620 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", | 618 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", |
621 | max_pfn_mapped<<PAGE_SHIFT); | 619 | max_pfn_mapped<<PAGE_SHIFT); |