]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/memory_object_control.defs
xnu-792.6.76.tar.gz
[apple/xnu.git] / osfmk / mach / memory_object_control.defs
1 /*
2 * Copyright (c) 2000 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 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
29 *
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
35 *
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
39 *
40 * Carnegie Mellon requests users of this software to return to
41 *
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
46 *
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
49 */
50 /*
51 */
52 /*
53 * File: mach/memory_object_control.defs
54 *
55 * Abstract:
56 * Basic Mach external memory management interface declaration.
57 */
58
59 subsystem
60 #if KERNEL_USER
61 KernelUser
62 #endif /* KERNEL_USER */
63 #if KERNEL_SERVER
64 KernelServer
65 #endif /* KERNEL_SERVER */
66 memory_object_control 2000;
67
68 #ifdef MACH_KERNEL
69 #include <advisory_pageout.h>
70 #endif /* MACH_KERNEL */
71
72 #include <mach/std_types.defs>
73 #include <mach/mach_types.defs>
74
75 /*
76 * Retrieves the attributes currently associated with
77 * a memory object.
78 */
79 routine memory_object_get_attributes(
80 memory_control : memory_object_control_t;
81 flavor : memory_object_flavor_t;
82 out attributes : memory_object_info_t, CountInOut);
83
84
85 routine memory_object_change_attributes(
86 memory_control : memory_object_control_t;
87 flavor : memory_object_flavor_t;
88 attributes : memory_object_info_t
89 );
90
91 routine memory_object_synchronize_completed (
92 memory_control : memory_object_control_t;
93 offset : memory_object_offset_t;
94 length : vm_offset_t);
95
96 /*
97 * Control use of the data associated with the given
98 * memory object. For each page in the given range,
99 * perform the following operations, in order:
100 * 1) restrict access to the page (disallow
101 * forms specified by "prot");
102 * 2) write back modifications (if "should_return"
103 * is RETURN_DIRTY and the page is dirty, or
104 * "should_return" is RETURN_ALL and the page
105 * is either dirty or precious); and,
106 * 3) flush the cached copy (if "should_flush"
107 * is asserted).
108 * The set of pages is defined by a starting offset
109 * ("offset") and size ("size"). Only pages with the
110 * same page alignment as the starting offset are
111 * considered.
112 */
113 routine memory_object_lock_request(
114 memory_control : memory_object_control_t;
115 offset : memory_object_offset_t;
116 size : memory_object_size_t;
117 out resid_offset : memory_object_offset_t;
118 out io_errno : integer_t;
119 should_return : memory_object_return_t;
120 flags : integer_t;
121 lock_value : vm_prot_t
122 );
123
124
125 /*
126 */
127 routine memory_object_destroy(
128 memory_control : memory_object_control_t;
129 reason : kern_return_t);
130
131 /*
132 * The pager gets memory_object_data_request and memory_object_data_return
133 * calls to inform it that data within the memory object needs to be
134 * manipulated. Those requests simply identify the range in the memory
135 * object that needs servicing, but not the data itself. The pager
136 * turns around and requests one (or several) Universal Page Lists (UPLs)
137 * from the VM cache object associated with the memory object via one
138 * of the following calls. These UPLs are then committed (or aborted)
139 * in whole (or in ranges) as the processing completes.
140 */
141
142 routine memory_object_upl_request(
143 memory_control : memory_object_control_t;
144 in offset : memory_object_offset_t;
145 in size : vm_size_t;
146 out upl : upl_t;
147 out page_list : upl_page_info_array_t, CountInOut;
148 in cntrl_flags : integer_t);
149
150 routine memory_object_super_upl_request(
151 memory_control : memory_object_control_t;
152 in offset : memory_object_offset_t;
153 in size : vm_size_t;
154 in super_size : vm_size_t;
155 out upl : upl_t;
156 out page_list : upl_page_info_array_t, CountInOut;
157 in cntrl_flags : integer_t);
158
159 /*
160 * This functions allows a single page to be manipulated with less overhead
161 * than creating a UPL.
162 */
163 routine memory_object_page_op(
164 memory_control : memory_object_control_t;
165 in offset : memory_object_offset_t;
166 in ops : integer_t;
167 out phys_entry : uint32_t;
168 out flags : integer_t);
169
170 routine memory_object_recover_named(
171 memory_control : memory_object_control_t;
172 in wait_on_terminating : boolean_t);
173
174 routine memory_object_release_name(
175 memory_control : memory_object_control_t;
176 flags : integer_t);
177
178 routine memory_object_range_op(
179 memory_control : memory_object_control_t;
180 in offset_beg : memory_object_offset_t;
181 in offset_end : memory_object_offset_t;
182 in ops : integer_t;
183 out range : integer_t);
184
185