]> Pileus Git - ~andy/linux/blobdiff - init/main.c
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
[~andy/linux] / init / main.c
index 4075d97e94b184c4d8b95a1e95057e249cf45f21..2ed3638deec7c996a5807c1ff18494ab5b576850 100644 (file)
 #include <linux/rmap.h>
 #include <linux/mempolicy.h>
 #include <linux/key.h>
-#include <net/sock.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
 #include <asm/setup.h>
 #include <asm/sections.h>
+#include <asm/cacheflush.h>
 
 /*
  * This is one of the first .c files built. Error out early
 #endif
 #endif
 
+#ifdef CONFIG_X86_LOCAL_APIC
+#include <asm/smp.h>
+#endif
+
 /*
  * Versions of gcc older than that listed below may actually compile
  * and link okay, but the end product can have subtle run time bugs.
@@ -96,6 +100,9 @@ extern void acpi_early_init(void);
 #else
 static inline void acpi_early_init(void) { }
 #endif
+#ifndef CONFIG_DEBUG_RODATA
+static inline void mark_rodata_ro(void) { }
+#endif
 
 #ifdef CONFIG_TC
 extern void tc_init(void);
@@ -310,7 +317,14 @@ extern void setup_arch(char **);
 
 #ifndef CONFIG_SMP
 
+#ifdef CONFIG_X86_LOCAL_APIC
+static void __init smp_init(void)
+{
+       APIC_init_uniprocessor();
+}
+#else
 #define smp_init()     do { } while (0)
+#endif
 
 static inline void setup_per_cpu_areas(void) { }
 static inline void smp_prepare_cpus(unsigned int maxcpus) { }
@@ -383,14 +397,16 @@ static void noinline rest_init(void)
        kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
        numa_default_policy();
        unlock_kernel();
-       preempt_enable_no_resched();
 
        /*
         * The boot idle thread must execute schedule()
         * at least one to get things moving:
         */
+       preempt_enable_no_resched();
        schedule();
+       preempt_disable();
 
+       /* Call into cpu_idle with preempt disabled */
        cpu_idle();
 } 
 
@@ -601,9 +617,6 @@ static void __init do_basic_setup(void)
        sysctl_init();
 #endif
 
-       /* Networking initialization needs a process context */ 
-       sock_init();
-
        do_initcalls();
 }
 
@@ -699,6 +712,7 @@ static int init(void * unused)
         */
        free_initmem();
        unlock_kernel();
+       mark_rodata_ro();
        system_state = SYSTEM_RUNNING;
        numa_default_policy();