diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Kconfig | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/lmb.h | 10 | ||||
-rw-r--r-- | arch/sparc/include/asm/memblock.h | 10 | ||||
-rw-r--r-- | arch/sparc/kernel/mdesc.c | 16 | ||||
-rw-r--r-- | arch/sparc/kernel/prom_64.c | 4 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 54 |
6 files changed, 48 insertions, 48 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 6f1470baa314..c0015db247ba 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -42,7 +42,7 @@ config SPARC64 | |||
42 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 42 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
43 | select HAVE_KRETPROBES | 43 | select HAVE_KRETPROBES |
44 | select HAVE_KPROBES | 44 | select HAVE_KPROBES |
45 | select HAVE_LMB | 45 | select HAVE_MEMBLOCK |
46 | select HAVE_SYSCALL_WRAPPERS | 46 | select HAVE_SYSCALL_WRAPPERS |
47 | select HAVE_DYNAMIC_FTRACE | 47 | select HAVE_DYNAMIC_FTRACE |
48 | select HAVE_FTRACE_MCOUNT_RECORD | 48 | select HAVE_FTRACE_MCOUNT_RECORD |
diff --git a/arch/sparc/include/asm/lmb.h b/arch/sparc/include/asm/lmb.h deleted file mode 100644 index 6a352cbcf520..000000000000 --- a/arch/sparc/include/asm/lmb.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef _SPARC64_LMB_H | ||
2 | #define _SPARC64_LMB_H | ||
3 | |||
4 | #include <asm/oplib.h> | ||
5 | |||
6 | #define LMB_DBG(fmt...) prom_printf(fmt) | ||
7 | |||
8 | #define LMB_REAL_LIMIT 0 | ||
9 | |||
10 | #endif /* !(_SPARC64_LMB_H) */ | ||
diff --git a/arch/sparc/include/asm/memblock.h b/arch/sparc/include/asm/memblock.h new file mode 100644 index 000000000000..f12af880649b --- /dev/null +++ b/arch/sparc/include/asm/memblock.h | |||
@@ -0,0 +1,10 @@ | |||
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 | #define MEMBLOCK_REAL_LIMIT 0 | ||
9 | |||
10 | #endif /* !(_SPARC64_MEMBLOCK_H) */ | ||
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index cdc91d919e93..83e85c2e802a 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c | |||
@@ -4,7 +4,7 @@ | |||
4 | */ | 4 | */ |
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/lmb.h> | 7 | #include <linux/memblock.h> |
8 | #include <linux/log2.h> | 8 | #include <linux/log2.h> |
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
@@ -86,7 +86,7 @@ static void mdesc_handle_init(struct mdesc_handle *hp, | |||
86 | hp->handle_size = handle_size; | 86 | hp->handle_size = handle_size; |
87 | } | 87 | } |
88 | 88 | ||
89 | static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | 89 | static struct mdesc_handle * __init mdesc_memblock_alloc(unsigned int mdesc_size) |
90 | { | 90 | { |
91 | unsigned int handle_size, alloc_size; | 91 | unsigned int handle_size, alloc_size; |
92 | struct mdesc_handle *hp; | 92 | struct mdesc_handle *hp; |
@@ -97,7 +97,7 @@ static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | |||
97 | mdesc_size); | 97 | mdesc_size); |
98 | alloc_size = PAGE_ALIGN(handle_size); | 98 | alloc_size = PAGE_ALIGN(handle_size); |
99 | 99 | ||
100 | paddr = lmb_alloc(alloc_size, PAGE_SIZE); | 100 | paddr = memblock_alloc(alloc_size, PAGE_SIZE); |
101 | 101 | ||
102 | hp = NULL; | 102 | hp = NULL; |
103 | if (paddr) { | 103 | if (paddr) { |
@@ -107,7 +107,7 @@ static struct mdesc_handle * __init mdesc_lmb_alloc(unsigned int mdesc_size) | |||
107 | return hp; | 107 | return hp; |
108 | } | 108 | } |
109 | 109 | ||
110 | static void mdesc_lmb_free(struct mdesc_handle *hp) | 110 | static void mdesc_memblock_free(struct mdesc_handle *hp) |
111 | { | 111 | { |
112 | unsigned int alloc_size; | 112 | unsigned int alloc_size; |
113 | unsigned long start; | 113 | unsigned long start; |
@@ -120,9 +120,9 @@ static void mdesc_lmb_free(struct mdesc_handle *hp) | |||
120 | free_bootmem_late(start, alloc_size); | 120 | free_bootmem_late(start, alloc_size); |
121 | } | 121 | } |
122 | 122 | ||
123 | static struct mdesc_mem_ops lmb_mdesc_ops = { | 123 | static struct mdesc_mem_ops memblock_mdesc_ops = { |
124 | .alloc = mdesc_lmb_alloc, | 124 | .alloc = mdesc_memblock_alloc, |
125 | .free = mdesc_lmb_free, | 125 | .free = mdesc_memblock_free, |
126 | }; | 126 | }; |
127 | 127 | ||
128 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) | 128 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) |
@@ -914,7 +914,7 @@ void __init sun4v_mdesc_init(void) | |||
914 | 914 | ||
915 | printk("MDESC: Size is %lu bytes.\n", len); | 915 | printk("MDESC: Size is %lu bytes.\n", len); |
916 | 916 | ||
917 | hp = mdesc_alloc(len, &lmb_mdesc_ops); | 917 | hp = mdesc_alloc(len, &memblock_mdesc_ops); |
918 | if (hp == NULL) { | 918 | if (hp == NULL) { |
919 | prom_printf("MDESC: alloc of %lu bytes failed.\n", len); | 919 | prom_printf("MDESC: alloc of %lu bytes failed.\n", len); |
920 | prom_halt(); | 920 | prom_halt(); |
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index fb06ac2bd38f..466a32763ea8 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <linux/mm.h> | 21 | #include <linux/mm.h> |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/lmb.h> | 23 | #include <linux/memblock.h> |
24 | #include <linux/of_device.h> | 24 | #include <linux/of_device.h> |
25 | 25 | ||
26 | #include <asm/prom.h> | 26 | #include <asm/prom.h> |
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | void * __init prom_early_alloc(unsigned long size) | 35 | void * __init prom_early_alloc(unsigned long size) |
36 | { | 36 | { |
37 | unsigned long paddr = lmb_alloc(size, SMP_CACHE_BYTES); | 37 | unsigned long paddr = memblock_alloc(size, SMP_CACHE_BYTES); |
38 | void *ret; | 38 | void *ret; |
39 | 39 | ||
40 | if (!paddr) { | 40 | if (!paddr) { |
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 | ||
1280 | static void __init bootmem_init_nonnuma(void) | 1280 | static 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... */ |