diff options
Diffstat (limited to 'arch/ia64/mm/discontig.c')
-rw-r--r-- | arch/ia64/mm/discontig.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index b5c90e548195..a3788fb84809 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -421,6 +421,37 @@ static void __init memory_less_nodes(void) | |||
421 | return; | 421 | return; |
422 | } | 422 | } |
423 | 423 | ||
424 | #ifdef CONFIG_SPARSEMEM | ||
425 | /** | ||
426 | * register_sparse_mem - notify SPARSEMEM that this memory range exists. | ||
427 | * @start: physical start of range | ||
428 | * @end: physical end of range | ||
429 | * @arg: unused | ||
430 | * | ||
431 | * Simply calls SPARSEMEM to register memory section(s). | ||
432 | */ | ||
433 | static int __init register_sparse_mem(unsigned long start, unsigned long end, | ||
434 | void *arg) | ||
435 | { | ||
436 | int nid; | ||
437 | |||
438 | start = __pa(start) >> PAGE_SHIFT; | ||
439 | end = __pa(end) >> PAGE_SHIFT; | ||
440 | nid = early_pfn_to_nid(start); | ||
441 | memory_present(nid, start, end); | ||
442 | |||
443 | return 0; | ||
444 | } | ||
445 | |||
446 | static void __init arch_sparse_init(void) | ||
447 | { | ||
448 | efi_memmap_walk(register_sparse_mem, NULL); | ||
449 | sparse_init(); | ||
450 | } | ||
451 | #else | ||
452 | #define arch_sparse_init() do {} while (0) | ||
453 | #endif | ||
454 | |||
424 | /** | 455 | /** |
425 | * find_memory - walk the EFI memory map and setup the bootmem allocator | 456 | * find_memory - walk the EFI memory map and setup the bootmem allocator |
426 | * | 457 | * |
@@ -528,8 +559,10 @@ void show_mem(void) | |||
528 | int shared = 0, cached = 0, reserved = 0; | 559 | int shared = 0, cached = 0, reserved = 0; |
529 | printk("Node ID: %d\n", pgdat->node_id); | 560 | printk("Node ID: %d\n", pgdat->node_id); |
530 | for(i = 0; i < pgdat->node_spanned_pages; i++) { | 561 | for(i = 0; i < pgdat->node_spanned_pages; i++) { |
531 | struct page *page = pgdat_page_nr(pgdat, i); | 562 | struct page *page; |
532 | if (!ia64_pfn_valid(pgdat->node_start_pfn+i)) | 563 | if (pfn_valid(pgdat->node_start_pfn + i)) |
564 | page = pfn_to_page(pgdat->node_start_pfn + i); | ||
565 | else | ||
533 | continue; | 566 | continue; |
534 | if (PageReserved(page)) | 567 | if (PageReserved(page)) |
535 | reserved++; | 568 | reserved++; |
@@ -648,12 +681,16 @@ void __init paging_init(void) | |||
648 | 681 | ||
649 | max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; | 682 | max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; |
650 | 683 | ||
684 | arch_sparse_init(); | ||
685 | |||
651 | efi_memmap_walk(filter_rsvd_memory, count_node_pages); | 686 | efi_memmap_walk(filter_rsvd_memory, count_node_pages); |
652 | 687 | ||
688 | #ifdef CONFIG_VIRTUAL_MEM_MAP | ||
653 | vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page)); | 689 | vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page)); |
654 | vmem_map = (struct page *) vmalloc_end; | 690 | vmem_map = (struct page *) vmalloc_end; |
655 | efi_memmap_walk(create_mem_map_page_table, NULL); | 691 | efi_memmap_walk(create_mem_map_page_table, NULL); |
656 | printk("Virtual mem_map starts at 0x%p\n", vmem_map); | 692 | printk("Virtual mem_map starts at 0x%p\n", vmem_map); |
693 | #endif | ||
657 | 694 | ||
658 | for_each_online_node(node) { | 695 | for_each_online_node(node) { |
659 | memset(zones_size, 0, sizeof(zones_size)); | 696 | memset(zones_size, 0, sizeof(zones_size)); |
@@ -690,7 +727,9 @@ void __init paging_init(void) | |||
690 | 727 | ||
691 | pfn_offset = mem_data[node].min_pfn; | 728 | pfn_offset = mem_data[node].min_pfn; |
692 | 729 | ||
730 | #ifdef CONFIG_VIRTUAL_MEM_MAP | ||
693 | NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; | 731 | NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; |
732 | #endif | ||
694 | free_area_init_node(node, NODE_DATA(node), zones_size, | 733 | free_area_init_node(node, NODE_DATA(node), zones_size, |
695 | pfn_offset, zholes_size); | 734 | pfn_offset, zholes_size); |
696 | } | 735 | } |