]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/mach_types.defs
xnu-124.13.tar.gz
[apple/xnu.git] / osfmk / mach / mach_types.defs
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
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
62type upl_page_info_t = struct[2] of integer_t;
63type memory_object_offset_t = struct[2] of integer_t;
64type memory_object_size_t = struct[2] of integer_t;
65
66
67
68
69type mach_port_status_t = struct[10] of integer_t; /* obsolete */
70
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)
76 */
77type mach_port_flavor_t = int;
78type mach_port_info_t = array[*:10] of integer_t;
79
80type task_t = mach_port_t
81#if KERNEL_SERVER
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 */
86 ;
87
88type thread_t = mach_port_t
89#if KERNEL_SERVER
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 */
94 ;
95
96type thread_act_t = mach_port_t
97#if KERNEL_SERVER
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)
101#endif KERNEL_SERVER
102 ;
103
104type thread_act_consume_ref_t = mach_port_move_send_t
105 ctype: thread_act_t
106#if KERNEL_SERVER
107 intran: thread_act_t convert_port_to_act(mach_port_t)
108 destructor: act_deallocate(thread_act_t)
109#endif KERNEL_SERVER
110 ;
111
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)
116 */
117#include <mach/machine/thread_state.h>
118type thread_state_flavor_t = int;
119type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t;
120
121type task_array_t = ^array[] of task_t;
122type thread_array_t = ^array[] of thread_t;
123type thread_act_array_t = ^array[] of thread_act_t;
124type act_params_t = array[6] of int;
125
126type vm_map_t = mach_port_t
127#if KERNEL_SERVER
128 intran: vm_map_t convert_port_to_map(mach_port_t)
129 destructor: vm_map_deallocate(vm_map_t)
130#endif /* KERNEL_SERVER */
131 ;
132
133type vm_task_entry_t = mach_port_t
134 ctype: vm_map_t
135#if KERNEL_SERVER
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 */
139 ;
140
141type vm_object_entry_t = mach_port_t
142 ctype: vm_object_t
143#if KERNEL_SERVER
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 */
147 ;
148
149type upl_object_entry_t = mach_port_t
150 ctype: upl_t
151#if KERNEL_SERVER
152 intran: upl_t convert_port_to_upl(mach_port_t)
153 destructor: mach_destroy_upl(upl_t)
154#endif /* KERNEL_SERVER */
155 ;
156
157type ipc_space_t = mach_port_t
158#if KERNEL_SERVER
159 intran: ipc_space_t convert_port_to_space(mach_port_t)
160 destructor: space_deallocate(ipc_space_t)
161#endif /* KERNEL_SERVER */
162 ;
163
164type vm_address_t = natural_t;
165type vm_offset_t = natural_t;
166type vm_size_t = natural_t;
167type vm_prot_t = int;
168type vm_inherit_t = int;
169type xxx_vm_statistics_data_t = struct[13] of integer_t;
170type vm_behavior_t = int;
171type vm_statistics_data_t = struct[12] of integer_t;
172type vm_machine_attribute_t = int;
173type vm_machine_attribute_val_t = int;
174type vm_sync_t = int;
175
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) */
184type thread_flavor_t = int;
185type thread_info_t = array[*:12] of integer_t;
186
187type thread_policy_flavor_t = natural_t;
188type thread_policy_t = array[*:16] of integer_t;
189
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) */
200type task_flavor_t = int;
201type task_info_t = array[*:8] of integer_t;
202
203type task_policy_flavor_t = natural_t;
204type task_policy_t = array[*:16] of integer_t;
205
206type mem_entry_name_port_t = mach_port_t
207#if KERNEL_SERVER
208 intran: mem_entry_name_port_t null_conversion(mach_port_t)
209#endif /* KERNEL_SERVER */
210 ;
211
212
213type memory_object_t = mach_port_t
214#if KERNEL_SERVER
215 intran: memory_object_t null_conversion(mach_port_t)
216#endif /* KERNEL_SERVER */
217 ;
218
219type memory_object_default_t = mach_port_t
220#if KERNEL_SERVER
221 intran: memory_object_default_t null_conversion(mach_port_t)
222#endif /* KERNEL_SERVER */
223 ;
224
225type upl_object_t = mach_port_t
226#if KERNEL_SERVER
227 intran: upl_object_t null_conversion(mach_port_t)
228#endif /* KERNEL_SERVER */
229 ;
230
231type vm_object_t = mach_port_t
232#if KERNEL_SERVER
233 intran: vm_object_t vm_object_lookup(mach_port_t)
234#endif /* KERNEL_SERVER */
235 ;
236
237type memory_object_name_t = mach_port_t
238 ctype: mach_port_t
239 ;
240
241type memory_object_copy_strategy_t = int;
242type memory_object_return_t = int;
243
244type machine_info_data_t = struct[5] of integer_t;
245type machine_slot_data_t = struct[8] of integer_t;
246
247type host_t = mach_port_t
248#if KERNEL_SERVER
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 */
252 ;
253
254type host_priv_t = mach_port_t
255#if KERNEL_SERVER
256 intran: host_priv_t convert_port_to_host_priv(mach_port_t)
257#endif /* KERNEL_SERVER */
258 ;
259
260type host_security_t = mach_port_t
261#if KERNEL_SERVER
262 intran: host_security_t convert_port_to_host_security(mach_port_t)
263#endif /* KERNEL_SERVER */
264 ;
265
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)
274 */
275type host_flavor_t = int;
276type host_info_t = array[*:12] of integer_t;
277
278type processor_t = mach_port_t
279#if KERNEL_SERVER
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 */
283 ;
284
285type processor_array_t = ^array[] of processor_t;
286
287 /* processor_info_t: variable-sized inline array that can
288 * contain:
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) */
294type processor_flavor_t = int;
295type processor_info_t = array[*:12] of integer_t;
296type processor_info_array_t = ^array[] of integer_t;
297
298type processor_set_t = mach_port_t
299#if KERNEL_SERVER
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 */
304 ;
305
306type processor_set_array_t = ^array[] of processor_set_t;
307
308type processor_set_name_t = mach_port_t
309#if KERNEL_SERVER
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 */
314 ;
315
316type processor_set_name_array_t = ^array[] of processor_set_name_t;
317
318 /* processor_set_info_t: variable-size inline array
319 * that can hold:
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)
328 * policy_t (1 int)
329 * If other flavors are added, this definition may
330 * need to be changed. (see mach/processor.h) */
331type processor_set_flavor_t = int;
332type processor_set_info_t = array[*:5] of integer_t;
333
334type bootstrap_t = mach_port_t;
335
336type kernel_version_t = c_string[*:512];
337type kernel_boot_info_t = c_string[*:4096];
338
339type time_value_t = struct[2] of integer_t;
340
341type user_subsystem_t = array[*:16384] of char;
342
343type subsystem_t = mach_port_t
344#if KERNEL_SERVER
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 */
348 ;
349
350type mach_port_qos_t = struct[2] of integer_t;
351
352type emulation_vector_t = ^array[] of vm_offset_t;
353
354type inline_existence_map_t = array[*:512] of char;
355
356type policy_t = int;
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) */
361type policy_base_t = array[*:5] of integer_t;
362type policy_info_t = array[*:2] of integer_t;
363type policy_limit_t = array[*:1] of integer_t;
364
365type ledger_t = mach_port_t
366#if KERNEL_SERVER
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 */
370 ;
371
372type ledger_array_t = ^array[] of ledger_t;
373type ledger_item_t = integer_t;
374
375type security_token_t = MACH_MSG_TYPE_INTEGER_64;
376
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) */
386type memory_object_flavor_t = int;
387type memory_object_info_t = array[*:6] of int;
388
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) */
393type vm_region_flavor_t = int;
394type vm_region_info_t = array[*:9] of int;
395type vm_region_info_64_t = array[*:10] of int;
396type vm_region_recurse_info_t = array[*:19] of int;
397type vm_region_recurse_info_64_t = array[*:19] of int;
398
399type vm_read_entry_t = array[512] of int
400 ctype: vm_read_entry_t;
401
402type exception_mask_t = int;
403type exception_behavior_t = int;
404
405type exception_handler_t = mach_port_t;
406
407type exception_handler_array_t =
408 array[*:32] of exception_handler_t;
409
410type exception_behavior_array_t =
411 array[*:32] of exception_behavior_t;
412
413type exception_flavor_array_t =
414 array[*:32] of thread_state_flavor_t;
415
416type exception_mask_array_t =
417 array[*:32] of exception_mask_t;
418
419type semaphore_t = mach_port_t
420#if KERNEL_SERVER
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 */
425 ;
426
427type semaphore_consume_ref_t = mach_port_move_send_t
428 ctype: semaphore_t
429#if KERNEL_SERVER
430 intran: semaphore_t convert_port_to_semaphore(mach_port_t)
431 destructor: semaphore_dereference(semaphore_t)
432#endif /* KERNEL_SERVER */
433 ;
434
435type lock_set_t = mach_port_t
436#if KERNEL_SERVER
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 */
441 ;
442
443type upl_page_list_ptr_t = array[*:20] of upl_page_info_t;
444
445/* kernel module loader */
446type kmod_t = int;
447type kmod_control_flavor_t = int;
448
449type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE
450 ctype: kmod_args_t;
451
452type io_master_t = mach_port_t;
453type UNDServerRef = mach_port_t;
454
455#ifdef KERNEL_SERVER
456#ifdef MACH_KERNEL_PRIVATE
457simport <kern/ipc_kobject.h>; /* for null conversion */
458simport <kern/ipc_tt.h>; /* for task/thread conversion */
459simport <kern/ipc_host.h>; /* for host/processor/pset conversions */
460simport <kern/ipc_subsystem.h>; /* for subsystem conversions */
461simport <kern/ipc_sync.h>; /* for lock_set and semaphore conversions */
462#endif /* MACH_KERNEL_PRIVATE */
463
464simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */
465
466#endif /* KERNEL_SERVER */
467
468import <mach/mach_types.h>;
469
470#endif /* _MACH_MACH_TYPES_DEFS_ */