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