xref: /xnu-8792.41.9/osfmk/mach/mach_types.defs (revision 5c2921b07a2480ab43ec66f5b9e41cb872bc554f)
1/*
2 * Copyright (c) 2000-2016 Apple 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  [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 * NOTICE: This file was modified by McAfee Research in 2004 to introduce
58 * support for mandatory and extensible security protections.  This notice
59 * is included in support of clause 2.2 (b) of the Apple Public License,
60 * Version 2.0.
61 */
62/*
63 */
64/*
65 *	Mach kernel interface type declarations
66 */
67
68#ifndef	_MACH_MACH_TYPES_DEFS_
69#define _MACH_MACH_TYPES_DEFS_
70
71
72#include <mach/std_types.defs>
73
74type memory_object_offset_t 	= uint64_t;
75type memory_object_size_t 	= uint64_t;
76type memory_object_cluster_size_t = uint32_t;
77type memory_object_fault_info_t = array[16] of integer_t;
78
79#ifdef KERNEL_PRIVATE
80
81/* Universal Page Lists - restricted to (in-kernel) pagers for now */
82type upl_size_t			= uint32_t;
83type upl_offset_t			= uint32_t;
84type upl_page_info_t		= struct[2] of integer_t;
85type upl_page_info_array_t	= array[*:256] of upl_page_info_t;
86
87type upl_t = mach_port_t
88		intran: upl_t convert_port_to_upl(mach_port_t)
89		outtran: mach_port_t convert_upl_to_port(upl_t)
90		destructor: upl_deallocate(upl_t)
91		;
92
93#endif /* KERNEL_PRIVATE */
94
95type mach_port_status_t = struct[10] of integer_t;	/* obsolete */
96type mach_port_info_ext_t = struct[17] of integer_t;
97
98		/* mach_port_info_t: can hold either a
99		 * mach_port_status_t (9 ints) or a
100		 * mach_port_limits_t (1 int) or a
101		 * mach_port_info_ext_t (17 ints). If new flavors of
102		 * mach_port_{get,set}_attributes are added, the size of
103		 * this array may have to be increased. (See mach/port.h)
104		 */
105type mach_port_flavor_t 	= int;
106type mach_port_info_t		= array[*:17] of integer_t;
107
108     		/*
109		 * mach_msg_max_trailer_t: can hold
110		 * mach_msg_trailer_type_t (1 int)
111		 * mach_msg_trailer_size_t (1 int)
112		 * mach_port_seqno_t (1 int)
113		 * security_token_t (2 ints)
114		 * audit_token_t (8 ints)
115		 * mach_port_context_t (2 ints)
116		 * msgh_ad (1 int)
117		 * msg_labels_t (1 int)
118		 */
119type mach_msg_trailer_type_t = int;
120type mach_msg_trailer_info_t	= array[*:68] of char;
121
122type mach_task_flavor_t = int;
123
124/* Task control, read, inspect, name port. In descending capability. */
125type task_t = mach_port_t
126#if	KERNEL_SERVER
127		intran: task_t convert_port_to_task_mig(mach_port_t)
128		outtran: mach_port_t convert_task_to_port_kernel(task_t)
129		destructor: task_deallocate_mig(task_t)
130#endif	/* KERNEL_SERVER */
131		;
132
133type task_read_t = mach_port_t
134#if	KERNEL_SERVER
135		intran: task_read_t convert_port_to_task_read_mig(mach_port_t)
136		outtran: mach_port_t convert_task_read_to_port_kernel(task_read_t)
137		destructor: task_read_deallocate_mig(task_read_t)
138#endif	/* KERNEL_SERVER */
139		;
140
141type task_inspect_t = mach_port_t
142#if	KERNEL_SERVER
143		intran: task_inspect_t convert_port_to_task_inspect_mig(mach_port_t)
144		outtran: mach_port_t convert_task_inspect_to_port(task_inspect_t)
145		destructor: task_inspect_deallocate_mig(task_inspect_t)
146#endif	/* KERNEL_SERVER */
147		;
148
149type task_name_t = mach_port_t
150#if	KERNEL_SERVER
151		intran: task_name_t convert_port_to_task_name_mig(mach_port_t)
152		outtran: mach_port_t convert_task_name_to_port(task_name_t)
153		destructor: task_name_deallocate_mig(task_name_t)
154#endif	/* KERNEL_SERVER */
155		;
156
157type task_policy_set_t = mach_port_t
158#if	KERNEL_SERVER
159		intran: task_policy_set_t convert_port_to_task_policy_set_mig(mach_port_t)
160		destructor: task_policy_set_deallocate_mig(task_policy_set_t)
161#endif	/* KERNEL_SERVER */
162		;
163
164type task_policy_get_t = mach_port_t
165#if	KERNEL_SERVER
166		intran: task_policy_get_t convert_port_to_task_policy_get_mig(mach_port_t)
167		destructor: task_policy_get_deallocate_mig(task_policy_get_t)
168#endif	/* KERNEL_SERVER */
169		;
170
171type task_id_token_t = mach_port_t
172#if KERNEL_SERVER
173		intran: task_id_token_t convert_port_to_task_id_token(mach_port_t)
174		outtran: mach_port_t convert_task_id_token_to_port(task_id_token_t)
175		destructor: task_id_token_release(task_id_token_t)
176#endif	/* KERNEL_SERVER */
177		;
178
179/* Thread control, read, inspect port. In descending capability. */
180type thread_t = mach_port_t
181#if	KERNEL_SERVER
182		intran: thread_t convert_port_to_thread(mach_port_t)
183		outtran: mach_port_t convert_thread_to_port(thread_t)
184		destructor: thread_deallocate(thread_t)
185#endif	/* KERNEL_SERVER */
186		;
187
188type thread_read_t = mach_port_t
189#if	KERNEL_SERVER
190		intran: thread_read_t convert_port_to_thread_read(mach_port_t)
191		outtran: mach_port_t convert_thread_read_to_port(thread_read_t)
192		destructor: thread_read_deallocate(thread_read_t)
193#endif	/* KERNEL_SERVER */
194		;
195
196type thread_inspect_t = mach_port_t
197#if	KERNEL_SERVER
198		intran: thread_inspect_t convert_port_to_thread_inspect(mach_port_t)
199		outtran: mach_port_t convert_thread_inspect_to_port(thread_inspect_t)
200		destructor: thread_inspect_deallocate(thread_inspect_t)
201#endif	/* KERNEL_SERVER */
202		;
203
204type thread_act_t = mach_port_t
205#if	KERNEL_SERVER
206		intran: thread_act_t convert_port_to_thread(mach_port_t)
207		outtran: mach_port_t convert_thread_to_port(thread_act_t)
208		destructor: thread_deallocate(thread_act_t)
209#endif	/* KERNEL_SERVER */
210		;
211
212type thread_act_consume_ref_t = mach_port_move_send_t
213		cusertype: thread_act_t
214#if	KERNEL_SERVER
215		intran: thread_act_t convert_port_to_thread(mach_port_t)
216		destructor: thread_deallocate(thread_act_t)
217#endif	/* KERNEL_SERVER */
218		;
219
220		/* thread_state_t: This inline array can hold
221		 * a machine-dependent amount of data, defined in
222		 * mach/machine/???? (currently THREAD_STATE_MAX,
223		 * in mach/thread_state.h)
224		 */
225#include <mach/machine/thread_state.h>
226type thread_state_flavor_t	= int;
227type thread_state_t		= array[*:THREAD_STATE_MAX] of natural_t;
228
229type task_array_t = ^array[] of task_t;
230type thread_array_t = ^array[] of thread_t;
231type thread_act_array_t = ^array[] of thread_act_t;
232type act_params_t = array[6] of int;
233
234type vm_map_t = mach_port_t
235#if	KERNEL_SERVER
236		intran: vm_map_t convert_port_to_map(mach_port_t)
237		destructor: vm_map_deallocate(vm_map_t)
238#endif	/* KERNEL_SERVER */
239		;
240
241type vm_map_inspect_t = mach_port_t
242#if	KERNEL_SERVER
243		intran: vm_map_inspect_t convert_port_to_map_inspect(mach_port_t)
244		destructor: vm_map_inspect_deallocate(vm_map_inspect_t)
245#endif	/* KERNEL_SERVER */
246		;
247
248type vm_map_read_t = mach_port_t
249#if	KERNEL_SERVER
250		intran: vm_map_read_t convert_port_to_map_read(mach_port_t)
251		destructor: vm_map_read_deallocate(vm_map_read_t)
252#endif	/* KERNEL_SERVER */
253		;
254
255type vm_task_entry_t = mach_port_t
256		cusertype: vm_map_t
257#if	KERNEL_SERVER
258		intran: vm_map_t convert_port_entry_to_map(mach_port_t)
259		destructor: vm_map_deallocate(vm_map_t)
260#endif	/* KERNEL_SERVER */
261		;
262
263type ipc_space_t = mach_port_t
264#if	KERNEL_SERVER
265		intran: ipc_space_t convert_port_to_space(mach_port_t)
266		destructor: space_deallocate(ipc_space_t)
267#endif	/* KERNEL_SERVER */
268		;
269
270type ipc_space_read_t = mach_port_t
271#if	KERNEL_SERVER
272		intran: ipc_space_read_t convert_port_to_space_read(mach_port_t)
273		destructor: space_read_deallocate(ipc_space_read_t)
274#endif	/* KERNEL_SERVER */
275		;
276
277type ipc_space_inspect_t = mach_port_t
278#if	KERNEL_SERVER
279		intran: ipc_space_inspect_t convert_port_to_space_inspect(mach_port_t)
280		destructor: space_inspect_deallocate(ipc_space_inspect_t)
281#endif	/* KERNEL_SERVER */
282		;
283
284type arcade_register_t = mach_port_t
285#if	KERNEL_SERVER
286		intran: arcade_register_t convert_port_to_arcade_register(mach_port_t)
287#endif	/* KERNEL_SERVER */
288		;
289
290type kcdata_object_t = mach_port_t
291#if KERNEL_SERVER
292		intran: kcdata_object_t convert_port_to_kcdata_object(mach_port_t)
293		outtran: mach_port_t convert_kcdata_object_to_port(kcdata_object_t)
294		destructor: kcdata_object_release(kcdata_object_t)
295#endif	/* KERNEL_SERVER */
296		;
297
298type vm_prot_t = int;
299type vm_inherit_t = int;
300type vm_purgable_t = int;
301type xxx_vm_statistics_data_t = struct[13] of integer_t;
302type vm_behavior_t = int;
303type vm_statistics_data_t = struct[15] of integer_t;
304type vm_machine_attribute_t = int;
305type vm_machine_attribute_val_t = int;
306type vm_sync_t = int;
307
308		/* thread_info_t: this inline array can hold any of:
309		 * thread_basic_info_t (10 ints)
310		 * policy_timeshare_info_t (5 ints)
311		 * policy_fifo_info_t (4 ints)
312		 * policy_rr_info_t (5 ints)
313		 * thread_extended_info (12 ints + 64 chars)
314		 * if other thread_info flavors are added, this
315		 * definition may need to be changed. (See
316		 * mach/thread_info.h and mach/policy.h) */
317type thread_flavor_t		= int;
318type thread_info_t		= array[*:32] of integer_t;
319
320type thread_policy_flavor_t	= natural_t;
321type thread_policy_t		= array[*:16] of integer_t;
322
323		/* task_info_t: this inline array can hold any of:
324		 * task_basic_info_32_t (8 ints)
325		 * task_basic_info_64_t (10 ints)
326		 * task_events_info_t (8 ints)
327		 * task_thread_times_info_t (4 ints)
328		 * policy_timeshare_info_t (5 ints)
329		 * policy_fifo_info_t (4 ints)
330		 * policy_rr_info_t (5 ints)
331		 * task security token (2 ints)
332		 * task audit token (8 ints)
333		 * dyld info (2 64-bit ints and 1 int)
334		 * task_extmod_info_t (8 64-bit ints)
335		 * task_basic_info_64_2_t
336		 * mach_task_basic_info_t (12 ints)
337		 * task_power_info_t (18 ints)
338		 * task_vm_info_t (89 ints)
339		 * If other task_info flavors are added, this
340		 * definition may need to be changed. (See
341		 * mach/task_info.h and mach/policy.h)
342		 *
343		 * Add at least 1 extra element to allow task_info(TASK_VM_INFO)
344		 * to detect callers that may pass "count" as the number of
345		 * bytes instead of number of integer_t, for example.
346		 * The MIG user stub truncates that number to the maximum
347		 * number of elements in "task_info_t" which currently
348		 * happens to be TASK_VM_INFO_COUNT, making it impossible
349		 * for the kernel to detect the misuse of "count" and
350		 * possibly causing an overflow of the user's buffer.
351		 */
352type task_flavor_t		= int;
353type task_info_t		= array[*:89+1] of integer_t;
354
355type task_purgable_info_t	= struct[68] of integer_t;
356
357type task_policy_flavor_t	= natural_t;
358type task_policy_t		= array[*:16] of integer_t;
359
360type task_inspect_flavor_t = natural_t;
361type task_inspect_info_t = array[*:4] of integer_t;
362
363type task_exc_guard_behavior_t = uint32_t;
364type task_corpse_forking_behavior_t = uint32_t;
365
366type mem_entry_name_port_t = mach_port_t
367#if     KERNEL_SERVER
368		intran: mem_entry_name_port_t null_conversion(mach_port_t)
369		outtran: mach_port_t null_conversion(mem_entry_name_port_t)
370#endif  /* KERNEL_SERVER */
371		;
372
373type mem_entry_name_port_move_send_t = mach_port_move_send_t
374	cusertype: mem_entry_name_port_t
375#if     KERNEL_SERVER
376		intran: mem_entry_name_port_t null_conversion(mach_port_t)
377		outtran: mach_port_t null_conversion(mem_entry_name_port_t)
378#endif  /* KERNEL_SERVER */
379		;
380
381type memory_object_default_t = mach_port_t
382#if	KERNEL_PRIVATE
383		intran: memory_object_default_t null_conversion(mach_port_t)
384		outtran: mach_port_t null_conversion(memory_object_default_t)
385#endif	/* KERNEL_PRIVATE */
386		;
387
388type memory_object_t = mach_port_t /* obsolete */
389#if	KERNEL_PRIVATE
390		intran: memory_object_t convert_port_to_memory_object(mach_port_t)
391		outtran: mach_port_t convert_memory_object_to_port(memory_object_t)
392#endif	/* KERNEL_PRIVATE */
393		;
394
395type memory_object_control_t = mach_port_t; /* obsolete */
396
397type memory_object_name_t = mach_port_t
398		ctype: mach_port_t
399		;
400
401
402type memory_object_copy_strategy_t = int;
403type memory_object_return_t = int;
404
405type machine_info_data_t = struct[5] of integer_t;
406type machine_slot_data_t = struct[8] of integer_t;
407
408type host_t = mach_port_t
409#if	KERNEL_SERVER
410		intran: host_t convert_port_to_host(mach_port_t)
411		outtran: mach_port_t convert_host_to_port(host_t)
412#endif	/* KERNEL_SERVER */
413		;
414
415type host_priv_t = mach_port_t
416#if	KERNEL_SERVER
417		intran: host_priv_t convert_port_to_host_priv(mach_port_t)
418#endif	/* KERNEL_SERVER */
419		;
420
421type host_security_t = mach_port_t; /* obsolete */
422
423		/*
424		 * host_info_t: variable-sized inline array that can contain:
425		 *
426		 * 	host_basic_info_old_t (5 ints)
427		 * 	host_basic_info_t (12 ints)
428		 * 	host_sched_info_t (2 ints)
429		 * 	kernel_resource_sizes_t (5 ints)
430		 * 	host_load_info_t (6 ints)
431		 * 	vm_statistics32_t (15 ints)
432		 * 	host_purgable_info_t (68 ints)
433		 *	host_expired_task_info uses a task_power_info (18 ints)
434		 *
435		 * If other host_info flavors are added, this definition may
436		 * need to be changed. (See mach/{host_info,vm_statistics}.h)
437		 */
438type host_flavor_t		= int;
439type host_info_t 		= array[*:68] of integer_t;
440		/*
441		 * host_info64_t: variable-sized inline array that can contain:
442		 *
443		 *	vm_statistics_t (6 ints and 9 longs)
444		 *	vm_extmod_statistics_t (6 64-bit ints)
445		 */
446type host_info64_t		= array[*:256] of integer_t;
447
448type processor_t = mach_port_t
449#if	KERNEL_SERVER
450		intran: processor_t convert_port_to_processor(mach_port_t)
451		outtran: mach_port_t convert_processor_to_port(processor_t)
452#endif	/* KERNEL_SERVER */
453		;
454
455type processor_array_t = ^array[] of processor_t;
456
457		/*
458		 * processor_info_t: variable-sized inline array that can
459		 * contain:
460		 *
461		 * - processor_basic_info_t:    (5 ints)
462		 * - processor_cpu_load_info_t: (4 ints)
463		 * - processor_machine_info_t:  (12 ints)
464		 * - processor_cpu_stat_t:      (10 ints)
465		 * - processor_cpu_stat64_t:    (20 ints)
466		 *
467		 * If other processor_info flavors are added, this definition
468		 * may need to be changed.
469		 *
470		 * See mach/processor_info.h and mach/arm/processor_info.h.
471		 */
472
473type processor_flavor_t     = int;
474type processor_info_t       = array[*:20] of integer_t;
475type processor_info_array_t = ^array[] of integer_t;
476
477type processor_set_t = mach_port_t
478#if	KERNEL_SERVER
479		intran: processor_set_t convert_port_to_pset(mach_port_t)
480		outtran: mach_port_t convert_pset_to_port(processor_set_t)
481#endif	/* KERNEL_SERVER */
482		;
483
484type processor_set_array_t = ^array[] of processor_set_t;
485
486type processor_set_name_t = mach_port_t
487#if	KERNEL_SERVER
488		intran: processor_set_name_t convert_port_to_pset_name(mach_port_t)
489		outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t)
490#endif	/* KERNEL_SERVER */
491		;
492
493type processor_set_name_array_t = ^array[] of processor_set_name_t;
494
495		/* processor_set_info_t: variable-size inline array
496		 * that can hold:
497		 * processor_set_basic_info (5 ints)
498		 * processor_set_load_info (4 ints)
499		 * policy_timeshare_base_t (1 int)
500		 * policy_fifo_base_t (1 int)
501		 * policy_rr_base_t (1 int)
502		 * policy_timeshare_base_t (1 int)
503		 * policy_fifo_base_t (1 int)
504		 * policy_rr_base_t (1 int)
505		 * policy_t (1 int)
506		 * If other flavors are added, this definition may
507		 * need to be changed. (see mach/processor.h) */
508type processor_set_flavor_t	= int;
509type processor_set_info_t	= array[*:5] of integer_t;
510
511type bootstrap_t = mach_port_t;
512
513type kernel_version_t           = c_string[*:512];
514type kernel_boot_info_t         = c_string[*:4096];
515
516type time_value_t = struct[2] of integer_t;
517
518type mach_port_qos_t = struct[2] of integer_t;
519
520type mach_port_options_t = struct[3] of uint64_t;
521type mach_port_options_ptr_t = ^ mach_port_options_t;
522
523type mach_service_port_info_data_t = struct[256] of char;
524
525type emulation_vector_t		= ^array[] of vm_offset_t;
526
527type inline_existence_map_t	= array[*:512] of char;
528
529type policy_t			= int;
530		/* policy_info_t: variable-size inline array. Can hold:
531		 * policy_timeshare_info_t (5 ints)
532		 * policy_fifo_info_t (4 ints)
533		 * policy_rr_info_t (5 ints) */
534type policy_base_t		= array[*:5] of integer_t;
535type policy_info_t		= array[*:2] of integer_t;
536type policy_limit_t		= array[*:1] of integer_t;
537
538type ledger_t = mach_port_t
539#if	KERNEL_SERVER
540		intran: ledger_t convert_port_to_ledger(mach_port_t)
541		outtran: mach_port_t convert_ledger_to_port(ledger_t)
542#endif	/* KERNEL_SERVER */
543                ;
544
545type ledger_array_t	 	= ^array[] of ledger_t;
546type ledger_item_t		= integer_t;
547     				  /* DEPRECATED */
548
549type ledger_amount_t		= int64_t;
550
551type security_token_t		= struct[2] of uint32_t;
552type audit_token_t		= struct[8] of uint32_t;
553
554type msg_labels_t = mach_port_t;
555
556		/* memory_object_info_t: variable-size inline array:
557		 * memory_object_attr_info_t (5 ints)
558		 * XXX actually it's 6 ints temporarily (object_ready!)
559		 * memory_object_behave_info_t (4 ints)
560		 * memory_object_perf_info_t (2 ints)
561		 * old_memory_object_attr_info_t (3 ints)
562		 * If other flavors are added, this definition may
563		 * need to be changed. (see mach/memory_object.h) */
564type memory_object_flavor_t	= int;
565type memory_object_info_t	= array[*:6] of int;
566
567		/* vm_region_info_t: variable-size inline array that can hold:
568		 * vm_region_basic_info_t (8 ints)
569		 * If other flavors are added, this definition may
570		 * need to be changed. (see mach/vm_region.h) */
571type vm_region_flavor_t		= int;
572type vm_region_info_t		= array[*:10] of int;
573type vm_region_recurse_info_t	= array[*:19] of int;
574
575type vm_page_info_flavor_t	= int;
576type vm_page_info_t		= array[*:32] of int;
577
578type mach_vm_read_entry_t = array[512] of mach_vm_offset_t;
579type vm_read_entry_t = array[512] of vm_offset_t;
580#ifdef VM32_SUPPORT
581type vm32_read_entry_t = array[512] of vm32_offset_t;
582#endif
583
584type exception_mask_t		= int;
585type exception_behavior_t	= int;
586
587type    exception_handler_t = mach_port_t;
588
589type    exception_handler_info_t = struct[2] of natural_t;
590
591type	exception_handler_array_t	=
592			array[*:32] of exception_handler_t;
593
594type    exception_handler_info_array_t =
595			array[*:32] of exception_handler_info_t;
596
597type	exception_behavior_array_t	=
598			array[*:32] of exception_behavior_t;
599
600type	exception_flavor_array_t	=
601			array[*:32] of thread_state_flavor_t;
602
603type	exception_mask_array_t	=
604			array[*:32] of exception_mask_t;
605
606type semaphore_t = mach_port_t
607#if	KERNEL_SERVER
608		intran: semaphore_t convert_port_to_semaphore(mach_port_t)
609		outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
610		destructor: semaphore_dereference(semaphore_t)
611#endif	/* KERNEL_SERVER */
612		;
613
614type semaphore_consume_ref_t = mach_port_move_send_t
615		cusertype: semaphore_t
616#if	KERNEL_SERVER
617		intran: semaphore_t convert_port_to_semaphore(mach_port_t)
618		outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
619#endif	/* KERNEL_SERVER */
620		;
621
622#ifndef _MACH_MACH_EVENTLINK_TYPE_DEFS
623#define _MACH_MACH_EVENTLINK_TYPE_DEFS
624
625type eventlink_t = mach_port_t
626		ctype: mach_port_t
627#if	KERNEL_SERVER
628		intran: ipc_eventlink_t convert_port_to_eventlink(mach_port_t)
629		destructor: ipc_eventlink_deallocate(ipc_eventlink_t)
630#endif	/* KERNEL_SERVER */
631		;
632
633type eventlink_consume_ref_t = mach_port_move_send_t
634		ctype: mach_port_t
635#if	KERNEL_SERVER
636		intran: ipc_eventlink_t convert_port_to_eventlink(mach_port_t)
637		destructor: ipc_eventlink_deallocate(ipc_eventlink_t)
638#endif	/* KERNEL_SERVER */
639		;
640
641type eventlink_port_pair_t = array[2] of mach_port_t;
642type mach_eventlink_create_option_t = uint32_t;
643type mach_eventlink_associate_option_t = uint32_t;
644type mach_eventlink_disassociate_option_t = uint32_t;
645type mach_eventlink_signal_wait_option_t = uint32_t;
646
647#endif /* _MACH_MACH_EVENTLINK_TYPE_DEFS */
648
649/* obsolete */
650type lock_set_t = mach_port_t;
651
652type task_suspension_token_t = mach_port_move_send_once_t
653#if	KERNEL_SERVER
654		intran: task_suspension_token_t convert_port_to_task_suspension_token_mig(mach_port_t)
655		outtran: mach_port_t convert_task_suspension_token_to_port_mig(task_suspension_token_t)
656#endif	/* KERNEL_SERVER */
657		;
658
659type vfs_path_t = c_string[4096];
660type nspace_path_t = c_string[1024];	/* 1024 == PATH_MAX */
661type nspace_name_t = c_string[1024];	/* 1024 == PATH_MAX */
662
663/* public voucher types */
664
665/* Mach voucher object */
666type mach_voucher_t = mach_port_t;
667type mach_voucher_name_t = mach_port_name_t;
668
669type mach_voucher_attr_manager_t = mach_port_t;
670type mach_voucher_attr_control_t = mach_port_t;
671
672/* IPC voucher internal object */
673type ipc_voucher_t = mach_port_t
674#if	KERNEL_SERVER
675		intran: ipc_voucher_t convert_port_to_voucher(mach_port_t)
676		outtran: mach_port_t convert_voucher_to_port(ipc_voucher_t)
677		destructor: ipc_voucher_release(ipc_voucher_t)
678#endif	/* KERNEL_SERVER */
679	        ;
680
681/* IPC voucher attribute control internal object */
682type ipc_voucher_attr_control_t = mach_port_t;
683
684type mach_voucher_attr_key_t = uint32_t;
685
686type mach_voucher_attr_command_t = uint32_t;
687type mach_voucher_attr_recipe_command_t = uint32_t;
688
689type mach_voucher_attr_content_size_t = uint32_t;
690type mach_voucher_attr_content_t = array[*:4096] of uint8_t;
691type mach_voucher_attr_content_array_t = array[*:5120] of uint8_t;
692
693type mach_voucher_attr_raw_recipe_size_t = uint32_t;
694type mach_voucher_attr_raw_recipe_t = array[*:4096] of uint8_t;
695type mach_voucher_attr_raw_recipe_array_t = array[*:5120] of uint8_t;
696
697type mach_voucher_selector_t = uint32_t;
698
699type mach_voucher_attr_value_handle_t = uint64_t;
700type mach_voucher_attr_value_handle_array_t = array[*:4] of mach_voucher_attr_value_handle_t;
701type mach_voucher_attr_value_reference_t = uint32_t;
702
703/* kernel module loader */
704type kmod_t = int;
705type kmod_control_flavor_t = int;
706
707type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
708	ctype: kmod_args_t;
709
710type io_main_t = mach_port_t;
711type UNDServerRef = mach_port_t;
712
713/* These must be kept in sync with definitions in osfmk/mach/dyld_kernel.h */
714type dyld_kernel_image_info_t = struct[40] of MACH_MSG_TYPE_BYTE;
715type dyld_kernel_image_info_array_t = ^array[] of dyld_kernel_image_info_t;
716type dyld_kernel_process_info_t = struct[64] of MACH_MSG_TYPE_BYTE;
717
718#if KERNEL_SERVER
719#ifdef	MACH_KERNEL_PRIVATE
720simport <ipc/ipc_voucher.h>;	/* for voucher conversions */
721simport <kern/ipc_kobject.h>;	/* for null conversion */
722simport <kern/ipc_tt.h>;	    /* for task/thread conversion */
723simport <kern/ipc_host.h>;	    /* for host/processor/pset conversions */
724simport <kern/ledger.h>;	    /* for ledger conversions */
725simport <kern/processor.h>;	    /* for processor conversions */
726simport <kern/sync_sema.h>;	    /* for semaphore conversions */
727simport <ipc/ipc_eventlink.h>;  /* for eventlink conversions */
728simport <vm/memory_object.h>;	/* for memory object type conversions */
729simport <vm/vm_map.h>;		    /* for vm_map conversions */
730#if CONFIG_ARCADE
731simport <kern/arcade.h>;        /* for arcade_register conversions */
732#endif
733#endif	/* MACH_KERNEL_PRIVATE */
734
735simport <kern/ipc_mig.h>;	    /* pick up kernel-specific MIG things */
736
737simport <kern/task_ident.h>;    /* for task_id_token conversions */
738simport <kern/kern_cdata.h>;    /* for kcdata_object conversions */
739#endif /* KERNEL_SERVER */
740
741import <mach/mig.h>;
742import <mach/mach_types.h>;
743
744#endif	/* _MACH_MACH_TYPES_DEFS_ */
745
746/* vim: set ft=c : */
747