16484c361SAlfred Perlstein.\" 26484c361SAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved. 36484c361SAlfred Perlstein.\" 46484c361SAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without 56484c361SAlfred Perlstein.\" modification, are permitted provided that the following conditions 66484c361SAlfred Perlstein.\" are met: 76484c361SAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright 86484c361SAlfred Perlstein.\" notice(s), this list of conditions and the following disclaimer as 96484c361SAlfred Perlstein.\" the first lines of this file unmodified other than the possible 106484c361SAlfred Perlstein.\" addition of one or more copyright notices. 116484c361SAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright 126484c361SAlfred Perlstein.\" notice(s), this list of conditions and the following disclaimer in the 136484c361SAlfred Perlstein.\" documentation and/or other materials provided with the distribution. 146484c361SAlfred Perlstein.\" 156484c361SAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 166484c361SAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 176484c361SAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 186484c361SAlfred Perlstein.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 196484c361SAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 206484c361SAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 216484c361SAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 226484c361SAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 236484c361SAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 246484c361SAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 256484c361SAlfred Perlstein.\" DAMAGE. 266484c361SAlfred Perlstein.\" 276484c361SAlfred Perlstein.\" $FreeBSD$ 286484c361SAlfred Perlstein.\" 296484c361SAlfred Perlstein.Dd July 13, 2001 306484c361SAlfred Perlstein.Dt VM_PAGE_ALLOC 9 316484c361SAlfred Perlstein.Os 326484c361SAlfred Perlstein.Sh NAME 336484c361SAlfred Perlstein.Nm vm_page_alloc 346484c361SAlfred Perlstein.Nd "allocates a page for the object and index" 356484c361SAlfred Perlstein.Sh SYNOPSIS 366484c361SAlfred Perlstein.In sys/param.h 376484c361SAlfred Perlstein.In vm/vm.h 386484c361SAlfred Perlstein.In vm/vm_page.h 396484c361SAlfred Perlstein.Ft vm_page_t 406484c361SAlfred Perlstein.Fn vm_page_alloc "vm_object_t object" "vm_pindex_t pindex" "int page_req" 416484c361SAlfred Perlstein.Sh DESCRIPTION 426484c361SAlfred PerlsteinThe 436484c361SAlfred Perlstein.Fn vm_page_alloc 446484c361SAlfred Perlsteinfunction allocates a page for 456484c361SAlfred Perlstein.Fa pindex 466484c361SAlfred Perlsteinin the VM object 476484c361SAlfred Perlstein.Fa object . 486484c361SAlfred PerlsteinIt is assumed that a page has not already been allocated for 496484c361SAlfred Perlstein.Fa pindex 506484c361SAlfred Perlsteinand 516484c361SAlfred Perlstein.Fa object . 526484c361SAlfred Perlstein.Pp 536484c361SAlfred PerlsteinThe 546484c361SAlfred Perlstein.Fn vm_page_alloc 556484c361SAlfred Perlsteinfunction will not block. 566484c361SAlfred Perlstein.Pp 576484c361SAlfred PerlsteinIts arguments are: 586484c361SAlfred Perlstein.Bl -tag -width ".Fa page_req" 596484c361SAlfred Perlstein.It Fa object 606484c361SAlfred PerlsteinThe VM object to allocate the page for. 616484c361SAlfred Perlstein.It Fa pindex 626484c361SAlfred PerlsteinThe index of the page that should be allocated. 636484c361SAlfred Perlstein.It Fa page_req 646484c361SAlfred PerlsteinA flag indicating how the page should be allocated. 656484c361SAlfred Perlstein.Bl -tag -width ".Dv VM_ALLOC_INTERRUPT" 666484c361SAlfred Perlstein.It Dv VM_ALLOC_NORMAL 676484c361SAlfred PerlsteinThe page should be allocated with no special treatment. 686484c361SAlfred Perlstein.It Dv VM_ALLOC_SYSTEM 696484c361SAlfred PerlsteinThe page can be allocated even if the buffer cache queue is empty 706484c361SAlfred Perlsteinand the free count is above the interrupt reserved water mark. 716484c361SAlfred PerlsteinThis should be used only when the system really needs the page. 726484c361SAlfred Perlstein.It Dv VM_ALLOC_INTERRUPT 736484c361SAlfred Perlstein.Fn vm_page_alloc 746484c361SAlfred Perlsteinis being called during an interrupt and therefore the cache cannot 756484c361SAlfred Perlsteinbe accessed. 766484c361SAlfred PerlsteinThe page will only be returned successfully if the free count is greater 776484c361SAlfred Perlsteinthan zero. 786484c361SAlfred Perlstein.It Dv VM_ALLOC_ZERO 796484c361SAlfred PerlsteinThe same as 806484c361SAlfred Perlstein.Dv VM_ALLOC_NORMAL 816484c361SAlfred Perlsteinexcept the page returned is zeroed. 826484c361SAlfred Perlstein.El 836484c361SAlfred Perlstein.El 846484c361SAlfred Perlstein.Sh RETURN VALUES 856484c361SAlfred PerlsteinA 866484c361SAlfred Perlstein.Vt vm_page_t 876484c361SAlfred Perlsteinis returned if successful; otherwise, 886484c361SAlfred Perlstein.Dv NULL 896484c361SAlfred Perlsteinis returned. 906484c361SAlfred Perlstein.Sh NOTES 916484c361SAlfred PerlsteinThe pager process is always upgraded to 926484c361SAlfred Perlstein.Dv VM_ALLOC_SYSTEM 936484c361SAlfred Perlsteinunless 946484c361SAlfred Perlstein.Dv VM_ALLOC_INTERRUPT 956484c361SAlfred Perlsteinis set. 966484c361SAlfred Perlstein.Sh AUTHORS 976484c361SAlfred PerlsteinThis man page was written by 986484c361SAlfred Perlstein.An Chad David Aq davidc@acns.ab.ca . 99