x86: include smpboot_hooks.h in smpboot_64.c
[sfrench/cifs-2.6.git] / arch / x86 / kernel / smpboot_64.c
index d7b59d6c6963275baaefe65b59a0f9f5006d7b8f..b9384b3af017003035155772d493c4b525701bc4 100644 (file)
@@ -60,6 +60,9 @@
 #include <asm/hw_irq.h>
 #include <asm/numa.h>
 
+#include <mach_wakecpu.h>
+#include <smpboot_hooks.h>
+
 /* Set when the idlers are all forked */
 int smp_threads_ready;
 
@@ -85,13 +88,6 @@ struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ;
 #define set_idle_for_cpu(x,p)   (idle_thread_array[(x)] = (p))
 #endif
 
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-       while (!atomic_read(deassert))
-               cpu_relax();
-       return;
-}
-
 static atomic_t init_deasserted __cpuinitdata;
 
 /*
@@ -239,6 +235,7 @@ void __cpuinit start_secondary(void)
 
        setup_secondary_clock();
 
+       wmb();
        cpu_idle();
 }
 
@@ -246,7 +243,7 @@ extern volatile unsigned long init_rsp;
 extern void (*initial_code)(void);
 
 #ifdef APIC_DEBUG
-static void inquire_remote_apic(int apicid)
+static void __inquire_remote_apic(int apicid)
 {
        unsigned i, regs[] = { APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4 };
        char *names[] = { "ID", "VERSION", "SPIV" };
@@ -521,14 +518,7 @@ do_rest:
 
        Dprintk("Setting warm reset code and vector.\n");
 
-       CMOS_WRITE(0xa, 0xf);
-       local_flush_tlb();
-       Dprintk("1.\n");
-       *((volatile unsigned short *) phys_to_virt(0x469)) = start_rip >> 4;
-       Dprintk("2.\n");
-       *((volatile unsigned short *) phys_to_virt(0x467)) = start_rip & 0xf;
-       Dprintk("3.\n");
-
+       smpboot_setup_warm_reset_vector(start_rip);
        /*
         * Be paranoid about clearing APIC errors.
         */
@@ -597,23 +587,6 @@ do_rest:
 cycles_t cacheflush_time;
 unsigned long cache_decay_ticks;
 
-/*
- * Cleanup possible dangling ends...
- */
-static __cpuinit void smp_cleanup_boot(void)
-{
-       /*
-        * Paranoid:  Set warm reset code and vector here back
-        * to default values.
-        */
-       CMOS_WRITE(0, 0xf);
-
-       /*
-        * Reset trampoline flag
-        */
-       *((volatile int *) phys_to_virt(0x467)) = 0;
-}
-
 /*
  * Fall back to non SMP mode after errors.
  *
@@ -823,12 +796,20 @@ int __cpuinit native_cpu_up(unsigned int cpu)
        return err;
 }
 
+extern void impress_friends(void);
+extern void smp_checks(void);
+
 /*
  * Finish the SMP boot.
  */
 void __init native_smp_cpus_done(unsigned int max_cpus)
 {
-       smp_cleanup_boot();
+       smpboot_restore_warm_reset_vector();
+
+       Dprintk("Boot done.\n");
+
+       impress_friends();
+       smp_checks();
        setup_ioapic_dest();
        check_nmi_watchdog();
 }