2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
29 * All Rights Reserved.
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
41 * Carnegie Mellon requests users of this software to return to
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
54 * Mach kernel interface type declarations
57 #ifndef _MACH_MACH_TYPES_DEFS_
58 #define _MACH_MACH_TYPES_DEFS_
61 #include <mach/std_types.defs>
63 type memory_object_offset_t = uint64_t;
64 type memory_object_size_t = uint64_t;
65 type memory_object_cluster_size_t = uint32_t;
69 /* Universal Page Lists - restricted to (in-kernel) pagers for now */
70 type upl_size_t = uint32_t;
71 type upl_offset_t = uint32_t;
72 type upl_page_info_t = struct[2] of integer_t;
73 type upl_page_info_array_t = array[*:256] of upl_page_info_t;
75 type upl_t = mach_port_t
76 intran: upl_t convert_port_to_upl(mach_port_t)
77 outtran: mach_port_t convert_upl_to_port(upl_t)
78 destructor: upl_deallocate(upl_t)
81 #endif /* KERNEL_PRIVATE */
83 type mach_port_status_t = struct[10] of integer_t; /* obsolete */
85 /* mach_port_info_t: can hold either a
86 * mach_port_status_t (9 ints) or a
87 * mach_port_limits_t (1 int). If new flavors of
88 * mach_port_{get,set}_attributes are added, the size of
89 * this array may have to be increased. (See mach/port.h)
91 type mach_port_flavor_t = int;
92 type mach_port_info_t = array[*:10] of integer_t;
94 type task_t = mach_port_t
96 intran: task_t convert_port_to_task(mach_port_t)
97 outtran: mach_port_t convert_task_to_port(task_t)
98 destructor: task_deallocate(task_t)
99 #endif /* KERNEL_SERVER */
102 type thread_t = mach_port_t
104 intran: thread_t convert_port_to_thread(mach_port_t)
105 outtran: mach_port_t convert_thread_to_port(thread_t)
106 destructor: thread_deallocate(thread_t)
107 #endif /* KERNEL_SERVER */
110 type thread_act_t = mach_port_t
112 intran: thread_act_t convert_port_to_thread(mach_port_t)
113 outtran: mach_port_t convert_thread_to_port(thread_act_t)
114 destructor: thread_deallocate(thread_act_t)
115 #endif /* KERNEL_SERVER */
118 type thread_act_consume_ref_t = mach_port_move_send_t
119 cusertype: thread_act_t
121 intran: thread_act_t convert_port_to_thread(mach_port_t)
122 destructor: thread_deallocate(thread_act_t)
123 #endif /* KERNEL_SERVER */
126 /* thread_state_t: This inline array can hold
127 * a machine-dependent amount of data, defined in
128 * mach/machine/???? (currently THREAD_STATE_MAX,
129 * in mach/thread_state.h)
131 #include <mach/machine/thread_state.h>
132 type thread_state_flavor_t = int;
133 type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t;
135 type task_array_t = ^array[] of task_t;
136 type thread_array_t = ^array[] of thread_t;
137 type thread_act_array_t = ^array[] of thread_act_t;
138 type act_params_t = array[6] of int;
140 type vm_map_t = mach_port_t
142 intran: vm_map_t convert_port_to_map(mach_port_t)
143 destructor: vm_map_deallocate(vm_map_t)
144 #endif /* KERNEL_SERVER */
147 type vm_task_entry_t = mach_port_t
150 intran: vm_map_t convert_port_entry_to_map(mach_port_t)
151 destructor: vm_map_deallocate(vm_map_t)
152 #endif /* KERNEL_SERVER */
155 type ipc_space_t = mach_port_t
157 intran: ipc_space_t convert_port_to_space(mach_port_t)
158 destructor: space_deallocate(ipc_space_t)
159 #endif /* KERNEL_SERVER */
162 type vm_prot_t = int;
163 type vm_inherit_t = int;
164 type vm_purgable_t = int;
165 type xxx_vm_statistics_data_t = struct[13] of integer_t;
166 type vm_behavior_t = int;
167 type vm_statistics_data_t = struct[14] of integer_t;
168 type vm_machine_attribute_t = int;
169 type vm_machine_attribute_val_t = int;
170 type vm_sync_t = int;
172 /* thread_info_t: this inline array can hold any of:
173 * thread_basic_info_t (10 ints)
174 * policy_timeshare_info_t (5 ints)
175 * policy_fifo_info_t (4 ints)
176 * policy_rr_info_t (5 ints)
177 * if other thread_info flavors are added, this
178 * definition may need to be changed. (See
179 * mach/thread_info.h and mach/policy.h) */
180 type thread_flavor_t = int;
181 type thread_info_t = array[*:12] of integer_t;
183 type thread_policy_flavor_t = natural_t;
184 type thread_policy_t = array[*:16] of integer_t;
186 /* task_info_t: this inline array can hold any of:
187 * task_basic_info_32_t (8 ints)
188 * task_basic_info_64_t (10 ints)
189 * task_events_info_t (8 ints)
190 * task_thread_times_info_t (4 ints)
191 * policy_timeshare_info_t (5 ints)
192 * policy_fifo_info_t (4 ints)
193 * policy_rr_info_t (5 ints)
194 * task security token (2 ints)
195 * task audit token (8 ints)
196 * If other task_info flavors are added, this
197 * definition may need to be changed. (See
198 * mach/task_info.h and mach/policy.h) */
199 type task_flavor_t = int;
200 type task_info_t = array[*:10] of integer_t;
202 type task_policy_flavor_t = natural_t;
203 type task_policy_t = array[*:16] of integer_t;
205 type mem_entry_name_port_t = mach_port_t
207 intran: mem_entry_name_port_t null_conversion(mach_port_t)
208 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
209 #endif /* KERNEL_SERVER */
212 type mem_entry_name_port_move_send_t = mach_port_move_send_t
213 cusertype: mem_entry_name_port_t
215 intran: mem_entry_name_port_t null_conversion(mach_port_t)
216 outtran: mach_port_t null_conversion(mem_entry_name_port_t)
217 #endif /* KERNEL_SERVER */
220 type memory_object_default_t = mach_port_t
222 intran: memory_object_default_t null_conversion(mach_port_t)
223 outtran: mach_port_t null_conversion(memory_object_default_t)
224 #endif /* KERNEL_PRIVATE */
227 type memory_object_t = mach_port_t
229 intran: memory_object_t convert_port_to_memory_object(mach_port_t)
230 outtran: mach_port_t convert_memory_object_to_port(memory_object_t)
231 #endif /* KERNEL_PRIVATE */
235 type memory_object_control_t = mach_port_t
237 intran: memory_object_control_t convert_port_to_mo_control(mach_port_t)
238 outtran: mach_port_t convert_mo_control_to_port(memory_object_control_t)
239 destructor: memory_object_control_deallocate(memory_object_control_t)
240 #endif /* KERNEL_PRIVATE */
243 type memory_object_name_t = mach_port_t
248 type memory_object_copy_strategy_t = int;
249 type memory_object_return_t = int;
251 type machine_info_data_t = struct[5] of integer_t;
252 type machine_slot_data_t = struct[8] of integer_t;
254 type host_t = mach_port_t
256 intran: host_t convert_port_to_host(mach_port_t)
257 outtran: mach_port_t convert_host_to_port(host_t)
258 #endif /* KERNEL_SERVER */
261 type host_priv_t = mach_port_t
263 intran: host_priv_t convert_port_to_host_priv(mach_port_t)
264 #endif /* KERNEL_SERVER */
267 type host_security_t = mach_port_t
269 intran: host_security_t convert_port_to_host_security(mach_port_t)
270 #endif /* KERNEL_SERVER */
273 /* host_info_t: variable-sized inline array that can contain:
274 * host_basic_info_old_t (5 ints)
275 * host_basic_info_t (12 ints)
276 * host_sched_info_t (2 ints)
277 * kernel_resource_sizes_t (5 ints)
278 * host_load_info_t (6 ints)
279 * vm_statistics_t (14 ints)
280 * If other host_info flavors are added, this definition may
281 * need to be changed. (See mach/{host_info,vm_statistics}.h)
283 type host_flavor_t = int;
284 type host_info_t = array[*:14] of integer_t;
286 type processor_t = mach_port_t
288 intran: processor_t convert_port_to_processor(mach_port_t)
289 outtran: mach_port_t convert_processor_to_port(processor_t)
290 #endif /* KERNEL_SERVER */
293 type processor_array_t = ^array[] of processor_t;
295 /* processor_info_t: variable-sized inline array that can
297 * processor_basic_info_t: (5 ints)
298 * processor_cpu_load_info_t:(4 ints)
299 * processor_machine_info_t :(12 ints)
300 * If other processor_info flavors are added, this definition
301 * may need to be changed. (See mach/processor_info.h) */
302 type processor_flavor_t = int;
303 type processor_info_t = array[*:12] of integer_t;
304 type processor_info_array_t = ^array[] of integer_t;
306 type processor_set_t = mach_port_t
308 intran: processor_set_t convert_port_to_pset(mach_port_t)
309 outtran: mach_port_t convert_pset_to_port(processor_set_t)
310 destructor: pset_deallocate(processor_set_t)
311 #endif /* KERNEL_SERVER */
314 type processor_set_array_t = ^array[] of processor_set_t;
316 type processor_set_name_t = mach_port_t
318 intran: processor_set_name_t convert_port_to_pset_name(mach_port_t)
319 outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t)
320 destructor: pset_deallocate(processor_set_name_t)
321 #endif /* KERNEL_SERVER */
324 type processor_set_name_array_t = ^array[] of processor_set_name_t;
326 /* processor_set_info_t: variable-size inline array
328 * processor_set_basic_info (5 ints)
329 * processor_set_load_info (4 ints)
330 * policy_timeshare_base_t (1 int)
331 * policy_fifo_base_t (1 int)
332 * policy_rr_base_t (1 int)
333 * policy_timeshare_base_t (1 int)
334 * policy_fifo_base_t (1 int)
335 * policy_rr_base_t (1 int)
337 * If other flavors are added, this definition may
338 * need to be changed. (see mach/processor.h) */
339 type processor_set_flavor_t = int;
340 type processor_set_info_t = array[*:5] of integer_t;
342 type bootstrap_t = mach_port_t;
344 type kernel_version_t = c_string[*:512];
345 type kernel_boot_info_t = c_string[*:4096];
347 type time_value_t = struct[2] of integer_t;
349 type mach_port_qos_t = struct[2] of integer_t;
351 type emulation_vector_t = ^array[] of vm_offset_t;
353 type inline_existence_map_t = array[*:512] of char;
356 /* policy_info_t: variable-size inline array. Can hold:
357 * policy_timeshare_info_t (5 ints)
358 * policy_fifo_info_t (4 ints)
359 * policy_rr_info_t (5 ints) */
360 type policy_base_t = array[*:5] of integer_t;
361 type policy_info_t = array[*:2] of integer_t;
362 type policy_limit_t = array[*:1] of integer_t;
364 type ledger_t = mach_port_t
366 intran: ledger_t convert_port_to_ledger(mach_port_t)
367 outtran: mach_port_t convert_ledger_to_port(ledger_t)
368 #endif /* KERNEL_SERVER */
371 type ledger_array_t = ^array[] of ledger_t;
372 type ledger_item_t = integer_t;
374 type security_token_t = struct[2] of uint32_t;
375 type audit_token_t = struct[8] of uint32_t;
377 /* memory_object_info_t: variable-size inline array:
378 * memory_object_attr_info_t (5 ints)
379 * XXX actually it's 6 ints temporarily (object_ready!)
380 * memory_object_behave_info_t (4 ints)
381 * memory_object_perf_info_t (2 ints)
382 * old_memory_object_attr_info_t (3 ints)
383 * memory_object_norma_info_t (5 ints)
384 * If other flavors are added, this definition may
385 * need to be changed. (see mach/memory_object.h) */
386 type memory_object_flavor_t = int;
387 type memory_object_info_t = array[*:6] of int;
389 /* vm_region_info_t: variable-size inline array that can hold:
390 * vm_region_basic_info_t (8 ints)
391 * If other flavors are added, this definition may
392 * need to be changed. (see mach/vm_region.h) */
393 type vm_region_flavor_t = int;
394 type vm_region_info_t = array[*:10] of int;
395 type vm_region_recurse_info_t = array[*:19] of int;
397 type mach_vm_read_entry_t = array[512] of mach_vm_offset_t;
398 type vm_read_entry_t = array[512] of vm_offset_t;
400 type exception_mask_t = int;
401 type exception_behavior_t = int;
403 type exception_handler_t = mach_port_t;
405 type exception_handler_array_t =
406 array[*:32] of exception_handler_t;
408 type exception_behavior_array_t =
409 array[*:32] of exception_behavior_t;
411 type exception_flavor_array_t =
412 array[*:32] of thread_state_flavor_t;
414 type exception_mask_array_t =
415 array[*:32] of exception_mask_t;
417 type semaphore_t = mach_port_t
419 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
420 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
421 destructor: semaphore_dereference(semaphore_t)
422 #endif /* KERNEL_SERVER */
425 type semaphore_consume_ref_t = mach_port_move_send_t
426 cusertype: semaphore_t
428 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
429 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
430 destructor: semaphore_dereference(semaphore_t)
431 #endif /* KERNEL_SERVER */
434 type lock_set_t = mach_port_t
436 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
437 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
438 destructor: lock_set_dereference(lock_set_t)
439 #endif /* KERNEL_SERVER */
442 /* kernel module loader */
444 type kmod_control_flavor_t = int;
446 type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
449 type io_master_t = mach_port_t;
450 type UNDServerRef = mach_port_t;
453 #ifdef MACH_KERNEL_PRIVATE
454 simport <kern/ipc_kobject.h>; /* for null conversion */
455 simport <kern/ipc_tt.h>; /* for task/thread conversion */
456 simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
457 simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */
458 simport <kern/ledger.h>; /* for ledger conversions */
459 simport <kern/processor.h>; /* for processor conversions */
460 simport <kern/sync_lock.h>; /* for lock-set conversions */
461 simport <kern/sync_sema.h>; /* for semaphore conversions */
462 simport <vm/memory_object.h>; /* for memory object type conversions */
463 simport <vm/vm_map.h>; /* for vm_map conversions */
464 #endif /* MACH_KERNEL_PRIVATE */
466 simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */
468 #endif /* KERNEL_SERVER */
471 import <mach/mach_types.h>;
473 #endif /* _MACH_MACH_TYPES_DEFS_ */