diff options
Diffstat (limited to 'arch/sh/mm')
| -rw-r--r-- | arch/sh/mm/init.c | 40 | ||||
| -rw-r--r-- | arch/sh/mm/numa.c | 8 |
2 files changed, 24 insertions, 24 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 46f84de62469..d0e249100e98 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | #include <linux/pagemap.h> | 16 | #include <linux/pagemap.h> |
| 17 | #include <linux/percpu.h> | 17 | #include <linux/percpu.h> |
| 18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
| 19 | #include <linux/lmb.h> | 19 | #include <linux/memblock.h> |
| 20 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
| 21 | #include <asm/mmu_context.h> | 21 | #include <asm/mmu_context.h> |
| 22 | #include <asm/mmzone.h> | 22 | #include <asm/mmzone.h> |
| @@ -33,7 +33,7 @@ pgd_t swapper_pg_dir[PTRS_PER_PGD]; | |||
| 33 | 33 | ||
| 34 | void __init generic_mem_init(void) | 34 | void __init generic_mem_init(void) |
| 35 | { | 35 | { |
| 36 | lmb_add(__MEMORY_START, __MEMORY_SIZE); | 36 | memblock_add(__MEMORY_START, __MEMORY_SIZE); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void __init __weak plat_mem_setup(void) | 39 | void __init __weak plat_mem_setup(void) |
| @@ -176,12 +176,12 @@ void __init allocate_pgdat(unsigned int nid) | |||
| 176 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); | 176 | get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); |
| 177 | 177 | ||
| 178 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 178 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
| 179 | phys = __lmb_alloc_base(sizeof(struct pglist_data), | 179 | phys = __memblock_alloc_base(sizeof(struct pglist_data), |
| 180 | SMP_CACHE_BYTES, end_pfn << PAGE_SHIFT); | 180 | SMP_CACHE_BYTES, end_pfn << PAGE_SHIFT); |
| 181 | /* Retry with all of system memory */ | 181 | /* Retry with all of system memory */ |
| 182 | if (!phys) | 182 | if (!phys) |
| 183 | phys = __lmb_alloc_base(sizeof(struct pglist_data), | 183 | phys = __memblock_alloc_base(sizeof(struct pglist_data), |
| 184 | SMP_CACHE_BYTES, lmb_end_of_DRAM()); | 184 | SMP_CACHE_BYTES, memblock_end_of_DRAM()); |
| 185 | if (!phys) | 185 | if (!phys) |
| 186 | panic("Can't allocate pgdat for node %d\n", nid); | 186 | panic("Can't allocate pgdat for node %d\n", nid); |
| 187 | 187 | ||
| @@ -212,7 +212,7 @@ static void __init bootmem_init_one_node(unsigned int nid) | |||
| 212 | 212 | ||
| 213 | total_pages = bootmem_bootmap_pages(p->node_spanned_pages); | 213 | total_pages = bootmem_bootmap_pages(p->node_spanned_pages); |
| 214 | 214 | ||
| 215 | paddr = lmb_alloc(total_pages << PAGE_SHIFT, PAGE_SIZE); | 215 | paddr = memblock_alloc(total_pages << PAGE_SHIFT, PAGE_SIZE); |
| 216 | if (!paddr) | 216 | if (!paddr) |
| 217 | panic("Can't allocate bootmap for nid[%d]\n", nid); | 217 | panic("Can't allocate bootmap for nid[%d]\n", nid); |
| 218 | 218 | ||
| @@ -227,9 +227,9 @@ static void __init bootmem_init_one_node(unsigned int nid) | |||
| 227 | */ | 227 | */ |
| 228 | if (nid == 0) { | 228 | if (nid == 0) { |
| 229 | /* Reserve the sections we're already using. */ | 229 | /* Reserve the sections we're already using. */ |
| 230 | for (i = 0; i < lmb.reserved.cnt; i++) | 230 | for (i = 0; i < memblock.reserved.cnt; i++) |
| 231 | reserve_bootmem(lmb.reserved.region[i].base, | 231 | reserve_bootmem(memblock.reserved.region[i].base, |
| 232 | lmb_size_bytes(&lmb.reserved, i), | 232 | memblock_size_bytes(&memblock.reserved, i), |
| 233 | BOOTMEM_DEFAULT); | 233 | BOOTMEM_DEFAULT); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| @@ -241,10 +241,10 @@ static void __init do_init_bootmem(void) | |||
| 241 | int i; | 241 | int i; |
| 242 | 242 | ||
| 243 | /* Add active regions with valid PFNs. */ | 243 | /* Add active regions with valid PFNs. */ |
| 244 | for (i = 0; i < lmb.memory.cnt; i++) { | 244 | for (i = 0; i < memblock.memory.cnt; i++) { |
| 245 | unsigned long start_pfn, end_pfn; | 245 | unsigned long start_pfn, end_pfn; |
| 246 | start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; | 246 | start_pfn = memblock.memory.region[i].base >> PAGE_SHIFT; |
| 247 | end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); | 247 | end_pfn = start_pfn + memblock_size_pages(&memblock.memory, i); |
| 248 | __add_active_range(0, start_pfn, end_pfn); | 248 | __add_active_range(0, start_pfn, end_pfn); |
| 249 | } | 249 | } |
| 250 | 250 | ||
| @@ -276,7 +276,7 @@ static void __init early_reserve_mem(void) | |||
| 276 | * this catches the (definitely buggy) case of us accidentally | 276 | * this catches the (definitely buggy) case of us accidentally |
| 277 | * initializing the bootmem allocator with an invalid RAM area. | 277 | * initializing the bootmem allocator with an invalid RAM area. |
| 278 | */ | 278 | */ |
| 279 | lmb_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, | 279 | memblock_reserve(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET, |
| 280 | (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - | 280 | (PFN_PHYS(start_pfn) + PAGE_SIZE - 1) - |
| 281 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); | 281 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); |
| 282 | 282 | ||
| @@ -284,7 +284,7 @@ static void __init early_reserve_mem(void) | |||
| 284 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. | 284 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. |
| 285 | */ | 285 | */ |
| 286 | if (CONFIG_ZERO_PAGE_OFFSET != 0) | 286 | if (CONFIG_ZERO_PAGE_OFFSET != 0) |
| 287 | lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); | 287 | memblock_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); |
| 288 | 288 | ||
| 289 | /* | 289 | /* |
| 290 | * Handle additional early reservations | 290 | * Handle additional early reservations |
| @@ -299,27 +299,27 @@ void __init paging_init(void) | |||
| 299 | unsigned long vaddr, end; | 299 | unsigned long vaddr, end; |
| 300 | int nid; | 300 | int nid; |
| 301 | 301 | ||
| 302 | lmb_init(); | 302 | memblock_init(); |
| 303 | 303 | ||
| 304 | sh_mv.mv_mem_init(); | 304 | sh_mv.mv_mem_init(); |
| 305 | 305 | ||
| 306 | early_reserve_mem(); | 306 | early_reserve_mem(); |
| 307 | 307 | ||
| 308 | lmb_enforce_memory_limit(memory_limit); | 308 | memblock_enforce_memory_limit(memory_limit); |
| 309 | lmb_analyze(); | 309 | memblock_analyze(); |
| 310 | 310 | ||
| 311 | lmb_dump_all(); | 311 | memblock_dump_all(); |
| 312 | 312 | ||
| 313 | /* | 313 | /* |
| 314 | * Determine low and high memory ranges: | 314 | * Determine low and high memory ranges: |
| 315 | */ | 315 | */ |
| 316 | max_low_pfn = max_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT; | 316 | max_low_pfn = max_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT; |
| 317 | min_low_pfn = __MEMORY_START >> PAGE_SHIFT; | 317 | min_low_pfn = __MEMORY_START >> PAGE_SHIFT; |
| 318 | 318 | ||
| 319 | nodes_clear(node_online_map); | 319 | nodes_clear(node_online_map); |
| 320 | 320 | ||
| 321 | memory_start = (unsigned long)__va(__MEMORY_START); | 321 | memory_start = (unsigned long)__va(__MEMORY_START); |
| 322 | memory_end = memory_start + (memory_limit ?: lmb_phys_mem_size()); | 322 | memory_end = memory_start + (memory_limit ?: memblock_phys_mem_size()); |
| 323 | 323 | ||
| 324 | uncached_init(); | 324 | uncached_init(); |
| 325 | pmb_init(); | 325 | pmb_init(); |
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c index a2e645f64a37..3d85225b9e95 100644 --- a/arch/sh/mm/numa.c +++ b/arch/sh/mm/numa.c | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | */ | 9 | */ |
| 10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
| 11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
| 12 | #include <linux/lmb.h> | 12 | #include <linux/memblock.h> |
| 13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
| 14 | #include <linux/numa.h> | 14 | #include <linux/numa.h> |
| 15 | #include <linux/pfn.h> | 15 | #include <linux/pfn.h> |
| @@ -39,12 +39,12 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
| 39 | pmb_bolt_mapping((unsigned long)__va(start), start, end - start, | 39 | pmb_bolt_mapping((unsigned long)__va(start), start, end - start, |
| 40 | PAGE_KERNEL); | 40 | PAGE_KERNEL); |
| 41 | 41 | ||
| 42 | lmb_add(start, end - start); | 42 | memblock_add(start, end - start); |
| 43 | 43 | ||
| 44 | __add_active_range(nid, start_pfn, end_pfn); | 44 | __add_active_range(nid, start_pfn, end_pfn); |
| 45 | 45 | ||
| 46 | /* Node-local pgdat */ | 46 | /* Node-local pgdat */ |
| 47 | NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data), | 47 | NODE_DATA(nid) = __va(memblock_alloc_base(sizeof(struct pglist_data), |
| 48 | SMP_CACHE_BYTES, end)); | 48 | SMP_CACHE_BYTES, end)); |
| 49 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | 49 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); |
| 50 | 50 | ||
| @@ -54,7 +54,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
| 54 | 54 | ||
| 55 | /* Node-local bootmap */ | 55 | /* Node-local bootmap */ |
| 56 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 56 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
| 57 | bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT, | 57 | bootmem_paddr = memblock_alloc_base(bootmap_pages << PAGE_SHIFT, |
| 58 | PAGE_SIZE, end); | 58 | PAGE_SIZE, end); |
| 59 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, | 59 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, |
| 60 | start_pfn, end_pfn); | 60 | start_pfn, end_pfn); |
