diff options
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r-- | arch/sparc/mm/init_64.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 8e073d802139..b3f5e7dfea51 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -790,7 +790,7 @@ static int find_node(unsigned long addr) | |||
790 | return -1; | 790 | return -1; |
791 | } | 791 | } |
792 | 792 | ||
793 | u64 memblock_nid_range(u64 start, u64 end, int *nid) | 793 | static u64 memblock_nid_range(u64 start, u64 end, int *nid) |
794 | { | 794 | { |
795 | *nid = find_node(start); | 795 | *nid = find_node(start); |
796 | start += PAGE_SIZE; | 796 | start += PAGE_SIZE; |
@@ -808,7 +808,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid) | |||
808 | return start; | 808 | return start; |
809 | } | 809 | } |
810 | #else | 810 | #else |
811 | u64 memblock_nid_range(u64 start, u64 end, int *nid) | 811 | static u64 memblock_nid_range(u64 start, u64 end, int *nid) |
812 | { | 812 | { |
813 | *nid = 0; | 813 | *nid = 0; |
814 | return end; | 814 | return end; |
@@ -816,7 +816,7 @@ u64 memblock_nid_range(u64 start, u64 end, int *nid) | |||
816 | #endif | 816 | #endif |
817 | 817 | ||
818 | /* This must be invoked after performing all of the necessary | 818 | /* This must be invoked after performing all of the necessary |
819 | * add_active_range() calls for 'nid'. We need to be able to get | 819 | * memblock_set_node() calls for 'nid'. We need to be able to get |
820 | * correct data from get_pfn_range_for_nid(). | 820 | * correct data from get_pfn_range_for_nid(). |
821 | */ | 821 | */ |
822 | static void __init allocate_node_data(int nid) | 822 | static void __init allocate_node_data(int nid) |
@@ -987,14 +987,11 @@ static void __init add_node_ranges(void) | |||
987 | 987 | ||
988 | this_end = memblock_nid_range(start, end, &nid); | 988 | this_end = memblock_nid_range(start, end, &nid); |
989 | 989 | ||
990 | numadbg("Adding active range nid[%d] " | 990 | numadbg("Setting memblock NUMA node nid[%d] " |
991 | "start[%lx] end[%lx]\n", | 991 | "start[%lx] end[%lx]\n", |
992 | nid, start, this_end); | 992 | nid, start, this_end); |
993 | 993 | ||
994 | add_active_range(nid, | 994 | memblock_set_node(start, this_end - start, nid); |
995 | start >> PAGE_SHIFT, | ||
996 | this_end >> PAGE_SHIFT); | ||
997 | |||
998 | start = this_end; | 995 | start = this_end; |
999 | } | 996 | } |
1000 | } | 997 | } |
@@ -1282,7 +1279,6 @@ static void __init bootmem_init_nonnuma(void) | |||
1282 | { | 1279 | { |
1283 | unsigned long top_of_ram = memblock_end_of_DRAM(); | 1280 | unsigned long top_of_ram = memblock_end_of_DRAM(); |
1284 | unsigned long total_ram = memblock_phys_mem_size(); | 1281 | unsigned long total_ram = memblock_phys_mem_size(); |
1285 | struct memblock_region *reg; | ||
1286 | 1282 | ||
1287 | numadbg("bootmem_init_nonnuma()\n"); | 1283 | numadbg("bootmem_init_nonnuma()\n"); |
1288 | 1284 | ||
@@ -1292,20 +1288,8 @@ static void __init bootmem_init_nonnuma(void) | |||
1292 | (top_of_ram - total_ram) >> 20); | 1288 | (top_of_ram - total_ram) >> 20); |
1293 | 1289 | ||
1294 | init_node_masks_nonnuma(); | 1290 | init_node_masks_nonnuma(); |
1295 | 1291 | memblock_set_node(0, (phys_addr_t)ULLONG_MAX, 0); | |
1296 | for_each_memblock(memory, reg) { | ||
1297 | unsigned long start_pfn, end_pfn; | ||
1298 | |||
1299 | if (!reg->size) | ||
1300 | continue; | ||
1301 | |||
1302 | start_pfn = memblock_region_memory_base_pfn(reg); | ||
1303 | end_pfn = memblock_region_memory_end_pfn(reg); | ||
1304 | add_active_range(0, start_pfn, end_pfn); | ||
1305 | } | ||
1306 | |||
1307 | allocate_node_data(0); | 1292 | allocate_node_data(0); |
1308 | |||
1309 | node_set_online(0); | 1293 | node_set_online(0); |
1310 | } | 1294 | } |
1311 | 1295 | ||
@@ -1769,8 +1753,6 @@ void __init paging_init(void) | |||
1769 | sun4v_ktsb_init(); | 1753 | sun4v_ktsb_init(); |
1770 | } | 1754 | } |
1771 | 1755 | ||
1772 | memblock_init(); | ||
1773 | |||
1774 | /* Find available physical memory... | 1756 | /* Find available physical memory... |
1775 | * | 1757 | * |
1776 | * Read it twice in order to work around a bug in openfirmware. | 1758 | * Read it twice in order to work around a bug in openfirmware. |
@@ -1796,7 +1778,7 @@ void __init paging_init(void) | |||
1796 | 1778 | ||
1797 | memblock_enforce_memory_limit(cmdline_memory_size); | 1779 | memblock_enforce_memory_limit(cmdline_memory_size); |
1798 | 1780 | ||
1799 | memblock_analyze(); | 1781 | memblock_allow_resize(); |
1800 | memblock_dump_all(); | 1782 | memblock_dump_all(); |
1801 | 1783 | ||
1802 | set_bit(0, mmu_context_bmap); | 1784 | set_bit(0, mmu_context_bmap); |