X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/0a7de7458d150b5d4dffc935ba399be265ef0a1a..bca245acd4c03fd752d1a45f011ad495e60fe53d:/iokit/Kernel/IOFilterInterruptEventSource.cpp diff --git a/iokit/Kernel/IOFilterInterruptEventSource.cpp b/iokit/Kernel/IOFilterInterruptEventSource.cpp index e3b9803cf..5e3371a10 100644 --- a/iokit/Kernel/IOFilterInterruptEventSource.cpp +++ b/iokit/Kernel/IOFilterInterruptEventSource.cpp @@ -84,7 +84,7 @@ IOFilterInterruptEventSource::interruptEventSource(OSObject *inOwner, IOService *inProvider, int inIntIndex) { - return 0; + return NULL; } bool @@ -122,7 +122,7 @@ IOFilterInterruptEventSource if (me && !me->init(inOwner, inAction, inFilterAction, inProvider, inIntIndex)) { me->release(); - return 0; + return NULL; } return me; @@ -141,14 +141,15 @@ IOFilterInterruptEventSource FilterBlock filter = Block_copy(inFilterAction); if (!filter) { - return 0; + OSSafeReleaseNULL(me); + return NULL; } if (me && !me->init(inOwner, (Action) NULL, (Filter) filter, inProvider, inIntIndex)) { me->release(); Block_release(filter); - return 0; + return NULL; } me->flags |= kFilterBlock; me->setActionBlock((IOEventSource::ActionBlock) inAction); @@ -220,9 +221,13 @@ IOFilterInterruptEventSource::normalInterruptOccurred } if (IOInterruptEventSource::reserved->statistics) { - if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelTimeIndex)) { + if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelTimeIndex) + || IOInterruptEventSource::reserved->statistics->enablePrimaryTimestamp) { startTime = mach_absolute_time(); } + if (IOInterruptEventSource::reserved->statistics->enablePrimaryTimestamp) { + IOInterruptEventSource::reserved->statistics->primaryTimestamp = startTime; + } } // Call the filter. @@ -269,9 +274,13 @@ IOFilterInterruptEventSource::disableInterruptOccurred } if (IOInterruptEventSource::reserved->statistics) { - if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelTimeIndex)) { + if (IA_GET_STATISTIC_ENABLED(kInterruptAccountingFirstLevelTimeIndex) + || IOInterruptEventSource::reserved->statistics->enablePrimaryTimestamp) { startTime = mach_absolute_time(); } + if (IOInterruptEventSource::reserved->statistics->enablePrimaryTimestamp) { + IOInterruptEventSource::reserved->statistics->primaryTimestamp = startTime; + } } // Call the filter.