summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-12 17:16:03 +0300
committerIngo Molnar <mingo@elte.hu>2009-02-12 17:21:17 +0300
commitd88316c243e5458a1888edbe0353c4dec6e61c73 (patch)
tree6c4c87c1c415ac6b8684c15d779580f721529da4
parent4769843bc265a9c24584b98709cf39e1df5c1404 (diff)
downloadlinux-d88316c243e5458a1888edbe0353c4dec6e61c73.tar.xz
x86, 32-bit: refactor find_low_pfn_range()
Impact: cleanup Make the max_low_pfn logic a bit more standard between lowmem_pfn_init() and highmem_pfn_init(). Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/mm/init_32.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 9d36eb9ebd53..1a9612499a34 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -687,6 +687,9 @@ early_param("highmem", parse_highmem);
*/
void __init lowmem_pfn_init(void)
{
+ /* max_low_pfn is 0, we already have early_res support */
+ max_low_pfn = max_pfn;
+
if (highmem_pages == -1)
highmem_pages = 0;
#ifdef CONFIG_HIGHMEM
@@ -720,6 +723,8 @@ void __init lowmem_pfn_init(void)
*/
void __init highmem_pfn_init(void)
{
+ max_low_pfn = MAXMEM_PFN;
+
if (highmem_pages == -1)
highmem_pages = max_pfn - MAXMEM_PFN;
@@ -732,7 +737,6 @@ void __init highmem_pfn_init(void)
pages_to_mb(highmem_pages));
highmem_pages = 0;
}
- max_low_pfn = MAXMEM_PFN;
#ifndef CONFIG_HIGHMEM
/* Maximum memory usable is what is directly addressable */
printk(KERN_WARNING "Warning only %ldMB will be used.\n", MAXMEM>>20);
@@ -758,13 +762,10 @@ void __init find_low_pfn_range(void)
{
/* it could update max_pfn */
- /* max_low_pfn is 0, we already have early_res support */
- max_low_pfn = max_pfn;
-
- if (max_low_pfn > MAXMEM_PFN)
- highmem_pfn_init();
- else
+ if (max_pfn <= MAXMEM_PFN)
lowmem_pfn_init();
+ else
+ highmem_pfn_init();
}
#ifndef CONFIG_NEED_MULTIPLE_NODES