diff options
-rw-r--r-- | arch/x86/kernel/setup_32.c | 16 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 6 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 2 |
3 files changed, 14 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); |
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index bb12a1619c12..8f85b2450562 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h | |||
@@ -39,6 +39,8 @@ void reserve_crashkernel(void); | |||
39 | #include <asm/bootparam.h> | 39 | #include <asm/bootparam.h> |
40 | 40 | ||
41 | void reserve_standard_io_resources(void); | 41 | void reserve_standard_io_resources(void); |
42 | void reserve_initrd(void); | ||
43 | |||
42 | 44 | ||
43 | #ifndef _SETUP | 45 | #ifndef _SETUP |
44 | 46 | ||