Subject: Re: Food for thought.
To: None <rearnsha@arm.com,port-arm32@netbsd.org>
From: Ben Harris <bjh21@netbsd.org>
List: port-arm32
Date: 01/10/2001 11:25:51
In article <200101100942.JAA29682@cam-mail2.cambridge.arm.com> you write:
>It's not just that you need a contiguous block of 4 x 4K pages, but that 
>the block must be 16K aligned.  Asking the VM system for this is (was?) 
>difficult if not impossible.

/*
 * uvm_pglistalloc: allocate a list of pages
 *
 * => allocated pages are placed at the tail of rlist.  rlist is
 *    assumed to be properly initialized by caller.
 * => returns 0 on success or errno on failure
 * => XXX: implementation allocates only a single segment, also
 *      might be able to better advantage of vm_physeg[].
 * => doesn't take into account clean non-busy pages on inactive list
 *      that could be used(?)
 * => params:
 *      size            the size of the allocation, rounded to page size.
 *      low             the low address of the allowed allocation range.
 *      high            the high address of the allowed allocation range.
 *      alignment       memory must be aligned to this power-of-two boundary.
 *      boundary        no segment in the allocation may cross this 
 *                      power-of-two boundary (relative to zero).
 */

I think that should do what you want (set size=16k, alignment=16k).

-- 
Ben Harris                                                   <bjh21@netbsd.org>
Portmaster, NetBSD/arm26               <URL:http://www.netbsd.org/Ports/arm26/>