diff options
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index e07d4019e266..2e08619a9c5c 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1056,12 +1056,20 @@ unsigned long __initdata end_user_pfn = MAX_ARCH_PFN; | |||
1056 | /* | 1056 | /* |
1057 | * Find the highest page frame number we have available | 1057 | * Find the highest page frame number we have available |
1058 | */ | 1058 | */ |
1059 | unsigned long __init e820_end_of_ram(void) | 1059 | unsigned long __init e820_end(void) |
1060 | { | 1060 | { |
1061 | unsigned long last_pfn; | 1061 | int i; |
1062 | unsigned long last_pfn = 0; | ||
1062 | unsigned long max_arch_pfn = MAX_ARCH_PFN; | 1063 | unsigned long max_arch_pfn = MAX_ARCH_PFN; |
1063 | 1064 | ||
1064 | last_pfn = find_max_pfn_with_active_regions(); | 1065 | for (i = 0; i < e820.nr_map; i++) { |
1066 | struct e820entry *ei = &e820.map[i]; | ||
1067 | unsigned long end_pfn; | ||
1068 | |||
1069 | end_pfn = (ei->addr + ei->size) >> PAGE_SHIFT; | ||
1070 | if (end_pfn > last_pfn) | ||
1071 | last_pfn = end_pfn; | ||
1072 | } | ||
1065 | 1073 | ||
1066 | if (last_pfn > max_arch_pfn) | 1074 | if (last_pfn > max_arch_pfn) |
1067 | last_pfn = max_arch_pfn; | 1075 | last_pfn = max_arch_pfn; |
@@ -1192,9 +1200,7 @@ static int __init parse_memmap_opt(char *p) | |||
1192 | * the real mem size before original memory map is | 1200 | * the real mem size before original memory map is |
1193 | * reset. | 1201 | * reset. |
1194 | */ | 1202 | */ |
1195 | e820_register_active_regions(0, 0, -1UL); | 1203 | saved_max_pfn = e820_end(); |
1196 | saved_max_pfn = e820_end_of_ram(); | ||
1197 | remove_all_active_ranges(); | ||
1198 | #endif | 1204 | #endif |
1199 | e820.nr_map = 0; | 1205 | e820.nr_map = 0; |
1200 | userdef = 1; | 1206 | userdef = 1; |