]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOCommandPool.cpp
xnu-1504.7.4.tar.gz
[apple/xnu.git] / iokit / Kernel / IOCommandPool.cpp
index 3bddd5b8a28a580cac6895508cfa0da4bbe36790..2a3b6e71b1313b46abc07657072dfe55c216d0ca 100644 (file)
@@ -147,9 +147,10 @@ IOCommandPool::getCommand(bool blockForCommand)
     IOReturn    result  = kIOReturnSuccess;
     IOCommand *command = 0;
 
-    result = fSerializer->runAction((IOCommandGate::Action)
-        &IOCommandPool::gatedGetCommand, 
-            (void *) &command, (void *) blockForCommand);
+    IOCommandGate::Action func = OSMemberFunctionCast(
+           IOCommandGate::Action, this, &IOCommandPool::gatedGetCommand);
+    result = fSerializer->
+       runAction(func, (void *) &command, (void *) blockForCommand);
     if (kIOReturnSuccess == result)
         return command;
     else
@@ -186,8 +187,9 @@ gatedGetCommand(IOCommand **command, bool blockForCommand)
 void IOCommandPool::
 returnCommand(IOCommand *command)
 {
-    (void) fSerializer->runAction((IOCommandGate::Action)
-        &IOCommandPool::gatedReturnCommand, (void *) command);
+    IOCommandGate::Action func = OSMemberFunctionCast(
+           IOCommandGate::Action, this, &IOCommandPool::gatedReturnCommand);
+    (void) fSerializer->runAction(func, (void *) command);
 }
 
 
@@ -199,7 +201,7 @@ returnCommand(IOCommand *command)
 IOReturn IOCommandPool::
 gatedReturnCommand(IOCommand *command)
 {
-    queue_enter(&fQueueHead, command, IOCommand *, fCommandChain);
+    queue_enter_first(&fQueueHead, command, IOCommand *, fCommandChain);
     if (fSleepers) {
         fSerializer->commandWakeup(&fSleepers, /* oneThread */ true);
         fSleepers--;