Re: ioremap addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__pa() and __va() apply only to physical memory (RAM) addresses, not to anything else. The reason is the way physical memory is mapped in kernel space - Physical address x is mapped at kernel virtual address x+PAGE_OFFSET. Of course, it's at page granularity, but you get my point, I hope.
Regards
Rahul


On 8/9/06, srinivas bakki <srinivas.bakki@xxxxxxxxx> wrote:


> > Besides, __pa() doesn't go through the page tables as Sebastian pointed
__pa()/__va() does a simple conversion to phy/virt. All ioremap does
is to build the page table entries corresponding to the address you
give as parameter so that a kernel virtual memory area is created and
the address be accessed via kernel virtual memory. The actual backing
memory of this area may lie somewhere in the device, mapped to some
PCI address space, which is generally outside (greater than) physical
memory range (but within 32bit address range) If you want to get this
device memory area user accessible, you would have to resort to
get_user_page() along with remap_pfn_range() or ioremap_page_range().
If you are curious about these calls, please refer ldd3, chapter 15.
 
This would mean that the addresses got from __va are not usable cause they dont have page table updation. Then why at all was this made ?
 
regards
Srinivas Bakki

 



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux