aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-13 05:00:56 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 04:36:17 -0400
commitd2dbf343329dc777d77488743465f7be4245971d (patch)
tree6c52b30af5ed0d22edcd6f7c514ee922dc30ff84 /arch/x86
parentb1f006b65c12b85df81f12c1073ad18fd26f4a16 (diff)
x86: clean up reserve_bootmem_generic() and port it to 32-bit
1. add reserve_bootmem_generic for 32bit 2. change len to unsigned long 3. make early_res_to_bootmem to use it Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/e820.c2
-rw-r--r--arch/x86/kernel/mpparse.c18
-rw-r--r--arch/x86/mm/init_32.c6
-rw-r--r--arch/x86/mm/init_64.c3
4 files changed, 15 insertions, 14 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 4f2cd5d179e2..774063f11be0 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -635,7 +635,7 @@ void __init early_res_to_bootmem(u64 start, u64 end)
635 continue; 635 continue;
636 printk(KERN_INFO " early res: %d [%llx-%llx] %s\n", i, 636 printk(KERN_INFO " early res: %d [%llx-%llx] %s\n", i,
637 final_start, final_end - 1, r->name); 637 final_start, final_end - 1, r->name);
638 reserve_bootmem(final_start, final_end - final_start, 638 reserve_bootmem_generic(final_start, final_end - final_start,
639 BOOTMEM_DEFAULT); 639 BOOTMEM_DEFAULT);
640 } 640 }
641} 641}
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 7ac1b689b70a..b62ac6ba1410 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -859,10 +859,11 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
859 859
860 if (!reserve) 860 if (!reserve)
861 return 1; 861 return 1;
862#ifdef CONFIG_X86_32 862 reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
863 reserve_bootmem(virt_to_phys(mpf), PAGE_SIZE,
864 BOOTMEM_DEFAULT); 863 BOOTMEM_DEFAULT);
865 if (mpf->mpf_physptr) { 864 if (mpf->mpf_physptr) {
865 unsigned long size = PAGE_SIZE;
866#ifdef CONFIG_X86_32
866 /* 867 /*
867 * We cannot access to MPC table to compute 868 * We cannot access to MPC table to compute
868 * table size yet, as only few megabytes from 869 * table size yet, as only few megabytes from
@@ -872,22 +873,15 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
872 * PAGE_SIZE from mpg->mpf_physptr yields BUG() 873 * PAGE_SIZE from mpg->mpf_physptr yields BUG()
873 * in reserve_bootmem. 874 * in reserve_bootmem.
874 */ 875 */
875 unsigned long size = PAGE_SIZE;
876 unsigned long end = max_low_pfn * PAGE_SIZE; 876 unsigned long end = max_low_pfn * PAGE_SIZE;
877 if (mpf->mpf_physptr + size > end) 877 if (mpf->mpf_physptr + size > end)
878 size = end - mpf->mpf_physptr; 878 size = end - mpf->mpf_physptr;
879 reserve_bootmem(mpf->mpf_physptr, size, 879#endif
880 reserve_bootmem_generic(mpf->mpf_physptr, size,
880 BOOTMEM_DEFAULT); 881 BOOTMEM_DEFAULT);
881 } 882 }
882 883
883#else 884 return 1;
884 reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
885 BOOTMEM_DEFAULT);
886 if (mpf->mpf_physptr)
887 reserve_bootmem_generic(mpf->mpf_physptr,
888 PAGE_SIZE, BOOTMEM_DEFAULT);
889#endif
890 return 1;
891 } 885 }
892 bp += 4; 886 bp += 4;
893 length -= 16; 887 length -= 16;
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 0e7bb5e81670..abadb1da70df 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -785,3 +785,9 @@ void free_initrd_mem(unsigned long start, unsigned long end)
785 free_init_pages("initrd memory", start, end); 785 free_init_pages("initrd memory", start, end);
786} 786}
787#endif 787#endif
788
789int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
790 int flags)
791{
792 return reserve_bootmem(phys, len, flags);
793}
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index bf7bf1de6c25..b8c2c1ef7ad5 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -799,7 +799,8 @@ void free_initrd_mem(unsigned long start, unsigned long end)
799} 799}
800#endif 800#endif
801 801
802int __init reserve_bootmem_generic(unsigned long phys, unsigned len, int flags) 802int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
803 int flags)
803{ 804{
804#ifdef CONFIG_NUMA 805#ifdef CONFIG_NUMA
805 int nid, next_nid; 806 int nid, next_nid;