]>
Commit | Line | Data |
---|---|---|
1c79356b A |
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.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 2200; | |
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 | #if KERNEL_SERVER | |
76 | serverprefix dp_; | |
77 | #else | |
78 | #if SEQNOS | |
79 | serverprefix seqnos_; | |
80 | serverdemux seqnos_memory_object_server; | |
81 | #endif SEQNOS | |
82 | #endif | |
83 | ||
84 | /* | |
85 | * Initialize the specified memory object, providing | |
86 | * a reqeust port on which control calls can be made. | |
87 | * [To allow the mapping of this object to be used, the | |
88 | * memory manager must call memory_object_set_attributes, | |
89 | * specifying the "ready" parameter as TRUE. To reject | |
90 | * all mappings of this object, the memory manager may | |
91 | * use memory_object_destroy.] | |
92 | */ | |
93 | simpleroutine memory_object_init( | |
94 | memory_object : memory_object_t; | |
95 | #if SEQNOS | |
96 | msgseqno seqno : mach_port_seqno_t; | |
97 | #endif SEQNOS | |
98 | memory_control : memory_object_control_t = | |
99 | MACH_MSG_TYPE_MAKE_SEND | |
100 | ctype: mach_port_t; | |
101 | memory_object_page_size : vm_size_t); | |
102 | ||
103 | ||
104 | /* | |
105 | * Indicates that the specified memory object is no longer | |
106 | * mapped (or cached -- see memory_object_set_attributes), | |
107 | * and that further mappings will cause another memory_object_init | |
108 | * call to be made. No further calls will be made on | |
109 | * the memory object by this kernel. | |
110 | * | |
111 | * [All rights to the control and name ports are included | |
112 | * in this call. The memory manager should use port_deallocate | |
113 | * to release them once they are no longer needed.] | |
114 | */ | |
115 | simpleroutine memory_object_terminate( | |
116 | memory_object : memory_object_t = | |
117 | MACH_MSG_TYPE_MOVE_SEND | |
118 | ctype: mach_port_t; | |
119 | #if SEQNOS | |
120 | msgseqno seqno : mach_port_seqno_t; | |
121 | #endif SEQNOS | |
122 | memory_control : memory_object_control_t = | |
123 | MACH_MSG_TYPE_MOVE_RECEIVE | |
124 | ctype: mach_port_t); | |
125 | ||
126 | /* | |
127 | * Request data from this memory object. At least | |
128 | * the specified data should be returned with at | |
129 | * least the specified access permitted. | |
130 | * | |
131 | * [Reply should be memory_object_data_provided.] | |
132 | */ | |
133 | simpleroutine memory_object_data_request( | |
134 | memory_object : memory_object_t; | |
135 | #if SEQNOS | |
136 | msgseqno seqno : mach_port_seqno_t; | |
137 | #endif SEQNOS | |
138 | memory_control : memory_object_control_t = | |
139 | MACH_MSG_TYPE_MAKE_SEND | |
140 | ctype: mach_port_t; | |
141 | offset : memory_object_offset_t; | |
142 | length : vm_size_t; | |
143 | desired_access : vm_prot_t); | |
144 | ||
145 | /* | |
146 | * Request that the specified portion of this | |
147 | * memory object be unlocked to allow the specified | |
148 | * forms of access; the kernel already has the data. | |
149 | * | |
150 | * [Reply should be memory_object_lock_request.] | |
151 | */ | |
152 | simpleroutine memory_object_data_unlock( | |
153 | memory_object : memory_object_t; | |
154 | #if SEQNOS | |
155 | msgseqno seqno : mach_port_seqno_t; | |
156 | #endif SEQNOS | |
157 | memory_control : memory_object_control_t = | |
158 | MACH_MSG_TYPE_MAKE_SEND | |
159 | ctype: mach_port_t; | |
160 | offset : memory_object_offset_t; | |
161 | length : vm_size_t; | |
162 | desired_access : vm_prot_t); | |
163 | ||
164 | /* | |
165 | * Indicate that a previous memory_object_lock_reqeust has been | |
166 | * completed. Note that this call is made on whatever | |
167 | * port is specified in the memory_object_lock_request; that port | |
168 | * need not be the memory object port itself. | |
169 | * | |
170 | * [No reply expected.] | |
171 | */ | |
172 | simpleroutine memory_object_lock_completed( | |
173 | memory_object : memory_object_t = | |
174 | polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE | |
175 | ctype: mach_port_t; | |
176 | #if SEQNOS | |
177 | msgseqno seqno : mach_port_seqno_t; | |
178 | #endif SEQNOS | |
179 | memory_control : memory_object_control_t = | |
180 | MACH_MSG_TYPE_MAKE_SEND | |
181 | ctype: mach_port_t; | |
182 | offset : memory_object_offset_t; | |
183 | length : vm_size_t); | |
184 | ||
185 | skip; | |
186 | ||
187 | /* | |
188 | * Return data to manager. This call is used in place of data_write | |
189 | * for objects initialized by object_ready instead of set_attributes. | |
190 | * This call indicates whether the returned data is dirty and whether | |
191 | * the kernel kept a copy. Precious data remains precious if the | |
192 | * kernel keeps a copy. The indication that the kernel kept a copy | |
193 | * is only a hint if the data is not precious; the cleaned copy may | |
194 | * be discarded without further notifying the manager. | |
195 | * | |
196 | * [Reply should be vm_deallocate to release the data.] | |
197 | */ | |
198 | simpleroutine memory_object_data_return( | |
199 | memory_object : memory_object_t; | |
200 | #if SEQNOS | |
201 | msgseqno seqno : mach_port_seqno_t; | |
202 | #endif SEQNOS | |
203 | memory_control : memory_object_control_t = | |
204 | MACH_MSG_TYPE_MAKE_SEND | |
205 | ctype: mach_port_t; | |
206 | offset : memory_object_offset_t; | |
207 | data : pointer_t; | |
208 | dirty : boolean_t; | |
209 | kernel_copy : boolean_t); | |
210 | ||
211 | ||
212 | simpleroutine memory_object_synchronize( | |
213 | memory_object : memory_object_t; | |
214 | #if SEQNOS | |
215 | msgseqno seqno : mach_port_seqno_t; | |
216 | #endif SEQNOS | |
217 | memory_control : memory_object_control_t = | |
218 | MACH_MSG_TYPE_MAKE_SEND | |
219 | ctype: mach_port_t; | |
220 | offset : memory_object_offset_t; | |
221 | length : vm_offset_t; | |
222 | sync_flags : vm_sync_t ); | |
223 | ||
224 | ||
225 | /* | |
226 | * Confirm a successful memory_object_change attributes message. | |
227 | */ | |
228 | simpleroutine memory_object_change_completed( | |
229 | memory_object : memory_object_t = | |
230 | polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE | |
231 | ctype: mach_port_t; | |
232 | #if SEQNOS | |
233 | msgseqno seqno : mach_port_seqno_t; | |
234 | #endif SEQNOS | |
235 | memory_control : memory_object_control_t = | |
236 | MACH_MSG_TYPE_MAKE_SEND | |
237 | ctype: mach_port_t; | |
238 | flavor : memory_object_flavor_t); | |
239 | ||
240 | ||
241 | skip; |