9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Tim Newsham <newsham@lava.net>
To: 9fans@cse.psu.edu
Subject: [9fans] kernel - kmap/KADDR ?
Date: Sat, 27 Nov 2004 11:50:06 -1000	[thread overview]
Message-ID: <Pine.BSI.4.58.0411271141430.6130@malasada.lava.net> (raw)

Hi,
   I'm confused about the usage of kmap and KADDR in the code.  I
had assumed that kmap() was used to map a page into kernel memory,
and kunmap() was used to unmap that page.  I just noticed that the
KADDR() macro is used in the port code in a similar way.  The
port code calls KADDR on a physical addr, and then starts reading
and writing the returned address.

Is this the correct usage of KADDR?  If so, isnt kmap() completely
redudant then?  Also, if this is the expected behavior of KADDR,
then how are platforms that have large memories supported?  (ie.
if you have more phys memory than free space above KZERO).  kmap()
could handle this (since there is a kunmap, and only a limited
number of active mappings), but KADDR does not have any unmap
facility and must rely on a large static mapping of memory.

Tim N.


             reply	other threads:[~2004-11-27 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-27 21:50 Tim Newsham [this message]
2004-11-28  0:54 ` Russ Cox

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=Pine.BSI.4.58.0411271141430.6130@malasada.lava.net \
    --to=newsham@lava.net \
    --cc=9fans@cse.psu.edu \
    /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).