aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-03 23:43:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-08-04 00:39:01 -0400
commit28be7072ce54b82642ebff6a80d474d4c6a6a7fd (patch)
treed6178a6084da7bd464fedfc861d73db53b2697bc /arch/powerpc/mm/numa.c
parent08b84798819e54ba1d29be71a52afbb697c7b666 (diff)
memblock/powerpc: Use new accessors
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index aa731af720c0..9ba9ba1a430d 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -746,16 +746,17 @@ static void __init setup_nonnuma(void)
746 unsigned long top_of_ram = memblock_end_of_DRAM(); 746 unsigned long top_of_ram = memblock_end_of_DRAM();
747 unsigned long total_ram = memblock_phys_mem_size(); 747 unsigned long total_ram = memblock_phys_mem_size();
748 unsigned long start_pfn, end_pfn; 748 unsigned long start_pfn, end_pfn;
749 unsigned int i, nid = 0; 749 unsigned int nid = 0;
750 struct memblock_region *reg;
750 751
751 printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", 752 printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
752 top_of_ram, total_ram); 753 top_of_ram, total_ram);
753 printk(KERN_DEBUG "Memory hole size: %ldMB\n", 754 printk(KERN_DEBUG "Memory hole size: %ldMB\n",
754 (top_of_ram - total_ram) >> 20); 755 (top_of_ram - total_ram) >> 20);
755 756
756 for (i = 0; i < memblock.memory.cnt; ++i) { 757 for_each_memblock(memory, reg) {
757 start_pfn = memblock.memory.region[i].base >> PAGE_SHIFT; 758 start_pfn = memblock_region_base_pfn(reg);
758 end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i); 759 end_pfn = memblock_region_end_pfn(reg);
759 760
760 fake_numa_create_new_node(end_pfn, &nid); 761 fake_numa_create_new_node(end_pfn, &nid);
761 add_active_range(nid, start_pfn, end_pfn); 762 add_active_range(nid, start_pfn, end_pfn);
@@ -891,11 +892,11 @@ static struct notifier_block __cpuinitdata ppc64_numa_nb = {
891static void mark_reserved_regions_for_nid(int nid) 892static void mark_reserved_regions_for_nid(int nid)
892{ 893{
893 struct pglist_data *node = NODE_DATA(nid); 894 struct pglist_data *node = NODE_DATA(nid);
894 int i; 895 struct memblock_region *reg;
895 896
896 for (i = 0; i < memblock.reserved.cnt; i++) { 897 for_each_memblock(reserved, reg) {
897 unsigned long physbase = memblock.reserved.region[i].base; 898 unsigned long physbase = reg->base;
898 unsigned long size = memblock.reserved.region[i].size; 899 unsigned long size = reg->size;
899 unsigned long start_pfn = physbase >> PAGE_SHIFT; 900 unsigned long start_pfn = physbase >> PAGE_SHIFT;
900 unsigned long end_pfn = PFN_UP(physbase + size); 901 unsigned long end_pfn = PFN_UP(physbase + size);
901 struct node_active_region node_ar; 902 struct node_active_region node_ar;