2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_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
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
36 * All Rights Reserved.
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 * Carnegie Mellon requests users of this software to return to
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
59 * File: device/device.defs
63 * Mach device support. Mach devices are accessed through
64 * block and character device interfaces to the kernel.
70 #endif /* KERNEL_SERVER */
73 #include <mach/std_types.defs>
74 #include <mach/mach_types.defs>
75 #include <mach/clock_types.defs>
76 #include <mach/clock_types.defs>
78 import <device/device_types.h>;
82 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
87 type io_name_t = c_string[*:128];
88 type io_string_t = c_string[*:512];
89 type io_struct_inband_t = array[*:4096] of char;
90 type io_scalar_inband_t = array[*:16] of int;
91 type io_async_ref_t = array[*:8] of natural_t;
92 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
93 type NDR_record_t = struct[8] of char;
95 type io_object_t = mach_port_t
98 intran: io_object_t iokit_lookup_object_port(mach_port_t)
99 outtran: mach_port_t iokit_make_object_port(io_object_t)
100 destructor: iokit_remove_reference(io_object_t)
101 #endif /* KERNEL_SERVER */
104 type io_connect_t = mach_port_t
107 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
108 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
109 destructor: iokit_remove_reference(io_connect_t)
110 #endif /* KERNEL_SERVER */
113 routine io_object_get_class(
114 object : io_object_t;
115 out className : io_name_t
118 routine io_object_conforms_to(
119 object : io_object_t;
120 in className : io_name_t;
121 out conforms : boolean_t
124 routine io_iterator_next(
125 iterator : io_object_t;
126 out object : io_object_t
129 routine io_iterator_reset(
130 iterator : io_object_t
133 routine io_service_get_matching_services(
134 master_port : mach_port_t;
135 in matching : io_string_t;
136 out existing : io_object_t
139 routine io_registry_entry_get_property(
140 registry_entry : io_object_t;
141 in property_name : io_name_t;
142 out properties : io_buf_ptr_t, physicalcopy
145 routine io_registry_create_iterator(
146 master_port : mach_port_t;
147 in plane : io_name_t;
149 out iterator : io_object_t
152 routine io_registry_iterator_enter_entry(
153 iterator : io_object_t
156 routine io_registry_iterator_exit_entry(
157 iterator : io_object_t
160 routine io_registry_entry_from_path(
161 master_port : mach_port_t;
162 in path : io_string_t;
163 out registry_entry : io_object_t
166 routine io_registry_entry_get_name(
167 registry_entry : io_object_t;
171 routine io_registry_entry_get_properties(
172 registry_entry : io_object_t;
173 out properties : io_buf_ptr_t, physicalcopy
176 routine io_registry_entry_get_property_bytes(
177 registry_entry : io_object_t;
178 in property_name : io_name_t;
179 out data : io_struct_inband_t, CountInOut
182 routine io_registry_entry_get_child_iterator(
183 registry_entry : io_object_t;
184 in plane : io_name_t;
185 out iterator : io_object_t
188 routine io_registry_entry_get_parent_iterator(
189 registry_entry : io_object_t;
190 in plane : io_name_t;
191 out iterator : io_object_t
194 routine io_service_open(
195 service : io_object_t;
196 in owningTask : task_t;
197 in connect_type : int;
198 out connection : io_connect_t
201 routine io_service_close(
202 connection : io_connect_t
205 routine io_connect_get_service(
206 connection : io_connect_t;
207 out service : io_object_t
210 routine io_connect_set_notification_port(
211 connection : io_connect_t;
212 in notification_type : int;
213 in port : mach_port_make_send_t;
217 routine io_connect_map_memory(
218 connection : io_connect_t;
219 in memory_type : int;
220 in into_task : task_t;
221 inout address : vm_address_t;
222 inout size : vm_size_t;
226 routine io_connect_add_client(
227 connection : io_connect_t;
228 in connect_to : io_connect_t
231 routine io_connect_set_properties(
232 connection : io_connect_t;
233 in properties : io_buf_ptr_t, physicalcopy;
234 out result : natural_t
238 routine io_connect_method_scalarI_scalarO(
239 connection : io_connect_t;
241 in input : io_scalar_inband_t;
242 out output : io_scalar_inband_t, CountInOut
245 routine io_connect_method_scalarI_structureO(
246 connection : io_connect_t;
248 in input : io_scalar_inband_t;
249 out output : io_struct_inband_t, CountInOut
252 routine io_connect_method_scalarI_structureI(
253 connection : io_connect_t;
255 in input : io_scalar_inband_t;
256 in inputStruct : io_struct_inband_t
259 routine io_connect_method_structureI_structureO(
260 connection : io_connect_t;
262 in input : io_struct_inband_t;
263 out output : io_struct_inband_t, CountInOut
266 routine io_registry_entry_get_path(
267 registry_entry : io_object_t;
268 in plane : io_name_t;
269 out path : io_string_t
272 routine io_registry_get_root_entry(
273 master_port : mach_port_t;
274 out root : io_object_t
277 routine io_registry_entry_set_properties(
278 registry_entry : io_object_t;
279 in properties : io_buf_ptr_t, physicalcopy;
280 out result : natural_t
283 routine io_registry_entry_in_plane(
284 registry_entry : io_object_t;
285 in plane : io_name_t;
286 out inPlane : boolean_t
289 routine io_object_get_retain_count(
290 object : io_object_t;
291 out retainCount : int
294 routine io_service_get_busy_state(
295 service : io_object_t;
299 routine io_service_wait_quiet(
300 service : io_object_t;
301 wait_time : mach_timespec_t
304 routine io_registry_entry_create_iterator(
305 registry_entry : io_object_t;
306 in plane : io_name_t;
308 out iterator : io_object_t
311 routine io_iterator_is_valid(
312 iterator : io_object_t;
313 out is_valid : boolean_t
316 routine io_make_matching(
317 master_port : mach_port_t;
320 in input : io_struct_inband_t;
321 out matching : io_string_t
324 routine io_catalog_send_data(
325 master_port : mach_port_t;
327 in inData : io_buf_ptr_t;
328 out result : natural_t
331 routine io_catalog_terminate(
332 master_port : mach_port_t;
337 routine io_catalog_get_data(
338 master_port : mach_port_t;
340 out outData : io_buf_ptr_t
343 routine io_catalog_get_gen_count(
344 master_port : mach_port_t;
348 routine io_catalog_module_loaded(
349 master_port : mach_port_t;
353 routine io_catalog_reset(
354 master_port : mach_port_t;
358 routine io_service_request_probe(
359 service : io_object_t;
363 routine io_registry_entry_get_name_in_plane(
364 registry_entry : io_object_t;
365 in plane : io_name_t;
369 routine io_service_match_property_table(
370 service : io_object_t;
371 in matching : io_string_t;
372 out matches : boolean_t
375 routine io_async_method_scalarI_scalarO(
376 connection : io_connect_t;
377 in wake_port : mach_port_make_send_t;
378 in reference : io_async_ref_t;
380 in input : io_scalar_inband_t;
381 out output : io_scalar_inband_t, CountInOut
384 routine io_async_method_scalarI_structureO(
385 connection : io_connect_t;
386 in wake_port : mach_port_make_send_t;
387 in reference : io_async_ref_t;
389 in input : io_scalar_inband_t;
390 out output : io_struct_inband_t, CountInOut
393 routine io_async_method_scalarI_structureI(
394 connection : io_connect_t;
395 in wake_port : mach_port_make_send_t;
396 in reference : io_async_ref_t;
398 in input : io_scalar_inband_t;
399 in inputStruct : io_struct_inband_t
402 routine io_async_method_structureI_structureO(
403 connection : io_connect_t;
404 in wake_port : mach_port_make_send_t;
405 in reference : io_async_ref_t;
407 in input : io_struct_inband_t;
408 out output : io_struct_inband_t, CountInOut
411 routine io_service_add_notification(
412 master_port : mach_port_t;
413 in notification_type : io_name_t;
414 in matching : io_string_t;
415 in wake_port : mach_port_make_send_t;
416 in reference : io_async_ref_t;
417 out notification : io_object_t
420 routine io_service_add_interest_notification(
421 service : io_object_t;
422 in type_of_interest : io_name_t;
423 in wake_port : mach_port_make_send_t;
424 in reference : io_async_ref_t;
425 out notification : io_object_t
428 routine io_service_acknowledge_notification(
429 service : io_object_t;
430 in notify_ref : natural_t;
431 in response : natural_t
434 routine io_connect_get_notification_semaphore(
435 connection : io_connect_t;
436 in notification_type : natural_t;
437 out semaphore : semaphore_t
440 routine io_connect_unmap_memory(
441 connection : io_connect_t;
442 in memory_type : int;
443 in into_task : task_t;
444 in address : vm_address_t
447 routine io_registry_entry_get_location_in_plane(
448 registry_entry : io_object_t;
449 in plane : io_name_t;
450 out location : io_name_t
453 routine io_registry_entry_get_property_recursively(
454 registry_entry : io_object_t;
455 in plane : io_name_t;
456 in property_name : io_name_t;
458 out properties : io_buf_ptr_t, physicalcopy
462 routine io_service_get_state(
463 service : io_object_t;
467 routine io_service_get_matching_services_ool(
468 master_port : mach_port_t;
469 in matching : io_buf_ptr_t, physicalcopy;
470 out result : natural_t;
471 out existing : io_object_t
474 routine io_service_match_property_table_ool(
475 service : io_object_t;
476 in matching : io_buf_ptr_t, physicalcopy;
477 out result : natural_t;
478 out matches : boolean_t
481 routine io_service_add_notification_ool(
482 master_port : mach_port_t;
483 in notification_type : io_name_t;
484 in matching : io_buf_ptr_t, physicalcopy;
485 in wake_port : mach_port_make_send_t;
486 in reference : io_async_ref_t;
487 out result : natural_t;
488 out notification : io_object_t
491 routine io_object_get_superclass(
492 master_port : mach_port_t;
493 in obj_name : io_name_t;
494 out class_name : io_name_t
497 routine io_object_get_bundle_identifier(
498 master_port : mach_port_t;
499 in obj_name : io_name_t;
500 out class_name : io_name_t
503 routine io_service_open_extended(
504 service : io_object_t;
505 in owningTask : task_t;
506 in connect_type : int;
507 in ndr : NDR_record_t;
508 in properties : io_buf_ptr_t, physicalcopy;
509 out result : natural_t;
510 out connection : io_connect_t