]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOCPU.cpp
xnu-1504.15.3.tar.gz
[apple/xnu.git] / iokit / Kernel / IOCPU.cpp
index 9ce7974ed0565801d2cf68d853031d2244c431c7..7646d2a97669f58d6618fe02b15cfb4f0d1729bb 100644 (file)
@@ -125,6 +125,12 @@ queue_head_t * iocpu_get_platform_quiesce_queue(void)
 
 queue_head_t * iocpu_get_platform_active_queue(void)
 {
+    if (!iocpu_active_queue.next)
+    {
+       queue_init(&iocpu_quiesce_queue);
+       queue_init(&iocpu_active_queue);
+       iocpu_platform_cpu_action_init(&iocpu_quiesce_queue, &iocpu_active_queue);
+    }
     return (&iocpu_active_queue);
 }
 
@@ -175,14 +181,14 @@ iocpu_run_platform_actions(queue_head_t * queue, uint32_t first_priority, uint32
 extern "C" kern_return_t 
 IOCPURunPlatformQuiesceActions(void)
 {
-    return (iocpu_run_platform_actions(iocpu_get_platform_quiesce_queue(), 0, 0UL-1,
+    return (iocpu_run_platform_actions(iocpu_get_platform_quiesce_queue(), 0, 0U-1,
                                    NULL, NULL, NULL));
 }
 
 extern "C" kern_return_t 
 IOCPURunPlatformActiveActions(void)
 {
-    return (iocpu_run_platform_actions(iocpu_get_platform_active_queue(), 0, 0UL-1,
+    return (iocpu_run_platform_actions(iocpu_get_platform_active_queue(), 0, 0U-1,
                                    NULL, NULL, NULL));
 }
 
@@ -324,7 +330,7 @@ void IOCPUSleepKernel(void)
        iter->release();
     }
 
-    iocpu_run_platform_actions(&gIOSleepActionQueue, 0, 0UL-1,
+    iocpu_run_platform_actions(&gIOSleepActionQueue, 0, 0U-1,
                                NULL, NULL, NULL);
 
     numCPUs = gIOCPUs->getCount();
@@ -350,7 +356,7 @@ void IOCPUSleepKernel(void)
     if (bootCPU)
         bootCPU->haltCPU();
 
-    iocpu_run_platform_actions(&gIOWakeActionQueue, 0, 0UL-1,
+    iocpu_run_platform_actions(&gIOWakeActionQueue, 0, 0U-1,
                                    NULL, NULL, NULL);
 
     iocpu_platform_action_entry_t * entry;
@@ -362,9 +368,9 @@ void IOCPUSleepKernel(void)
     }
 
     if (!queue_empty(&gIOSleepActionQueue))
-       IOPanic("gIOSleepActionQueue");
+       panic("gIOSleepActionQueue");
     if (!queue_empty(&gIOWakeActionQueue))
-       IOPanic("gIOWakeActionQueue");
+       panic("gIOWakeActionQueue");
   
     // Wake the other CPUs.
     for (cnt = 0; cnt < numCPUs; cnt++) 
@@ -432,7 +438,7 @@ bool IOCPU::start(IOService *provider)
   provider->setProperty("timebase-frequency", timebaseFrequency);
   timebaseFrequency->release();
   
-  super::setProperty("IOCPUID", (UInt32)this, 32);
+  super::setProperty("IOCPUID", (uintptr_t)this, sizeof(uintptr_t)*8);
   
   setCPUNumber(0);
   setCPUState(kIOCPUStateUnregistered);