+ cpu_data_t *cdp = cpu_datap(cpu);
+
+ /*
+ * Wait until the CPU indicates that it has stopped.
+ */
+ simple_lock(&x86_topo_lock);
+ while ((cdp->lcpu.state != LCPU_HALT)
+ && (cdp->lcpu.state != LCPU_OFF)
+ && !cdp->lcpu.stopped) {
+ simple_unlock(&x86_topo_lock);
+ cpu_pause();
+ simple_lock(&x86_topo_lock);
+ }
+ simple_unlock(&x86_topo_lock);