xref: /original-bsd/sys/vm/vm_pageout.h (revision 6066c21e)
1 /*
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * The Mach Operating System project at Carnegie-Mellon University.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)vm_pageout.h	8.2 (Berkeley) 01/12/94
11  *
12  *
13  * Copyright (c) 1987, 1990 Carnegie-Mellon University.
14  * All rights reserved.
15  *
16  * Author: Avadis Tevanian, Jr.
17  *
18  * Permission to use, copy, modify and distribute this software and
19  * its documentation is hereby granted, provided that both the copyright
20  * notice and this permission notice appear in all copies of the
21  * software, derivative works or modified versions, and any portions
22  * thereof, and that both notices appear in supporting documentation.
23  *
24  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
25  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
26  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
27  *
28  * Carnegie Mellon requests users of this software to return to
29  *
30  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
31  *  School of Computer Science
32  *  Carnegie Mellon University
33  *  Pittsburgh PA 15213-3890
34  *
35  * any improvements or extensions that they make and grant Carnegie the
36  * rights to redistribute these changes.
37  */
38 
39 /*
40  *	Header file for pageout daemon.
41  */
42 
43 /*
44  *	Exported data structures.
45  */
46 
47 extern int	vm_pages_needed;	/* should be some "event" structure */
48 simple_lock_data_t	vm_pages_needed_lock;
49 
50 
51 /*
52  *	Exported routines.
53  */
54 
55 /*
56  *	Signal pageout-daemon and wait for it.
57  */
58 
59 #define	VM_WAIT		{ \
60 			simple_lock(&vm_pages_needed_lock); \
61 			thread_wakeup((int)&vm_pages_needed); \
62 			thread_sleep((int)&cnt.v_free_count, \
63 				&vm_pages_needed_lock, FALSE); \
64 			}
65 #ifdef KERNEL
66 void		 vm_pageout __P((void));
67 void		 vm_pageout_scan __P((void));
68 void		 vm_pageout_page __P((vm_page_t, vm_object_t));
69 void		 vm_pageout_cluster __P((vm_page_t, vm_object_t));
70 #endif
71