]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/mach_types.defs
xnu-792.17.14.tar.gz
[apple/xnu.git] / osfmk / mach / mach_types.defs
1 /*
2 * Copyright (c) 2000-2004 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 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 * Mach kernel interface type declarations
60 */
61
62 #ifndef _MACH_MACH_TYPES_DEFS_
63 #define _MACH_MACH_TYPES_DEFS_
64
65
66 #include <mach/std_types.defs>
67
68 type memory_object_offset_t = uint64_t;
69 type memory_object_size_t = uint64_t;
70 type memory_object_cluster_size_t = uint32_t;
71
72 #ifdef KERNEL_PRIVATE
73
74 /* Universal Page Lists - restricted to (in-kernel) pagers for now */
75 type upl_size_t = uint32_t;
76 type upl_offset_t = uint32_t;
77 type upl_page_info_t = struct[2] of integer_t;
78 type upl_page_info_array_t = array[*:256] of upl_page_info_t;
79
80 type upl_t = mach_port_t
81 intran: upl_t convert_port_to_upl(mach_port_t)
82 outtran: mach_port_t convert_upl_to_port(upl_t)
83 destructor: upl_deallocate(upl_t)
84 ;
85
86 #endif /* KERNEL_PRIVATE */
87
88 type mach_port_status_t = struct[10] of integer_t; /* obsolete */
89
90 /* mach_port_info_t: can hold either a
91 * mach_port_status_t (9 ints) or a
92 * mach_port_limits_t (1 int). If new flavors of
93 * mach_port_{get,set}_attributes are added, the size of
94 * this array may have to be increased. (See mach/port.h)
95 */
96 type mach_port_flavor_t = int;
97 type mach_port_info_t = array[*:10] of integer_t;
98
99 type task_t = mach_port_t
100 #if KERNEL_SERVER
101 intran: task_t convert_port_to_task(mach_port_t)
102 outtran: mach_port_t convert_task_to_port(task_t)
103 destructor: task_deallocate(task_t)
104 #endif /* KERNEL_SERVER */
105 ;
106
107 type thread_t = mach_port_t
108 #if KERNEL_SERVER
109 intran: thread_t convert_port_to_thread(mach_port_t)
110 outtran: mach_port_t convert_thread_to_port(thread_t)
111 destructor: thread_deallocate(thread_t)
112 #endif /* KERNEL_SERVER */
113 ;
114
115 type thread_act_t = mach_port_t
116 #if KERNEL_SERVER
117 intran: thread_act_t convert_port_to_thread(mach_port_t)
118 outtran: mach_port_t convert_thread_to_port(thread_act_t)
119 destructor: thread_deallocate(thread_act_t)
120 #endif /* KERNEL_SERVER */
121 ;
122
123 type thread_act_consume_ref_t = mach_port_move_send_t
124 cusertype: thread_act_t
125 #if KERNEL_SERVER
126 intran: thread_act_t convert_port_to_thread(mach_port_t)
127 destructor: thread_deallocate(thread_act_t)
128 #endif /* KERNEL_SERVER */
129 ;
130
131 /* thread_state_t: This inline array can hold
132 * a machine-dependent amount of data, defined in
133 * mach/machine/???? (currently THREAD_STATE_MAX,
134 * in mach/thread_state.h)
135 */
136 #include <mach/machine/thread_state.h>
137 type thread_state_flavor_t = int;
138 type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t;
139
140 type task_array_t = ^array[] of task_t;
141 type thread_array_t = ^array[] of thread_t;
142 type thread_act_array_t = ^array[] of thread_act_t;
143 type act_params_t = array[6] of int;
144
145 type vm_map_t = mach_port_t
146 #if KERNEL_SERVER
147 intran: vm_map_t convert_port_to_map(mach_port_t)
148 destructor: vm_map_deallocate(vm_map_t)
149 #endif /* KERNEL_SERVER */
150 ;
151
152 type vm_task_entry_t = mach_port_t
153 cusertype: vm_map_t
154 #if KERNEL_SERVER
155 intran: vm_map_t convert_port_entry_to_map(mach_port_t)
156 destructor: vm_map_deallocate(vm_map_t)
157 #endif /* KERNEL_SERVER */
158 ;
159
160 type ipc_space_t = mach_port_t
161 #if KERNEL_SERVER
162 intran: ipc_space_t convert_port_to_space(mach_port_t)
163 destructor: space_deallocate(ipc_space_t)
164 #endif /* KERNEL_SERVER */
165 ;
166
167 type vm_prot_t = int;
168 type vm_inherit_t = int;
169 type vm_purgable_t = int;
170 type xxx_vm_statistics_data_t = struct[13] of integer_t;
171 type vm_behavior_t = int;
172 type vm_statistics_data_t = struct[14] of integer_t;
173 type vm_machine_attribute_t = int;
174 type vm_machine_attribute_val_t = int;
175 type vm_sync_t = int;
176
177 /* thread_info_t: this inline array can hold any of:
178 * thread_basic_info_t (10 ints)
179 * policy_timeshare_info_t (5 ints)
180 * policy_fifo_info_t (4 ints)
181 * policy_rr_info_t (5 ints)
182 * if other thread_info flavors are added, this
183 * definition may need to be changed. (See
184 * mach/thread_info.h and mach/policy.h) */
185 type thread_flavor_t = int;
186 type thread_info_t = array[*:12] of integer_t;
187
188 type thread_policy_flavor_t = natural_t;
189 type thread_policy_t = array[*:16] of integer_t;
190
191 /* task_info_t: this inline array can hold any of:
192 * task_basic_info_32_t (8 ints)
193 * task_basic_info_64_t (10 ints)
194 * task_events_info_t (8 ints)
195 * task_thread_times_info_t (4 ints)
196 * policy_timeshare_info_t (5 ints)
197 * policy_fifo_info_t (4 ints)
198 * policy_rr_info_t (5 ints)
199 * task security token (2 ints)
200 * task audit token (8 ints)
201 * If other task_info flavors are added, this
202 * definition may need to be changed. (See
203 * mach/task_info.h and mach/policy.h) */
204 type task_flavor_t = int;
205 type task_info_t = array[*:10] of integer_t;
206
207 type task_policy_flavor_t = natural_t;
208 type task_policy_t = array[*:16] of integer_t;
209
210 type mem_entry_name_port_t = mach_port_t
211 #if KERNEL_SERVER
212 intran: mem_entry_name_port_t null_conversion(mach_port_t)
213 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
214 #endif /* KERNEL_SERVER */
215 ;
216
217 type mem_entry_name_port_move_send_t = mach_port_move_send_t
218 cusertype: mem_entry_name_port_t
219 #if KERNEL_SERVER
220 intran: mem_entry_name_port_t null_conversion(mach_port_t)
221 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
222 #endif /* KERNEL_SERVER */
223 ;
224
225 type memory_object_default_t = mach_port_t
226 #if KERNEL_PRIVATE
227 intran: memory_object_default_t null_conversion(mach_port_t)
228 outtran: mach_port_t null_conversion(memory_object_default_t)
229 #endif /* KERNEL_PRIVATE */
230 ;
231
232 type memory_object_t = mach_port_t
233 #if KERNEL_PRIVATE
234 intran: memory_object_t convert_port_to_memory_object(mach_port_t)
235 outtran: mach_port_t convert_memory_object_to_port(memory_object_t)
236 #endif /* KERNEL_PRIVATE */
237 ;
238
239
240 type memory_object_control_t = mach_port_t
241 #if KERNEL_PRIVATE
242 intran: memory_object_control_t convert_port_to_mo_control(mach_port_t)
243 outtran: mach_port_t convert_mo_control_to_port(memory_object_control_t)
244 destructor: memory_object_control_deallocate(memory_object_control_t)
245 #endif /* KERNEL_PRIVATE */
246 ;
247
248 type memory_object_name_t = mach_port_t
249 ctype: mach_port_t
250 ;
251
252
253 type memory_object_copy_strategy_t = int;
254 type memory_object_return_t = int;
255
256 type machine_info_data_t = struct[5] of integer_t;
257 type machine_slot_data_t = struct[8] of integer_t;
258
259 type host_t = mach_port_t
260 #if KERNEL_SERVER
261 intran: host_t convert_port_to_host(mach_port_t)
262 outtran: mach_port_t convert_host_to_port(host_t)
263 #endif /* KERNEL_SERVER */
264 ;
265
266 type host_priv_t = mach_port_t
267 #if KERNEL_SERVER
268 intran: host_priv_t convert_port_to_host_priv(mach_port_t)
269 #endif /* KERNEL_SERVER */
270 ;
271
272 type host_security_t = mach_port_t
273 #if KERNEL_SERVER
274 intran: host_security_t convert_port_to_host_security(mach_port_t)
275 #endif /* KERNEL_SERVER */
276 ;
277
278 /* host_info_t: variable-sized inline array that can contain:
279 * host_basic_info_old_t (5 ints)
280 * host_basic_info_t (12 ints)
281 * host_sched_info_t (2 ints)
282 * kernel_resource_sizes_t (5 ints)
283 * host_load_info_t (6 ints)
284 * vm_statistics_t (14 ints)
285 * If other host_info flavors are added, this definition may
286 * need to be changed. (See mach/{host_info,vm_statistics}.h)
287 */
288 type host_flavor_t = int;
289 type host_info_t = array[*:14] of integer_t;
290
291 type processor_t = mach_port_t
292 #if KERNEL_SERVER
293 intran: processor_t convert_port_to_processor(mach_port_t)
294 outtran: mach_port_t convert_processor_to_port(processor_t)
295 #endif /* KERNEL_SERVER */
296 ;
297
298 type processor_array_t = ^array[] of processor_t;
299
300 /* processor_info_t: variable-sized inline array that can
301 * contain:
302 * processor_basic_info_t: (5 ints)
303 * processor_cpu_load_info_t:(4 ints)
304 * processor_machine_info_t :(12 ints)
305 * If other processor_info flavors are added, this definition
306 * may need to be changed. (See mach/processor_info.h) */
307 type processor_flavor_t = int;
308 type processor_info_t = array[*:12] of integer_t;
309 type processor_info_array_t = ^array[] of integer_t;
310
311 type processor_set_t = mach_port_t
312 #if KERNEL_SERVER
313 intran: processor_set_t convert_port_to_pset(mach_port_t)
314 outtran: mach_port_t convert_pset_to_port(processor_set_t)
315 destructor: pset_deallocate(processor_set_t)
316 #endif /* KERNEL_SERVER */
317 ;
318
319 type processor_set_array_t = ^array[] of processor_set_t;
320
321 type processor_set_name_t = mach_port_t
322 #if KERNEL_SERVER
323 intran: processor_set_name_t convert_port_to_pset_name(mach_port_t)
324 outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t)
325 destructor: pset_deallocate(processor_set_name_t)
326 #endif /* KERNEL_SERVER */
327 ;
328
329 type processor_set_name_array_t = ^array[] of processor_set_name_t;
330
331 /* processor_set_info_t: variable-size inline array
332 * that can hold:
333 * processor_set_basic_info (5 ints)
334 * processor_set_load_info (4 ints)
335 * policy_timeshare_base_t (1 int)
336 * policy_fifo_base_t (1 int)
337 * policy_rr_base_t (1 int)
338 * policy_timeshare_base_t (1 int)
339 * policy_fifo_base_t (1 int)
340 * policy_rr_base_t (1 int)
341 * policy_t (1 int)
342 * If other flavors are added, this definition may
343 * need to be changed. (see mach/processor.h) */
344 type processor_set_flavor_t = int;
345 type processor_set_info_t = array[*:5] of integer_t;
346
347 type bootstrap_t = mach_port_t;
348
349 type kernel_version_t = c_string[*:512];
350 type kernel_boot_info_t = c_string[*:4096];
351
352 type time_value_t = struct[2] of integer_t;
353
354 type mach_port_qos_t = struct[2] of integer_t;
355
356 type emulation_vector_t = ^array[] of vm_offset_t;
357
358 type inline_existence_map_t = array[*:512] of char;
359
360 type policy_t = int;
361 /* policy_info_t: variable-size inline array. Can hold:
362 * policy_timeshare_info_t (5 ints)
363 * policy_fifo_info_t (4 ints)
364 * policy_rr_info_t (5 ints) */
365 type policy_base_t = array[*:5] of integer_t;
366 type policy_info_t = array[*:2] of integer_t;
367 type policy_limit_t = array[*:1] of integer_t;
368
369 type ledger_t = mach_port_t
370 #if KERNEL_SERVER
371 intran: ledger_t convert_port_to_ledger(mach_port_t)
372 outtran: mach_port_t convert_ledger_to_port(ledger_t)
373 #endif /* KERNEL_SERVER */
374 ;
375
376 type ledger_array_t = ^array[] of ledger_t;
377 type ledger_item_t = integer_t;
378
379 type security_token_t = struct[2] of uint32_t;
380 type audit_token_t = struct[8] of uint32_t;
381
382 /* memory_object_info_t: variable-size inline array:
383 * memory_object_attr_info_t (5 ints)
384 * XXX actually it's 6 ints temporarily (object_ready!)
385 * memory_object_behave_info_t (4 ints)
386 * memory_object_perf_info_t (2 ints)
387 * old_memory_object_attr_info_t (3 ints)
388 * memory_object_norma_info_t (5 ints)
389 * If other flavors are added, this definition may
390 * need to be changed. (see mach/memory_object.h) */
391 type memory_object_flavor_t = int;
392 type memory_object_info_t = array[*:6] of int;
393
394 /* vm_region_info_t: variable-size inline array that can hold:
395 * vm_region_basic_info_t (8 ints)
396 * If other flavors are added, this definition may
397 * need to be changed. (see mach/vm_region.h) */
398 type vm_region_flavor_t = int;
399 type vm_region_info_t = array[*:10] of int;
400 type vm_region_recurse_info_t = array[*:19] of int;
401
402 type mach_vm_read_entry_t = array[512] of mach_vm_offset_t;
403 type vm_read_entry_t = array[512] of vm_offset_t;
404
405 type exception_mask_t = int;
406 type exception_behavior_t = int;
407
408 type exception_handler_t = mach_port_t;
409
410 type exception_handler_array_t =
411 array[*:32] of exception_handler_t;
412
413 type exception_behavior_array_t =
414 array[*:32] of exception_behavior_t;
415
416 type exception_flavor_array_t =
417 array[*:32] of thread_state_flavor_t;
418
419 type exception_mask_array_t =
420 array[*:32] of exception_mask_t;
421
422 type semaphore_t = mach_port_t
423 #if KERNEL_SERVER
424 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
425 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
426 destructor: semaphore_dereference(semaphore_t)
427 #endif /* KERNEL_SERVER */
428 ;
429
430 type semaphore_consume_ref_t = mach_port_move_send_t
431 cusertype: semaphore_t
432 #if KERNEL_SERVER
433 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
434 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
435 destructor: semaphore_dereference(semaphore_t)
436 #endif /* KERNEL_SERVER */
437 ;
438
439 type lock_set_t = mach_port_t
440 #if KERNEL_SERVER
441 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
442 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
443 destructor: lock_set_dereference(lock_set_t)
444 #endif /* KERNEL_SERVER */
445 ;
446
447 /* kernel module loader */
448 type kmod_t = int;
449 type kmod_control_flavor_t = int;
450
451 type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
452 ctype: kmod_args_t;
453
454 type io_master_t = mach_port_t;
455 type UNDServerRef = mach_port_t;
456
457 #if KERNEL_SERVER
458 #ifdef MACH_KERNEL_PRIVATE
459 simport <kern/ipc_kobject.h>; /* for null conversion */
460 simport <kern/ipc_tt.h>; /* for task/thread conversion */
461 simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
462 simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */
463 simport <kern/ledger.h>; /* for ledger conversions */
464 simport <kern/processor.h>; /* for processor conversions */
465 simport <kern/sync_lock.h>; /* for lock-set conversions */
466 simport <kern/sync_sema.h>; /* for semaphore conversions */
467 simport <vm/memory_object.h>; /* for memory object type conversions */
468 simport <vm/vm_map.h>; /* for vm_map conversions */
469 #endif /* MACH_KERNEL_PRIVATE */
470
471 simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */
472
473 #endif /* KERNEL_SERVER */
474
475 import <mach/mig.h>;
476 import <mach/mach_types.h>;
477
478 #endif /* _MACH_MACH_TYPES_DEFS_ */