]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/memory_object.defs
xnu-344.tar.gz
[apple/xnu.git] / osfmk / mach / memory_object.defs
CommitLineData
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
59subsystem
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
76serverprefix dp_;
1c79356b
A
77#endif
78
79/*
80 * Initialize the specified memory object, providing
0b4e3aa0
A
81 * a memory object control reference on which to make
82 * cache control calls.
1c79356b
A
83 * [To allow the mapping of this object to be used, the
84 * memory manager must call memory_object_set_attributes,
85 * specifying the "ready" parameter as TRUE. To reject
86 * all mappings of this object, the memory manager may
87 * use memory_object_destroy.]
88 */
0b4e3aa0 89routine memory_object_init(
1c79356b 90 memory_object : memory_object_t;
0b4e3aa0 91 memory_control : memory_object_control_t;
1c79356b
A
92 memory_object_page_size : vm_size_t);
93
94
95/*
96 * Indicates that the specified memory object is no longer
97 * mapped (or cached -- see memory_object_set_attributes),
98 * and that further mappings will cause another memory_object_init
0b4e3aa0 99 * call to be made.
1c79356b 100 *
0b4e3aa0
A
101 * [The kernel will release its reference on the memory object
102 * after this call returns. The memory object control associated
103 * with the memory object is no longer usable - the pager should
104 * drop the control reference granted to it by memory_object_init.]
1c79356b 105 */
0b4e3aa0
A
106routine memory_object_terminate(
107 memory_object : memory_object_t);
1c79356b
A
108
109/*
110 * Request data from this memory object. At least
111 * the specified data should be returned with at
112 * least the specified access permitted.
113 *
0b4e3aa0 114 * [Response should be upl commit over the specified range.]
1c79356b 115 */
0b4e3aa0 116routine memory_object_data_request(
1c79356b 117 memory_object : memory_object_t;
1c79356b
A
118 offset : memory_object_offset_t;
119 length : vm_size_t;
120 desired_access : vm_prot_t);
121
1c79356b
A
122/*
123 * Return data to manager. This call is used in place of data_write
124 * for objects initialized by object_ready instead of set_attributes.
125 * This call indicates whether the returned data is dirty and whether
126 * the kernel kept a copy. Precious data remains precious if the
127 * kernel keeps a copy. The indication that the kernel kept a copy
128 * is only a hint if the data is not precious; the cleaned copy may
129 * be discarded without further notifying the manager.
130 *
0b4e3aa0 131 * [response should be a upl_commit over the range specified]
1c79356b 132 */
0b4e3aa0 133routine memory_object_data_return(
1c79356b 134 memory_object : memory_object_t;
1c79356b 135 offset : memory_object_offset_t;
0b4e3aa0 136 size : vm_size_t;
1c79356b
A
137 dirty : boolean_t;
138 kernel_copy : boolean_t);
139
0b4e3aa0
A
140/*
141 * Provide initial data contents for this region of
142 * the memory object. If data has already been written
143 * to the object, this value must be discarded; otherwise,
144 * this call acts identically to memory_object_data_return.
145 *
146 * [response should be UPL commit over the specified range.]
147 */
148routine memory_object_data_initialize(
149 memory_object : memory_object_t;
150 offset : memory_object_offset_t;
151 size : vm_size_t);
152
153/*
154 * Request that the specified portion of this
155 * memory object be unlocked to allow the specified
156 * forms of access; the kernel already has the data.
157 *
158 * [Response should be memory_object_lock_request when
159 * the operation is fully complete.]
160 */
161routine memory_object_data_unlock(
162 memory_object : memory_object_t;
163 offset : memory_object_offset_t;
164 size : vm_size_t;
165 desired_access : vm_prot_t);
1c79356b 166
1c79356b 167
0b4e3aa0
A
168/*
169 * Request that the specified portion of this
170 * memory object be synchronized with its backing
171 * store according to the supplied flags.
172 *
173 * [Response should be memory_object_synchronize_completed when
174 * the operation is fully complete.]
175 */
176routine memory_object_synchronize(
177 memory_object : memory_object_t;
178 offset : memory_object_offset_t;
179 size : vm_size_t;
180 sync_flags : vm_sync_t );
1c79356b
A
181
182/*
0b4e3aa0
A
183 * Notify the pager that the specified memory object
184 * has no other (mapped) references besides the named
185 * reference held by the pager itself.
186 *
187 * [Response should be a release of the named reference when
188 * the pager deems that appropriate.]
1c79356b 189 */
0b4e3aa0
A
190routine memory_object_unmap(
191 memory_object : memory_object_t);
192
193