aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/mm/init.c')
-rw-r--r--arch/avr32/mm/init.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index 2798c2d4a1cf..e66e8406f992 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -146,34 +146,14 @@ void __init mem_init(void)
146 initsize >> 10); 146 initsize >> 10);
147} 147}
148 148
149static inline void free_area(unsigned long addr, unsigned long end, char *s)
150{
151 unsigned int size = (end - addr) >> 10;
152
153 for (; addr < end; addr += PAGE_SIZE) {
154 struct page *page = virt_to_page(addr);
155 ClearPageReserved(page);
156 init_page_count(page);
157 free_page(addr);
158 totalram_pages++;
159 }
160
161 if (size && s)
162 printk(KERN_INFO "Freeing %s memory: %dK (%lx - %lx)\n",
163 s, size, end - (size << 10), end);
164}
165
166void free_initmem(void) 149void free_initmem(void)
167{ 150{
168 free_area((unsigned long)__init_begin, (unsigned long)__init_end, 151 free_initmem_default(0);
169 "init");
170} 152}
171 153
172#ifdef CONFIG_BLK_DEV_INITRD 154#ifdef CONFIG_BLK_DEV_INITRD
173
174void free_initrd_mem(unsigned long start, unsigned long end) 155void free_initrd_mem(unsigned long start, unsigned long end)
175{ 156{
176 free_area(start, end, "initrd"); 157 free_reserved_area(start, end, 0, "initrd");
177} 158}
178
179#endif 159#endif