Merge branch 'linus' into stackprotector
[sfrench/cifs-2.6.git] / init / main.c
index b44e4eb0f5e3d807044358db2ea4130ebeba724a..6aaff34a38c01e9df7f08b83807734214b96d6ef 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/initrd.h>
-#include <linux/hdreg.h>
 #include <linux/bootmem.h>
 #include <linux/tty.h>
 #include <linux/gfp.h>
@@ -32,6 +31,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/start_kernel.h>
 #include <linux/security.h>
+#include <linux/smp.h>
 #include <linux/workqueue.h>
 #include <linux/profile.h>
 #include <linux/rcupdate.h>
@@ -87,8 +87,6 @@ extern void init_IRQ(void);
 extern void fork_init(unsigned long);
 extern void mca_init(void);
 extern void sbus_init(void);
-extern void pidhash_init(void);
-extern void pidmap_init(void);
 extern void prio_tree_init(void);
 extern void radix_tree_init(void);
 extern void free_initmem(void);
@@ -415,6 +413,13 @@ static void __init smp_init(void)
 {
        unsigned int cpu;
 
+       /*
+        * Set up the current CPU as possible to migrate to.
+        * The other ones will be done by cpu_up/cpu_down()
+        */
+       cpu = smp_processor_id();
+       cpu_set(cpu, cpu_active_map);
+
        /* FIXME: This should be done in userspace --RR */
        for_each_present_cpu(cpu) {
                if (num_online_cpus() >= setup_max_cpus)
@@ -636,9 +641,11 @@ asmlinkage void __init start_kernel(void)
 
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start && !initrd_below_start_ok &&
-                       initrd_start < min_low_pfn << PAGE_SHIFT) {
+           page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
                printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
-                   "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT);
+                   "disabling it.\n",
+                   page_to_pfn(virt_to_page((void *)initrd_start)),
+                   min_low_pfn);
                initrd_start = 0;
        }
 #endif
@@ -691,7 +698,7 @@ asmlinkage void __init start_kernel(void)
        rest_init();
 }
 
-static int __initdata initcall_debug;
+static int initcall_debug;
 
 static int __init initcall_debug_setup(char *str)
 {
@@ -700,7 +707,7 @@ static int __init initcall_debug_setup(char *str)
 }
 __setup("initcall_debug", initcall_debug_setup);
 
-static void __init do_one_initcall(initcall_t fn)
+int do_one_initcall(initcall_t fn)
 {
        int count = preempt_count();
        ktime_t t0, t1, delta;
@@ -708,7 +715,7 @@ static void __init do_one_initcall(initcall_t fn)
        int result;
 
        if (initcall_debug) {
-               print_fn_descriptor_symbol("calling  %s\n", fn);
+               printk("calling  %pF @ %i\n", fn, task_pid_nr(current));
                t0 = ktime_get();
        }
 
@@ -718,8 +725,8 @@ static void __init do_one_initcall(initcall_t fn)
                t1 = ktime_get();
                delta = ktime_sub(t1, t0);
 
-               print_fn_descriptor_symbol("initcall %s", fn);
-               printk(" returned %d after %Ld msecs\n", result,
+               printk("initcall %pF returned %d after %Ld msecs\n",
+                       fn, result,
                        (unsigned long long) delta.tv64 >> 20);
        }
 
@@ -737,19 +744,20 @@ static void __init do_one_initcall(initcall_t fn)
                local_irq_enable();
        }
        if (msgbuf[0]) {
-               print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn);
-               printk(" returned with %s\n", msgbuf);
+               printk("initcall %pF returned with %s\n", fn, msgbuf);
        }
+
+       return result;
 }
 
 
-extern initcall_t __initcall_start[], __initcall_end[];
+extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
 
 static void __init do_initcalls(void)
 {
        initcall_t *call;
 
-       for (call = __initcall_start; call < __initcall_end; call++)
+       for (call = __early_initcall_end; call < __initcall_end; call++)
                do_one_initcall(*call);
 
        /* Make sure there is no pending stuff from the initcall sequence */
@@ -765,6 +773,7 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
+       rcu_init_sched(); /* needed by module_init stage. */
        /* drivers will send hotplug events */
        init_workqueues();
        usermodehelper_init();
@@ -773,23 +782,12 @@ static void __init do_basic_setup(void)
        do_initcalls();
 }
 
-static int __initdata nosoftlockup;
-
-static int __init nosoftlockup_setup(char *str)
-{
-       nosoftlockup = 1;
-       return 1;
-}
-__setup("nosoftlockup", nosoftlockup_setup);
-
 static void __init do_pre_smp_initcalls(void)
 {
-       extern int spawn_ksoftirqd(void);
+       initcall_t *call;
 
-       migration_init();
-       spawn_ksoftirqd();
-       if (!nosoftlockup)
-               spawn_softlockup_task();
+       for (call = __initcall_start; call < __early_initcall_end; call++)
+               do_one_initcall(*call);
 }
 
 static void run_init_process(char *init_filename)