aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-29 18:06:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:30 -0400
commit8be65857f2a4c1f83ef6d2714b7a6428a6fa386c (patch)
treebfee37972000c8caa42a5aabda73d8026f7f1b31
parent66f62594216a8df661239e233736997dba074bbe (diff)
mm/m32r: use common help functions to free reserved pages
Use common help functions to free reserved pages. Also include <asm/sections.h> to avoid local declarations. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/m32r/mm/init.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 78b660e903da..ab4cbce91a9b 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -28,10 +28,7 @@
28#include <asm/mmu_context.h> 28#include <asm/mmu_context.h>
29#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/tlb.h> 30#include <asm/tlb.h>
31 31#include <asm/sections.h>
32/* References to section boundaries */
33extern char _text, _etext, _edata;
34extern char __init_begin, __init_end;
35 32
36pgd_t swapper_pg_dir[1024]; 33pgd_t swapper_pg_dir[1024];
37 34
@@ -184,17 +181,7 @@ void __init mem_init(void)
184 *======================================================================*/ 181 *======================================================================*/
185void free_initmem(void) 182void free_initmem(void)
186{ 183{
187 unsigned long addr; 184 free_initmem_default(0);
188
189 addr = (unsigned long)(&__init_begin);
190 for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
191 ClearPageReserved(virt_to_page(addr));
192 init_page_count(virt_to_page(addr));
193 free_page(addr);
194 totalram_pages++;
195 }
196 printk (KERN_INFO "Freeing unused kernel memory: %dk freed\n", \
197 (int)(&__init_end - &__init_begin) >> 10);
198} 185}
199 186
200#ifdef CONFIG_BLK_DEV_INITRD 187#ifdef CONFIG_BLK_DEV_INITRD
@@ -204,13 +191,6 @@ void free_initmem(void)
204 *======================================================================*/ 191 *======================================================================*/
205void free_initrd_mem(unsigned long start, unsigned long end) 192void free_initrd_mem(unsigned long start, unsigned long end)
206{ 193{
207 unsigned long p; 194 free_reserved_area(start, end, 0, "initrd");
208 for (p = start; p < end; p += PAGE_SIZE) {
209 ClearPageReserved(virt_to_page(p));
210 init_page_count(virt_to_page(p));
211 free_page(p);
212 totalram_pages++;
213 }
214 printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
215} 195}
216#endif 196#endif