X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/fe8ab488e9161c46dd9885d58fc52996dc0249ff..e8c3f78193f1895ea514044358b93b1add9322f3:/iokit/Kernel/IOInterruptEventSource.cpp?ds=inline diff --git a/iokit/Kernel/IOInterruptEventSource.cpp b/iokit/Kernel/IOInterruptEventSource.cpp index 1636405f6..0d96bbb86 100644 --- a/iokit/Kernel/IOInterruptEventSource.cpp +++ b/iokit/Kernel/IOInterruptEventSource.cpp @@ -220,6 +220,19 @@ IOInterruptEventSource::interruptEventSource(OSObject *inOwner, return me; } +IOInterruptEventSource * +IOInterruptEventSource::interruptEventSource(OSObject *inOwner, + IOService *inProvider, + int inIntIndex, + ActionBlock inAction) +{ + IOInterruptEventSource * ies; + ies = IOInterruptEventSource::interruptEventSource(inOwner, (Action) NULL, inProvider, inIntIndex); + if (ies) ies->setActionBlock((IOEventSource::ActionBlock) inAction); + + return ies; +} + void IOInterruptEventSource::free() { if (provider && intIndex >= 0) @@ -300,6 +313,7 @@ bool IOInterruptEventSource::checkForWork() unsigned int cacheProdCount = producerCount; int numInts = cacheProdCount - consumerCount; IOInterruptEventAction intAction = (IOInterruptEventAction) action; + ActionBlock intActionBlock = (ActionBlock) actionBlock; bool trace = (gIOKitTrace & kIOTraceIntEventSource) ? true : false; IOStatisticsCheckForWork(); @@ -308,7 +322,8 @@ bool IOInterruptEventSource::checkForWork() { if (trace) IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION), - VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner), + VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop)); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelSystemTimeIndex)) { @@ -321,7 +336,8 @@ bool IOInterruptEventSource::checkForWork() } // Call the handler - (*intAction)(owner, this, numInts); + if (kActionBlock & flags) (intActionBlock)(this, numInts); + else (*intAction)(owner, this, numInts); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelCountIndex)) { @@ -341,7 +357,8 @@ bool IOInterruptEventSource::checkForWork() if (trace) IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION), - VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner), + VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop)); consumerCount = cacheProdCount; if (autoDisable && !explicitDisable) @@ -352,7 +369,8 @@ bool IOInterruptEventSource::checkForWork() { if (trace) IOTimeStampStartConstant(IODBG_INTES(IOINTES_ACTION), - VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner), + VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop)); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelSystemTimeIndex)) { @@ -365,7 +383,8 @@ bool IOInterruptEventSource::checkForWork() } // Call the handler - (*intAction)(owner, this, -numInts); + if (kActionBlock & flags) (intActionBlock)(this, numInts); + else (*intAction)(owner, this, numInts); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingSecondLevelCountIndex)) { @@ -385,7 +404,8 @@ bool IOInterruptEventSource::checkForWork() if (trace) IOTimeStampEndConstant(IODBG_INTES(IOINTES_ACTION), - VM_KERNEL_UNSLIDE(intAction), (uintptr_t) owner, (uintptr_t) this, (uintptr_t) workLoop); + VM_KERNEL_ADDRHIDE(intAction), VM_KERNEL_ADDRHIDE(owner), + VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(workLoop)); consumerCount = cacheProdCount; if (autoDisable && !explicitDisable) @@ -404,7 +424,7 @@ void IOInterruptEventSource::normalInterruptOccurred producerCount++; if (trace) - IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner); + IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner)); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelCountIndex)) { @@ -415,7 +435,7 @@ void IOInterruptEventSource::normalInterruptOccurred signalWorkAvailable(); if (trace) - IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner); + IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner)); } void IOInterruptEventSource::disableInterruptOccurred @@ -429,7 +449,7 @@ void IOInterruptEventSource::disableInterruptOccurred producerCount++; if (trace) - IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner); + IOTimeStampStartConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner)); if (reserved->statistics) { if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelCountIndex)) { @@ -440,7 +460,7 @@ void IOInterruptEventSource::disableInterruptOccurred signalWorkAvailable(); if (trace) - IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), (uintptr_t) this, (uintptr_t) owner); + IOTimeStampEndConstant(IODBG_INTES(IOINTES_SEMA), VM_KERNEL_ADDRHIDE(this), VM_KERNEL_ADDRHIDE(owner)); } void IOInterruptEventSource::interruptOccurred