]>
Commit | Line | Data |
---|---|---|
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 | ||
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; | |
65 | ||
66 | ||
67 | ||
68 | ||
69 | type 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 | */ | |
77 | type mach_port_flavor_t = int; | |
78 | type mach_port_info_t = array[*:10] of integer_t; | |
79 | ||
80 | type 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 | ||
88 | type 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 | ||
96 | type 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 | ||
104 | type 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> | |
118 | type thread_state_flavor_t = int; | |
119 | type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t; | |
120 | ||
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; | |
125 | ||
126 | type 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 | ||
133 | type 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 | ||
141 | type 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 | ||
149 | type 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 | ||
157 | type 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 | ||
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; | |
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) */ | |
184 | type thread_flavor_t = int; | |
185 | type thread_info_t = array[*:12] of integer_t; | |
186 | ||
187 | type thread_policy_flavor_t = natural_t; | |
188 | type 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) */ | |
200 | type task_flavor_t = int; | |
201 | type task_info_t = array[*:8] of integer_t; | |
202 | ||
203 | type task_policy_flavor_t = natural_t; | |
204 | type task_policy_t = array[*:16] of integer_t; | |
205 | ||
206 | type 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 | ||
213 | type 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 | ||
219 | type 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 | ||
225 | type 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 | ||
231 | type 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 | ||
237 | type memory_object_name_t = mach_port_t | |
238 | ctype: mach_port_t | |
239 | ; | |
240 | ||
241 | type memory_object_copy_strategy_t = int; | |
242 | type memory_object_return_t = int; | |
243 | ||
244 | type machine_info_data_t = struct[5] of integer_t; | |
245 | type machine_slot_data_t = struct[8] of integer_t; | |
246 | ||
247 | type 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 | ||
254 | type 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 | ||
260 | type 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 | */ | |
275 | type host_flavor_t = int; | |
276 | type host_info_t = array[*:12] of integer_t; | |
277 | ||
278 | type 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 | ||
285 | type 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) */ | |
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; | |
297 | ||
298 | type 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 | ||
306 | type processor_set_array_t = ^array[] of processor_set_t; | |
307 | ||
308 | type 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 | ||
316 | type 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) */ | |
331 | type processor_set_flavor_t = int; | |
332 | type processor_set_info_t = array[*:5] of integer_t; | |
333 | ||
334 | type bootstrap_t = mach_port_t; | |
335 | ||
336 | type kernel_version_t = c_string[*:512]; | |
337 | type kernel_boot_info_t = c_string[*:4096]; | |
338 | ||
339 | type time_value_t = struct[2] of integer_t; | |
340 | ||
341 | type user_subsystem_t = array[*:16384] of char; | |
342 | ||
343 | type 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 | ||
350 | type mach_port_qos_t = struct[2] of integer_t; | |
351 | ||
352 | type emulation_vector_t = ^array[] of vm_offset_t; | |
353 | ||
354 | type inline_existence_map_t = array[*:512] of char; | |
355 | ||
356 | type 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) */ | |
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; | |
364 | ||
365 | type 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 | ||
372 | type ledger_array_t = ^array[] of ledger_t; | |
373 | type ledger_item_t = integer_t; | |
374 | ||
375 | type 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) */ | |
386 | type memory_object_flavor_t = int; | |
387 | type 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) */ | |
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; | |
398 | ||
399 | type vm_read_entry_t = array[512] of int | |
400 | ctype: vm_read_entry_t; | |
401 | ||
402 | type exception_mask_t = int; | |
403 | type exception_behavior_t = int; | |
404 | ||
405 | type exception_handler_t = mach_port_t; | |
406 | ||
407 | type exception_handler_array_t = | |
408 | array[*:32] of exception_handler_t; | |
409 | ||
410 | type exception_behavior_array_t = | |
411 | array[*:32] of exception_behavior_t; | |
412 | ||
413 | type exception_flavor_array_t = | |
414 | array[*:32] of thread_state_flavor_t; | |
415 | ||
416 | type exception_mask_array_t = | |
417 | array[*:32] of exception_mask_t; | |
418 | ||
419 | type 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 | ||
427 | type 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 | ||
435 | type 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 | ||
443 | type upl_page_list_ptr_t = array[*:20] of upl_page_info_t; | |
444 | ||
445 | /* kernel module loader */ | |
446 | type kmod_t = int; | |
447 | type kmod_control_flavor_t = int; | |
448 | ||
449 | type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE | |
450 | ctype: kmod_args_t; | |
451 | ||
452 | type io_master_t = mach_port_t; | |
453 | type UNDServerRef = mach_port_t; | |
454 | ||
455 | #ifdef KERNEL_SERVER | |
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 */ | |
463 | ||
464 | simport <kern/ipc_mig.h>; /* pick up kernel-specific MIG things */ | |
465 | ||
466 | #endif /* KERNEL_SERVER */ | |
467 | ||
468 | import <mach/mach_types.h>; | |
469 | ||
470 | #endif /* _MACH_MACH_TYPES_DEFS_ */ |