2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
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.
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.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * File: mach/memory_object.defs
56 * Basic Mach external memory management interface declaration.
69 #include <advisory_pageout.h>
70 #endif /* MACH_KERNEL */
72 #include <mach/std_types.defs>
73 #include <mach/mach_types.defs>
80 serverdemux seqnos_memory_object_server;
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.]
93 simpleroutine memory_object_init(
94 memory_object : memory_object_t;
96 msgseqno seqno : mach_port_seqno_t;
98 memory_control : memory_object_control_t =
99 MACH_MSG_TYPE_MAKE_SEND
101 memory_object_page_size : vm_size_t);
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.
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.]
115 simpleroutine memory_object_terminate(
116 memory_object : memory_object_t =
117 MACH_MSG_TYPE_MOVE_SEND
120 msgseqno seqno : mach_port_seqno_t;
122 memory_control : memory_object_control_t =
123 MACH_MSG_TYPE_MOVE_RECEIVE
127 * Request data from this memory object. At least
128 * the specified data should be returned with at
129 * least the specified access permitted.
131 * [Reply should be memory_object_data_provided.]
133 simpleroutine memory_object_data_request(
134 memory_object : memory_object_t;
136 msgseqno seqno : mach_port_seqno_t;
138 memory_control : memory_object_control_t =
139 MACH_MSG_TYPE_MAKE_SEND
141 offset : memory_object_offset_t;
143 desired_access : vm_prot_t);
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.
150 * [Reply should be memory_object_lock_request.]
152 simpleroutine memory_object_data_unlock(
153 memory_object : memory_object_t;
155 msgseqno seqno : mach_port_seqno_t;
157 memory_control : memory_object_control_t =
158 MACH_MSG_TYPE_MAKE_SEND
160 offset : memory_object_offset_t;
162 desired_access : vm_prot_t);
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.
170 * [No reply expected.]
172 simpleroutine memory_object_lock_completed(
173 memory_object : memory_object_t =
174 polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
177 msgseqno seqno : mach_port_seqno_t;
179 memory_control : memory_object_control_t =
180 MACH_MSG_TYPE_MAKE_SEND
182 offset : memory_object_offset_t;
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.
196 * [Reply should be vm_deallocate to release the data.]
198 simpleroutine memory_object_data_return(
199 memory_object : memory_object_t;
201 msgseqno seqno : mach_port_seqno_t;
203 memory_control : memory_object_control_t =
204 MACH_MSG_TYPE_MAKE_SEND
206 offset : memory_object_offset_t;
209 kernel_copy : boolean_t);
212 simpleroutine memory_object_synchronize(
213 memory_object : memory_object_t;
215 msgseqno seqno : mach_port_seqno_t;
217 memory_control : memory_object_control_t =
218 MACH_MSG_TYPE_MAKE_SEND
220 offset : memory_object_offset_t;
221 length : vm_offset_t;
222 sync_flags : vm_sync_t );
226 * Confirm a successful memory_object_change attributes message.
228 simpleroutine memory_object_change_completed(
229 memory_object : memory_object_t =
230 polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
233 msgseqno seqno : mach_port_seqno_t;
235 memory_control : memory_object_control_t =
236 MACH_MSG_TYPE_MAKE_SEND
238 flavor : memory_object_flavor_t);