0

How to convert virtual address to physical address in kernel space? Using :

 #include <asm/io.h>

 phys_addr = virt_to_phys(virt_addr);
 virt_addr = phys_to_virt(phys_addr);
 bus_addr = virt_to_bus(virt_addr);
 virt_addr = bus_to_virt(bus_addr);
phoenix
  • 3,069
  • 3
  • 22
  • 29
  • So, what is a question? You ask "how to .." and immediately provide code, which probably do that. If this code doesn't work for you, note that in the question post. – Tsyvarev Feb 05 '16 at 09:50
  • No no i do not need the code just a procedure, explanation how i am going to implement it or any algorithm –  Feb 05 '16 at 12:37
  • Functions you list in the code are already defined in "asm/io.h", you may use them. Is this what you want? – Tsyvarev Feb 05 '16 at 12:48
  • Yes that i know, but i am getting how to use it. Because in that virt_addr how to use it. –  Feb 08 '16 at 05:36
  • Then your real question is _How to use a virtual address in kernel space?_? - If your English is not sufficient to express your question, you should ask someone to put it for you. – Armali Apr 05 '16 at 13:13

0 Answers0