aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-07-12 00:36:09 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-07-14 03:14:00 -0400
commit95f72d1ed41a66f1c1c29c24d479de81a0bea36f (patch)
treebd92b3804ff0bea083d69af0ede52f99ab34c0af /arch/sparc/mm
parent1c5474a65bf15a4cb162dfff86d6d0b5a08a740c (diff)
lmb: rename to memblock
via following scripts FILES=$(find * -type f | grep -vE 'oprofile|[^K]config') sed -i \ -e 's/lmb/memblock/g' \ -e 's/LMB/MEMBLOCK/g' \ $FILES for N in $(find . -name lmb.[ch]); do M=$(echo $N | sed 's/lmb/memblock/g') mv $N $M done and remove some wrong change like lmbench and dlmb etc. also move memblock.c from lib/ to mm/ Suggested-by: Ingo Molnar <mingo@elte.hu> Acked-by: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r--arch/sparc/mm/init_64.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index b2831dc3c121..f0434513df15 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -23,7 +23,7 @@
23#include <linux/cache.h> 23#include <linux/cache.h>
24#include <linux/sort.h> 24#include <linux/sort.h>
25#include <linux/percpu.h> 25#include <linux/percpu.h>
26#include <linux/lmb.h> 26#include <linux/memblock.h>
27#include <linux/mmzone.h> 27#include <linux/mmzone.h>
28#include <linux/gfp.h> 28#include <linux/gfp.h>
29 29
@@ -726,7 +726,7 @@ static void __init find_ramdisk(unsigned long phys_base)
726 initrd_start = ramdisk_image; 726 initrd_start = ramdisk_image;
727 initrd_end = ramdisk_image + sparc_ramdisk_size; 727 initrd_end = ramdisk_image + sparc_ramdisk_size;
728 728
729 lmb_reserve(initrd_start, sparc_ramdisk_size); 729 memblock_reserve(initrd_start, sparc_ramdisk_size);
730 730
731 initrd_start += PAGE_OFFSET; 731 initrd_start += PAGE_OFFSET;
732 initrd_end += PAGE_OFFSET; 732 initrd_end += PAGE_OFFSET;
@@ -822,7 +822,7 @@ static void __init allocate_node_data(int nid)
822 struct pglist_data *p; 822 struct pglist_data *p;
823 823
824#ifdef CONFIG_NEED_MULTIPLE_NODES 824#ifdef CONFIG_NEED_MULTIPLE_NODES
825 paddr = lmb_alloc_nid(sizeof(struct pglist_data), 825 paddr = memblock_alloc_nid(sizeof(struct pglist_data),
826 SMP_CACHE_BYTES, nid, nid_range); 826 SMP_CACHE_BYTES, nid, nid_range);
827 if (!paddr) { 827 if (!paddr) {
828 prom_printf("Cannot allocate pglist_data for nid[%d]\n", nid); 828 prom_printf("Cannot allocate pglist_data for nid[%d]\n", nid);
@@ -843,7 +843,7 @@ static void __init allocate_node_data(int nid)
843 if (p->node_spanned_pages) { 843 if (p->node_spanned_pages) {
844 num_pages = bootmem_bootmap_pages(p->node_spanned_pages); 844 num_pages = bootmem_bootmap_pages(p->node_spanned_pages);
845 845
846 paddr = lmb_alloc_nid(num_pages << PAGE_SHIFT, PAGE_SIZE, nid, 846 paddr = memblock_alloc_nid(num_pages << PAGE_SHIFT, PAGE_SIZE, nid,
847 nid_range); 847 nid_range);
848 if (!paddr) { 848 if (!paddr) {
849 prom_printf("Cannot allocate bootmap for nid[%d]\n", 849 prom_printf("Cannot allocate bootmap for nid[%d]\n",
@@ -974,11 +974,11 @@ static void __init add_node_ranges(void)
974{ 974{
975 int i; 975 int i;
976 976
977 for (i = 0; i < lmb.memory.cnt; i++) { 977 for (i = 0; i < memblock.memory.cnt; i++) {
978 unsigned long size = lmb_size_bytes(&lmb.memory, i); 978 unsigned long size = memblock_size_bytes(&memblock.memory, i);
979 unsigned long start, end; 979 unsigned long start, end;
980 980
981 start = lmb.memory.region[i].base; 981 start = memblock.memory.region[i].base;
982 end = start + size; 982 end = start + size;
983 while (start < end) { 983 while (start < end) {
984 unsigned long this_end; 984 unsigned long this_end;
@@ -1010,7 +1010,7 @@ static int __init grab_mlgroups(struct mdesc_handle *md)
1010 if (!count) 1010 if (!count)
1011 return -ENOENT; 1011 return -ENOENT;
1012 1012
1013 paddr = lmb_alloc(count * sizeof(struct mdesc_mlgroup), 1013 paddr = memblock_alloc(count * sizeof(struct mdesc_mlgroup),
1014 SMP_CACHE_BYTES); 1014 SMP_CACHE_BYTES);
1015 if (!paddr) 1015 if (!paddr)
1016 return -ENOMEM; 1016 return -ENOMEM;
@@ -1051,7 +1051,7 @@ static int __init grab_mblocks(struct mdesc_handle *md)
1051 if (!count) 1051 if (!count)
1052 return -ENOENT; 1052 return -ENOENT;
1053 1053
1054 paddr = lmb_alloc(count * sizeof(struct mdesc_mblock), 1054 paddr = memblock_alloc(count * sizeof(struct mdesc_mblock),
1055 SMP_CACHE_BYTES); 1055 SMP_CACHE_BYTES);
1056 if (!paddr) 1056 if (!paddr)
1057 return -ENOMEM; 1057 return -ENOMEM;
@@ -1279,8 +1279,8 @@ static int bootmem_init_numa(void)
1279 1279
1280static void __init bootmem_init_nonnuma(void) 1280static void __init bootmem_init_nonnuma(void)
1281{ 1281{
1282 unsigned long top_of_ram = lmb_end_of_DRAM(); 1282 unsigned long top_of_ram = memblock_end_of_DRAM();
1283 unsigned long total_ram = lmb_phys_mem_size(); 1283 unsigned long total_ram = memblock_phys_mem_size();
1284 unsigned int i; 1284 unsigned int i;
1285 1285
1286 numadbg("bootmem_init_nonnuma()\n"); 1286 numadbg("bootmem_init_nonnuma()\n");
@@ -1292,15 +1292,15 @@ static void __init bootmem_init_nonnuma(void)
1292 1292
1293 init_node_masks_nonnuma(); 1293 init_node_masks_nonnuma();
1294 1294
1295 for (i = 0; i < lmb.memory.cnt; i++) { 1295 for (i = 0; i < memblock.memory.cnt; i++) {
1296 unsigned long size = lmb_size_bytes(&lmb.memory, i); 1296 unsigned long size = memblock_size_bytes(&memblock.memory, i);
1297 unsigned long start_pfn, end_pfn; 1297 unsigned long start_pfn, end_pfn;
1298 1298
1299 if (!size) 1299 if (!size)
1300 continue; 1300 continue;
1301 1301
1302 start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; 1302 start_pfn = memblock.memory.region[i].base >> PAGE_SHIFT;
1303 end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); 1303 end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i);
1304 add_active_range(0, start_pfn, end_pfn); 1304 add_active_range(0, start_pfn, end_pfn);
1305 } 1305 }
1306 1306
@@ -1338,9 +1338,9 @@ static void __init trim_reserved_in_node(int nid)
1338 1338
1339 numadbg(" trim_reserved_in_node(%d)\n", nid); 1339 numadbg(" trim_reserved_in_node(%d)\n", nid);
1340 1340
1341 for (i = 0; i < lmb.reserved.cnt; i++) { 1341 for (i = 0; i < memblock.reserved.cnt; i++) {
1342 unsigned long start = lmb.reserved.region[i].base; 1342 unsigned long start = memblock.reserved.region[i].base;
1343 unsigned long size = lmb_size_bytes(&lmb.reserved, i); 1343 unsigned long size = memblock_size_bytes(&memblock.reserved, i);
1344 unsigned long end = start + size; 1344 unsigned long end = start + size;
1345 1345
1346 reserve_range_in_node(nid, start, end); 1346 reserve_range_in_node(nid, start, end);
@@ -1384,7 +1384,7 @@ static unsigned long __init bootmem_init(unsigned long phys_base)
1384 unsigned long end_pfn; 1384 unsigned long end_pfn;
1385 int nid; 1385 int nid;
1386 1386
1387 end_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; 1387 end_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT;
1388 max_pfn = max_low_pfn = end_pfn; 1388 max_pfn = max_low_pfn = end_pfn;
1389 min_low_pfn = (phys_base >> PAGE_SHIFT); 1389 min_low_pfn = (phys_base >> PAGE_SHIFT);
1390 1390
@@ -1734,7 +1734,7 @@ void __init paging_init(void)
1734 sun4v_ktsb_init(); 1734 sun4v_ktsb_init();
1735 } 1735 }
1736 1736
1737 lmb_init(); 1737 memblock_init();
1738 1738
1739 /* Find available physical memory... 1739 /* Find available physical memory...
1740 * 1740 *
@@ -1752,17 +1752,17 @@ void __init paging_init(void)
1752 phys_base = 0xffffffffffffffffUL; 1752 phys_base = 0xffffffffffffffffUL;
1753 for (i = 0; i < pavail_ents; i++) { 1753 for (i = 0; i < pavail_ents; i++) {
1754 phys_base = min(phys_base, pavail[i].phys_addr); 1754 phys_base = min(phys_base, pavail[i].phys_addr);
1755 lmb_add(pavail[i].phys_addr, pavail[i].reg_size); 1755 memblock_add(pavail[i].phys_addr, pavail[i].reg_size);
1756 } 1756 }
1757 1757
1758 lmb_reserve(kern_base, kern_size); 1758 memblock_reserve(kern_base, kern_size);
1759 1759
1760 find_ramdisk(phys_base); 1760 find_ramdisk(phys_base);
1761 1761
1762 lmb_enforce_memory_limit(cmdline_memory_size); 1762 memblock_enforce_memory_limit(cmdline_memory_size);
1763 1763
1764 lmb_analyze(); 1764 memblock_analyze();
1765 lmb_dump_all(); 1765 memblock_dump_all();
1766 1766
1767 set_bit(0, mmu_context_bmap); 1767 set_bit(0, mmu_context_bmap);
1768 1768
@@ -1816,8 +1816,8 @@ void __init paging_init(void)
1816 */ 1816 */
1817 for_each_possible_cpu(i) { 1817 for_each_possible_cpu(i) {
1818 /* XXX Use node local allocations... XXX */ 1818 /* XXX Use node local allocations... XXX */
1819 softirq_stack[i] = __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 1819 softirq_stack[i] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
1820 hardirq_stack[i] = __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE)); 1820 hardirq_stack[i] = __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
1821 } 1821 }
1822 1822
1823 /* Setup bootmem... */ 1823 /* Setup bootmem... */