Re: ioremap addresses

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

 



On 8/10/06, Rahul Iyer <idlisambar@xxxxxxxxx> wrote:
> io_remap maps device registers to a virtual address. So, by definition,
> it is not backed by physical memory. So, __pa() shouldn't make sense,
> right?
Yes.
what did you mean by  " backed by physical memory " ?
That means a physical page exists somewhere corresponding to the
virtual memory you refer. Or, it refers to an address which can
eventually be referenced somewhere in the physical memory.
why shouldn't it make sense ?? device registers are memory mapped thus its
Making sense is a strong sentence.
as normal as any other memory available ( unless the caching issue comes in)
Devices may or may not be memory mapped. What about io mapped devices?
you have to use special instructions to access them({in,out}{b,w,l}),
right?
> 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.

Regards,
Om.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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