summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-06-15 15:48:40 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-06-15 15:48:40 +0900
commitfc90ec86294202b306b7b124f2f6d5035c94fa13 (patch)
treeda3da512c8082f2864c95de9684a0a75ac997dad /arch/powerpc/mm/mem.c
parentd521dd944e461371cb309c7c3568483cd2b6f5f2 (diff)
parente6c4d3d43d4d00a0ed945c77e6b89c74b38120d7 (diff)
Merge branch 'fbdev/panning-fixes'
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r--arch/powerpc/mm/mem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 57e545b84bf1..29d4dde65c45 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -382,6 +382,25 @@ void __init mem_init(void)
mem_init_done = 1;
}
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+ if (start >= end)
+ return;
+
+ start = _ALIGN_DOWN(start, PAGE_SIZE);
+ end = _ALIGN_UP(end, PAGE_SIZE);
+ pr_info("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+
+ for (; start < end; start += PAGE_SIZE) {
+ ClearPageReserved(virt_to_page(start));
+ init_page_count(virt_to_page(start));
+ free_page(start);
+ totalram_pages++;
+ }
+}
+#endif
+
/*
* This is called when a page has been modified by the kernel.
* It just marks the page as not i-cache clean. We do the i-cache