xref: /xnu-11215.41.3/osfmk/mach/vm32_map.defs (revision 33de042d024d46de5ff4e89f2471de6608e37fa4)
1/*
2 * Copyright (c) 2000-2016 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_FREE_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 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  [email protected]
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/vm_map.defs
60 *
61 *	Exported kernel VM calls for 32-bit client tasks.
62 */
63
64subsystem
65#if	KERNEL_SERVER || KOBJECT_SERVER
66	KernelServer
67#endif	/* KERNEL_SERVER || KOBJECT_SERVER */
68	  map 3800;
69
70#if KERNEL_SERVER
71#define VM_KERNEL_SERVER 1
72#endif
73
74serverprefix vm32_;
75
76#include <mach/std_types.defs>
77#include <mach/mach_types.defs>
78#include <mach_debug/mach_debug_types.defs>
79
80#ifdef VM32_SUPPORT
81
82/* See vm_map.defs for more information */
83
84routine region(
85                target_task     : vm_map_read_t;
86	inout	address		: vm32_address_t;
87        out     size            : vm32_size_t;
88		flavor		: vm_region_flavor_t;
89	out	info		: vm_region_info_t, CountInOut;
90        out     object_name     : memory_object_name_t =
91                                        MACH_MSG_TYPE_MOVE_SEND
92                                        ctype: mach_port_t);
93
94routine allocate(
95		target_task	: vm_task_entry_t;
96	inout	address		: VM_USE_TMPTYPE(vm32_address_t);
97		size		: VM_USE_TMPTYPE(vm32_size_t);
98		flags		: int);
99
100routine deallocate(
101		target_task	: vm_task_entry_t;
102		address		: VM_USE_TMPTYPE(vm32_address_t);
103		size		: VM_USE_TMPTYPE(vm32_size_t));
104
105routine protect(
106		target_task	: vm_task_entry_t;
107		address		: vm32_address_t;
108		size		: vm32_size_t;
109		set_maximum	: boolean_t;
110		new_protection	: vm_prot_t);
111
112routine inherit(
113		target_task	: vm_task_entry_t;
114		address		: vm32_address_t;
115		size		: vm32_size_t;
116		new_inheritance	: vm_inherit_t);
117
118routine read(
119		target_task	: vm_map_read_t;
120		address		: VM_USE_TMPTYPE(vm32_address_t);
121		size		: VM_USE_TMPTYPE(vm32_size_t);
122	out	data		: pointer_t);
123
124routine read_list(
125		target_task 	: vm_map_read_t;
126	inout	data_list   	: vm32_read_entry_t;
127		count		: natural_t);
128
129routine write(
130		target_task	: vm_map_t;
131		address		: VM_USE_TMPTYPE(vm32_address_t);
132		data		: pointer_t);
133
134routine copy(
135		target_task	: vm_map_t;
136		source_address	: VM_USE_TMPTYPE(vm32_address_t);
137		size		: VM_USE_TMPTYPE(vm32_size_t);
138		dest_address	: VM_USE_TMPTYPE(vm32_address_t));
139
140routine read_overwrite(
141		target_task	: vm_map_read_t;
142		address		: VM_USE_TMPTYPE(vm32_address_t);
143		size		: VM_USE_TMPTYPE(vm32_size_t);
144		data		: VM_USE_TMPTYPE(vm32_address_t);
145	out	outsize		: VM_USE_TMPTYPE(vm32_size_t));
146
147
148routine msync(
149		target_task	: vm_map_t;
150		address		: vm32_address_t;
151		size		: vm32_size_t;
152		sync_flags	: vm_sync_t );
153
154routine behavior_set(
155		target_task	: vm_map_t;
156		address		: vm32_address_t;
157		size		: vm32_size_t;
158		new_behavior	: vm_behavior_t);
159
160routine map(
161		target_task	: vm_task_entry_t;
162	inout	address		: VM_USE_TMPTYPE(vm32_address_t);
163		size		: VM_USE_TMPTYPE(vm32_size_t);
164		mask		: VM_USE_TMPTYPE(vm32_address_t);
165		flags		: int;
166		object		: mem_entry_name_port_t;
167		offset		: VM_USE_TMPTYPE(vm32_offset_t);
168		copy		: boolean_t;
169		cur_protection	: VM_USE_TMPTYPE(vm_prot_t);
170		max_protection	: VM_USE_TMPTYPE(vm_prot_t);
171		inheritance	: VM_USE_TMPTYPE(vm_inherit_t));
172
173routine machine_attribute(
174		target_task	: vm_map_t;
175		address		: vm32_address_t;
176		size		: vm32_size_t;
177		attribute	: vm_machine_attribute_t;
178	inout	value		: vm_machine_attribute_val_t);
179
180routine remap(
181		target_task	: vm_map_t;
182	inout	target_address	: VM_USE_TMPTYPE(vm32_address_t);
183		size		: VM_USE_TMPTYPE(vm32_size_t);
184		mask		: VM_USE_TMPTYPE(vm32_address_t);
185		anywhere	: boolean_t;
186		src_task	: vm_map_t;
187		src_address	: VM_USE_TMPTYPE(vm32_address_t);
188		copy		: boolean_t;
189	out	cur_protection	: VM_USE_TMPTYPE(vm_prot_t);
190	out	max_protection	: VM_USE_TMPTYPE(vm_prot_t);
191		inheritance	: VM_USE_TMPTYPE(vm_inherit_t));
192
193routine _task_wire(
194		target_task	: vm_map_t;
195		must_wire	: boolean_t);
196
197routine make_memory_entry(
198		target_task	:vm_map_t;
199	inout	size		:VM_USE_TMPTYPE(vm32_size_t);
200		offset		:VM_USE_TMPTYPE(vm32_offset_t);
201		permission	:VM_USE_TMPTYPE(vm_prot_t);
202	out	object_handle	:mem_entry_name_port_move_send_t;
203		parent_entry	:mem_entry_name_port_t);
204
205routine map_page_query(
206                target_map      :vm_map_read_t;
207                offset          :vm32_offset_t;
208        out     disposition     :integer_t;
209        out     ref_count       :integer_t);
210
211routine region_info(
212		task		: vm_map_read_t;
213		address		: vm32_address_t;
214	out	region		: vm_info_region_t;
215	out	objects		: vm_info_object_array_t);
216
217routine mapped_pages_info(
218		task		: vm_map_read_t;
219	out	pages		: page_address_array_t);
220
221skip; /* was vm_region_object_create */
222
223routine region_recurse(
224                target_task     : vm_map_read_t;
225	inout	address		: vm32_address_t;
226        out     size            : vm32_size_t;
227	inout	nesting_depth	: natural_t;
228	out	info		: vm_region_recurse_info_t,CountInOut);
229
230routine region_recurse_64(
231                target_task     : vm_map_read_t;
232	inout	address		: vm32_address_t;
233        out     size            : vm32_size_t;
234	inout	nesting_depth	: natural_t;
235	out	info		: vm_region_recurse_info_t,CountInOut);
236
237routine region_info_64(
238		task		: vm_map_read_t;
239		address		: vm32_address_t;
240	out	region		: vm_info_region_64_t;
241	out	objects		: vm_info_object_array_t);
242
243routine region_64(
244                target_task     : vm_map_read_t;
245	inout	address		: vm32_address_t;
246        out     size            : vm32_size_t;
247		flavor		: vm_region_flavor_t;
248	out	info		: vm_region_info_t, CountInOut;
249        out     object_name     : memory_object_name_t =
250                                        MACH_MSG_TYPE_MOVE_SEND
251                                        ctype: mach_port_t);
252
253routine make_memory_entry_64(
254		target_task	:vm_map_t;
255	inout	size		:VM_USE_TMPTYPE(memory_object_size_t);
256		offset		:VM_USE_TMPTYPE(memory_object_offset_t);
257		permission	:VM_USE_TMPTYPE(vm_prot_t);
258	out	object_handle	:mach_port_move_send_t;
259		parent_entry	:mem_entry_name_port_t);
260
261
262
263routine map_64(
264		target_task	: vm_task_entry_t;
265	inout	address		: VM_USE_TMPTYPE(vm32_address_t);
266		size		: VM_USE_TMPTYPE(vm32_size_t);
267		mask		: VM_USE_TMPTYPE(vm32_address_t);
268		flags		: int;
269		object		: mem_entry_name_port_t;
270		offset		: VM_USE_TMPTYPE(memory_object_offset_t);
271		copy		: boolean_t;
272		cur_protection	: VM_USE_TMPTYPE(vm_prot_t);
273		max_protection	: VM_USE_TMPTYPE(vm_prot_t);
274		inheritance	: VM_USE_TMPTYPE(vm_inherit_t));
275
276skip; /* was vm_map_get_upl */
277skip; /* was vm_upl_map */
278skip; /* was vm_upl_unmap */
279
280routine purgable_control(
281		target_task	: vm_map_t;
282		address		: vm32_address_t;
283		control		: vm_purgable_t;
284	inout	state		: int);
285
286
287routine _map_exec_lockdown(
288		target_task : vm_map_t);
289
290
291#endif /* VM32_SUPPORT */
292
293/* vim: set ft=c : */
294