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