aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 22:55:55 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 22:55:55 -0400
commit719c1514f2fef5f01fcfa2bba81b7bb079c7c6a1 (patch)
treee648d87274c832b0bab4c5dc1777bc0fb236b0f5 /arch/arm/mm/init.c
parent28be7072ce54b82642ebff6a80d474d4c6a6a7fd (diff)
memblock/arm: Use new accessors
CC: Russell King <linux@arm.linux.org.uk> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r--arch/arm/mm/init.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index e739223e2a54..8504906b147f 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -150,6 +150,7 @@ static void __init find_limits(struct meminfo *mi,
150static void __init arm_bootmem_init(struct meminfo *mi, 150static void __init arm_bootmem_init(struct meminfo *mi,
151 unsigned long start_pfn, unsigned long end_pfn) 151 unsigned long start_pfn, unsigned long end_pfn)
152{ 152{
153 struct memblock_region *reg;
153 unsigned int boot_pages; 154 unsigned int boot_pages;
154 phys_addr_t bitmap; 155 phys_addr_t bitmap;
155 pg_data_t *pgdat; 156 pg_data_t *pgdat;
@@ -180,13 +181,13 @@ static void __init arm_bootmem_init(struct meminfo *mi,
180 /* 181 /*
181 * Reserve the memblock reserved regions in bootmem. 182 * Reserve the memblock reserved regions in bootmem.
182 */ 183 */
183 for (i = 0; i < memblock.reserved.cnt; i++) { 184 for_each_memblock(reserved, reg) {
184 phys_addr_t start = memblock_start_pfn(&memblock.reserved, i); 185 phys_addr_t start = memblock_region_base_pfn(reg);
185 if (start >= start_pfn && 186 phys_addr_t end = memblock_region_end_pfn(reg);
186 memblock_end_pfn(&memblock.reserved, i) <= end_pfn) 187 if (start >= start_pfn && end <= end_pfn)
187 reserve_bootmem_node(pgdat, __pfn_to_phys(start), 188 reserve_bootmem_node(pgdat, __pfn_to_phys(start),
188 memblock_size_bytes(&memblock.reserved, i), 189 (end - start) << PAGE_SHIFT,
189 BOOTMEM_DEFAULT); 190 BOOTMEM_DEFAULT);
190 } 191 }
191} 192}
192 193
@@ -247,10 +248,12 @@ static void arm_memory_present(void)
247#else 248#else
248static void arm_memory_present(void) 249static void arm_memory_present(void)
249{ 250{
251 struct memblock_region *reg;
250 int i; 252 int i;
251 for (i = 0; i < memblock.memory.cnt; i++) 253
252 memory_present(0, memblock_start_pfn(&memblock.memory, i), 254 for_each_memblock(memory, reg) {
253 memblock_end_pfn(&memblock.memory, i)); 255 memory_present(0, memblock_region_base_pfn(reg),
256 memblock_region_end_pfn(reg));
254} 257}
255#endif 258#endif
256 259