vm_pageout.h revision 32702
15455Sdg/*
21541Srgrimes * Copyright (c) 1991, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed to Berkeley by
61541Srgrimes * The Mach Operating System project at Carnegie-Mellon University.
71541Srgrimes *
81541Srgrimes * Redistribution and use in source and binary forms, with or without
91541Srgrimes * modification, are permitted provided that the following conditions
101541Srgrimes * are met:
111541Srgrimes * 1. Redistributions of source code must retain the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer.
131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer in the
151541Srgrimes *    documentation and/or other materials provided with the distribution.
161541Srgrimes * 3. All advertising materials mentioning features or use of this software
171541Srgrimes *    must display the following acknowledgement:
181541Srgrimes *	This product includes software developed by the University of
191541Srgrimes *	California, Berkeley and its contributors.
201541Srgrimes * 4. Neither the name of the University nor the names of its contributors
211541Srgrimes *    may be used to endorse or promote products derived from this software
221541Srgrimes *    without specific prior written permission.
231541Srgrimes *
241541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
251541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
261541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
271541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
281541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
291541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
301541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
311541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
321541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
331541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
341541Srgrimes * SUCH DAMAGE.
351541Srgrimes *
361817Sdg *	from: @(#)vm_pageout.h	8.2 (Berkeley) 1/12/94
371541Srgrimes *
381541Srgrimes *
391541Srgrimes * Copyright (c) 1987, 1990 Carnegie-Mellon University.
401541Srgrimes * All rights reserved.
411541Srgrimes *
421541Srgrimes * Author: Avadis Tevanian, Jr.
435455Sdg *
441541Srgrimes * Permission to use, copy, modify and distribute this software and
451541Srgrimes * its documentation is hereby granted, provided that both the copyright
461541Srgrimes * notice and this permission notice appear in all copies of the
471541Srgrimes * software, derivative works or modified versions, and any portions
481541Srgrimes * thereof, and that both notices appear in supporting documentation.
495455Sdg *
505455Sdg * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
515455Sdg * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
521541Srgrimes * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
535455Sdg *
541541Srgrimes * Carnegie Mellon requests users of this software to return to
551541Srgrimes *
561541Srgrimes *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
571541Srgrimes *  School of Computer Science
581541Srgrimes *  Carnegie Mellon University
591541Srgrimes *  Pittsburgh PA 15213-3890
601541Srgrimes *
611541Srgrimes * any improvements or extensions that they make and grant Carnegie the
621541Srgrimes * rights to redistribute these changes.
631817Sdg *
6432702Sdyson * $Id: vm_pageout.h,v 1.22 1998/01/12 01:44:46 dyson Exp $
651541Srgrimes */
661541Srgrimes
672177Spaul#ifndef _VM_VM_PAGEOUT_H_
682177Spaul#define _VM_VM_PAGEOUT_H_
692177Spaul
701541Srgrimes/*
711541Srgrimes *	Header file for pageout daemon.
721541Srgrimes */
731541Srgrimes
741541Srgrimes/*
751541Srgrimes *	Exported data structures.
761541Srgrimes */
771541Srgrimes
787090Sbdeextern int vm_page_max_wired;
795455Sdgextern int vm_pages_needed;	/* should be some "event" structure */
801549Srgrimesextern int vm_pageout_pages_needed;
8132702Sdysonextern int vm_pageout_deficit;
821541Srgrimes
831549Srgrimes#define VM_PAGEOUT_ASYNC 0
841549Srgrimes#define VM_PAGEOUT_SYNC 1
851549Srgrimes#define VM_PAGEOUT_FORCE 2
861541Srgrimes
871541Srgrimes/*
8831563Sdyson * Swap out requests
8931563Sdyson */
9031563Sdyson#define VM_SWAP_NORMAL 1
9131563Sdyson#define VM_SWAP_IDLE 2
9231563Sdyson
9331563Sdyson/*
941541Srgrimes *	Exported routines.
951541Srgrimes */
961541Srgrimes
971541Srgrimes/*
981541Srgrimes *	Signal pageout-daemon and wait for it.
991541Srgrimes */
1001541Srgrimes
10120007Sdysonextern void pagedaemon_wakeup __P((void));
1021549Srgrimes#define VM_WAIT vm_wait()
10320007Sdysonextern void vm_wait __P((void));
1041549Srgrimes
1051541Srgrimes#ifdef KERNEL
1065455Sdgvoid vm_pageout_page __P((vm_page_t, vm_object_t));
1075455Sdgvoid vm_pageout_cluster __P((vm_page_t, vm_object_t));
10812110Sdysonint vm_pageout_flush __P((vm_page_t *, int, int));
10932454Sdysonvoid vm_pageout_page_free __P((vm_page_t));
1105455Sdg
1111541Srgrimes#endif
1122177Spaul
1132177Spaul#endif
114