| 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_NORMALVM_ALLOC_SYSTEMVM_ALLOC_INTERRUPTvm_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_NOBUSYVM_ALLOC_NODUMPVM_ALLOC_NOOBJVM_ALLOC_SBUSYVM_ALLOC_WIREDVM_ALLOC_ZEROPG_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 |