x86: introduce reserve_initrd
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -336,7 +336,7 @@ void __init reserve_initrd(void)
|
|||||||
* in i386_start_kernel
|
* in i386_start_kernel
|
||||||
*/
|
*/
|
||||||
initrd_start = ramdisk_image + PAGE_OFFSET;
|
initrd_start = ramdisk_image + PAGE_OFFSET;
|
||||||
initrd_end = initrd_start+ramdisk_size;
|
initrd_end = initrd_start + ramdisk_size;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@ void __init reserve_initrd(void)
|
|||||||
|
|
||||||
#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
|
#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
|
||||||
|
|
||||||
static void __init relocate_initrd(void)
|
static void __init post_reserve_initrd(void)
|
||||||
{
|
{
|
||||||
u64 ramdisk_image = boot_params.hdr.ramdisk_image;
|
u64 ramdisk_image = boot_params.hdr.ramdisk_image;
|
||||||
u64 ramdisk_size = boot_params.hdr.ramdisk_size;
|
u64 ramdisk_size = boot_params.hdr.ramdisk_size;
|
||||||
@@ -417,7 +417,13 @@ static void __init relocate_initrd(void)
|
|||||||
/* need to free that, otherwise init highmem will reserve it again */
|
/* need to free that, otherwise init highmem will reserve it again */
|
||||||
free_early(ramdisk_image, ramdisk_image+ramdisk_size);
|
free_early(ramdisk_image, ramdisk_image+ramdisk_size);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
void __init reserve_initrd(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
static void __init post_reserve_initrd(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif /* CONFIG_BLK_DEV_INITRD */
|
#endif /* CONFIG_BLK_DEV_INITRD */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -632,9 +638,7 @@ void __init setup_arch(char **cmdline_p)
|
|||||||
* NOTE: at this point the bootmem allocator is fully available.
|
* NOTE: at this point the bootmem allocator is fully available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_BLK_DEV_INITRD
|
post_reserve_initrd();
|
||||||
relocate_initrd();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
remapped_pgdat_init();
|
remapped_pgdat_init();
|
||||||
sparse_init();
|
sparse_init();
|
||||||
|
@@ -597,8 +597,6 @@ void __init zone_sizes_init(void)
|
|||||||
}
|
}
|
||||||
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
||||||
|
|
||||||
extern void reserve_initrd(void);
|
|
||||||
|
|
||||||
void __init setup_bootmem_allocator(void)
|
void __init setup_bootmem_allocator(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -613,9 +611,9 @@ void __init setup_bootmem_allocator(void)
|
|||||||
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, "BOOTMAP");
|
reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP");
|
||||||
#ifdef CONFIG_BLK_DEV_INITRD
|
|
||||||
reserve_initrd();
|
reserve_initrd();
|
||||||
#endif
|
|
||||||
bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn);
|
bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn);
|
||||||
printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
|
printk(KERN_INFO " mapped low ram: 0 - %08lx\n",
|
||||||
max_pfn_mapped<<PAGE_SHIFT);
|
max_pfn_mapped<<PAGE_SHIFT);
|
||||||
|
@@ -39,6 +39,8 @@ void reserve_crashkernel(void);
|
|||||||
#include <asm/bootparam.h>
|
#include <asm/bootparam.h>
|
||||||
|
|
||||||
void reserve_standard_io_resources(void);
|
void reserve_standard_io_resources(void);
|
||||||
|
void reserve_initrd(void);
|
||||||
|
|
||||||
|
|
||||||
#ifndef _SETUP
|
#ifndef _SETUP
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user