Mapping Physical Memory without a Device?

John Baldwin jhb at FreeBSD.org
Mon Jun 9 04:55:28 PDT 2003


On 07-Jun-2003 cd_freebsd wrote:
> After sending my first note, I found pmap_mapdev. Anything wrong with using that?

/*
 * Map a set of physical memory pages into the kernel virtual
 * address space. Return a pointer to where it is mapped. This
 * routine is intended to be used for mapping device memory,
 * NOT real memory.
 */

Read the last comment.  It is intended for memory-mapped devices (I use
it to map the I/O APICs and local APIC for example) and not for actual
RAM.  The problem is that the RAM could be used out from under you.
You need to reserve it in the VM somehow.  I'm not sure how you would
accomplish that.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the freebsd-hackers mailing list