Subject: Re: Phy addr from Virtual Addr (vm_map_entry) ?
To: Nalin Gupta <nalingupta2000@gmail.com>
From: Cherry G. Mathew <cherry.g.mathew@gmail.com>
List: tech-kern
Date: 04/16/2007 03:54:50
On 4/14/07, Nalin Gupta <nalingupta2000@gmail.com> wrote:
> Originally,
> 1. I used uvm_km_kmemalloc1 bcos man page says it allocate wired pages.
> (Still unsure but much later from src code comment, I found it may do only
> when uvm_object is type kernel_object).
>
You're using very old sources. the uvm api's were changed by yamt
almost two years ago:
See:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_km.c.diff?r1=1.76.4.1&r2=1.76.4.2&f=h
> 2. kernel_map - I used bcos I do not know what exactly to use. From some
> references and guess I used it, considering I wanted to allocate wired pages
> with in kernel owned by kernel.
>
uvm_km_alloc() can asserts that you use the kernel_map. If you want to
avoid this (can't see why ), then you could use uvm_pagealloc() to
allocate a physical page from the free page pool. I'm not sure what
the constraints on mapping it are though.
--
~Cherry