aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-30 01:23:59 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-06-30 01:23:59 -0400
commit6da49a292534d31ca391928ea97f8225774dc1e0 (patch)
tree060c5f5f40dceb10d4528763bc7fc1ccc88210d9 /arch/powerpc/mm/mem.c
parent17bdc6c0e979ae61879806e4dd93ec3b169d0931 (diff)
parentca56a95eedcc95f8fea7b49c87565cd961d74fe2 (diff)
Merge remote branch 'origin/master' into next
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 097b288779e2..89cbfef5a7dd 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -383,6 +383,25 @@ void __init mem_init(void)
383 mem_init_done = 1; 383 mem_init_done = 1;
384} 384}
385 385
386#ifdef CONFIG_BLK_DEV_INITRD
387void __init free_initrd_mem(unsigned long start, unsigned long end)
388{
389 if (start >= end)
390 return;
391
392 start = _ALIGN_DOWN(start, PAGE_SIZE);
393 end = _ALIGN_UP(end, PAGE_SIZE);
394 pr_info("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
395
396 for (; start < end; start += PAGE_SIZE) {
397 ClearPageReserved(virt_to_page(start));
398 init_page_count(virt_to_page(start));
399 free_page(start);
400 totalram_pages++;
401 }
402}
403#endif
404
386/* 405/*
387 * This is called when a page has been modified by the kernel. 406 * This is called when a page has been modified by the kernel.
388 * It just marks the page as not i-cache clean. We do the i-cache 407 * It just marks the page as not i-cache clean. We do the i-cache