Loading...
iokit/Kernel/IOWorkLoop.cpp xnu-124.7 xnu-201.14
--- xnu/xnu-124.7/iokit/Kernel/IOWorkLoop.cpp
+++ xnu/xnu-201.14/iokit/Kernel/IOWorkLoop.cpp
@@ -37,7 +37,8 @@
 OSDefineMetaClassAndStructors(IOWorkLoop, OSObject);
 
 // Block of unused functions intended for future use
-OSMetaClassDefineReservedUnused(IOWorkLoop, 0);
+OSMetaClassDefineReservedUsed(IOWorkLoop, 0);
+
 OSMetaClassDefineReservedUnused(IOWorkLoop, 1);
 OSMetaClassDefineReservedUnused(IOWorkLoop, 2);
 OSMetaClassDefineReservedUnused(IOWorkLoop, 3);
@@ -374,6 +375,20 @@
     IORecursiveLockWakeup(gateLock, event, oneThread);
 }
 
+IOReturn IOWorkLoop::runAction(Action inAction, OSObject *target,
+                                  void *arg0 = 0, void *arg1 = 0,
+                                  void *arg2 = 0, void *arg3 = 0)
+{
+    IOReturn res;
+
+    // closeGate is recursive so don't worry if we already hold the lock.
+    closeGate();
+    res = (*inAction)(target, arg0, arg1, arg2, arg3);
+    openGate();
+
+    return res;
+}
+
 IOReturn IOWorkLoop::_maintRequest(void *inC, void *inD, void *, void *)
 {
     maintCommandEnum command = (maintCommandEnum) (vm_address_t) inC;