aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 10:54:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 10:54:53 -0500
commit4a2164a7dbf0d3b6a1c2ef6f20c0d54350491a12 (patch)
tree1ef38a6a3b39f7e539fff848975a5672acc21f44 /arch/sparc
parent15f043a65f655eb8a3aeb831a85da66de520c80f (diff)
parent45aa0663cc408617b79a2b53f0a5f50e94688a48 (diff)
Merge branch 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits) memblock: Reimplement memblock allocation using reverse free area iterator memblock: Kill early_node_map[] score: Use HAVE_MEMBLOCK_NODE_MAP s390: Use HAVE_MEMBLOCK_NODE_MAP mips: Use HAVE_MEMBLOCK_NODE_MAP ia64: Use HAVE_MEMBLOCK_NODE_MAP SuperH: Use HAVE_MEMBLOCK_NODE_MAP sparc: Use HAVE_MEMBLOCK_NODE_MAP powerpc: Use HAVE_MEMBLOCK_NODE_MAP memblock: Implement memblock_add_node() memblock: s/memblock_analyze()/memblock_allow_resize()/ and update users memblock: Track total size of regions automatically powerpc: Cleanup memblock usage memblock: Reimplement memblock_enforce_memory_limit() using __memblock_remove() memblock: Make memblock functions handle overflowing range @size memblock: Reimplement __memblock_remove() using memblock_isolate_range() memblock: Separate out memblock_isolate_range() from memblock_set_node() memblock: Kill memblock_init() memblock: Kill sentinel entries at the end of static region arrays memblock: Add __memblock_dump_all() ...
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig4
-rw-r--r--arch/sparc/include/asm/memblock.h8
-rw-r--r--arch/sparc/mm/init_64.c32
3 files changed, 8 insertions, 36 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index f92602e86607..70ae9d81870e 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -43,6 +43,7 @@ config SPARC64
43 select HAVE_KPROBES 43 select HAVE_KPROBES
44 select HAVE_RCU_TABLE_FREE if SMP 44 select HAVE_RCU_TABLE_FREE if SMP
45 select HAVE_MEMBLOCK 45 select HAVE_MEMBLOCK
46 select HAVE_MEMBLOCK_NODE_MAP
46 select HAVE_SYSCALL_WRAPPERS 47 select HAVE_SYSCALL_WRAPPERS
47 select HAVE_DYNAMIC_FTRACE 48 select HAVE_DYNAMIC_FTRACE
48 select HAVE_FTRACE_MCOUNT_RECORD 49 select HAVE_FTRACE_MCOUNT_RECORD
@@ -352,9 +353,6 @@ config NODES_SPAN_OTHER_NODES
352 def_bool y 353 def_bool y
353 depends on NEED_MULTIPLE_NODES 354 depends on NEED_MULTIPLE_NODES
354 355
355config ARCH_POPULATES_NODE_MAP
356 def_bool y if SPARC64
357
358config ARCH_SELECT_MEMORY_MODEL 356config ARCH_SELECT_MEMORY_MODEL
359 def_bool y if SPARC64 357 def_bool y if SPARC64
360 358
diff --git a/arch/sparc/include/asm/memblock.h b/arch/sparc/include/asm/memblock.h
deleted file mode 100644
index c67b047ef85e..000000000000
--- a/arch/sparc/include/asm/memblock.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _SPARC64_MEMBLOCK_H
2#define _SPARC64_MEMBLOCK_H
3
4#include <asm/oplib.h>
5
6#define MEMBLOCK_DBG(fmt...) prom_printf(fmt)
7
8#endif /* !(_SPARC64_MEMBLOCK_H) */
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
793u64 memblock_nid_range(u64 start, u64 end, int *nid) 793static 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
811u64 memblock_nid_range(u64 start, u64 end, int *nid) 811static 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 */
822static void __init allocate_node_data(int nid) 822static 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);