]> git.saurik.com Git - apple/xnu.git/blob - osfmk/kern/task_swap.c
xnu-792.10.96.tar.gz
[apple/xnu.git] / osfmk / kern / task_swap.c
1 /*
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 */
25 /*
26 * File: kern/task_swap.c
27 *
28 * Task residency management primitives implementation.
29 */
30 #include <mach_assert.h>
31 #include <task_swapper.h>
32
33 #include <kern/spl.h>
34 #include <kern/lock.h>
35 #include <kern/queue.h>
36 #include <kern/host.h>
37 #include <kern/task.h>
38 #include <kern/task_swap.h>
39 #include <kern/thread.h>
40 #include <kern/host_statistics.h>
41 #include <kern/misc_protos.h>
42 #include <kern/assert.h>
43 #include <mach/policy.h>
44
45 #include <ipc/ipc_port.h> /* We use something from in here */
46
47 /*
48 * task_swappable: [exported]
49 *
50 * Make a task swappable or non-swappable. If made non-swappable,
51 * it will be swapped in.
52 */
53 kern_return_t
54 task_swappable(
55 host_priv_t host_priv,
56 task_t task,
57 __unused boolean_t make_swappable)
58 {
59 if (host_priv == HOST_PRIV_NULL)
60 return (KERN_INVALID_ARGUMENT);
61
62 if (task == TASK_NULL)
63 return (KERN_INVALID_ARGUMENT);
64
65 /*
66 * We don't support swapping, this call is purely advisory.
67 */
68 return (KERN_SUCCESS);
69 }