]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/cpu.c
xnu-1228.15.4.tar.gz
[apple/xnu.git] / osfmk / i386 / cpu.c
index 1760eabf5962ea3d1787c7485d12491b50662a56..194a6576bc3a0589e5818285b85f6dd575910977 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -141,9 +141,13 @@ cpu_exit_wait(
 {
        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.state != LCPU_OFF)
+              && !cdp->lcpu.stopped) {
            simple_unlock(&x86_topo_lock);
            cpu_pause();
            simple_lock(&x86_topo_lock);