aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/mm')
-rw-r--r--arch/arc/mm/init.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 6634cf50e3b4..4a177365b2c4 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -141,37 +141,18 @@ void __init mem_init(void)
141 PAGES_TO_KB(reserved_pages)); 141 PAGES_TO_KB(reserved_pages));
142} 142}
143 143
144static void __init free_init_pages(const char *what, unsigned long begin,
145 unsigned long end)
146{
147 unsigned long addr;
148
149 pr_info("Freeing %s: %ldk [%lx] to [%lx]\n",
150 what, TO_KB(end - begin), begin, end);
151
152 /* need to check that the page we free is not a partial page */
153 for (addr = begin; addr + PAGE_SIZE <= end; addr += PAGE_SIZE) {
154 ClearPageReserved(virt_to_page(addr));
155 init_page_count(virt_to_page(addr));
156 free_page(addr);
157 totalram_pages++;
158 }
159}
160
161/* 144/*
162 * free_initmem: Free all the __init memory. 145 * free_initmem: Free all the __init memory.
163 */ 146 */
164void __init_refok free_initmem(void) 147void __init_refok free_initmem(void)
165{ 148{
166 free_init_pages("unused kernel memory", 149 free_initmem_default(0);
167 (unsigned long)__init_begin,
168 (unsigned long)__init_end);
169} 150}
170 151
171#ifdef CONFIG_BLK_DEV_INITRD 152#ifdef CONFIG_BLK_DEV_INITRD
172void __init free_initrd_mem(unsigned long start, unsigned long end) 153void __init free_initrd_mem(unsigned long start, unsigned long end)
173{ 154{
174 free_init_pages("initrd memory", start, end); 155 free_reserved_area(start, end, 0, "initrd");
175} 156}
176#endif 157#endif
177 158