X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6d2010ae8f7a6078e10b361c6962983bab233e0f..04b8595b18b1b41ac7a206e4b3d51a635f8413d7:/iokit/Kernel/IODMAController.cpp?ds=inline diff --git a/iokit/Kernel/IODMAController.cpp b/iokit/Kernel/IODMAController.cpp index 603998035..faf7c20aa 100644 --- a/iokit/Kernel/IODMAController.cpp +++ b/iokit/Kernel/IODMAController.cpp @@ -51,7 +51,14 @@ IODMAController *IODMAController::getController(IOService *provider, UInt32 dmaI // Find the name of the parent dma controller dmaParentData = OSDynamicCast(OSData, provider->getProperty("dma-parent")); if (dmaParentData == 0) return NULL; - dmaParentName = createControllerName(*(UInt32 *)dmaParentData->getBytesNoCopy()); + + if (dmaParentData->getLength() == sizeof(UInt32)) { + dmaParentName = createControllerName(*(UInt32 *)dmaParentData->getBytesNoCopy()); + } else { + if (dmaIndex >= dmaParentData->getLength() / sizeof(UInt32)) + panic("dmaIndex out of range"); + dmaParentName = createControllerName(*(UInt32 *)dmaParentData->getBytesNoCopy(dmaIndex * sizeof(UInt32), sizeof(UInt32))); + } if (dmaParentName == 0) return NULL; // Wait for the parent dma controller @@ -91,9 +98,9 @@ void IODMAController::completeDMACommand(IODMAEventSource *dmaES, IODMACommand * dmaES->completeDMACommand(dmaCommand); } -void IODMAController::notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount) +void IODMAController::notifyDMACommand(IODMAEventSource *dmaES, IODMACommand *dmaCommand, IOReturn status, IOByteCount actualByteCount, AbsoluteTime timeStamp) { - dmaES->notifyDMACommand(dmaCommand, status, actualByteCount); + dmaES->notifyDMACommand(dmaCommand, status, actualByteCount, timeStamp); }