aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-03 13:28:46 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-03 13:28:46 -0400
commitf68ec0c24755e5cdb779be6240925f2175311d84 (patch)
treea7b7128e61a8456385d82bd1c7ca5f14eecbf2ca /init/main.c
parent98920dc3d1113b883cbc73e3293446d3525c6042 (diff)
parent94aca1dac6f6d21f4b07e4864baf7768cabcc6e7 (diff)
Merge commit 'v2.6.27-rc8' into x86/setup
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/init/main.c b/init/main.c
index edeace036fd9..f6f7042331dc 100644
--- a/init/main.c
+++ b/init/main.c
@@ -22,7 +22,6 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
24#include <linux/initrd.h> 24#include <linux/initrd.h>
25#include <linux/hdreg.h>
26#include <linux/bootmem.h> 25#include <linux/bootmem.h>
27#include <linux/tty.h> 26#include <linux/tty.h>
28#include <linux/gfp.h> 27#include <linux/gfp.h>
@@ -87,8 +86,6 @@ extern void init_IRQ(void);
87extern void fork_init(unsigned long); 86extern void fork_init(unsigned long);
88extern void mca_init(void); 87extern void mca_init(void);
89extern void sbus_init(void); 88extern void sbus_init(void);
90extern void pidhash_init(void);
91extern void pidmap_init(void);
92extern void prio_tree_init(void); 89extern void prio_tree_init(void);
93extern void radix_tree_init(void); 90extern void radix_tree_init(void);
94extern void free_initmem(void); 91extern void free_initmem(void);
@@ -415,6 +412,13 @@ static void __init smp_init(void)
415{ 412{
416 unsigned int cpu; 413 unsigned int cpu;
417 414
415 /*
416 * Set up the current CPU as possible to migrate to.
417 * The other ones will be done by cpu_up/cpu_down()
418 */
419 cpu = smp_processor_id();
420 cpu_set(cpu, cpu_active_map);
421
418 /* FIXME: This should be done in userspace --RR */ 422 /* FIXME: This should be done in userspace --RR */
419 for_each_present_cpu(cpu) { 423 for_each_present_cpu(cpu) {
420 if (num_online_cpus() >= setup_max_cpus) 424 if (num_online_cpus() >= setup_max_cpus)
@@ -630,9 +634,11 @@ asmlinkage void __init start_kernel(void)
630 634
631#ifdef CONFIG_BLK_DEV_INITRD 635#ifdef CONFIG_BLK_DEV_INITRD
632 if (initrd_start && !initrd_below_start_ok && 636 if (initrd_start && !initrd_below_start_ok &&
633 initrd_start < min_low_pfn << PAGE_SHIFT) { 637 page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
634 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " 638 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
635 "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT); 639 "disabling it.\n",
640 page_to_pfn(virt_to_page((void *)initrd_start)),
641 min_low_pfn);
636 initrd_start = 0; 642 initrd_start = 0;
637 } 643 }
638#endif 644#endif
@@ -685,7 +691,7 @@ asmlinkage void __init start_kernel(void)
685 rest_init(); 691 rest_init();
686} 692}
687 693
688static int __initdata initcall_debug; 694static int initcall_debug;
689 695
690static int __init initcall_debug_setup(char *str) 696static int __init initcall_debug_setup(char *str)
691{ 697{
@@ -694,7 +700,7 @@ static int __init initcall_debug_setup(char *str)
694} 700}
695__setup("initcall_debug", initcall_debug_setup); 701__setup("initcall_debug", initcall_debug_setup);
696 702
697static void __init do_one_initcall(initcall_t fn) 703int do_one_initcall(initcall_t fn)
698{ 704{
699 int count = preempt_count(); 705 int count = preempt_count();
700 ktime_t t0, t1, delta; 706 ktime_t t0, t1, delta;
@@ -734,16 +740,18 @@ static void __init do_one_initcall(initcall_t fn)
734 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn); 740 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn);
735 printk(" returned with %s\n", msgbuf); 741 printk(" returned with %s\n", msgbuf);
736 } 742 }
743
744 return result;
737} 745}
738 746
739 747
740extern initcall_t __initcall_start[], __initcall_end[]; 748extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
741 749
742static void __init do_initcalls(void) 750static void __init do_initcalls(void)
743{ 751{
744 initcall_t *call; 752 initcall_t *call;
745 753
746 for (call = __initcall_start; call < __initcall_end; call++) 754 for (call = __early_initcall_end; call < __initcall_end; call++)
747 do_one_initcall(*call); 755 do_one_initcall(*call);
748 756
749 /* Make sure there is no pending stuff from the initcall sequence */ 757 /* Make sure there is no pending stuff from the initcall sequence */
@@ -768,24 +776,12 @@ static void __init do_basic_setup(void)
768 do_initcalls(); 776 do_initcalls();
769} 777}
770 778
771static int __initdata nosoftlockup;
772
773static int __init nosoftlockup_setup(char *str)
774{
775 nosoftlockup = 1;
776 return 1;
777}
778__setup("nosoftlockup", nosoftlockup_setup);
779
780static void __init do_pre_smp_initcalls(void) 779static void __init do_pre_smp_initcalls(void)
781{ 780{
782 extern int spawn_ksoftirqd(void); 781 initcall_t *call;
783 782
784 init_call_single_data(); 783 for (call = __initcall_start; call < __early_initcall_end; call++)
785 migration_init(); 784 do_one_initcall(*call);
786 spawn_ksoftirqd();
787 if (!nosoftlockup)
788 spawn_softlockup_task();
789} 785}
790 786
791static void run_init_process(char *init_filename) 787static void run_init_process(char *init_filename)