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