diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-30 07:23:59 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-06-30 07:23:59 +0200 |
commit | 6da49a292534d31ca391928ea97f8225774dc1e0 (patch) | |
tree | 060c5f5f40dceb10d4528763bc7fc1ccc88210d9 /arch/powerpc/mm/mem.c | |
parent | powerpc/pseries: Move hvsi support into a library (diff) | |
parent | Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/air... (diff) | |
download | linux-6da49a292534d31ca391928ea97f8225774dc1e0.tar.xz linux-6da49a292534d31ca391928ea97f8225774dc1e0.zip |
Merge remote branch 'origin/master' into next
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r-- | arch/powerpc/mm/mem.c | 19 |
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) 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 |