X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..04b8595b18b1b41ac7a206e4b3d51a635f8413d7:/iokit/Kernel/IODMAEventSource.cpp diff --git a/iokit/Kernel/IODMAEventSource.cpp b/iokit/Kernel/IODMAEventSource.cpp index eeaf70c8a..1b53b0b0b 100644 --- a/iokit/Kernel/IODMAEventSource.cpp +++ b/iokit/Kernel/IODMAEventSource.cpp @@ -65,6 +65,12 @@ bool IODMAEventSource::init(OSObject *inOwner, return true; } +void IODMAEventSource::free() +{ + if (dmaCommandsCompletedLock != NULL) IOSimpleLockFree(dmaCommandsCompletedLock); + super::free(); +} + IODMAEventSource *IODMAEventSource::dmaEventSource(OSObject *inOwner, IOService *inProvider, Action inCompletion, @@ -103,7 +109,7 @@ IOReturn IODMAEventSource::startDMACommand(IODMACommand *dmaCommand, IODirection return kIOReturnSuccess; } -IOReturn IODMAEventSource::stopDMACommand(bool flush, mach_timespec_t *timeout) +IOReturn IODMAEventSource::stopDMACommand(bool flush, uint64_t timeout) { if ((dmaController == 0) || (dmaIndex == 0xFFFFFFFF)) return kIOReturnError; @@ -119,6 +125,30 @@ IOReturn IODMAEventSource::queryDMACommand(IODMACommand **dmaCommand, IOByteCoun } +IOByteCount IODMAEventSource::getFIFODepth(IODirection direction) +{ + if ((dmaController == 0) || (dmaIndex == 0xFFFFFFFF)) return 0; + + return dmaController->getFIFODepth(dmaIndex, direction); +} + + +IOReturn IODMAEventSource::setFIFODepth(IOByteCount depth) +{ + if ((dmaController == 0) || (dmaIndex == 0xFFFFFFFF)) return kIOReturnError; + + return dmaController->setFIFODepth(dmaIndex, depth); +} + + +IOByteCount IODMAEventSource::validFIFODepth(IOByteCount depth, IODirection direction) +{ + if ((dmaController == 0) || (dmaIndex == 0xFFFFFFFF)) return kIOReturnError; + + return dmaController->validFIFODepth(dmaIndex, depth, direction); +} + + // protected bool IODMAEventSource::checkForWork(void) @@ -137,7 +167,7 @@ bool IODMAEventSource::checkForWork(void) IOSimpleLockUnlock(dmaCommandsCompletedLock); if (work) { - (*dmaCompletionAction)(owner, this, dmaCommand, dmaCommand->reserved->fStatus, dmaCommand->reserved->fActualByteCount); + (*dmaCompletionAction)(owner, this, dmaCommand, dmaCommand->reserved->fStatus, dmaCommand->reserved->fActualByteCount, dmaCommand->reserved->fTimeStamp); } return again; @@ -157,10 +187,21 @@ void IODMAEventSource::completeDMACommand(IODMACommand *dmaCommand) } } -void IODMAEventSource::notifyDMACommand(IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount) +void IODMAEventSource::notifyDMACommand(IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount, AbsoluteTime timeStamp) { dmaCommand->reserved->fStatus = status; - dmaCommand->reserved->fActualByteCount = actualByteCount; + dmaCommand->reserved->fActualByteCount = actualByteCount; + dmaCommand->reserved->fTimeStamp = timeStamp; - if (dmaNotificationAction != 0) (*dmaNotificationAction)(owner, this, dmaCommand, status, actualByteCount); + if (dmaNotificationAction != 0) (*dmaNotificationAction)(owner, this, dmaCommand, status, actualByteCount, timeStamp); +} + +IOReturn IODMAEventSource::setDMAConfig(UInt32 newReqIndex) +{ + return dmaController->setDMAConfig(dmaIndex, dmaProvider, newReqIndex); +} + +bool IODMAEventSource::validDMAConfig(UInt32 newReqIndex) +{ + return dmaController->validDMAConfig(dmaIndex, dmaProvider, newReqIndex); }