]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/memory_object_control.defs
xnu-792.13.8.tar.gz
[apple/xnu.git] / osfmk / mach / memory_object_control.defs
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
8ad349bb
A
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 * @OSF_COPYRIGHT@
32 */
33/*
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
36 * All Rights Reserved.
37 *
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
43 *
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
47 *
48 * Carnegie Mellon requests users of this software to return to
49 *
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
57 */
58/*
59 */
60/*
0b4e3aa0 61 * File: mach/memory_object_control.defs
1c79356b
A
62 *
63 * Abstract:
64 * Basic Mach external memory management interface declaration.
65 */
66
67subsystem
68#if KERNEL_USER
69 KernelUser
55e303ae 70#endif /* KERNEL_USER */
1c79356b
A
71#if KERNEL_SERVER
72 KernelServer
55e303ae 73#endif /* KERNEL_SERVER */
1c79356b
A
74 memory_object_control 2000;
75
76#ifdef MACH_KERNEL
77#include <advisory_pageout.h>
78#endif /* MACH_KERNEL */
79
80#include <mach/std_types.defs>
81#include <mach/mach_types.defs>
82
1c79356b
A
83/*
84 * Retrieves the attributes currently associated with
85 * a memory object.
86 */
87routine memory_object_get_attributes(
0b4e3aa0 88 memory_control : memory_object_control_t;
1c79356b
A
89 flavor : memory_object_flavor_t;
90 out attributes : memory_object_info_t, CountInOut);
91
92
0b4e3aa0
A
93routine memory_object_change_attributes(
94 memory_control : memory_object_control_t;
1c79356b
A
95 flavor : memory_object_flavor_t;
96 attributes : memory_object_info_t
1c79356b
A
97 );
98
0b4e3aa0
A
99routine memory_object_synchronize_completed (
100 memory_control : memory_object_control_t;
101 offset : memory_object_offset_t;
102 length : vm_offset_t);
1c79356b
A
103
104/*
105 * Control use of the data associated with the given
106 * memory object. For each page in the given range,
107 * perform the following operations, in order:
108 * 1) restrict access to the page (disallow
109 * forms specified by "prot");
110 * 2) write back modifications (if "should_return"
111 * is RETURN_DIRTY and the page is dirty, or
112 * "should_return" is RETURN_ALL and the page
113 * is either dirty or precious); and,
114 * 3) flush the cached copy (if "should_flush"
115 * is asserted).
116 * The set of pages is defined by a starting offset
117 * ("offset") and size ("size"). Only pages with the
118 * same page alignment as the starting offset are
119 * considered.
1c79356b 120 */
0b4e3aa0
A
121routine memory_object_lock_request(
122 memory_control : memory_object_control_t;
1c79356b
A
123 offset : memory_object_offset_t;
124 size : memory_object_size_t;
91447636
A
125 out resid_offset : memory_object_offset_t;
126 out io_errno : integer_t;
1c79356b
A
127 should_return : memory_object_return_t;
128 flags : integer_t;
129 lock_value : vm_prot_t
1c79356b
A
130 );
131
132
1c79356b
A
133/*
134 */
0b4e3aa0
A
135routine memory_object_destroy(
136 memory_control : memory_object_control_t;
1c79356b
A
137 reason : kern_return_t);
138
139/*
0b4e3aa0
A
140 * The pager gets memory_object_data_request and memory_object_data_return
141 * calls to inform it that data within the memory object needs to be
142 * manipulated. Those requests simply identify the range in the memory
143 * object that needs servicing, but not the data itself. The pager
144 * turns around and requests one (or several) Universal Page Lists (UPLs)
145 * from the VM cache object associated with the memory object via one
146 * of the following calls. These UPLs are then committed (or aborted)
147 * in whole (or in ranges) as the processing completes.
1c79356b
A
148 */
149
0b4e3aa0
A
150routine memory_object_upl_request(
151 memory_control : memory_object_control_t;
152 in offset : memory_object_offset_t;
153 in size : vm_size_t;
154 out upl : upl_t;
155 out page_list : upl_page_info_array_t, CountInOut;
156 in cntrl_flags : integer_t);
157
158routine memory_object_super_upl_request(
159 memory_control : memory_object_control_t;
160 in offset : memory_object_offset_t;
161 in size : vm_size_t;
162 in super_size : vm_size_t;
163 out upl : upl_t;
164 out page_list : upl_page_info_array_t, CountInOut;
165 in cntrl_flags : integer_t);
166
167/*
168 * This functions allows a single page to be manipulated with less overhead
169 * than creating a UPL.
170 */
171routine memory_object_page_op(
172 memory_control : memory_object_control_t;
173 in offset : memory_object_offset_t;
174 in ops : integer_t;
55e303ae 175 out phys_entry : uint32_t;
0b4e3aa0
A
176 out flags : integer_t);
177
178routine memory_object_recover_named(
179 memory_control : memory_object_control_t;
180 in wait_on_terminating : boolean_t);
181
182routine memory_object_release_name(
183 memory_control : memory_object_control_t;
184 flags : integer_t);
185
55e303ae
A
186routine memory_object_range_op(
187 memory_control : memory_object_control_t;
188 in offset_beg : memory_object_offset_t;
189 in offset_end : memory_object_offset_t;
190 in ops : integer_t;
191 out range : integer_t);
0b4e3aa0
A
192
193