What is the best way (XP/VISTA) to obtain the physicall address of the
users virtual memory durint a write operation.
Currently I am doing the following and it works. I build an array of
physical address and length. In the ISR if the next item in the DMA is
not NULL, I restart the DMA using the next item in the Array.
Out device does not support Scatter/Gather. I am doing it myself
for (idx = 0; Length > 0; idx++)
{
DmaPageLength = Length;
DmaAddress= IoMapTransfer(
NULL,
pMdl,
NULL,
Buffer,
&DmaPageLength,
TRUE TRUE == Write to device
);
Length -= DmaPageLength;
Buffer += DmaPageLength;
DmaArray[idx].buffer = (void *)DmaAddress.LowPart;
DmaArray[idx].nbytes = DmaPageLength;
DmaArray[idx].nwords = DmaPageLength/4;
DmaArray[idx].va = va;
}
DmaArray[idx].buffer = NULL;
DmaArray[idx].nbytes = 0;
DmaArray[idx].va = NULL;
I would like to get away from calling IoMapTransfer because I have
heard this is an obsoeite function.
So is there another way to obtain the physical address and lenth of
the users virtual address?
John
>> Stay informed about: Calculating Physical Address of users Virtual Memory