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