kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: htmldeveloper@gmail.com (Peter Teoh)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Can we map a device address to two different memory locations?
Date: Sat, 28 May 2011 20:24:25 +0800	[thread overview]
Message-ID: <BANLkTi=Dvj-UCSB_-wUJiVuhhnpKTX_Bqg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikcp1GeX=WeD4Eei2DMobNXCxVa8A@mail.gmail.com>

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@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

      parent reply	other threads:[~2011-05-28 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 10:49 Can we map a device address to two different memory locations? sandeep kumar
2011-05-27 15:34 ` Daniel Baluta
2011-05-27 17:24 ` Mulyadi Santosa
2011-05-27 17:48   ` anish singh
2011-05-27 18:01     ` Mulyadi Santosa
2011-05-28 12:24 ` Peter Teoh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=Dvj-UCSB_-wUJiVuhhnpKTX_Bqg@mail.gmail.com' \
    --to=htmldeveloper@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).