aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-29 18:06:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:30 -0400
commitd3e5351b8562ac72f0bd639f778098793f80ffa8 (patch)
tree6f406d3e3e94f5a32bdfb49d5107bd9f689c5315 /arch/parisc
parent7932f61ba888a9daa3a82eaf8939902ac82029d3 (diff)
mm/parisc: 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: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/mm/init.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index cf2da13c41e6..157b931e7b09 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -505,7 +505,6 @@ static void __init map_pages(unsigned long start_vaddr,
505 505
506void free_initmem(void) 506void free_initmem(void)
507{ 507{
508 unsigned long addr;
509 unsigned long init_begin = (unsigned long)__init_begin; 508 unsigned long init_begin = (unsigned long)__init_begin;
510 unsigned long init_end = (unsigned long)__init_end; 509 unsigned long init_end = (unsigned long)__init_end;
511 510
@@ -533,19 +532,10 @@ void free_initmem(void)
533 * pages are no-longer executable */ 532 * pages are no-longer executable */
534 flush_icache_range(init_begin, init_end); 533 flush_icache_range(init_begin, init_end);
535 534
536 for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 535 num_physpages += free_initmem_default(0);
537 ClearPageReserved(virt_to_page(addr));
538 init_page_count(virt_to_page(addr));
539 free_page(addr);
540 num_physpages++;
541 totalram_pages++;
542 }
543 536
544 /* set up a new led state on systems shipped LED State panel */ 537 /* set up a new led state on systems shipped LED State panel */
545 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 538 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);
546
547 printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n",
548 (init_end - init_begin) >> 10);
549} 539}
550 540
551 541
@@ -1109,15 +1099,6 @@ void flush_tlb_all(void)
1109#ifdef CONFIG_BLK_DEV_INITRD 1099#ifdef CONFIG_BLK_DEV_INITRD
1110void free_initrd_mem(unsigned long start, unsigned long end) 1100void free_initrd_mem(unsigned long start, unsigned long end)
1111{ 1101{
1112 if (start >= end) 1102 num_physpages += free_reserved_area(start, end, 0, "initrd");
1113 return;
1114 printk(KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
1115 for (; start < end; start += PAGE_SIZE) {
1116 ClearPageReserved(virt_to_page(start));
1117 init_page_count(virt_to_page(start));
1118 free_page(start);
1119 num_physpages++;
1120 totalram_pages++;
1121 }
1122} 1103}
1123#endif 1104#endif