@@ -11,6 +11,7 @@
#include <linux/errno.h>
#include <linux/swap.h>
#include <linux/init.h>
+#include <linux/initrd.h>
#include <linux/bootmem.h>
#include <linux/mman.h>
#include <linux/nodemask.h>
@@ -32,9 +33,6 @@
#include "mm.h"
-static unsigned long phys_initrd_start __initdata = 0;
-static unsigned long phys_initrd_size __initdata = 0;
-
static int __init early_initrd(char *p)
{
unsigned long start, size;
@@ -44,8 +42,8 @@ static int __init early_initrd(char *p)
if (*endp == ',') {
size = memparse(endp + 1, NULL);
- phys_initrd_start = start;
- phys_initrd_size = size;
+ initrd_start = __phys_to_virt(start);
+ initrd_end = initrd_start + size;
}
return 0;
}
@@ -55,8 +53,8 @@ static int __init parse_tag_initrd(const struct tag *tag)
{
printk(KERN_WARNING "ATAG_INITRD is deprecated; "
"please update your bootloader.\n");
- phys_initrd_start = __virt_to_phys(tag->u.initrd.start);
- phys_initrd_size = tag->u.initrd.size;
+ initrd_start = tag->u.initrd.start;
+ initrd_end = initrd_start + tag->u.initrd.size;
return 0;
}
@@ -64,8 +62,8 @@ __tagtable(ATAG_INITRD, parse_tag_initrd);
static int __init parse_tag_initrd2(const struct tag *tag)
{
- phys_initrd_start = tag->u.initrd.start;
- phys_initrd_size = tag->u.initrd.size;
+ initrd_start = __phys_to_virt(tag->u.initrd.start);
+ initrd_end = initrd_start + tag->u.initrd.size;
return 0;
}
@@ -284,7 +282,7 @@ void __init arm_lmb_reserve(void)
#else
lmb_reserve(__pa(_stext), _end - _stext);
#endif
- lmb_reserve(phys_initrd_start, phys_initrd_size);
+ lmb_reserve(__pa(initrd_start), initrd_end - initrd_start);
arm_mm_lmb_reserve();
}