aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:04:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:37 -0400
commitad941989d0cf2ef1320ecf46ee1188df85e94b43 (patch)
tree7044dca7c689f4b61ebcbe0217beb950fb5e1874
parenta18d0e2d7097937e9f51b83eda4bc750d93eb34d (diff)
mm/score: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Lennox Wu <lennox.wu@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/score/mm/init.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/arch/score/mm/init.c b/arch/score/mm/init.c
index a8b917742dec..9fbce49ad3bd 100644
--- a/arch/score/mm/init.c
+++ b/arch/score/mm/init.c
@@ -75,33 +75,11 @@ void __init paging_init(void)
75 75
76void __init mem_init(void) 76void __init mem_init(void)
77{ 77{
78 unsigned long codesize, reservedpages, datasize, initsize;
79 unsigned long tmp, ram = 0;
80
81 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); 78 high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
82 free_all_bootmem(); 79 free_all_bootmem();
83 setup_zero_page(); /* Setup zeroed pages. */ 80 setup_zero_page(); /* Setup zeroed pages. */
84 reservedpages = 0; 81
85 82 mem_init_print_info(NULL);
86 for (tmp = 0; tmp < max_low_pfn; tmp++)
87 if (page_is_ram(tmp)) {
88 ram++;
89 if (PageReserved(pfn_to_page(tmp)))
90 reservedpages++;
91 }
92
93 num_physpages = ram;
94 codesize = (unsigned long) &_etext - (unsigned long) &_text;
95 datasize = (unsigned long) &_edata - (unsigned long) &_etext;
96 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
97
98 printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
99 "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
100 (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
101 ram << (PAGE_SHIFT-10), codesize >> 10,
102 reservedpages << (PAGE_SHIFT-10), datasize >> 10,
103 initsize >> 10,
104 totalhigh_pages << (PAGE_SHIFT-10));
105} 83}
106#endif /* !CONFIG_NEED_MULTIPLE_NODES */ 84#endif /* !CONFIG_NEED_MULTIPLE_NODES */
107 85