]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IODMAController.cpp
xnu-2782.20.48.tar.gz
[apple/xnu.git] / iokit / Kernel / IODMAController.cpp
index 603998035f6d746b734519b62a7cd8b2b3b41182..faf7c20aa386fdc6f4ee7298155a78c45c9119be 100644 (file)
@@ -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);
 }