diff options
Diffstat (limited to 'arch/x86/kernel/head_32.S')
-rw-r--r-- | arch/x86/kernel/head_32.S | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index bcece91dd311..c0dbd9ac24f0 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -60,16 +60,18 @@ | |||
60 | #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD) | 60 | #define PAGE_TABLE_SIZE(pages) ((pages) / PTRS_PER_PGD) |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | /* Number of possible pages in the lowmem region */ | ||
64 | LOWMEM_PAGES = (((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) | ||
65 | |||
63 | /* Enough space to fit pagetables for the low memory linear map */ | 66 | /* Enough space to fit pagetables for the low memory linear map */ |
64 | MAPPING_BEYOND_END = \ | 67 | MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT |
65 | PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT | ||
66 | 68 | ||
67 | /* | 69 | /* |
68 | * Worst-case size of the kernel mapping we need to make: | 70 | * Worst-case size of the kernel mapping we need to make: |
69 | * the worst-case size of the kernel itself, plus the extra we need | 71 | * a relocatable kernel can live anywhere in lowmem, so we need to be able |
70 | * to map for the linear map. | 72 | * to map all of lowmem. |
71 | */ | 73 | */ |
72 | KERNEL_PAGES = (KERNEL_IMAGE_SIZE + MAPPING_BEYOND_END)>>PAGE_SHIFT | 74 | KERNEL_PAGES = LOWMEM_PAGES |
73 | 75 | ||
74 | INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm | 76 | INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm |
75 | RESERVE_BRK(pagetables, INIT_MAP_SIZE) | 77 | RESERVE_BRK(pagetables, INIT_MAP_SIZE) |
@@ -620,13 +622,13 @@ ENTRY(initial_code) | |||
620 | __PAGE_ALIGNED_BSS | 622 | __PAGE_ALIGNED_BSS |
621 | .align PAGE_SIZE_asm | 623 | .align PAGE_SIZE_asm |
622 | #ifdef CONFIG_X86_PAE | 624 | #ifdef CONFIG_X86_PAE |
623 | initial_pg_pmd: | 625 | ENTRY(initial_pg_pmd) |
624 | .fill 1024*KPMDS,4,0 | 626 | .fill 1024*KPMDS,4,0 |
625 | #else | 627 | #else |
626 | ENTRY(initial_page_table) | 628 | ENTRY(initial_page_table) |
627 | .fill 1024,4,0 | 629 | .fill 1024,4,0 |
628 | #endif | 630 | #endif |
629 | initial_pg_fixmap: | 631 | ENTRY(initial_pg_fixmap) |
630 | .fill 1024,4,0 | 632 | .fill 1024,4,0 |
631 | ENTRY(empty_zero_page) | 633 | ENTRY(empty_zero_page) |
632 | .fill 4096,1,0 | 634 | .fill 4096,1,0 |