diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-23 22:51:10 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:50:24 -0400 |
commit | 11cd0bc140b5d66566c9eb49c1058737888cd75c (patch) | |
tree | abbbeb1847a2fd6dc6998fefef656baf20efd089 /arch | |
parent | c09434571d4b1d8abf530ba4ce28cb868b45f2e5 (diff) |
x86: move some func calling from setup_arch to paging_init
those function depend on paging setup pgtable, so they could access
the ram in bootmem region but just get mapped.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 34 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c | 29 |
2 files changed, 31 insertions, 32 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 1e670372c191..220d92faf0a9 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -249,7 +249,7 @@ static void __init reserve_initrd(void) | |||
249 | 249 | ||
250 | #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) | 250 | #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT) |
251 | 251 | ||
252 | static void __init post_reserve_initrd(void) | 252 | void __init post_reserve_initrd(void) |
253 | { | 253 | { |
254 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; | 254 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; |
255 | u64 ramdisk_size = boot_params.hdr.ramdisk_size; | 255 | u64 ramdisk_size = boot_params.hdr.ramdisk_size; |
@@ -307,29 +307,11 @@ static void __init post_reserve_initrd(void) | |||
307 | void __init reserve_initrd(void) | 307 | void __init reserve_initrd(void) |
308 | { | 308 | { |
309 | } | 309 | } |
310 | static void __init post_reserve_initrd(void) | 310 | void __init post_reserve_initrd(void) |
311 | { | 311 | { |
312 | } | 312 | } |
313 | #endif /* CONFIG_BLK_DEV_INITRD */ | 313 | #endif /* CONFIG_BLK_DEV_INITRD */ |
314 | 314 | ||
315 | /* | ||
316 | * The node 0 pgdat is initialized before all of these because | ||
317 | * it's needed for bootmem. node>0 pgdats have their virtual | ||
318 | * space allocated before the pagetables are in place to access | ||
319 | * them, so they can't be cleared then. | ||
320 | * | ||
321 | * This should all compile down to nothing when NUMA is off. | ||
322 | */ | ||
323 | static void __init remapped_pgdat_init(void) | ||
324 | { | ||
325 | int nid; | ||
326 | |||
327 | for_each_online_node(nid) { | ||
328 | if (nid != 0) | ||
329 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | ||
330 | } | ||
331 | } | ||
332 | |||
333 | #ifdef CONFIG_MCA | 315 | #ifdef CONFIG_MCA |
334 | static void set_mca_bus(int x) | 316 | static void set_mca_bus(int x) |
335 | { | 317 | { |
@@ -524,18 +506,6 @@ void __init setup_arch(char **cmdline_p) | |||
524 | init_ohci1394_dma_on_all_controllers(); | 506 | init_ohci1394_dma_on_all_controllers(); |
525 | #endif | 507 | #endif |
526 | 508 | ||
527 | /* | ||
528 | * NOTE: at this point the bootmem allocator is fully available. | ||
529 | */ | ||
530 | |||
531 | post_reserve_initrd(); | ||
532 | |||
533 | remapped_pgdat_init(); | ||
534 | sparse_init(); | ||
535 | zone_sizes_init(); | ||
536 | |||
537 | paravirt_post_allocator_init(); | ||
538 | |||
539 | #ifdef CONFIG_X86_GENERICARCH | 509 | #ifdef CONFIG_X86_GENERICARCH |
540 | generic_apic_probe(); | 510 | generic_apic_probe(); |
541 | #endif | 511 | #endif |
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 9bb35cf8bc4c..20ca29591abe 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -705,6 +705,23 @@ void __init setup_bootmem_allocator(void) | |||
705 | 705 | ||
706 | } | 706 | } |
707 | 707 | ||
708 | /* | ||
709 | * The node 0 pgdat is initialized before all of these because | ||
710 | * it's needed for bootmem. node>0 pgdats have their virtual | ||
711 | * space allocated before the pagetables are in place to access | ||
712 | * them, so they can't be cleared then. | ||
713 | * | ||
714 | * This should all compile down to nothing when NUMA is off. | ||
715 | */ | ||
716 | static void __init remapped_pgdat_init(void) | ||
717 | { | ||
718 | int nid; | ||
719 | |||
720 | for_each_online_node(nid) { | ||
721 | if (nid != 0) | ||
722 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | ||
723 | } | ||
724 | } | ||
708 | 725 | ||
709 | /* | 726 | /* |
710 | * paging_init() sets up the page tables - note that the first 8MB are | 727 | * paging_init() sets up the page tables - note that the first 8MB are |
@@ -727,6 +744,18 @@ void __init paging_init(void) | |||
727 | __flush_tlb_all(); | 744 | __flush_tlb_all(); |
728 | 745 | ||
729 | kmap_init(); | 746 | kmap_init(); |
747 | |||
748 | /* | ||
749 | * NOTE: at this point the bootmem allocator is fully available. | ||
750 | */ | ||
751 | |||
752 | post_reserve_initrd(); | ||
753 | |||
754 | remapped_pgdat_init(); | ||
755 | sparse_init(); | ||
756 | zone_sizes_init(); | ||
757 | |||
758 | paravirt_post_allocator_init(); | ||
730 | } | 759 | } |
731 | 760 | ||
732 | /* | 761 | /* |