aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-01 23:55:37 -0700
committerIngo Molnar <mingo@elte.hu>2008-06-03 13:26:29 +0200
commitc8c034ce79418d2143c00c4cf751cfa51701f788 (patch)
tree1b7a53b01b5ff16ed3c7f35c5cb5bff912d77605 /arch
parent6af61a7614a306fe882a0c2b4ddc63b65aa66efc (diff)
x86: clean up max_pfn_mapped usage - 64-bit
on 64-bit we only get valid max_pfn_mapped after init_memory_mapping(). Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/e820_64.c15
-rw-r--r--arch/x86/kernel/setup_64.c2
2 files changed, 4 insertions, 13 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index 5e063e72b24..a11bec20f65 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -55,16 +55,12 @@ unsigned long __init e820_end_of_ram(void)
last_pfn = find_max_pfn_with_active_regions();
- if (last_pfn > max_pfn_mapped)
- max_pfn_mapped = last_pfn;
- if (max_pfn_mapped > MAXMEM>>PAGE_SHIFT)
- max_pfn_mapped = MAXMEM>>PAGE_SHIFT;
+ if (last_pfn > MAXMEM>>PAGE_SHIFT)
+ last_pfn = MAXMEM>>PAGE_SHIFT;
if (last_pfn > end_user_pfn)
last_pfn = end_user_pfn;
- if (last_pfn > max_pfn_mapped)
- last_pfn = max_pfn_mapped;
- printk(KERN_INFO "max_pfn_mapped = %lu\n", max_pfn_mapped);
+ printk(KERN_INFO "last_pfn = %lu\n", last_pfn);
return last_pfn;
}
@@ -109,10 +105,6 @@ static int __init e820_find_active_region(const struct e820entry *ei,
if (*ei_startpfn >= *ei_endpfn)
return 0;
- /* Check if max_pfn_mapped should be updated */
- if (ei->type != E820_RAM && *ei_endpfn > max_pfn_mapped)
- max_pfn_mapped = *ei_endpfn;
-
/* Skip if map is outside the node */
if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
*ei_startpfn >= last_pfn)
@@ -229,7 +221,6 @@ static int __init parse_memmap_opt(char *p)
saved_max_pfn = e820_end_of_ram();
remove_all_active_ranges();
#endif
- max_pfn_mapped = 0;
e820.nr_map = 0;
userdef = 1;
return 0;
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 978a0d637f3..2599b274420 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -396,7 +396,7 @@ void __init setup_arch(char **cmdline_p)
check_efer();
- max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT));
+ max_pfn_mapped = init_memory_mapping(0, (end_pfn << PAGE_SHIFT));
if (efi_enabled)
efi_init();