diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-03-05 07:54:55 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-05 08:17:12 -0500 |
commit | e7179853e7552ba6631e2cdd9f5c374383403b4b (patch) | |
tree | 48218c4a6faa8ad8a5fe48cb05c63e68b217d29d /arch/x86/mm/init_32.c | |
parent | 49a2bf7303b0dc5fccbb3ff7cf2e7751f0e3953d (diff) |
x86: move pgd_base out of init_memory_mapping()
Impact: cleanup
This patch moves pgd_base out of init_memory_mapping() to reduce
the diff between the 32-bit version and the 64-bit version of the
function.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <1236257708-27269-4-git-send-email-penberg@cs.helsinki.fi>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 86a99947455b..cfc68d601380 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -227,11 +227,11 @@ static inline int is_kernel_text(unsigned long addr) | |||
227 | * of max_low_pfn pages, by creating page tables starting from address | 227 | * of max_low_pfn pages, by creating page tables starting from address |
228 | * PAGE_OFFSET: | 228 | * PAGE_OFFSET: |
229 | */ | 229 | */ |
230 | static void __init kernel_physical_mapping_init(pgd_t *pgd_base, | 230 | static void __init kernel_physical_mapping_init(unsigned long start_pfn, |
231 | unsigned long start_pfn, | ||
232 | unsigned long end_pfn, | 231 | unsigned long end_pfn, |
233 | int use_pse) | 232 | int use_pse) |
234 | { | 233 | { |
234 | pgd_t *pgd_base = swapper_pg_dir; | ||
235 | int pgd_idx, pmd_idx, pte_ofs; | 235 | int pgd_idx, pmd_idx, pte_ofs; |
236 | unsigned long pfn; | 236 | unsigned long pfn; |
237 | pgd_t *pgd; | 237 | pgd_t *pgd; |
@@ -509,8 +509,9 @@ void __init native_pagetable_setup_done(pgd_t *base) | |||
509 | * be partially populated, and so it avoids stomping on any existing | 509 | * be partially populated, and so it avoids stomping on any existing |
510 | * mappings. | 510 | * mappings. |
511 | */ | 511 | */ |
512 | static void __init early_ioremap_page_table_range_init(pgd_t *pgd_base) | 512 | static void __init early_ioremap_page_table_range_init(void) |
513 | { | 513 | { |
514 | pgd_t *pgd_base = swapper_pg_dir; | ||
514 | unsigned long vaddr, end; | 515 | unsigned long vaddr, end; |
515 | 516 | ||
516 | /* | 517 | /* |
@@ -925,7 +926,6 @@ static int save_mr(struct map_range *mr, int nr_range, | |||
925 | unsigned long __init_refok init_memory_mapping(unsigned long start, | 926 | unsigned long __init_refok init_memory_mapping(unsigned long start, |
926 | unsigned long end) | 927 | unsigned long end) |
927 | { | 928 | { |
928 | pgd_t *pgd_base = swapper_pg_dir; | ||
929 | unsigned long page_size_mask = 0; | 929 | unsigned long page_size_mask = 0; |
930 | unsigned long start_pfn, end_pfn; | 930 | unsigned long start_pfn, end_pfn; |
931 | unsigned long pos; | 931 | unsigned long pos; |
@@ -1040,12 +1040,12 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
1040 | find_early_table_space(end, use_pse, use_gbpages); | 1040 | find_early_table_space(end, use_pse, use_gbpages); |
1041 | 1041 | ||
1042 | for (i = 0; i < nr_range; i++) | 1042 | for (i = 0; i < nr_range; i++) |
1043 | kernel_physical_mapping_init(pgd_base, | 1043 | kernel_physical_mapping_init( |
1044 | mr[i].start >> PAGE_SHIFT, | 1044 | mr[i].start >> PAGE_SHIFT, |
1045 | mr[i].end >> PAGE_SHIFT, | 1045 | mr[i].end >> PAGE_SHIFT, |
1046 | mr[i].page_size_mask == (1<<PG_LEVEL_2M)); | 1046 | mr[i].page_size_mask == (1<<PG_LEVEL_2M)); |
1047 | 1047 | ||
1048 | early_ioremap_page_table_range_init(pgd_base); | 1048 | early_ioremap_page_table_range_init(); |
1049 | 1049 | ||
1050 | load_cr3(swapper_pg_dir); | 1050 | load_cr3(swapper_pg_dir); |
1051 | 1051 | ||