aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:04:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:36 -0400
commit9671468f1e1e7ef67169f7fb518a9905f44b0dd6 (patch)
tree450cfd9765f71597dab62fbc6d84ee1f7f1b30ae /arch/m68k
parenta0e7b805cd337d387373d197aa15d61a853e5ed7 (diff)
mm/m68k: 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> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/mm/init.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 614c60a04459..397a8848f067 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -149,33 +149,11 @@ void __init print_memmap(void)
149void __init mem_init(void) 149void __init mem_init(void)
150{ 150{
151 pg_data_t *pgdat; 151 pg_data_t *pgdat;
152 int codepages = 0;
153 int datapages = 0;
154 int initpages = 0;
155 int i; 152 int i;
156 153
157 /* this will put all memory onto the freelists */ 154 /* this will put all memory onto the freelists */
158 num_physpages = 0; 155 for_each_online_pgdat(pgdat)
159 for_each_online_pgdat(pgdat) {
160 num_physpages += pgdat->node_present_pages;
161
162 free_all_bootmem_node(pgdat); 156 free_all_bootmem_node(pgdat);
163 for (i = 0; i < pgdat->node_spanned_pages; i++) {
164 struct page *page = pgdat->node_mem_map + i;
165 char *addr = page_to_virt(page);
166
167 if (!PageReserved(page))
168 continue;
169 if (addr >= _text &&
170 addr < _etext)
171 codepages++;
172 else if (addr >= __init_begin &&
173 addr < __init_end)
174 initpages++;
175 else
176 datapages++;
177 }
178 }
179 157
180#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE) 158#if defined(CONFIG_MMU) && !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
181 /* insert pointer tables allocated so far into the tablelist */ 159 /* insert pointer tables allocated so far into the tablelist */
@@ -190,12 +168,7 @@ void __init mem_init(void)
190 init_pointer_table((unsigned long)zero_pgtable); 168 init_pointer_table((unsigned long)zero_pgtable);
191#endif 169#endif
192 170
193 pr_info("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n", 171 mem_init_print_info(NULL);
194 nr_free_pages() << (PAGE_SHIFT-10),
195 totalram_pages << (PAGE_SHIFT-10),
196 codepages << (PAGE_SHIFT-10),
197 datapages << (PAGE_SHIFT-10),
198 initpages << (PAGE_SHIFT-10));
199 print_memmap(); 172 print_memmap();
200} 173}
201 174