]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_types.defs
xnu-792.13.8.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 *
8ad349bb 4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
1c79356b 5 *
8ad349bb
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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
1c79356b
A
29 */
30/*
31 * @OSF_COPYRIGHT@
32 */
33/*
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
36 * All Rights Reserved.
37 *
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
43 *
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
47 *
48 * Carnegie Mellon requests users of this software to return to
49 *
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
57 */
58/*
59 */
60/*
61 * Mach kernel interface type declarations
62 */
63
64#ifndef _MACH_MACH_TYPES_DEFS_
65#define _MACH_MACH_TYPES_DEFS_
66
67
68#include <mach/std_types.defs>
69
9bccf70c
A
70type memory_object_offset_t = uint64_t;
71type memory_object_size_t = uint64_t;
91447636 72type memory_object_cluster_size_t = uint32_t;
1c79356b 73
91447636 74#ifdef KERNEL_PRIVATE
1c79356b 75
91447636
A
76/* Universal Page Lists - restricted to (in-kernel) pagers for now */
77type upl_size_t = uint32_t;
78type upl_offset_t = uint32_t;
79type upl_page_info_t = struct[2] of integer_t;
80type upl_page_info_array_t = array[*:256] of upl_page_info_t;
1c79356b 81
91447636
A
82type upl_t = mach_port_t
83 intran: upl_t convert_port_to_upl(mach_port_t)
84 outtran: mach_port_t convert_upl_to_port(upl_t)
85 destructor: upl_deallocate(upl_t)
86 ;
87
88#endif /* KERNEL_PRIVATE */
1c79356b
A
89
90type mach_port_status_t = struct[10] of integer_t; /* obsolete */
91
92 /* mach_port_info_t: can hold either a
93 * mach_port_status_t (9 ints) or a
94 * mach_port_limits_t (1 int). If new flavors of
95 * mach_port_{get,set}_attributes are added, the size of
96 * this array may have to be increased. (See mach/port.h)
97 */
98type mach_port_flavor_t = int;
99type mach_port_info_t = array[*:10] of integer_t;
100
101type task_t = mach_port_t
102#if KERNEL_SERVER
103 intran: task_t convert_port_to_task(mach_port_t)
104 outtran: mach_port_t convert_task_to_port(task_t)
105 destructor: task_deallocate(task_t)
106#endif /* KERNEL_SERVER */
107 ;
108
5d5c5d0d
A
109type task_name_t = mach_port_t
110#if KERNEL_SERVER
111 intran: task_name_t convert_port_to_task_name(mach_port_t)
112 outtran: mach_port_t convert_task_name_to_port(task_name_t)
113 destructor: task_name_deallocate(task_name_t)
114#endif /* KERNEL_SERVER */
115 ;
116
1c79356b
A
117type thread_t = mach_port_t
118#if KERNEL_SERVER
119 intran: thread_t convert_port_to_thread(mach_port_t)
120 outtran: mach_port_t convert_thread_to_port(thread_t)
121 destructor: thread_deallocate(thread_t)
122#endif /* KERNEL_SERVER */
123 ;
124
125type thread_act_t = mach_port_t
126#if KERNEL_SERVER
91447636
A
127 intran: thread_act_t convert_port_to_thread(mach_port_t)
128 outtran: mach_port_t convert_thread_to_port(thread_act_t)
129 destructor: thread_deallocate(thread_act_t)
55e303ae 130#endif /* KERNEL_SERVER */
1c79356b
A
131 ;
132
133type thread_act_consume_ref_t = mach_port_move_send_t
91447636 134 cusertype: thread_act_t
1c79356b 135#if KERNEL_SERVER
91447636
A
136 intran: thread_act_t convert_port_to_thread(mach_port_t)
137 destructor: thread_deallocate(thread_act_t)
55e303ae 138#endif /* KERNEL_SERVER */
1c79356b
A
139 ;
140
141 /* thread_state_t: This inline array can hold
142 * a machine-dependent amount of data, defined in
143 * mach/machine/???? (currently THREAD_STATE_MAX,
144 * in mach/thread_state.h)
145 */
146#include <mach/machine/thread_state.h>
147type thread_state_flavor_t = int;
148type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t;
149
150type task_array_t = ^array[] of task_t;
151type thread_array_t = ^array[] of thread_t;
152type thread_act_array_t = ^array[] of thread_act_t;
153type act_params_t = array[6] of int;
154
155type vm_map_t = mach_port_t
156#if KERNEL_SERVER
157 intran: vm_map_t convert_port_to_map(mach_port_t)
158 destructor: vm_map_deallocate(vm_map_t)
159#endif /* KERNEL_SERVER */
160 ;
161
162type vm_task_entry_t = mach_port_t
91447636 163 cusertype: vm_map_t
1c79356b
A
164#if KERNEL_SERVER
165 intran: vm_map_t convert_port_entry_to_map(mach_port_t)
166 destructor: vm_map_deallocate(vm_map_t)
167#endif /* KERNEL_SERVER */
168 ;
169
1c79356b
A
170type ipc_space_t = mach_port_t
171#if KERNEL_SERVER
172 intran: ipc_space_t convert_port_to_space(mach_port_t)
173 destructor: space_deallocate(ipc_space_t)
174#endif /* KERNEL_SERVER */
175 ;
176
1c79356b
A
177type vm_prot_t = int;
178type vm_inherit_t = int;
91447636 179type vm_purgable_t = int;
1c79356b
A
180type xxx_vm_statistics_data_t = struct[13] of integer_t;
181type vm_behavior_t = int;
91447636 182type vm_statistics_data_t = struct[14] of integer_t;
1c79356b
A
183type vm_machine_attribute_t = int;
184type vm_machine_attribute_val_t = int;
185type vm_sync_t = int;
186
187 /* thread_info_t: this inline array can hold any of:
188 * thread_basic_info_t (10 ints)
189 * policy_timeshare_info_t (5 ints)
190 * policy_fifo_info_t (4 ints)
191 * policy_rr_info_t (5 ints)
192 * if other thread_info flavors are added, this
193 * definition may need to be changed. (See
194 * mach/thread_info.h and mach/policy.h) */
195type thread_flavor_t = int;
196type thread_info_t = array[*:12] of integer_t;
197
198type thread_policy_flavor_t = natural_t;
199type thread_policy_t = array[*:16] of integer_t;
200
201 /* task_info_t: this inline array can hold any of:
91447636
A
202 * task_basic_info_32_t (8 ints)
203 * task_basic_info_64_t (10 ints)
1c79356b
A
204 * task_events_info_t (8 ints)
205 * task_thread_times_info_t (4 ints)
206 * policy_timeshare_info_t (5 ints)
207 * policy_fifo_info_t (4 ints)
208 * policy_rr_info_t (5 ints)
55e303ae
A
209 * task security token (2 ints)
210 * task audit token (8 ints)
1c79356b
A
211 * If other task_info flavors are added, this
212 * definition may need to be changed. (See
213 * mach/task_info.h and mach/policy.h) */
214type task_flavor_t = int;
91447636 215type task_info_t = array[*:10] of integer_t;
1c79356b
A
216
217type task_policy_flavor_t = natural_t;
218type task_policy_t = array[*:16] of integer_t;
219
220type mem_entry_name_port_t = mach_port_t
221#if KERNEL_SERVER
0b4e3aa0 222 intran: mem_entry_name_port_t null_conversion(mach_port_t)
91447636
A
223 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
224#endif /* KERNEL_SERVER */
225 ;
226
227type mem_entry_name_port_move_send_t = mach_port_move_send_t
228 cusertype: mem_entry_name_port_t
229#if KERNEL_SERVER
230 intran: mem_entry_name_port_t null_conversion(mach_port_t)
231 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
1c79356b
A
232#endif /* KERNEL_SERVER */
233 ;
234
1c79356b 235type memory_object_default_t = mach_port_t
0b4e3aa0 236#if KERNEL_PRIVATE
1c79356b 237 intran: memory_object_default_t null_conversion(mach_port_t)
0b4e3aa0
A
238 outtran: mach_port_t null_conversion(memory_object_default_t)
239#endif /* KERNEL_PRIVATE */
1c79356b 240 ;
0b4e3aa0
A
241
242type memory_object_t = mach_port_t
243#if KERNEL_PRIVATE
244 intran: memory_object_t convert_port_to_memory_object(mach_port_t)
245 outtran: mach_port_t convert_memory_object_to_port(memory_object_t)
246#endif /* KERNEL_PRIVATE */
1c79356b
A
247 ;
248
0b4e3aa0
A
249
250type memory_object_control_t = mach_port_t
251#if KERNEL_PRIVATE
252 intran: memory_object_control_t convert_port_to_mo_control(mach_port_t)
253 outtran: mach_port_t convert_mo_control_to_port(memory_object_control_t)
254 destructor: memory_object_control_deallocate(memory_object_control_t)
255#endif /* KERNEL_PRIVATE */
1c79356b
A
256 ;
257
258type memory_object_name_t = mach_port_t
259 ctype: mach_port_t
260 ;
261
0b4e3aa0 262
1c79356b
A
263type memory_object_copy_strategy_t = int;
264type memory_object_return_t = int;
265
266type machine_info_data_t = struct[5] of integer_t;
267type machine_slot_data_t = struct[8] of integer_t;
268
269type host_t = mach_port_t
270#if KERNEL_SERVER
271 intran: host_t convert_port_to_host(mach_port_t)
272 outtran: mach_port_t convert_host_to_port(host_t)
273#endif /* KERNEL_SERVER */
274 ;
275
276type host_priv_t = mach_port_t
277#if KERNEL_SERVER
278 intran: host_priv_t convert_port_to_host_priv(mach_port_t)
279#endif /* KERNEL_SERVER */
280 ;
281
282type host_security_t = mach_port_t
283#if KERNEL_SERVER
284 intran: host_security_t convert_port_to_host_security(mach_port_t)
285#endif /* KERNEL_SERVER */
286 ;
287
288 /* host_info_t: variable-sized inline array that can contain:
91447636
A
289 * host_basic_info_old_t (5 ints)
290 * host_basic_info_t (12 ints)
1c79356b
A
291 * host_sched_info_t (2 ints)
292 * kernel_resource_sizes_t (5 ints)
293 * host_load_info_t (6 ints)
91447636 294 * vm_statistics_t (14 ints)
1c79356b
A
295 * If other host_info flavors are added, this definition may
296 * need to be changed. (See mach/{host_info,vm_statistics}.h)
297 */
298type host_flavor_t = int;
91447636 299type host_info_t = array[*:14] of integer_t;
1c79356b
A
300
301type processor_t = mach_port_t
302#if KERNEL_SERVER
303 intran: processor_t convert_port_to_processor(mach_port_t)
304 outtran: mach_port_t convert_processor_to_port(processor_t)
305#endif /* KERNEL_SERVER */
306 ;
307
308type processor_array_t = ^array[] of processor_t;
309
310 /* processor_info_t: variable-sized inline array that can
311 * contain:
312 * processor_basic_info_t: (5 ints)
313 * processor_cpu_load_info_t:(4 ints)
314 * processor_machine_info_t :(12 ints)
315 * If other processor_info flavors are added, this definition
316 * may need to be changed. (See mach/processor_info.h) */
317type processor_flavor_t = int;
318type processor_info_t = array[*:12] of integer_t;
319type processor_info_array_t = ^array[] of integer_t;
320
321type processor_set_t = mach_port_t
322#if KERNEL_SERVER
323 intran: processor_set_t convert_port_to_pset(mach_port_t)
324 outtran: mach_port_t convert_pset_to_port(processor_set_t)
325 destructor: pset_deallocate(processor_set_t)
326#endif /* KERNEL_SERVER */
327 ;
328
329type processor_set_array_t = ^array[] of processor_set_t;
330
331type processor_set_name_t = mach_port_t
332#if KERNEL_SERVER
333 intran: processor_set_name_t convert_port_to_pset_name(mach_port_t)
334 outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t)
335 destructor: pset_deallocate(processor_set_name_t)
336#endif /* KERNEL_SERVER */
337 ;
338
339type processor_set_name_array_t = ^array[] of processor_set_name_t;
340
341 /* processor_set_info_t: variable-size inline array
342 * that can hold:
343 * processor_set_basic_info (5 ints)
344 * processor_set_load_info (4 ints)
345 * policy_timeshare_base_t (1 int)
346 * policy_fifo_base_t (1 int)
347 * policy_rr_base_t (1 int)
348 * policy_timeshare_base_t (1 int)
349 * policy_fifo_base_t (1 int)
350 * policy_rr_base_t (1 int)
351 * policy_t (1 int)
352 * If other flavors are added, this definition may
353 * need to be changed. (see mach/processor.h) */
354type processor_set_flavor_t = int;
355type processor_set_info_t = array[*:5] of integer_t;
356
357type bootstrap_t = mach_port_t;
358
359type kernel_version_t = c_string[*:512];
360type kernel_boot_info_t = c_string[*:4096];
361
362type time_value_t = struct[2] of integer_t;
363
1c79356b
A
364type mach_port_qos_t = struct[2] of integer_t;
365
366type emulation_vector_t = ^array[] of vm_offset_t;
367
368type inline_existence_map_t = array[*:512] of char;
369
370type policy_t = int;
371 /* policy_info_t: variable-size inline array. Can hold:
372 * policy_timeshare_info_t (5 ints)
373 * policy_fifo_info_t (4 ints)
374 * policy_rr_info_t (5 ints) */
375type policy_base_t = array[*:5] of integer_t;
376type policy_info_t = array[*:2] of integer_t;
377type policy_limit_t = array[*:1] of integer_t;
378
379type ledger_t = mach_port_t
380#if KERNEL_SERVER
381 intran: ledger_t convert_port_to_ledger(mach_port_t)
382 outtran: mach_port_t convert_ledger_to_port(ledger_t)
383#endif /* KERNEL_SERVER */
384 ;
385
55e303ae 386type ledger_array_t = ^array[] of ledger_t;
1c79356b
A
387type ledger_item_t = integer_t;
388
55e303ae
A
389type security_token_t = struct[2] of uint32_t;
390type audit_token_t = struct[8] of uint32_t;
1c79356b
A
391
392 /* memory_object_info_t: variable-size inline array:
393 * memory_object_attr_info_t (5 ints)
394 * XXX actually it's 6 ints temporarily (object_ready!)
395 * memory_object_behave_info_t (4 ints)
396 * memory_object_perf_info_t (2 ints)
397 * old_memory_object_attr_info_t (3 ints)
398 * memory_object_norma_info_t (5 ints)
399 * If other flavors are added, this definition may
400 * need to be changed. (see mach/memory_object.h) */
401type memory_object_flavor_t = int;
402type memory_object_info_t = array[*:6] of int;
403
404 /* vm_region_info_t: variable-size inline array that can hold:
405 * vm_region_basic_info_t (8 ints)
406 * If other flavors are added, this definition may
407 * need to be changed. (see mach/vm_region.h) */
408type vm_region_flavor_t = int;
91447636 409type vm_region_info_t = array[*:10] of int;
1c79356b 410type vm_region_recurse_info_t = array[*:19] of int;
1c79356b 411
91447636
A
412type mach_vm_read_entry_t = array[512] of mach_vm_offset_t;
413type vm_read_entry_t = array[512] of vm_offset_t;
1c79356b
A
414
415type exception_mask_t = int;
416type exception_behavior_t = int;
417
418type exception_handler_t = mach_port_t;
419
420type exception_handler_array_t =
421 array[*:32] of exception_handler_t;
422
423type exception_behavior_array_t =
424 array[*:32] of exception_behavior_t;
425
426type exception_flavor_array_t =
427 array[*:32] of thread_state_flavor_t;
428
429type exception_mask_array_t =
430 array[*:32] of exception_mask_t;
431
432type semaphore_t = mach_port_t
433#if KERNEL_SERVER
434 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
435 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
436 destructor: semaphore_dereference(semaphore_t)
437#endif /* KERNEL_SERVER */
438 ;
439
440type semaphore_consume_ref_t = mach_port_move_send_t
91447636 441 cusertype: semaphore_t
1c79356b
A
442#if KERNEL_SERVER
443 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
0b4e3aa0 444 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
1c79356b
A
445 destructor: semaphore_dereference(semaphore_t)
446#endif /* KERNEL_SERVER */
447 ;
448
449type lock_set_t = mach_port_t
450#if KERNEL_SERVER
451 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
452 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
453 destructor: lock_set_dereference(lock_set_t)
454#endif /* KERNEL_SERVER */
455 ;
456
1c79356b
A
457/* kernel module loader */
458type kmod_t = int;
459type kmod_control_flavor_t = int;
460
461type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
462 ctype: kmod_args_t;
463
464type io_master_t = mach_port_t;
465type UNDServerRef = mach_port_t;
466
9bccf70c 467#if KERNEL_SERVER
1c79356b
A
468#ifdef MACH_KERNEL_PRIVATE
469simport <kern/ipc_kobject.h>; /* for null conversion */
470simport <kern/ipc_tt.h>; /* for task/thread conversion */
471simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
1c79356b 472simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */
9bccf70c 473simport <kern/ledger.h>; /* for ledger conversions */
91447636
A
474simport <kern/processor.h>; /* for processor conversions */
475simport <kern/sync_lock.h>; /* for lock-set conversions */
476simport <kern/sync_sema.h>; /* for semaphore conversions */
477simport <vm/memory_object.h>; /* for memory object type conversions */
478simport <vm/vm_map.h>; /* for vm_map conversions */
1c79356b
A
479#endif /* MACH_KERNEL_PRIVATE */
480
481simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */
482
483#endif /* KERNEL_SERVER */
484
9bccf70c 485import <mach/mig.h>;
1c79356b
A
486import <mach/mach_types.h>;
487
488#endif /* _MACH_MACH_TYPES_DEFS_ */