linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Timur Tabi <ttabi@interactivesi.com>
Cc: linux-mm@kvack.org
Subject: Re: temp. mem mappings
Date: Tue, 5 Jun 2001 19:41:36 +0100	[thread overview]
Message-ID: <20010605194136.K26756@redhat.com> (raw)
In-Reply-To: <LD7imD.A.DyE.aQSH7@dinero.interactivesi.com>; from ttabi@interactivesi.com on Tue, Jun 05, 2001 at 01:25:27PM -0500

Hi,

On Tue, Jun 05, 2001 at 01:25:27PM -0500, Timur Tabi wrote:
> ** Reply to message from cohutta <cohutta@MailAndNews.com> on Tue, 5 Jun 2001
> 13:54:15 -0400
> 
> > what is the a preferred/correct method to map and unmap memory
> > temporarily?
> 
> Allocate a virtual memory area using vmalloc and then save and modify the
> pmd/pgd/pte to point to the physical memory you want.  To unmap, just undo the
> previous steps.

ioremap() is there for exactly that purpose.  Playing with page
tables directly is most definitely frowned upon and is unlikely to
lead to portable code.  ioremap() will take a physical address and
return the new virtual address, and ioremap_nocache() additionally
specifies the memory as being uncachable (via page table flags) so
that it can be used for PCI control register remapping.

Both functions are declared in <asm/io.h> and are available on both
2.2 and 2.4.

Cheers,
 Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

  reply	other threads:[~2001-06-05 18:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-05 17:54 cohutta
2001-06-05 18:25 ` Timur Tabi
2001-06-05 18:41   ` Stephen C. Tweedie [this message]
2001-06-05 18:51     ` Timur Tabi
2001-06-05 18:59       ` Stephen C. Tweedie
2001-06-05 20:42 cohutta
2001-06-05 20:59 ` Timur Tabi
2001-06-05 22:27   ` Joseph A. Knapka
2001-06-06  8:23 ` Stephen C. Tweedie
2001-06-06 21:14 cohutta
2001-06-07 10:00 ` Stephen C. Tweedie
2001-06-08  1:38 cohutta
2001-06-08 17:02 ` Joseph A. Knapka
2001-06-08 18:07 ` Stephen C. Tweedie
2001-06-08 21:22   ` Joseph A. Knapka
2001-06-11 16:32 cohutta
2001-06-25  6:52 ` Eric W. Biederman

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=20010605194136.K26756@redhat.com \
    --to=sct@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=ttabi@interactivesi.com \
    /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