1*9fc45356Sriastradh /* $NetBSD: uvm_pdaemon.h,v 1.20 2020/09/05 16:30:13 riastradh Exp $ */ 2f2caacc7Smrg 3f2caacc7Smrg /* 4f2caacc7Smrg * Copyright (c) 1997 Charles D. Cranor and Washington University. 5f2caacc7Smrg * Copyright (c) 1991, 1993, The Regents of the University of California. 6f2caacc7Smrg * 7f2caacc7Smrg * All rights reserved. 8f2caacc7Smrg * 9f2caacc7Smrg * This code is derived from software contributed to Berkeley by 10f2caacc7Smrg * The Mach Operating System project at Carnegie-Mellon University. 11f2caacc7Smrg * 12f2caacc7Smrg * Redistribution and use in source and binary forms, with or without 13f2caacc7Smrg * modification, are permitted provided that the following conditions 14f2caacc7Smrg * are met: 15f2caacc7Smrg * 1. Redistributions of source code must retain the above copyright 16f2caacc7Smrg * notice, this list of conditions and the following disclaimer. 17f2caacc7Smrg * 2. Redistributions in binary form must reproduce the above copyright 18f2caacc7Smrg * notice, this list of conditions and the following disclaimer in the 19f2caacc7Smrg * documentation and/or other materials provided with the distribution. 2040ec801aSchuck * 3. Neither the name of the University nor the names of its contributors 21f2caacc7Smrg * may be used to endorse or promote products derived from this software 22f2caacc7Smrg * without specific prior written permission. 23f2caacc7Smrg * 24f2caacc7Smrg * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25f2caacc7Smrg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26f2caacc7Smrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27f2caacc7Smrg * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28f2caacc7Smrg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29f2caacc7Smrg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30f2caacc7Smrg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31f2caacc7Smrg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32f2caacc7Smrg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33f2caacc7Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34f2caacc7Smrg * SUCH DAMAGE. 35f2caacc7Smrg * 36f2caacc7Smrg * @(#)vm_pageout.h 8.2 (Berkeley) 1/12/94 371f6b921cSmrg * from: Id: uvm_pdaemon.h,v 1.1.2.4 1998/02/02 20:07:20 chuck Exp 38f2caacc7Smrg * 39f2caacc7Smrg * 40f2caacc7Smrg * Copyright (c) 1987, 1990 Carnegie-Mellon University. 41f2caacc7Smrg * All rights reserved. 42f2caacc7Smrg * 43f2caacc7Smrg * Permission to use, copy, modify and distribute this software and 44f2caacc7Smrg * its documentation is hereby granted, provided that both the copyright 45f2caacc7Smrg * notice and this permission notice appear in all copies of the 46f2caacc7Smrg * software, derivative works or modified versions, and any portions 47f2caacc7Smrg * thereof, and that both notices appear in supporting documentation. 48f2caacc7Smrg * 49f2caacc7Smrg * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 50f2caacc7Smrg * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 51f2caacc7Smrg * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 52f2caacc7Smrg * 53f2caacc7Smrg * Carnegie Mellon requests users of this software to return to 54f2caacc7Smrg * 55f2caacc7Smrg * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 56f2caacc7Smrg * School of Computer Science 57f2caacc7Smrg * Carnegie Mellon University 58f2caacc7Smrg * Pittsburgh PA 15213-3890 59f2caacc7Smrg * 60f2caacc7Smrg * any improvements or extensions that they make and grant Carnegie the 61f2caacc7Smrg * rights to redistribute these changes. 62f2caacc7Smrg */ 63f2caacc7Smrg 64021fdb64Sperry #ifndef _UVM_UVM_PDAEMON_H_ 65021fdb64Sperry #define _UVM_UVM_PDAEMON_H_ 66021fdb64Sperry 67f2caacc7Smrg /* 68f2caacc7Smrg * uvm_pdaemon.h: page daemon hooks 69f2caacc7Smrg */ 70f2caacc7Smrg 71abb48c5bSthorpej #ifdef _KERNEL 72abb48c5bSthorpej 73*9fc45356Sriastradh #ifdef _KERNEL_OPT 74*9fc45356Sriastradh #include "opt_vmswap.h" 75*9fc45356Sriastradh #endif 76*9fc45356Sriastradh 77*9fc45356Sriastradh #include <sys/stdbool.h> 78*9fc45356Sriastradh 79*9fc45356Sriastradh struct vm_page; 80*9fc45356Sriastradh struct krwlock; 81*9fc45356Sriastradh 82f2caacc7Smrg /* 83f2caacc7Smrg * prototypes 84f2caacc7Smrg */ 85f2caacc7Smrg 86325f5482Sjunyoung void uvm_wait(const char *); 87712239e3Sthorpej bool uvm_reclaimable(void); 88021fdb64Sperry 89*9fc45356Sriastradh struct krwlock *uvmpd_trylockowner(struct vm_page *); 9004d191ffSpooka #ifdef VMSWAP 919344a595Sad bool uvmpd_dropswap(struct vm_page *); 9204d191ffSpooka #else 939344a595Sad #define uvmpd_dropswap(_a_) (/*CONSTCOND*/false) 9404d191ffSpooka #endif 959d3e3eabSyamt 96abb48c5bSthorpej #endif /* _KERNEL */ 97abb48c5bSthorpej 98021fdb64Sperry #endif /* _UVM_UVM_PDAEMON_H_ */ 99