2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
29 * All Rights Reserved.
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
41 * Carnegie Mellon requests users of this software to return to
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
52 * File: device/device.defs
56 * Mach device support. Mach devices are accessed through
57 * block and character device interfaces to the kernel.
63 #endif /* KERNEL_SERVER */
66 #include <mach/std_types.defs>
67 #include <mach/mach_types.defs>
68 #include <mach/clock_types.defs>
69 #include <mach/clock_types.defs>
71 import <device/device_types.h>;
75 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
80 type io_name_t = c_string[*:128];
81 type io_string_t = c_string[*:512];
82 type io_struct_inband_t = array[*:4096] of char;
83 type io_scalar_inband_t = array[*:16] of int;
84 type io_async_ref_t = array[*:8] of natural_t;
85 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
87 type io_object_t = mach_port_t
90 intran: io_object_t iokit_lookup_object_port(mach_port_t)
91 outtran: mach_port_t iokit_make_object_port(io_object_t)
92 destructor: iokit_remove_reference(io_object_t)
93 #endif /* KERNEL_SERVER */
96 type io_connect_t = mach_port_t
99 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
100 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
101 destructor: iokit_remove_reference(io_connect_t)
102 #endif /* KERNEL_SERVER */
105 routine io_object_get_class(
106 object : io_object_t;
107 out className : io_name_t
110 routine io_object_conforms_to(
111 object : io_object_t;
112 in className : io_name_t;
113 out conforms : boolean_t
116 routine io_iterator_next(
117 iterator : io_object_t;
118 out object : io_object_t
121 routine io_iterator_reset(
122 iterator : io_object_t
125 routine io_service_get_matching_services(
126 master_port : mach_port_t;
127 in matching : io_string_t;
128 out existing : io_object_t
131 routine io_registry_entry_get_property(
132 registry_entry : io_object_t;
133 in property_name : io_name_t;
134 out properties : io_buf_ptr_t, physicalcopy
137 routine io_registry_create_iterator(
138 master_port : mach_port_t;
139 in plane : io_name_t;
141 out iterator : io_object_t
144 routine io_registry_iterator_enter_entry(
145 iterator : io_object_t
148 routine io_registry_iterator_exit_entry(
149 iterator : io_object_t
152 routine io_registry_entry_from_path(
153 master_port : mach_port_t;
154 in path : io_string_t;
155 out registry_entry : io_object_t
158 routine io_registry_entry_get_name(
159 registry_entry : io_object_t;
163 routine io_registry_entry_get_properties(
164 registry_entry : io_object_t;
165 out properties : io_buf_ptr_t, physicalcopy
168 routine io_registry_entry_get_property_bytes(
169 registry_entry : io_object_t;
170 in property_name : io_name_t;
171 out data : io_struct_inband_t, CountInOut
174 routine io_registry_entry_get_child_iterator(
175 registry_entry : io_object_t;
176 in plane : io_name_t;
177 out iterator : io_object_t
180 routine io_registry_entry_get_parent_iterator(
181 registry_entry : io_object_t;
182 in plane : io_name_t;
183 out iterator : io_object_t
186 routine io_service_open(
187 service : io_object_t;
188 in owningTask : task_t;
189 in connect_type : int;
190 out connection : io_connect_t
193 routine io_service_close(
194 connection : io_connect_t
197 routine io_connect_get_service(
198 connection : io_connect_t;
199 out service : io_object_t
202 routine io_connect_set_notification_port(
203 connection : io_connect_t;
204 in notification_type : int;
205 in port : mach_port_make_send_t;
209 routine io_connect_map_memory(
210 connection : io_connect_t;
211 in memory_type : int;
212 in into_task : task_t;
213 inout address : vm_address_t;
214 inout size : vm_size_t;
218 routine io_connect_add_client(
219 connection : io_connect_t;
220 in connect_to : io_connect_t
223 routine io_connect_set_properties(
224 connection : io_connect_t;
225 in properties : io_buf_ptr_t, physicalcopy;
226 out result : natural_t
230 routine io_connect_method_scalarI_scalarO(
231 connection : io_connect_t;
233 in input : io_scalar_inband_t;
234 out output : io_scalar_inband_t, CountInOut
237 routine io_connect_method_scalarI_structureO(
238 connection : io_connect_t;
240 in input : io_scalar_inband_t;
241 out output : io_struct_inband_t, CountInOut
244 routine io_connect_method_scalarI_structureI(
245 connection : io_connect_t;
247 in input : io_scalar_inband_t;
248 in inputStruct : io_struct_inband_t
251 routine io_connect_method_structureI_structureO(
252 connection : io_connect_t;
254 in input : io_struct_inband_t;
255 out output : io_struct_inband_t, CountInOut
258 routine io_registry_entry_get_path(
259 registry_entry : io_object_t;
260 in plane : io_name_t;
261 out path : io_string_t
264 routine io_registry_get_root_entry(
265 master_port : mach_port_t;
266 out root : io_object_t
269 routine io_registry_entry_set_properties(
270 registry_entry : io_object_t;
271 in properties : io_buf_ptr_t, physicalcopy;
272 out result : natural_t
275 routine io_registry_entry_in_plane(
276 registry_entry : io_object_t;
277 in plane : io_name_t;
278 out inPlane : boolean_t
281 routine io_object_get_retain_count(
282 object : io_object_t;
283 out retainCount : int
286 routine io_service_get_busy_state(
287 service : io_object_t;
291 routine io_service_wait_quiet(
292 service : io_object_t;
293 wait_time : mach_timespec_t
296 routine io_registry_entry_create_iterator(
297 registry_entry : io_object_t;
298 in plane : io_name_t;
300 out iterator : io_object_t
303 routine io_iterator_is_valid(
304 iterator : io_object_t;
305 out is_valid : boolean_t
308 routine io_make_matching(
309 master_port : mach_port_t;
312 in input : io_struct_inband_t;
313 out matching : io_string_t
316 routine io_catalog_send_data(
317 master_port : mach_port_t;
319 in inData : io_buf_ptr_t;
320 out result : natural_t
323 routine io_catalog_terminate(
324 master_port : mach_port_t;
329 routine io_catalog_get_data(
330 master_port : mach_port_t;
332 out outData : io_buf_ptr_t
335 routine io_catalog_get_gen_count(
336 master_port : mach_port_t;
340 routine io_catalog_module_loaded(
341 master_port : mach_port_t;
345 routine io_catalog_reset(
346 master_port : mach_port_t;
350 routine io_service_request_probe(
351 service : io_object_t;
355 routine io_registry_entry_get_name_in_plane(
356 registry_entry : io_object_t;
357 in plane : io_name_t;
361 routine io_service_match_property_table(
362 service : io_object_t;
363 in matching : io_string_t;
364 out matches : boolean_t
367 routine io_async_method_scalarI_scalarO(
368 connection : io_connect_t;
369 in wake_port : mach_port_make_send_t;
370 in reference : io_async_ref_t;
372 in input : io_scalar_inband_t;
373 out output : io_scalar_inband_t, CountInOut
376 routine io_async_method_scalarI_structureO(
377 connection : io_connect_t;
378 in wake_port : mach_port_make_send_t;
379 in reference : io_async_ref_t;
381 in input : io_scalar_inband_t;
382 out output : io_struct_inband_t, CountInOut
385 routine io_async_method_scalarI_structureI(
386 connection : io_connect_t;
387 in wake_port : mach_port_make_send_t;
388 in reference : io_async_ref_t;
390 in input : io_scalar_inband_t;
391 in inputStruct : io_struct_inband_t
394 routine io_async_method_structureI_structureO(
395 connection : io_connect_t;
396 in wake_port : mach_port_make_send_t;
397 in reference : io_async_ref_t;
399 in input : io_struct_inband_t;
400 out output : io_struct_inband_t, CountInOut
403 routine io_service_add_notification(
404 master_port : mach_port_t;
405 in notification_type : io_name_t;
406 in matching : io_string_t;
407 in wake_port : mach_port_make_send_t;
408 in reference : io_async_ref_t;
409 out notification : io_object_t
412 routine io_service_add_interest_notification(
413 service : io_object_t;
414 in type_of_interest : io_name_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_acknowledge_notification(
421 service : io_object_t;
422 in notify_ref : natural_t;
423 in response : natural_t
426 routine io_connect_get_notification_semaphore(
427 connection : io_connect_t;
428 in notification_type : natural_t;
429 out semaphore : semaphore_t
432 routine io_connect_unmap_memory(
433 connection : io_connect_t;
434 in memory_type : int;
435 in into_task : task_t;
436 in address : vm_address_t
439 routine io_registry_entry_get_location_in_plane(
440 registry_entry : io_object_t;
441 in plane : io_name_t;
442 out location : io_name_t
445 routine io_registry_entry_get_property_recursively(
446 registry_entry : io_object_t;
447 in plane : io_name_t;
448 in property_name : io_name_t;
450 out properties : io_buf_ptr_t, physicalcopy
454 routine io_service_get_state(
455 service : io_object_t;
459 routine io_service_get_matching_services_ool(
460 master_port : mach_port_t;
461 in matching : io_buf_ptr_t, physicalcopy;
462 out result : natural_t;
463 out existing : io_object_t
466 routine io_service_match_property_table_ool(
467 service : io_object_t;
468 in matching : io_buf_ptr_t, physicalcopy;
469 out result : natural_t;
470 out matches : boolean_t
473 routine io_service_add_notification_ool(
474 master_port : mach_port_t;
475 in notification_type : io_name_t;
476 in matching : io_buf_ptr_t, physicalcopy;
477 in wake_port : mach_port_make_send_t;
478 in reference : io_async_ref_t;
479 out result : natural_t;
480 out notification : io_object_t
483 routine io_object_get_superclass(
484 master_port : mach_port_t;
485 in obj_name : io_name_t;
486 out class_name : io_name_t
489 routine io_object_get_bundle_identifier(
490 master_port : mach_port_t;
491 in obj_name : io_name_t;
492 out class_name : io_name_t