#ifdef CONFIG_BLK_DEV_INITRD
-static bool do_relocate_initrd = false;
+static void __init relocate_initrd(void);
static void __init reserve_initrd(void)
{
u64 ramdisk_end = ramdisk_image + ramdisk_size;
u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
u64 ramdisk_here;
- u64 ramdisk_target;
if (!boot_params.hdr.type_of_loader ||
!ramdisk_image || !ramdisk_size)
printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n",
ramdisk_here, ramdisk_here + ramdisk_size);
- do_relocate_initrd = true;
+ relocate_initrd();
}
#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
-void __init post_reserve_initrd(void)
+static void __init relocate_initrd(void)
{
u64 ramdisk_image = boot_params.hdr.ramdisk_image;
u64 ramdisk_size = boot_params.hdr.ramdisk_size;
unsigned long slop, clen, mapaddr;
char *p, *q;
- if (!do_relocate_initrd)
- return;
-
ramdisk_here = initrd_start - PAGE_OFFSET;
q = (char *)initrd_start;
p = (char *)__va(ramdisk_image);
memcpy(q, p, clen);
q += clen;
- /* need to free these low pages...*/
- printk(KERN_INFO "Freeing old partial RAMDISK %08llx-%08llx\n",
- ramdisk_image, ramdisk_image + clen - 1);
- free_bootmem(ramdisk_image, clen);
ramdisk_image += clen;
ramdisk_size -= clen;
}
ramdisk_image, ramdisk_image + ramdisk_size - 1,
ramdisk_here, ramdisk_here + ramdisk_size - 1);
- /* need to free that, otherwise init highmem will reserve it again */
+ /*
+ * need to free old one, otherwise init cross max_low_pfn could be
+ * converted to bootmem
+ */
free_early(ramdisk_image, ramdisk_image+ramdisk_size);
}
#else
void __init reserve_initrd(void)
{
}
-void __init post_reserve_initrd(void)
-{
-}
#endif /* CONFIG_BLK_DEV_INITRD */
#ifdef CONFIG_MCA