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