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