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