aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_32.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-22 05:46:58 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 06:50:16 -0400
commit225c37d71bc8b97eb2063e8eda153b383328b20b (patch)
tree912185a6db6753a62842966db180ebecfce32fc6 /arch/x86/kernel/setup_32.c
parentb2ac82a0909aea0d2620ba4c189f37c567c21fe5 (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/kernel/setup_32.c')
-rw-r--r--arch/x86/kernel/setup_32.c16
1 files changed, 10 insertions, 6 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
366static void __init relocate_initrd(void) 366static 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
421void __init reserve_initrd(void)
422{
423}
424static 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();