2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
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.
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.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
59 * File: mach/memory_object_control.defs
62 * Basic Mach external memory management interface declaration.
68 #endif /* KERNEL_USER */
71 #endif /* KERNEL_SERVER */
72 memory_object_control 2000;
75 #include <advisory_pageout.h>
76 #endif /* MACH_KERNEL */
78 #include <mach/std_types.defs>
79 #include <mach/mach_types.defs>
82 * Retrieves the attributes currently associated with
85 routine memory_object_get_attributes(
86 memory_control : memory_object_control_t;
87 flavor : memory_object_flavor_t;
88 out attributes : memory_object_info_t, CountInOut);
91 routine memory_object_change_attributes(
92 memory_control : memory_object_control_t;
93 flavor : memory_object_flavor_t;
94 attributes : memory_object_info_t
97 routine memory_object_synchronize_completed (
98 memory_control : memory_object_control_t;
99 offset : memory_object_offset_t;
100 length : memory_object_size_t);
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"
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
119 routine memory_object_lock_request(
120 memory_control : memory_object_control_t;
121 offset : memory_object_offset_t;
122 size : memory_object_size_t;
123 out resid_offset : memory_object_offset_t;
124 out io_errno : integer_t;
125 should_return : memory_object_return_t;
127 lock_value : vm_prot_t
133 routine memory_object_destroy(
134 memory_control : memory_object_control_t;
135 reason : kern_return_t);
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.
148 routine memory_object_upl_request(
149 memory_control : memory_object_control_t;
150 in offset : memory_object_offset_t;
151 in size : upl_size_t;
153 out page_list : upl_page_info_array_t, CountInOut;
154 in cntrl_flags : integer_t);
156 routine memory_object_super_upl_request(
157 memory_control : memory_object_control_t;
158 in offset : memory_object_offset_t;
159 in size : upl_size_t;
160 in super_size : upl_size_t;
162 out page_list : upl_page_info_array_t, CountInOut;
163 in cntrl_flags : integer_t);
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 out io_streaming : uint32_t;
171 in fault_info : memory_object_fault_info_t);
174 * This functions allows a single page to be manipulated with less overhead
175 * than creating a UPL.
177 routine memory_object_page_op(
178 memory_control : memory_object_control_t;
179 in offset : memory_object_offset_t;
181 out phys_entry : uint32_t;
182 out flags : integer_t);
184 routine memory_object_recover_named(
185 memory_control : memory_object_control_t;
186 in wait_on_terminating : boolean_t);
188 routine memory_object_release_name(
189 memory_control : memory_object_control_t;
192 routine memory_object_range_op(
193 memory_control : memory_object_control_t;
194 in offset_beg : memory_object_offset_t;
195 in offset_end : memory_object_offset_t;
197 out range : integer_t);
199 /* vim: set ft=c : */