aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2008-10-06 13:24:40 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-11-28 10:36:44 -0500
commit4b5f32cee0cce7b9783ced5cbeabd17aa53c51fb (patch)
tree95d3f2af07733cf70419ea5c3ae1100be2533197 /arch/arm/mm/init.c
parent43ae286b7d4d8c4983bc263ef2e3cccc10dedb2b (diff)
[ARM] rationalize memory configuration code some more
Currently there are two instances of struct meminfo: one in kernel/setup.c marked __initdata, and another in mm/init.c with permanent storage. Let's keep only the later to directly populate the permanent version from arm_add_memory(). Also move common validation tests between the MMU and non-MMU cases into arm_add_memory() to remove some duplication. Protection against overflowing the membank array is also moved in there in order to cover the kernel cmdline parsing path as well. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r--arch/arm/mm/init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 82c4b4217989..b43da2479fa0 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -64,10 +64,11 @@ static int __init parse_tag_initrd2(const struct tag *tag)
64__tagtable(ATAG_INITRD2, parse_tag_initrd2); 64__tagtable(ATAG_INITRD2, parse_tag_initrd2);
65 65
66/* 66/*
67 * This is used to pass memory configuration data from paging_init 67 * This keeps memory configuration data used by a couple memory
68 * to mem_init, and by show_mem() to skip holes in the memory map. 68 * initialization functions, as well as show_mem() for the skipping
69 * of holes in the memory map. It is populated by arm_add_memory().
69 */ 70 */
70static struct meminfo meminfo = { 0, }; 71struct meminfo meminfo;
71 72
72void show_mem(void) 73void show_mem(void)
73{ 74{
@@ -331,13 +332,12 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
331 free_area_init_node(node, zone_size, start_pfn, zhole_size); 332 free_area_init_node(node, zone_size, start_pfn, zhole_size);
332} 333}
333 334
334void __init bootmem_init(struct meminfo *mi) 335void __init bootmem_init(void)
335{ 336{
337 struct meminfo *mi = &meminfo;
336 unsigned long memend_pfn = 0; 338 unsigned long memend_pfn = 0;
337 int node, initrd_node; 339 int node, initrd_node;
338 340
339 memcpy(&meminfo, mi, sizeof(meminfo));
340
341 /* 341 /*
342 * Locate which node contains the ramdisk image, if any. 342 * Locate which node contains the ramdisk image, if any.
343 */ 343 */