diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-12 09:16:03 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-12 09:21:17 -0500 |
commit | d88316c243e5458a1888edbe0353c4dec6e61c73 (patch) | |
tree | 6c4c87c1c415ac6b8684c15d779580f721529da4 /arch/x86 | |
parent | 4769843bc265a9c24584b98709cf39e1df5c1404 (diff) |
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/mm/init_32.c | 15 |
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); | |||
687 | */ | 687 | */ |
688 | void __init lowmem_pfn_init(void) | 688 | void __init lowmem_pfn_init(void) |
689 | { | 689 | { |
690 | /* max_low_pfn is 0, we already have early_res support */ | ||
691 | max_low_pfn = max_pfn; | ||
692 | |||
690 | if (highmem_pages == -1) | 693 | if (highmem_pages == -1) |
691 | highmem_pages = 0; | 694 | highmem_pages = 0; |
692 | #ifdef CONFIG_HIGHMEM | 695 | #ifdef CONFIG_HIGHMEM |
@@ -720,6 +723,8 @@ void __init lowmem_pfn_init(void) | |||
720 | */ | 723 | */ |
721 | void __init highmem_pfn_init(void) | 724 | void __init highmem_pfn_init(void) |
722 | { | 725 | { |
726 | max_low_pfn = MAXMEM_PFN; | ||
727 | |||
723 | if (highmem_pages == -1) | 728 | if (highmem_pages == -1) |
724 | highmem_pages = max_pfn - MAXMEM_PFN; | 729 | highmem_pages = max_pfn - MAXMEM_PFN; |
725 | 730 | ||
@@ -732,7 +737,6 @@ void __init highmem_pfn_init(void) | |||
732 | pages_to_mb(highmem_pages)); | 737 | pages_to_mb(highmem_pages)); |
733 | highmem_pages = 0; | 738 | highmem_pages = 0; |
734 | } | 739 | } |
735 | max_low_pfn = MAXMEM_PFN; | ||
736 | #ifndef CONFIG_HIGHMEM | 740 | #ifndef CONFIG_HIGHMEM |
737 | /* Maximum memory usable is what is directly addressable */ | 741 | /* Maximum memory usable is what is directly addressable */ |
738 | printk(KERN_WARNING "Warning only %ldMB will be used.\n", MAXMEM>>20); | 742 | printk(KERN_WARNING "Warning only %ldMB will be used.\n", MAXMEM>>20); |
@@ -758,13 +762,10 @@ void __init find_low_pfn_range(void) | |||
758 | { | 762 | { |
759 | /* it could update max_pfn */ | 763 | /* it could update max_pfn */ |
760 | 764 | ||
761 | /* max_low_pfn is 0, we already have early_res support */ | 765 | if (max_pfn <= MAXMEM_PFN) |
762 | max_low_pfn = max_pfn; | ||
763 | |||
764 | if (max_low_pfn > MAXMEM_PFN) | ||
765 | highmem_pfn_init(); | ||
766 | else | ||
767 | lowmem_pfn_init(); | 766 | lowmem_pfn_init(); |
767 | else | ||
768 | highmem_pfn_init(); | ||
768 | } | 769 | } |
769 | 770 | ||
770 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 771 | #ifndef CONFIG_NEED_MULTIPLE_NODES |