X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..15129b1c8dbb3650c63b70adb1cad9af601c6c17:/iokit/Kernel/IOInterruptEventSource.cpp?ds=sidebyside diff --git a/iokit/Kernel/IOInterruptEventSource.cpp b/iokit/Kernel/IOInterruptEventSource.cpp index 8b49024a1..6782ec9fe 100644 --- a/iokit/Kernel/IOInterruptEventSource.cpp +++ b/iokit/Kernel/IOInterruptEventSource.cpp @@ -167,19 +167,20 @@ void IOInterruptEventSource::disable() void IOInterruptEventSource::setWorkLoop(IOWorkLoop *inWorkLoop) { - super::setWorkLoop(inWorkLoop); - - if (!provider) - return; - - if ( !inWorkLoop ) { - if (intIndex >= 0) { - provider->unregisterInterrupt(intIndex); + if (inWorkLoop) super::setWorkLoop(inWorkLoop); + + if (provider) { + if (!inWorkLoop) { + if (intIndex >= 0) { + provider->unregisterInterrupt(intIndex); + intIndex = ~intIndex; + } + } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) { intIndex = ~intIndex; } - } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) { - intIndex = ~intIndex; } + + if (!inWorkLoop) super::setWorkLoop(inWorkLoop); } const IOService *IOInterruptEventSource::getProvider() const @@ -210,14 +211,14 @@ bool IOInterruptEventSource::checkForWork() { if (trace) IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION), - (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); // Call the handler (*intAction)(owner, this, numInts); if (trace) IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION), - (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); consumerCount = cacheProdCount; if (autoDisable && !explicitDisable) @@ -228,14 +229,14 @@ bool IOInterruptEventSource::checkForWork() { if (trace) IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION), - (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); // Call the handler (*intAction)(owner, this, -numInts); if (trace) IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION), - (uintptr_t) intAction, (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); consumerCount = cacheProdCount; if (autoDisable && !explicitDisable)