diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-04-29 18:06:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:31 -0400 |
commit | 7acb2c2e1c4391b58bf8e61efcd478cde5800ec1 (patch) | |
tree | cbe410d8ef67c30c52505ee7a1bdd00781a350b5 /arch/xtensa/mm | |
parent | bced0e32f6bdf4e2584bc9df58e3fbebaaf42bef (diff) |
mm/xtensa: use common help functions to free reserved pages
Use common help functions to free reserved pages.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/xtensa/mm')
-rw-r--r-- | arch/xtensa/mm/init.c | 21 |
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 | ||
211 | void | ||
212 | free_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 |
223 | extern int initrd_is_mapped; | 212 | extern int initrd_is_mapped; |
224 | 213 | ||
225 | void free_initrd_mem(unsigned long start, unsigned long end) | 214 | void 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 | ||
234 | void free_initmem(void) | 221 | void 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 | } |