diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-23 06:05:30 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:50:20 -0400 |
commit | 2ec65f8b89ea003c27ff7723525a2ee335a2b393 (patch) | |
tree | 9b8718be2017f619b2a0185492315b85ea1731fa /arch/x86/mm/init_32.c | |
parent | bef1568d9714f1162086c32583ba7984a7ca8e3e (diff) |
x86: clean up using max_low_pfn on 32-bit
so that max_low_pfn is not changed after it is set.
so we can move that early and out of initmem_init.
could call find_low_pfn_range just after max_pfn is set.
also could move reserve_initrd out of setup_bootmem_allocator
so 32bit is more like 64bit.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index d1017336f1b5..27b829312944 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -561,9 +561,15 @@ early_param("highmem", parse_highmem); | |||
561 | /* | 561 | /* |
562 | * Determine low and high memory ranges: | 562 | * Determine low and high memory ranges: |
563 | */ | 563 | */ |
564 | unsigned long __init find_max_low_pfn(void) | 564 | void __init find_low_pfn_range(void) |
565 | { | 565 | { |
566 | unsigned long max_low_pfn; | 566 | /* it could update max_pfn */ |
567 | |||
568 | /* | ||
569 | * partially used pages are not usable - thus | ||
570 | * we are rounding upwards: | ||
571 | */ | ||
572 | min_low_pfn = PFN_UP(init_pg_tables_end); | ||
567 | 573 | ||
568 | max_low_pfn = max_pfn; | 574 | max_low_pfn = max_pfn; |
569 | if (max_low_pfn > MAXMEM_PFN) { | 575 | if (max_low_pfn > MAXMEM_PFN) { |
@@ -625,21 +631,12 @@ unsigned long __init find_max_low_pfn(void) | |||
625 | " kernel!\n"); | 631 | " kernel!\n"); |
626 | #endif | 632 | #endif |
627 | } | 633 | } |
628 | return max_low_pfn; | ||
629 | } | 634 | } |
630 | 635 | ||
631 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 636 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
632 | unsigned long __init initmem_init(unsigned long start_pfn, | 637 | void __init initmem_init(unsigned long start_pfn, |
633 | unsigned long end_pfn) | 638 | unsigned long end_pfn) |
634 | { | 639 | { |
635 | /* | ||
636 | * partially used pages are not usable - thus | ||
637 | * we are rounding upwards: | ||
638 | */ | ||
639 | min_low_pfn = PFN_UP(init_pg_tables_end); | ||
640 | |||
641 | max_low_pfn = find_max_low_pfn(); | ||
642 | |||
643 | #ifdef CONFIG_HIGHMEM | 640 | #ifdef CONFIG_HIGHMEM |
644 | highstart_pfn = highend_pfn = max_pfn; | 641 | highstart_pfn = highend_pfn = max_pfn; |
645 | if (max_pfn > max_low_pfn) | 642 | if (max_pfn > max_low_pfn) |
@@ -661,8 +658,6 @@ unsigned long __init initmem_init(unsigned long start_pfn, | |||
661 | pages_to_mb(max_low_pfn)); | 658 | pages_to_mb(max_low_pfn)); |
662 | 659 | ||
663 | setup_bootmem_allocator(); | 660 | setup_bootmem_allocator(); |
664 | |||
665 | return max_low_pfn; | ||
666 | } | 661 | } |
667 | 662 | ||
668 | void __init zone_sizes_init(void) | 663 | void __init zone_sizes_init(void) |
@@ -699,8 +694,6 @@ void __init setup_bootmem_allocator(void) | |||
699 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); | 694 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); |
700 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); | 695 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); |
701 | 696 | ||
702 | reserve_initrd(); | ||
703 | |||
704 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); | 697 | bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, max_low_pfn); |
705 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", | 698 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", |
706 | max_pfn_mapped<<PAGE_SHIFT); | 699 | max_pfn_mapped<<PAGE_SHIFT); |