]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - init/main.c
[MIPS] Alchemy: Console output fixup
[linux-2.6-omap-h63xx.git] / init / main.c
index 4075d97e94b184c4d8b95a1e95057e249cf45f21..27f97f9b46362c4fa316619fdcc8e0d29751bbd3 100644 (file)
 #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.
@@ -310,7 +314,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 +394,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();
 }