cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,355 Views
Registered: ‎02-27-2017

require the phsical addree to configure VDMA in linux (Hardware Accelerators )

hi,

   I have a question in Hardware Accelerators system.  In linux system,  if i use "pIni = (float*)sds_alloc(N*N);" to malloc a space, how could i get the corresponding phsical address to configure the destination address of VDMA? Or else, does has another way to slove the problem? thank you for your help!

 

 


 

0 Kudos
1 Reply
Highlighted
Scholar
Scholar
1,337 Views
Registered: ‎03-22-2016

Re: require the phsical addree to configure VDMA in linux (Hardware Accelerators )

@csuhuadong

 

Check out this article on TLDP.org

http://www.tldp.org/LDP/khg/HyperNews/get/devices/addrxlate.html

 

Basically

        #include <asm/io.h>
...
phys_addr = virt_to_phys(virt_addr); virt_addr = phys_to_virt(phys_addr);

However these are only accessible in kernel mode.

In user space you need to decode /proc/<PID>/pagemap and /proc/<PID>/maps. 

Here is an explanation and code.

http://fivelinesofcode.blogspot.com/2014/03/how-to-translate-virtual-to-physical.html

 

 

 

vitorian.com --- We do this for fun. Always give kudos. Accept as solution if your question was answered.
I will not answer to personal messages - use the forums instead.
0 Kudos