aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/mm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/mm')
-rw-r--r--arch/xtensa/mm/init.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index 7a5156ffebb6..bba125b4bb06 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -208,32 +208,17 @@ void __init mem_init(void)
208 highmemsize >> 10); 208 highmemsize >> 10);
209} 209}
210 210
211void
212free_reserved_mem(void *start, void *end)
213{
214 for (; start < end; start += PAGE_SIZE) {
215 ClearPageReserved(virt_to_page(start));
216 init_page_count(virt_to_page(start));
217 free_page((unsigned long)start);
218 totalram_pages++;
219 }
220}
221
222#ifdef CONFIG_BLK_DEV_INITRD 211#ifdef CONFIG_BLK_DEV_INITRD
223extern int initrd_is_mapped; 212extern int initrd_is_mapped;
224 213
225void free_initrd_mem(unsigned long start, unsigned long end) 214void free_initrd_mem(unsigned long start, unsigned long end)
226{ 215{
227 if (initrd_is_mapped) { 216 if (initrd_is_mapped)
228 free_reserved_mem((void*)start, (void*)end); 217 free_reserved_area(start, end, 0, "initrd");
229 printk ("Freeing initrd memory: %ldk freed\n",(end-start)>>10);
230 }
231} 218}
232#endif 219#endif
233 220
234void free_initmem(void) 221void free_initmem(void)
235{ 222{
236 free_reserved_mem(__init_begin, __init_end); 223 free_initmem_default(0);
237 printk("Freeing unused kernel memory: %zuk freed\n",
238 (__init_end - __init_begin) >> 10);
239} 224}