1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
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.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
35 *
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.
41 *
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.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
49 *  School of Computer Science
50 *  Carnegie Mellon University
51 *  Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58/*
59 * File:	mach/memory_object_control.defs
60 *
61 * Abstract:
62 *	Basic Mach external memory management interface declaration.
63 */
64
65subsystem
66#if	KERNEL_USER
67	  KernelUser
68#endif	/* KERNEL_USER */
69#if	KERNEL_SERVER
70	  KernelServer
71#endif	/* KERNEL_SERVER */
72		     memory_object_control 2000;
73
74#include <mach/std_types.defs>
75#include <mach/mach_types.defs>
76
77/*
78 *      Retrieves the attributes currently associated with
79 *      a memory object.
80 */
81routine memory_object_get_attributes(
82                memory_control	: memory_object_control_t;
83		flavor		: memory_object_flavor_t;
84	out	attributes	: memory_object_info_t, CountInOut);
85
86
87routine memory_object_change_attributes(
88                memory_control	: memory_object_control_t;
89                flavor          : memory_object_flavor_t;
90        	attributes      : memory_object_info_t
91		);
92
93routine memory_object_synchronize_completed (
94		memory_control	: memory_object_control_t;
95		offset		: memory_object_offset_t;
96		length		: memory_object_size_t);
97
98/*
99 *	Control use of the data associated with the given
100 *	memory object.  For each page in the given range,
101 *	perform the following operations, in order:
102 *		1)  restrict access to the page (disallow
103 *		    forms specified by "prot");
104 *		2)  write back modifications (if "should_return"
105 *		    is RETURN_DIRTY and the page is dirty, or
106 *		    "should_return" is RETURN_ALL and the page
107 * 		    is either dirty or precious); and,
108 *		3)  flush the cached copy (if "should_flush"
109 *		    is asserted).
110 *	The set of pages is defined by a starting offset
111 *	("offset") and size ("size").  Only pages with the
112 *	same page alignment as the starting offset are
113 *	considered.
114 */
115routine memory_object_lock_request(
116		memory_control	: memory_object_control_t;
117		offset		: memory_object_offset_t;
118		size		: memory_object_size_t;
119	out	resid_offset	: memory_object_offset_t;
120	out	io_errno	: integer_t;
121		should_return	: memory_object_return_t;
122		flags		: integer_t;
123		lock_value	: vm_prot_t
124		);
125
126
127/*
128 */
129routine memory_object_destroy(
130		memory_control	: memory_object_control_t;
131		reason		: kern_return_t);
132
133/*
134 *	The pager gets memory_object_data_request and memory_object_data_return
135 *	calls to inform it that data within the memory object needs to be
136 *	manipulated.  Those requests simply identify the range in the memory
137 *	object that needs servicing, but not the data itself.  The pager
138 *	turns around and requests one (or several) Universal Page Lists (UPLs)
139 *	from the VM cache object associated with the memory object via one
140 *	of the following calls.  These UPLs are then committed (or aborted)
141 *	in whole (or in ranges) as the processing completes.
142 */
143
144routine memory_object_upl_request(
145		memory_control	: memory_object_control_t;
146	in	offset		: memory_object_offset_t;
147	in	size		: upl_size_t;
148	out	upl		: upl_t;
149	out	page_list	: upl_page_info_array_t, CountInOut;
150	in	cntrl_flags	: integer_t);
151
152routine memory_object_super_upl_request(
153		memory_control		: memory_object_control_t;
154	in	offset		: memory_object_offset_t;
155	in	size		: upl_size_t;
156	in	super_size	: upl_size_t;
157	out	upl		: upl_t;
158	out	page_list	: upl_page_info_array_t, CountInOut;
159	in	cntrl_flags	: integer_t);
160
161
162routine memory_object_cluster_size(
163		control		: memory_object_control_t;
164	out	start		: memory_object_offset_t;
165	out	length		: vm_size_t;
166	out	io_streaming	: uint32_t;
167	in	fault_info	: memory_object_fault_info_t);
168
169/*
170 * This functions allows a single page to be manipulated with less overhead
171 * than creating a UPL.
172 */
173routine memory_object_page_op(
174		memory_control	: memory_object_control_t;
175	in	offset		: memory_object_offset_t;
176	in	ops		: integer_t;
177	out	phys_entry	: uint32_t;
178	out	flags		: integer_t);
179
180routine memory_object_recover_named(
181		memory_control	: memory_object_control_t;
182	in	wait_on_terminating : boolean_t);
183
184routine memory_object_release_name(
185		memory_control	: memory_object_control_t;
186		flags		: integer_t);
187
188routine memory_object_range_op(
189		memory_control	: memory_object_control_t;
190	in	offset_beg	: memory_object_offset_t;
191	in	offset_end	: memory_object_offset_t;
192	in      ops             : integer_t;
193	out     range		: integer_t);
194
195/* vim: set ft=c : */
196