]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86: clean up and and print out initial max_pfn_mapped
authorYinghai Lu <yinghai@kernel.org>
Sun, 10 May 2009 06:47:42 +0000 (23:47 -0700)
committerIngo Molnar <mingo@elte.hu>
Mon, 11 May 2009 09:11:12 +0000 (11:11 +0200)
Do this so we can check the range that is mapped before
init_memory_mapping().

To be able to print out meaningful info, we first have to fix
64-bit to have max_pfn_mapped assigned before that call. This
also unifies the code-path a bit.

[ Impact: print more debug info, cleanup ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49BF0978.40605@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/setup.c
arch/x86/mm/init.c

index 0d77e56e821be9fe3a76e8d32f5c8c65b7d3c17d..4031d6cb3ff97f52e19f8f3075371d5c5a51aed2 100644 (file)
@@ -862,12 +862,16 @@ void __init setup_arch(char **cmdline_p)
                max_low_pfn = max_pfn;
 
        high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
+       max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
 #endif
 
 #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
        setup_bios_corruption_check();
 #endif
 
+       printk(KERN_DEBUG "initial memory mapped : 0 - %08lx\n",
+                       max_pfn_mapped<<PAGE_SHIFT);
+
        reserve_brk();
 
        /* max_pfn_mapped is updated here */
index 95f5ecf2be5020dbcc57773b25b913ae0deb7a15..92d2108a62c3de03ce516fa9d23b1a6894d2598c 100644 (file)
@@ -132,12 +132,11 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
         */
 #ifdef CONFIG_X86_32
        start = 0x7000;
-       e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
-                                       tables, PAGE_SIZE);
-#else /* CONFIG_X86_64 */
+#else
        start = 0x8000;
-       e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
 #endif
+       e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
+                                       tables, PAGE_SIZE);
        if (e820_table_start == -1UL)
                panic("Cannot find space for the kernel page tables");