diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-03-05 07:54:59 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-05 08:17:14 -0500 |
commit | cbba65796df99f3ca9bf70d14e5a19384c54b6a1 (patch) | |
tree | c1a88f3eb150ab99a8223652f301c3fc64d73fe3 /arch/x86/mm/init_64.c | |
parent | c464573cb3d3bdd45eed8f5f59596f84ede95a0c (diff) |
x86: unify kernel_physical_mapping_init() call in init_memory_mapping()
Impact: cleanup
The 64-bit version of init_memory_mapping() uses the last mapped
address returned from kernel_physical_mapping_init() whereas the
32-bit version doesn't. This patch adds relevant ifdefs to both
versions of the function to reduce the diff between them.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <1236257708-27269-8-git-send-email-penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r-- | arch/x86/mm/init_64.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index c3c0be5b6373..e4fadea2e521 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -686,10 +686,10 @@ static int save_mr(struct map_range *mr, int nr_range, | |||
686 | unsigned long __init_refok init_memory_mapping(unsigned long start, | 686 | unsigned long __init_refok init_memory_mapping(unsigned long start, |
687 | unsigned long end) | 687 | unsigned long end) |
688 | { | 688 | { |
689 | unsigned long last_map_addr = 0; | ||
690 | unsigned long page_size_mask = 0; | 689 | unsigned long page_size_mask = 0; |
691 | unsigned long start_pfn, end_pfn; | 690 | unsigned long start_pfn, end_pfn; |
692 | unsigned long pos; | 691 | unsigned long pos; |
692 | unsigned long ret; | ||
693 | 693 | ||
694 | struct map_range mr[NR_RANGE_MR]; | 694 | struct map_range mr[NR_RANGE_MR]; |
695 | int nr_range, i; | 695 | int nr_range, i; |
@@ -819,10 +819,18 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
819 | if (!after_bootmem) | 819 | if (!after_bootmem) |
820 | find_early_table_space(end, use_pse, use_gbpages); | 820 | find_early_table_space(end, use_pse, use_gbpages); |
821 | 821 | ||
822 | #ifdef CONFIG_X86_32 | ||
823 | for (i = 0; i < nr_range; i++) | ||
824 | kernel_physical_mapping_init( | ||
825 | mr[i].start >> PAGE_SHIFT, | ||
826 | mr[i].end >> PAGE_SHIFT, | ||
827 | mr[i].page_size_mask == (1<<PG_LEVEL_2M)); | ||
828 | ret = end; | ||
829 | #else /* CONFIG_X86_64 */ | ||
822 | for (i = 0; i < nr_range; i++) | 830 | for (i = 0; i < nr_range; i++) |
823 | last_map_addr = kernel_physical_mapping_init( | 831 | ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, |
824 | mr[i].start, mr[i].end, | 832 | mr[i].page_size_mask); |
825 | mr[i].page_size_mask); | 833 | #endif |
826 | 834 | ||
827 | if (!after_bootmem) | 835 | if (!after_bootmem) |
828 | mmu_cr4_features = read_cr4(); | 836 | mmu_cr4_features = read_cr4(); |
@@ -832,13 +840,10 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
832 | reserve_early(table_start << PAGE_SHIFT, | 840 | reserve_early(table_start << PAGE_SHIFT, |
833 | table_end << PAGE_SHIFT, "PGTABLE"); | 841 | table_end << PAGE_SHIFT, "PGTABLE"); |
834 | 842 | ||
835 | printk(KERN_INFO "last_map_addr: %lx end: %lx\n", | ||
836 | last_map_addr, end); | ||
837 | |||
838 | if (!after_bootmem) | 843 | if (!after_bootmem) |
839 | early_memtest(start, end); | 844 | early_memtest(start, end); |
840 | 845 | ||
841 | return last_map_addr >> PAGE_SHIFT; | 846 | return ret >> PAGE_SHIFT; |
842 | } | 847 | } |
843 | 848 | ||
844 | #ifndef CONFIG_NUMA | 849 | #ifndef CONFIG_NUMA |