]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOCommandGate.cpp
xnu-1456.1.26.tar.gz
[apple/xnu.git] / iokit / Kernel / IOCommandGate.cpp
index f276ebc220ed5e7b94e02d278578ed743f31f8e4..55d6eee7fe4683dc4563ab9b169f9b5c728d01f5 100644 (file)
 #define super IOEventSource
 
 OSDefineMetaClassAndStructors(IOCommandGate, IOEventSource)
+#if __LP64__
 OSMetaClassDefineReservedUnused(IOCommandGate, 0);
+#else
+OSMetaClassDefineReservedUsed(IOCommandGate, 0);
+#endif
 OSMetaClassDefineReservedUnused(IOCommandGate, 1);
 OSMetaClassDefineReservedUnused(IOCommandGate, 2);
 OSMetaClassDefineReservedUnused(IOCommandGate, 3);
@@ -126,7 +130,7 @@ IOReturn IOCommandGate::runAction(Action inAction,
         return kIOReturnBadArgument;
 
     IOTimeStampConstant(IODBG_CMDQ(IOCMDQ_ACTION),
-                       (unsigned int) inAction, (unsigned int) owner);
+                       (uintptr_t) inAction, (uintptr_t) owner);
 
     // closeGate is recursive needn't worry if we already hold the lock.
     closeGate();
@@ -179,7 +183,7 @@ IOReturn IOCommandGate::attemptAction(Action inAction,
         res = kIOReturnNotPermitted;
     else {
        IOTimeStampConstant(IODBG_CMDQ(IOCMDQ_ACTION),
-                           (unsigned int) inAction, (unsigned int) owner);
+                           (uintptr_t) inAction, (uintptr_t) owner);
 
        res = (*inAction)(owner, arg0, arg1, arg2, arg3);
     }
@@ -197,6 +201,14 @@ IOReturn IOCommandGate::commandSleep(void *event, UInt32 interruptible)
     return sleepGate(event, interruptible);
 }
 
+IOReturn IOCommandGate::commandSleep(void *event, AbsoluteTime deadline, UInt32 interruptible)
+{
+    if (!workLoop->inGate())
+        return kIOReturnNotPermitted;
+
+    return sleepGate(event, deadline, interruptible);
+}
+
 void IOCommandGate::commandWakeup(void *event, bool oneThread)
 {
     wakeupGate(event, oneThread);