VM_PAGE_ALLOC(9) | Kernel Developer's Manual | VM_PAGE_ALLOC(9) |
vm_page_alloc
—
allocate a page for a
vm_object
#include
<sys/param.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
vm_page_t
vm_page_alloc
(vm_object_t
object, vm_pindex_t
pindex, int
req);
The
vm_page_alloc
()
function allocates a page at pindex within
object. It is assumed that a page has not already been
allocated at pindex. The page returned is inserted
into the object, unless VM_ALLOC_NOOBJ
is specified
in the req.
vm_page_alloc
()
will not sleep.
Its arguments are:
VM_ALLOC_NOOBJ
is not
specified.Exactly one of the following classes must be specified:
VM_ALLOC_NORMAL
VM_ALLOC_SYSTEM
VM_ALLOC_INTERRUPT
vm_page_alloc
()
is being called during an interrupt. A page will be returned
successfully if the free page count is greater than zero.The optional flags are:
VM_ALLOC_NOBUSY
VM_ALLOC_NODUMP
VM_ALLOC_NOOBJ
VM_ALLOC_SBUSY
VM_ALLOC_WIRED
VM_ALLOC_ZERO
PG_ZERO
flag set if it is zeroed.The vm_page_t that was allocated is returned
if successful; otherwise, NULL
is returned.
The pager process is always upgraded to
VM_ALLOC_SYSTEM
unless
VM_ALLOC_INTERRUPT
is set.
This manual page was written by Chad David <davidc@acns.ab.ca>.
November 16, 2016 | Debian |