aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-29 18:06:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:30 -0400
commit7beb5987875bd633c0e10162fbdd4e35d266a9e1 (patch)
treefda974f021e31287bfba1188a4bd515832b0b997 /arch
parent920f1ad081ddc38f0307a2c2bffa704769226249 (diff)
mm/microblaze: 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: Michal Simek <monstr@monstr.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/include/asm/setup.h1
-rw-r--r--arch/microblaze/mm/init.c28
2 files changed, 2 insertions, 27 deletions
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index 0e0b0a5ec756..f05df5630c84 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -46,7 +46,6 @@ void machine_shutdown(void);
46void machine_halt(void); 46void machine_halt(void);
47void machine_power_off(void); 47void machine_power_off(void);
48 48
49void free_init_pages(char *what, unsigned long begin, unsigned long end);
50extern void *alloc_maybe_bootmem(size_t size, gfp_t mask); 49extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
51extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 50extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
52 51
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 8f8b367c079e..9be53024a832 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -236,40 +236,16 @@ void __init setup_memory(void)
236 paging_init(); 236 paging_init();
237} 237}
238 238
239void free_init_pages(char *what, unsigned long begin, unsigned long end)
240{
241 unsigned long addr;
242
243 for (addr = begin; addr < end; addr += PAGE_SIZE) {
244 ClearPageReserved(virt_to_page(addr));
245 init_page_count(virt_to_page(addr));
246 free_page(addr);
247 totalram_pages++;
248 }
249 pr_info("Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
250}
251
252#ifdef CONFIG_BLK_DEV_INITRD 239#ifdef CONFIG_BLK_DEV_INITRD
253void free_initrd_mem(unsigned long start, unsigned long end) 240void free_initrd_mem(unsigned long start, unsigned long end)
254{ 241{
255 int pages = 0; 242 free_reserved_area(start, end, 0, "initrd");
256 for (; start < end; start += PAGE_SIZE) {
257 ClearPageReserved(virt_to_page(start));
258 init_page_count(virt_to_page(start));
259 free_page(start);
260 totalram_pages++;
261 pages++;
262 }
263 pr_notice("Freeing initrd memory: %dk freed\n",
264 (int)(pages * (PAGE_SIZE / 1024)));
265} 243}
266#endif 244#endif
267 245
268void free_initmem(void) 246void free_initmem(void)
269{ 247{
270 free_init_pages("unused kernel memory", 248 free_initmem_default(0);
271 (unsigned long)(&__init_begin),
272 (unsigned long)(&__init_end));
273} 249}
274 250
275void __init mem_init(void) 251void __init mem_init(void)