Can we map a device address to two different memory locations?

Peter Teoh htmldeveloper at gmail.com
Sat May 28 08:24:25 EDT 2011


the concept of "remap" is to map again, thus, if u call ioremap()
multiple times, u will just remove the previous mapping setup.   This
is implied in the source for ioremap() - delved down all the way to
where the PTE is setup.   the reason for this is because the MMU
translation process is hardware-based - each page table can only map
from one physical memory to another virtual memory, based on the PTE
values.   but it is possible to have same physical address mapping to
the different virtual address - but definitely not for kernel virtual
address, (which thus eliminate IO addresses) - the page tables have to
be different.   this is because all kernel virtual addresses share the
same page table.

more info:

http://www.kernel.org/doc/gorman/html/understand/understand006.html

On Fri, May 27, 2011 at 6:49 PM, sandeep kumar
<coolsandyforyou at gmail.com> wrote:
> Hi all,
> Memory mapping is done so that CPU can access the devices, which it cant
> unless.
>
> Now the question is can we memory map a one device resource(say some
> iomemory) to two different memory locations?
> the other way of seeing at this question is,
> Will ioremap() gives different 'virtual addresses' when called multiple
> times?
>
> Please give reply..
>
> --
> With regards,
> Sandeep Kumar Anantapalli,
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>



-- 
Regards,
Peter Teoh



More information about the Kernelnewbies mailing list