]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/task_swap.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
31 * Revision 1.1.1.1 1998/09/22 21:05:32 wsanchez
32 * Import of Mac OS X kernel (~semeria)
34 * Revision 1.1.1.1 1998/03/07 02:25:56 wsanchez
35 * Import of OSF Mach kernel (~mburg)
37 * Revision 1.1.4.1 1995/04/07 19:02:38 barbou
38 * Merged into mainline.
41 * Revision 1.1.2.2 1995/02/13 15:35:45 barbou
42 * Merged/ported to MK6.
44 * Revision 1.1.1.3 94/08/12 15:44:39 barbou
45 * VM Merge - Task Swapper.
47 * Changed host_priv_t into host_t.
50 * Revision 1.1.1.2 1994/07/28 15:33:46 barbou
53 * Revision 3.0.3.2 1994/01/20 19:53:01 chasb
54 * Remove excessively restrictive copyright notice
55 * [1994/01/20 17:50:40 chasb]
57 * Revision 3.0.3.1 1993/12/20 21:06:49 gupta
58 * Expanded C O P Y R I G H T
59 * [1993/12/17 22:19:22 gupta]
61 * Revision 3.0 1992/12/31 22:08:24 ede
62 * Initial revision for OSF/1 R1.3
64 * Revision 1.1.4.5 1992/03/16 18:02:52 gmf
65 * Add TASK_SW_ELIGIBLE flag to swap_flags; prototype
66 * task_swapout_eligible, task_swapout_ineligible.
67 * [1992/02/12 22:01:48 gmf]
69 * Revision 1.1.4.4 1992/01/22 22:14:13 gmf
70 * Change prototype for task_swappable() to use host_priv_t
72 * [1992/01/17 17:48:13 gmf]
74 * Revision 1.1.4.3 1991/12/10 17:20:55 gmf
75 * Add extern declaration for new thread.
76 * Changed TASK_SW_WAIT flag to TASK_SW_WANT_IN.
77 * [1991/12/10 16:19:10 gmf]
79 * Revision 1.1.4.2 1991/11/21 21:48:35 mmp
80 * initial task swapping code
81 * [1991/11/21 21:01:37 mmp]
87 * File: kern/task_swap.h
89 * Task residency management primitives declarations.
92 #ifndef _KERN_TASK_SWAP_H_
93 #define _KERN_TASK_SWAP_H_
95 #include <kern/host.h>
100 #define TASK_SW_UNSWAPPABLE 1 /* not swappable */
101 #define TASK_SW_IN 2 /* swapped in (resident) */
102 #define TASK_SW_OUT 3 /* swapped out (non-resident) */
103 #define TASK_SW_COMING_IN 4 /* about to be swapped in */
104 #define TASK_SW_GOING_OUT 5 /* being swapped out */
109 #define TASK_SW_MAKE_UNSWAPPABLE 0x01 /* make it unswappable */
110 #define TASK_SW_WANT_IN 0x02 /* sleeping on state */
111 #define TASK_SW_ELIGIBLE 0x04 /* eligible for swapping */
116 extern void task_swapper_init(void);
117 extern kern_return_t
task_swapin(
119 boolean_t
); /* make_unswappable */
120 extern kern_return_t
task_swapout(task_t
/* task */);
121 extern void task_swapper(void);
122 extern void task_swap_swapout_thread(void);
123 extern void compute_vm_averages(void);
124 extern kern_return_t
task_swappable(
125 host_priv_t
, /* host */
127 boolean_t
); /* swappable */
128 extern void task_swapout_eligible(task_t
/* task */);
129 extern void task_swapout_ineligible(task_t
/* task */);
130 extern void swapout_ast(void);
132 #endif /* _KERN_TASK_SWAP_H_ */