DMA and Virtual to Physical Address Translation

Hi,

I am interested in DMAing some data to and from a network device. This
device ofcourse only understands physical memory addresses. How do first
allocate contigious physical memory in QNX (is this mmap() call) - From what
I read on the mmap call, it returns an address in the process’s space (i.e.
virtual). Secondly, how do I get the physical address from user space
address?

-Vinay

You can use io-net’s allocator:
ion->alloc*()
ion->mphys()

which boil down to mmap() and mem_offset().

-seanb

Vinay Ravuri <vinay_usenet@yahoo.com> wrote:

Hi,

I am interested in DMAing some data to and from a network device. This
device ofcourse only understands physical memory addresses. How do first
allocate contigious physical memory in QNX (is this mmap() call) - From what
I read on the mmap call, it returns an address in the process’s space (i.e.
virtual). Secondly, how do I get the physical address from user space
address?

-Vinay