X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..4d15aeb193b2c68f1d38666c317f8d3734f5f083:/iokit/Kernel/IODMAController.cpp diff --git a/iokit/Kernel/IODMAController.cpp b/iokit/Kernel/IODMAController.cpp index 4f81342d4..faf7c20aa 100644 --- a/iokit/Kernel/IODMAController.cpp +++ b/iokit/Kernel/IODMAController.cpp @@ -37,7 +37,7 @@ const OSSymbol *IODMAController::createControllerName(UInt32 phandle) #define CREATE_BUF_LEN 48 char buf[CREATE_BUF_LEN]; - snprintf(buf, CREATE_BUF_LEN, "IODMAController%08lX", phandle); + snprintf(buf, CREATE_BUF_LEN, "IODMAController%08X", (uint32_t)phandle); return OSSymbol::withCString(buf); } @@ -50,9 +50,16 @@ 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 false; - dmaParentName = createControllerName(*(UInt32 *)dmaParentData->getBytesNoCopy()); - if (dmaParentName == 0) return false; + if (dmaParentData == 0) return NULL; + + 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 dmaController = OSDynamicCast(IODMAController, IOService::waitForService(IOService::nameMatching(dmaParentName))); @@ -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); }