2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * Mach kernel interface type declarations
56 #ifndef _MACH_MACH_TYPES_DEFS_
57 #define _MACH_MACH_TYPES_DEFS_
60 #include <mach/std_types.defs>
62 type upl_page_info_t = struct[2] of integer_t;
63 type memory_object_offset_t = struct[2] of integer_t;
64 type memory_object_size_t = struct[2] of integer_t;
69 type mach_port_status_t = struct[10] of integer_t; /* obsolete */
71 /* mach_port_info_t: can hold either a
72 * mach_port_status_t (9 ints) or a
73 * mach_port_limits_t (1 int). If new flavors of
74 * mach_port_{get,set}_attributes are added, the size of
75 * this array may have to be increased. (See mach/port.h)
77 type mach_port_flavor_t = int;
78 type mach_port_info_t = array[*:10] of integer_t;
80 type task_t = mach_port_t
82 intran: task_t convert_port_to_task(mach_port_t)
83 outtran: mach_port_t convert_task_to_port(task_t)
84 destructor: task_deallocate(task_t)
85 #endif /* KERNEL_SERVER */
88 type thread_t = mach_port_t
90 intran: thread_t convert_port_to_thread(mach_port_t)
91 outtran: mach_port_t convert_thread_to_port(thread_t)
92 destructor: thread_deallocate(thread_t)
93 #endif /* KERNEL_SERVER */
96 type thread_act_t = mach_port_t
98 intran: thread_act_t convert_port_to_act(mach_port_t)
99 outtran: mach_port_t convert_act_to_port(thread_act_t)
100 destructor: act_deallocate(thread_act_t)
104 type thread_act_consume_ref_t = mach_port_move_send_t
107 intran: thread_act_t convert_port_to_act(mach_port_t)
108 destructor: act_deallocate(thread_act_t)
112 /* thread_state_t: This inline array can hold
113 * a machine-dependent amount of data, defined in
114 * mach/machine/???? (currently THREAD_STATE_MAX,
115 * in mach/thread_state.h)
117 #include <mach/machine/thread_state.h>
118 type thread_state_flavor_t = int;
119 type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t;
121 type task_array_t = ^array[] of task_t;
122 type thread_array_t = ^array[] of thread_t;
123 type thread_act_array_t = ^array[] of thread_act_t;
124 type act_params_t = array[6] of int;
126 type vm_map_t = mach_port_t
128 intran: vm_map_t convert_port_to_map(mach_port_t)
129 destructor: vm_map_deallocate(vm_map_t)
130 #endif /* KERNEL_SERVER */
133 type vm_task_entry_t = mach_port_t
136 intran: vm_map_t convert_port_entry_to_map(mach_port_t)
137 destructor: vm_map_deallocate(vm_map_t)
138 #endif /* KERNEL_SERVER */
141 type vm_object_entry_t = mach_port_t
144 intran: vm_object_t convert_port_entry_to_object(mach_port_t)
145 destructor: vm_object_deallocate(vm_object_t)
146 #endif /* KERNEL_SERVER */
149 type upl_object_entry_t = mach_port_t
152 intran: upl_t convert_port_to_upl(mach_port_t)
153 destructor: mach_destroy_upl(upl_t)
154 #endif /* KERNEL_SERVER */
157 type ipc_space_t = mach_port_t
159 intran: ipc_space_t convert_port_to_space(mach_port_t)
160 destructor: space_deallocate(ipc_space_t)
161 #endif /* KERNEL_SERVER */
164 type vm_address_t = natural_t;
165 type vm_offset_t = natural_t;
166 type vm_size_t = natural_t;
167 type vm_prot_t = int;
168 type vm_inherit_t = int;
169 type xxx_vm_statistics_data_t = struct[13] of integer_t;
170 type vm_behavior_t = int;
171 type vm_statistics_data_t = struct[12] of integer_t;
172 type vm_machine_attribute_t = int;
173 type vm_machine_attribute_val_t = int;
174 type vm_sync_t = int;
176 /* thread_info_t: this inline array can hold any of:
177 * thread_basic_info_t (10 ints)
178 * policy_timeshare_info_t (5 ints)
179 * policy_fifo_info_t (4 ints)
180 * policy_rr_info_t (5 ints)
181 * if other thread_info flavors are added, this
182 * definition may need to be changed. (See
183 * mach/thread_info.h and mach/policy.h) */
184 type thread_flavor_t = int;
185 type thread_info_t = array[*:12] of integer_t;
187 type thread_policy_flavor_t = natural_t;
188 type thread_policy_t = array[*:16] of integer_t;
190 /* task_info_t: this inline array can hold any of:
191 * task_basic_info_t (8 ints)
192 * task_events_info_t (8 ints)
193 * task_thread_times_info_t (4 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 task_info flavors are added, this
198 * definition may need to be changed. (See
199 * mach/task_info.h and mach/policy.h) */
200 type task_flavor_t = int;
201 type task_info_t = array[*:8] of integer_t;
203 type task_policy_flavor_t = natural_t;
204 type task_policy_t = array[*:16] of integer_t;
206 type mem_entry_name_port_t = mach_port_t
208 intran: mem_entry_name_port_t null_conversion(mach_port_t)
209 #endif /* KERNEL_SERVER */
213 type memory_object_t = mach_port_t
215 intran: memory_object_t null_conversion(mach_port_t)
216 #endif /* KERNEL_SERVER */
219 type memory_object_default_t = mach_port_t
221 intran: memory_object_default_t null_conversion(mach_port_t)
222 #endif /* KERNEL_SERVER */
225 type upl_object_t = mach_port_t
227 intran: upl_object_t null_conversion(mach_port_t)
228 #endif /* KERNEL_SERVER */
231 type vm_object_t = mach_port_t
233 intran: vm_object_t vm_object_lookup(mach_port_t)
234 #endif /* KERNEL_SERVER */
237 type memory_object_name_t = mach_port_t
241 type memory_object_copy_strategy_t = int;
242 type memory_object_return_t = int;
244 type machine_info_data_t = struct[5] of integer_t;
245 type machine_slot_data_t = struct[8] of integer_t;
247 type host_t = mach_port_t
249 intran: host_t convert_port_to_host(mach_port_t)
250 outtran: mach_port_t convert_host_to_port(host_t)
251 #endif /* KERNEL_SERVER */
254 type host_priv_t = mach_port_t
256 intran: host_priv_t convert_port_to_host_priv(mach_port_t)
257 #endif /* KERNEL_SERVER */
260 type host_security_t = mach_port_t
262 intran: host_security_t convert_port_to_host_security(mach_port_t)
263 #endif /* KERNEL_SERVER */
266 /* host_info_t: variable-sized inline array that can contain:
267 * host_basic_info_t (5 ints)
268 * host_sched_info_t (2 ints)
269 * kernel_resource_sizes_t (5 ints)
270 * host_load_info_t (6 ints)
271 * vm_statistics_t (12 ints)
272 * If other host_info flavors are added, this definition may
273 * need to be changed. (See mach/{host_info,vm_statistics}.h)
275 type host_flavor_t = int;
276 type host_info_t = array[*:12] of integer_t;
278 type processor_t = mach_port_t
280 intran: processor_t convert_port_to_processor(mach_port_t)
281 outtran: mach_port_t convert_processor_to_port(processor_t)
282 #endif /* KERNEL_SERVER */
285 type processor_array_t = ^array[] of processor_t;
287 /* processor_info_t: variable-sized inline array that can
289 * processor_basic_info_t: (5 ints)
290 * processor_cpu_load_info_t:(4 ints)
291 * processor_machine_info_t :(12 ints)
292 * If other processor_info flavors are added, this definition
293 * may need to be changed. (See mach/processor_info.h) */
294 type processor_flavor_t = int;
295 type processor_info_t = array[*:12] of integer_t;
296 type processor_info_array_t = ^array[] of integer_t;
298 type processor_set_t = mach_port_t
300 intran: processor_set_t convert_port_to_pset(mach_port_t)
301 outtran: mach_port_t convert_pset_to_port(processor_set_t)
302 destructor: pset_deallocate(processor_set_t)
303 #endif /* KERNEL_SERVER */
306 type processor_set_array_t = ^array[] of processor_set_t;
308 type processor_set_name_t = mach_port_t
310 intran: processor_set_name_t convert_port_to_pset_name(mach_port_t)
311 outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t)
312 destructor: pset_deallocate(processor_set_name_t)
313 #endif /* KERNEL_SERVER */
316 type processor_set_name_array_t = ^array[] of processor_set_name_t;
318 /* processor_set_info_t: variable-size inline array
320 * processor_set_basic_info (5 ints)
321 * processor_set_load_info (4 ints)
322 * policy_timeshare_base_t (1 int)
323 * policy_fifo_base_t (1 int)
324 * policy_rr_base_t (1 int)
325 * policy_timeshare_base_t (1 int)
326 * policy_fifo_base_t (1 int)
327 * policy_rr_base_t (1 int)
329 * If other flavors are added, this definition may
330 * need to be changed. (see mach/processor.h) */
331 type processor_set_flavor_t = int;
332 type processor_set_info_t = array[*:5] of integer_t;
334 type bootstrap_t = mach_port_t;
336 type kernel_version_t = c_string[*:512];
337 type kernel_boot_info_t = c_string[*:4096];
339 type time_value_t = struct[2] of integer_t;
341 type user_subsystem_t = array[*:16384] of char;
343 type subsystem_t = mach_port_t
345 intran: subsystem_t convert_port_to_subsystem(mach_port_t)
346 outtran: mach_port_t convert_subsystem_to_port(subsystem_t)
347 #endif /* KERNEL_SERVER */
350 type mach_port_qos_t = struct[2] of integer_t;
352 type emulation_vector_t = ^array[] of vm_offset_t;
354 type inline_existence_map_t = array[*:512] of char;
357 /* policy_info_t: variable-size inline array. Can hold:
358 * policy_timeshare_info_t (5 ints)
359 * policy_fifo_info_t (4 ints)
360 * policy_rr_info_t (5 ints) */
361 type policy_base_t = array[*:5] of integer_t;
362 type policy_info_t = array[*:2] of integer_t;
363 type policy_limit_t = array[*:1] of integer_t;
365 type ledger_t = mach_port_t
367 intran: ledger_t convert_port_to_ledger(mach_port_t)
368 outtran: mach_port_t convert_ledger_to_port(ledger_t)
369 #endif /* KERNEL_SERVER */
372 type ledger_array_t = ^array[] of ledger_t;
373 type ledger_item_t = integer_t;
375 type security_token_t = MACH_MSG_TYPE_INTEGER_64;
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[*:9] of int;
395 type vm_region_info_64_t = array[*:10] of int;
396 type vm_region_recurse_info_t = array[*:19] of int;
397 type vm_region_recurse_info_64_t = array[*:19] of int;
399 type vm_read_entry_t = array[512] of int
400 ctype: vm_read_entry_t;
402 type exception_mask_t = int;
403 type exception_behavior_t = int;
405 type exception_handler_t = mach_port_t;
407 type exception_handler_array_t =
408 array[*:32] of exception_handler_t;
410 type exception_behavior_array_t =
411 array[*:32] of exception_behavior_t;
413 type exception_flavor_array_t =
414 array[*:32] of thread_state_flavor_t;
416 type exception_mask_array_t =
417 array[*:32] of exception_mask_t;
419 type semaphore_t = mach_port_t
421 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
422 outtran: mach_port_t convert_semaphore_to_port(semaphore_t)
423 destructor: semaphore_dereference(semaphore_t)
424 #endif /* KERNEL_SERVER */
427 type semaphore_consume_ref_t = mach_port_move_send_t
430 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
431 destructor: semaphore_dereference(semaphore_t)
432 #endif /* KERNEL_SERVER */
435 type lock_set_t = mach_port_t
437 intran: lock_set_t convert_port_to_lock_set(mach_port_t)
438 outtran: mach_port_t convert_lock_set_to_port(lock_set_t)
439 destructor: lock_set_dereference(lock_set_t)
440 #endif /* KERNEL_SERVER */
443 type upl_page_list_ptr_t = array[*:20] of upl_page_info_t;
445 /* kernel module loader */
447 type kmod_control_flavor_t = int;
449 type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
452 type io_master_t = mach_port_t;
453 type UNDServerRef = mach_port_t;
456 #ifdef MACH_KERNEL_PRIVATE
457 simport <kern/ipc_kobject.h>; /* for null conversion */
458 simport <kern/ipc_tt.h>; /* for task/thread conversion */
459 simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
460 simport <kern/ipc_subsystem.h>; /* for subsystem conversions */
461 simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */
462 #endif /* MACH_KERNEL_PRIVATE */
464 simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */
466 #endif /* KERNEL_SERVER */
468 import <mach/mach_types.h>;
470 #endif /* _MACH_MACH_TYPES_DEFS_ */