- 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;