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