Calculating Physical Address of users Virtual Memory

Posted: 11-30-2007, 07:47 PM
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
Reply With Quote

Responses to "Calculating Physical Address of users Virtual Memory"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Physical Address (MAC Address) MicroBoy Windows Vista Networking & Sharing 10 07-26-2007 04:03 AM
Reduce Physical Memory Use summaawilum Windows Vista Performance & Maintenance 3 11-16-2006 06:20 AM
How to map virtual address to physical address Eva Windows XP Device Drivers 2 09-20-2005 05:06 AM
Physical Memory Jeff Windows XP Games 3 01-17-2004 08:08 AM
Virtual memory low windows attempting to add to virtual memory Joe Monti Windows XP Performance & Maintenance 1 07-18-2003 06:25 PM