]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/memory_object_control.defs
xnu-517.12.7.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 should_return : memory_object_return_t;
118 flags : integer_t;
119 lock_value : vm_prot_t
120 );
121
122
123 /*
124 */
125 routine memory_object_destroy(
126 memory_control : memory_object_control_t;
127 reason : kern_return_t);
128
129 /*
130 * The pager gets memory_object_data_request and memory_object_data_return
131 * calls to inform it that data within the memory object needs to be
132 * manipulated. Those requests simply identify the range in the memory
133 * object that needs servicing, but not the data itself. The pager
134 * turns around and requests one (or several) Universal Page Lists (UPLs)
135 * from the VM cache object associated with the memory object via one
136 * of the following calls. These UPLs are then committed (or aborted)
137 * in whole (or in ranges) as the processing completes.
138 */
139
140 routine memory_object_upl_request(
141 memory_control : memory_object_control_t;
142 in offset : memory_object_offset_t;
143 in size : vm_size_t;
144 out upl : upl_t;
145 out page_list : upl_page_info_array_t, CountInOut;
146 in cntrl_flags : integer_t);
147
148 routine memory_object_super_upl_request(
149 memory_control : memory_object_control_t;
150 in offset : memory_object_offset_t;
151 in size : vm_size_t;
152 in super_size : vm_size_t;
153 out upl : upl_t;
154 out page_list : upl_page_info_array_t, CountInOut;
155 in cntrl_flags : integer_t);
156
157 /*
158 * This functions allows a single page to be manipulated with less overhead
159 * than creating a UPL.
160 */
161 routine memory_object_page_op(
162 memory_control : memory_object_control_t;
163 in offset : memory_object_offset_t;
164 in ops : integer_t;
165 out phys_entry : uint32_t;
166 out flags : integer_t);
167
168 routine memory_object_recover_named(
169 memory_control : memory_object_control_t;
170 in wait_on_terminating : boolean_t);
171
172 routine memory_object_release_name(
173 memory_control : memory_object_control_t;
174 flags : integer_t);
175
176 routine memory_object_range_op(
177 memory_control : memory_object_control_t;
178 in offset_beg : memory_object_offset_t;
179 in offset_end : memory_object_offset_t;
180 in ops : integer_t;
181 out range : integer_t);
182
183