1*3ba477b1Schuck /* $NetBSD: uvm_loan.h,v 1.17 2011/02/02 15:13:34 chuck Exp $ */ 2f2caacc7Smrg 3f2caacc7Smrg /* 4f2caacc7Smrg * Copyright (c) 1997 Charles D. Cranor and Washington University. 5f2caacc7Smrg * All rights reserved. 6f2caacc7Smrg * 7f2caacc7Smrg * Redistribution and use in source and binary forms, with or without 8f2caacc7Smrg * modification, are permitted provided that the following conditions 9f2caacc7Smrg * are met: 10f2caacc7Smrg * 1. Redistributions of source code must retain the above copyright 11f2caacc7Smrg * notice, this list of conditions and the following disclaimer. 12f2caacc7Smrg * 2. Redistributions in binary form must reproduce the above copyright 13f2caacc7Smrg * notice, this list of conditions and the following disclaimer in the 14f2caacc7Smrg * documentation and/or other materials provided with the distribution. 15f2caacc7Smrg * 16f2caacc7Smrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17f2caacc7Smrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18f2caacc7Smrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19f2caacc7Smrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20f2caacc7Smrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21f2caacc7Smrg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22f2caacc7Smrg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23f2caacc7Smrg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24f2caacc7Smrg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25f2caacc7Smrg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 261f6b921cSmrg * 271f6b921cSmrg * from: Id: uvm_loan.h,v 1.1.4.1 1997/12/08 16:07:14 chuck Exp 28f2caacc7Smrg */ 29f2caacc7Smrg 30021fdb64Sperry #ifndef _UVM_UVM_LOAN_H_ 31021fdb64Sperry #define _UVM_UVM_LOAN_H_ 32021fdb64Sperry 33abb48c5bSthorpej #ifdef _KERNEL 34abb48c5bSthorpej 35f2caacc7Smrg /* 362ed88fe0Schs * flags for uvm_loan() 37f2caacc7Smrg */ 38f2caacc7Smrg 39f2caacc7Smrg #define UVM_LOAN_TOANON 0x1 /* loan to anon */ 40f2caacc7Smrg #define UVM_LOAN_TOPAGE 0x2 /* loan to page */ 41f2caacc7Smrg 42f2caacc7Smrg /* 43f2caacc7Smrg * loan prototypes 44f2caacc7Smrg */ 45f2caacc7Smrg 46325f5482Sjunyoung void uvm_loan_init(void); 47325f5482Sjunyoung int uvm_loan(struct vm_map *, vaddr_t, vsize_t, void *, int); 48325f5482Sjunyoung void uvm_unloan(void *, int, int); 49325f5482Sjunyoung int uvm_loanuobjpages(struct uvm_object *, voff_t, int, 50325f5482Sjunyoung struct vm_page **); 51325f5482Sjunyoung struct vm_page *uvm_loanbreak(struct vm_page *); 520dceadd7Suebayasi int uvm_loanbreak_anon(struct vm_anon *, struct uvm_object *); 53021fdb64Sperry 54abb48c5bSthorpej #endif /* _KERNEL */ 55abb48c5bSthorpej 56021fdb64Sperry #endif /* _UVM_UVM_LOAN_H_ */ 57