2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
57 * File: device/device.defs
61 * Mach device support. Mach devices are accessed through
62 * block and character device interfaces to the kernel.
68 #endif /* KERNEL_SERVER */
71 #include <mach/std_types.defs>
72 #include <mach/mach_types.defs>
73 #include <mach/clock_types.defs>
74 #include <mach/clock_types.defs>
76 import <device/device_types.h>;
80 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
85 type io_name_t = c_string[*:128];
86 type io_string_t = c_string[*:512];
87 type io_struct_inband_t = array[*:4096] of char;
88 type io_scalar_inband_t = array[*:16] of int;
89 type io_async_ref_t = array[*:8] of natural_t;
90 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
92 type io_object_t = mach_port_t
95 intran: io_object_t iokit_lookup_object_port(mach_port_t)
96 outtran: mach_port_t iokit_make_object_port(io_object_t)
97 destructor: iokit_remove_reference(io_object_t)
98 #endif /* KERNEL_SERVER */
101 type io_connect_t = mach_port_t
104 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
105 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
106 destructor: iokit_remove_reference(io_connect_t)
107 #endif /* KERNEL_SERVER */
110 routine io_object_get_class(
111 object : io_object_t;
112 out className : io_name_t
115 routine io_object_conforms_to(
116 object : io_object_t;
117 in className : io_name_t;
118 out conforms : boolean_t
121 routine io_iterator_next(
122 iterator : io_object_t;
123 out object : io_object_t
126 routine io_iterator_reset(
127 iterator : io_object_t
130 routine io_service_get_matching_services(
131 master_port : mach_port_t;
132 in matching : io_string_t;
133 out existing : io_object_t
136 routine io_registry_entry_get_property(
137 registry_entry : io_object_t;
138 in property_name : io_name_t;
139 out properties : io_buf_ptr_t, physicalcopy
142 routine io_registry_create_iterator(
143 master_port : mach_port_t;
144 in plane : io_name_t;
146 out iterator : io_object_t
149 routine io_registry_iterator_enter_entry(
150 iterator : io_object_t
153 routine io_registry_iterator_exit_entry(
154 iterator : io_object_t
157 routine io_registry_entry_from_path(
158 master_port : mach_port_t;
159 in path : io_string_t;
160 out registry_entry : io_object_t
163 routine io_registry_entry_get_name(
164 registry_entry : io_object_t;
168 routine io_registry_entry_get_properties(
169 registry_entry : io_object_t;
170 out properties : io_buf_ptr_t, physicalcopy
173 routine io_registry_entry_get_property_bytes(
174 registry_entry : io_object_t;
175 in property_name : io_name_t;
176 out data : io_struct_inband_t, CountInOut
179 routine io_registry_entry_get_child_iterator(
180 registry_entry : io_object_t;
181 in plane : io_name_t;
182 out iterator : io_object_t
185 routine io_registry_entry_get_parent_iterator(
186 registry_entry : io_object_t;
187 in plane : io_name_t;
188 out iterator : io_object_t
191 routine io_service_open(
192 service : io_object_t;
193 in owningTask : task_t;
194 in connect_type : int;
195 out connection : io_connect_t
198 routine io_service_close(
199 connection : io_connect_t
202 routine io_connect_get_service(
203 connection : io_connect_t;
204 out service : io_object_t
207 routine io_connect_set_notification_port(
208 connection : io_connect_t;
209 in notification_type : int;
210 in port : mach_port_make_send_t;
214 routine io_connect_map_memory(
215 connection : io_connect_t;
216 in memory_type : int;
217 in into_task : task_t;
218 inout address : vm_address_t;
219 inout size : vm_size_t;
223 routine io_connect_add_client(
224 connection : io_connect_t;
225 in connect_to : io_connect_t
228 routine io_connect_set_properties(
229 connection : io_connect_t;
230 in properties : io_buf_ptr_t, physicalcopy;
231 out result : natural_t
235 routine io_connect_method_scalarI_scalarO(
236 connection : io_connect_t;
238 in input : io_scalar_inband_t;
239 out output : io_scalar_inband_t, CountInOut
242 routine io_connect_method_scalarI_structureO(
243 connection : io_connect_t;
245 in input : io_scalar_inband_t;
246 out output : io_struct_inband_t, CountInOut
249 routine io_connect_method_scalarI_structureI(
250 connection : io_connect_t;
252 in input : io_scalar_inband_t;
253 in inputStruct : io_struct_inband_t
256 routine io_connect_method_structureI_structureO(
257 connection : io_connect_t;
259 in input : io_struct_inband_t;
260 out output : io_struct_inband_t, CountInOut
263 routine io_registry_entry_get_path(
264 registry_entry : io_object_t;
265 in plane : io_name_t;
266 out path : io_string_t
269 routine io_registry_get_root_entry(
270 master_port : mach_port_t;
271 out root : io_object_t
274 routine io_registry_entry_set_properties(
275 registry_entry : io_object_t;
276 in properties : io_buf_ptr_t, physicalcopy;
277 out result : natural_t
280 routine io_registry_entry_in_plane(
281 registry_entry : io_object_t;
282 in plane : io_name_t;
283 out inPlane : boolean_t
286 routine io_object_get_retain_count(
287 object : io_object_t;
288 out retainCount : int
291 routine io_service_get_busy_state(
292 service : io_object_t;
296 routine io_service_wait_quiet(
297 service : io_object_t;
298 wait_time : mach_timespec_t
301 routine io_registry_entry_create_iterator(
302 registry_entry : io_object_t;
303 in plane : io_name_t;
305 out iterator : io_object_t
308 routine io_iterator_is_valid(
309 iterator : io_object_t;
310 out is_valid : boolean_t
313 routine io_make_matching(
314 master_port : mach_port_t;
317 in input : io_struct_inband_t;
318 out matching : io_string_t
321 routine io_catalog_send_data(
322 master_port : mach_port_t;
324 in inData : io_buf_ptr_t;
325 out result : natural_t
328 routine io_catalog_terminate(
329 master_port : mach_port_t;
334 routine io_catalog_get_data(
335 master_port : mach_port_t;
337 out outData : io_buf_ptr_t
340 routine io_catalog_get_gen_count(
341 master_port : mach_port_t;
345 routine io_catalog_module_loaded(
346 master_port : mach_port_t;
350 routine io_catalog_reset(
351 master_port : mach_port_t;
355 routine io_service_request_probe(
356 service : io_object_t;
360 routine io_registry_entry_get_name_in_plane(
361 registry_entry : io_object_t;
362 in plane : io_name_t;
366 routine io_service_match_property_table(
367 service : io_object_t;
368 in matching : io_string_t;
369 out matches : boolean_t
372 routine io_async_method_scalarI_scalarO(
373 connection : io_connect_t;
374 in wake_port : mach_port_make_send_t;
375 in reference : io_async_ref_t;
377 in input : io_scalar_inband_t;
378 out output : io_scalar_inband_t, CountInOut
381 routine io_async_method_scalarI_structureO(
382 connection : io_connect_t;
383 in wake_port : mach_port_make_send_t;
384 in reference : io_async_ref_t;
386 in input : io_scalar_inband_t;
387 out output : io_struct_inband_t, CountInOut
390 routine io_async_method_scalarI_structureI(
391 connection : io_connect_t;
392 in wake_port : mach_port_make_send_t;
393 in reference : io_async_ref_t;
395 in input : io_scalar_inband_t;
396 in inputStruct : io_struct_inband_t
399 routine io_async_method_structureI_structureO(
400 connection : io_connect_t;
401 in wake_port : mach_port_make_send_t;
402 in reference : io_async_ref_t;
404 in input : io_struct_inband_t;
405 out output : io_struct_inband_t, CountInOut
408 routine io_service_add_notification(
409 master_port : mach_port_t;
410 in notification_type : io_name_t;
411 in matching : io_string_t;
412 in wake_port : mach_port_make_send_t;
413 in reference : io_async_ref_t;
414 out notification : io_object_t
417 routine io_service_add_interest_notification(
418 service : io_object_t;
419 in type_of_interest : io_name_t;
420 in wake_port : mach_port_make_send_t;
421 in reference : io_async_ref_t;
422 out notification : io_object_t
425 routine io_service_acknowledge_notification(
426 service : io_object_t;
427 in notify_ref : natural_t;
428 in response : natural_t
431 routine io_connect_get_notification_semaphore(
432 connection : io_connect_t;
433 in notification_type : natural_t;
434 out semaphore : semaphore_t
437 routine io_connect_unmap_memory(
438 connection : io_connect_t;
439 in memory_type : int;
440 in into_task : task_t;
441 in address : vm_address_t
444 routine io_registry_entry_get_location_in_plane(
445 registry_entry : io_object_t;
446 in plane : io_name_t;
447 out location : io_name_t
450 routine io_registry_entry_get_property_recursively(
451 registry_entry : io_object_t;
452 in plane : io_name_t;
453 in property_name : io_name_t;
455 out properties : io_buf_ptr_t, physicalcopy
459 routine io_service_get_state(
460 service : io_object_t;
464 routine io_service_get_matching_services_ool(
465 master_port : mach_port_t;
466 in matching : io_buf_ptr_t, physicalcopy;
467 out result : natural_t;
468 out existing : io_object_t
471 routine io_service_match_property_table_ool(
472 service : io_object_t;
473 in matching : io_buf_ptr_t, physicalcopy;
474 out result : natural_t;
475 out matches : boolean_t
478 routine io_service_add_notification_ool(
479 master_port : mach_port_t;
480 in notification_type : io_name_t;
481 in matching : io_buf_ptr_t, physicalcopy;
482 in wake_port : mach_port_make_send_t;
483 in reference : io_async_ref_t;
484 out result : natural_t;
485 out notification : io_object_t
488 routine io_object_get_superclass(
489 master_port : mach_port_t;
490 in obj_name : io_name_t;
491 out class_name : io_name_t
494 routine io_object_get_bundle_identifier(
495 master_port : mach_port_t;
496 in obj_name : io_name_t;
497 out class_name : io_name_t