x86: introduce initmem_init for 64 bit
authorYinghai Lu <yhlu.kernel@gmail.com>
Sun, 22 Jun 2008 09:44:49 +0000 (02:44 -0700)
committerIngo Molnar <mingo@elte.hu>
Tue, 8 Jul 2008 10:50:14 +0000 (12:50 +0200)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/init_64.c
arch/x86/mm/numa_64.c
include/asm-x86/numa_64.h
include/asm-x86/page_64.h

index 97c2bc741e94fc511a6021e19c4e7acef264ed7a..99a091ee5a6a26f101538c83585feb9da3c92c69 100644 (file)
@@ -611,6 +611,22 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
 }
 
 #ifndef CONFIG_NUMA
+void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn)
+{
+       unsigned long bootmap_size, bootmap;
+
+       bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT;
+       bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size,
+                                PAGE_SIZE);
+       if (bootmap == -1L)
+               panic("Cannot find bootmem map of size %ld\n", bootmap_size);
+       bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, end_pfn);
+       e820_register_active_regions(0, start_pfn, end_pfn);
+       free_bootmem_with_active_regions(0, end_pfn);
+       early_res_to_bootmem(0, end_pfn<<PAGE_SHIFT);
+       reserve_bootmem(bootmap, bootmap_size, BOOTMEM_DEFAULT);
+}
+
 void __init paging_init(void)
 {
        unsigned long max_zone_pfns[MAX_NR_ZONES];
index c4557e25f60c8714a7487315f591d529811406e4..316e5f961ef0ead2e133a64de8ed33ff5d663ed3 100644 (file)
@@ -514,7 +514,7 @@ out:
 }
 #endif /* CONFIG_NUMA_EMU */
 
-void __init numa_initmem_init(unsigned long start_pfn, unsigned long last_pfn)
+void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn)
 {
        int i;
 
index b510daf4f4d86c9bede1ffb265e5a8dda5e11c83..3830094434a9ef75eb686bb2a84ef5c10daaaef7 100644 (file)
@@ -22,7 +22,6 @@ extern int hotadd_percent;
 
 extern s16 apicid_to_node[MAX_LOCAL_APIC];
 
-extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn);
 extern unsigned long numa_free_all_bootmem(void);
 extern void setup_node_bootmem(int nodeid, unsigned long start,
                               unsigned long end);
index 6ea72859c491abaeec409afcdeb548e1c464192e..ac37643078e7d3a5b033a77334b66d46c3ac31a5 100644 (file)
@@ -83,6 +83,7 @@ typedef struct { pteval_t pte; } pte_t;
 extern unsigned long init_memory_mapping(unsigned long start,
                                         unsigned long end);
 
+extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn);
 #endif /* !__ASSEMBLY__ */
 
 #ifdef CONFIG_FLATMEM