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>
80 import <device/device_types.h>;
84 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
89 type io_name_t = c_string[*:128];
90 type io_string_t = c_string[*:512];
91 type io_struct_inband_t = array[*:4096] of char;
92 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
93 type NDR_record_t = struct[8] of char;
96 type io_user_scalar_t = uint64_t;
97 type io_user_reference_t = uint64_t;
98 type io_scalar_inband_t = array[*:16] of int;
99 type io_async_ref_t = array[*:8] of natural_t;
100 type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
101 type io_async_ref64_t = array[*:8] of io_user_reference_t;
103 type io_user_scalar_t = uint64_t;
104 type io_user_reference_t = uint64_t;
105 type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
106 type io_async_ref_t = array[*:8] of io_user_reference_t;
107 type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
108 type io_async_ref64_t = array[*:8] of io_user_reference_t;
110 type io_user_scalar_t = int;
111 type io_user_reference_t = natural_t;
112 type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
113 type io_async_ref_t = array[*:8] of io_user_reference_t;
114 type io_scalar_inband64_t = array[*:16] of uint64_t;
115 type io_async_ref64_t = array[*:8] of uint64_t;
118 type io_object_t = mach_port_t
121 intran: io_object_t iokit_lookup_object_port(mach_port_t)
122 outtran: mach_port_t iokit_make_object_port(io_object_t)
123 destructor: iokit_remove_reference(io_object_t)
124 #endif /* KERNEL_SERVER */
127 type io_connect_t = mach_port_t
130 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
131 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
132 destructor: iokit_remove_reference(io_connect_t)
133 #endif /* KERNEL_SERVER */
136 routine io_object_get_class(
137 object : io_object_t;
138 out className : io_name_t
141 routine io_object_conforms_to(
142 object : io_object_t;
143 in className : io_name_t;
144 out conforms : boolean_t
147 routine io_iterator_next(
148 iterator : io_object_t;
149 out object : io_object_t
152 routine io_iterator_reset(
153 iterator : io_object_t
156 routine io_service_get_matching_services(
157 master_port : mach_port_t;
158 in matching : io_string_t;
159 out existing : io_object_t
162 routine io_registry_entry_get_property(
163 registry_entry : io_object_t;
164 in property_name : io_name_t;
165 out properties : io_buf_ptr_t, physicalcopy
168 routine io_registry_create_iterator(
169 master_port : mach_port_t;
170 in plane : io_name_t;
171 in options : uint32_t;
172 out iterator : io_object_t
175 routine io_registry_iterator_enter_entry(
176 iterator : io_object_t
179 routine io_registry_iterator_exit_entry(
180 iterator : io_object_t
183 routine io_registry_entry_from_path(
184 master_port : mach_port_t;
185 in path : io_string_t;
186 out registry_entry : io_object_t
189 routine io_registry_entry_get_name(
190 registry_entry : io_object_t;
194 routine io_registry_entry_get_properties(
195 registry_entry : io_object_t;
196 out properties : io_buf_ptr_t, physicalcopy
199 routine io_registry_entry_get_property_bytes(
200 registry_entry : io_object_t;
201 in property_name : io_name_t;
202 out data : io_struct_inband_t, CountInOut
205 routine io_registry_entry_get_child_iterator(
206 registry_entry : io_object_t;
207 in plane : io_name_t;
208 out iterator : io_object_t
211 routine io_registry_entry_get_parent_iterator(
212 registry_entry : io_object_t;
213 in plane : io_name_t;
214 out iterator : io_object_t
217 routine io_service_open(
218 service : io_object_t;
219 in owningTask : task_t;
220 in connect_type : uint32_t;
221 out connection : io_connect_t
224 routine io_service_close(
225 connection : io_connect_t
228 routine io_connect_get_service(
229 connection : io_connect_t;
230 out service : io_object_t
233 #if KERNEL_SERVER || __ILP32__
234 routine io_connect_set_notification_port(
235 connection : io_connect_t;
236 in notification_type : uint32_t;
237 in port : mach_port_make_send_t;
238 in reference : uint32_t
241 routine io_connect_map_memory(
242 connection : io_connect_t;
243 in memory_type : uint32_t;
244 in into_task : task_t;
245 inout address : vm_address_t;
246 inout size : vm_size_t;
254 routine io_connect_add_client(
255 connection : io_connect_t;
256 in connect_to : io_connect_t
259 routine io_connect_set_properties(
260 connection : io_connect_t;
261 in properties : io_buf_ptr_t, physicalcopy;
262 out result : kern_return_t
265 #if KERNEL_SERVER || (__ILP32__ && !MAP_32B_METHODS)
266 routine io_connect_method_scalarI_scalarO(
267 connection : io_connect_t;
268 in selector : uint32_t;
269 in input : io_scalar_inband_t;
270 out output : io_scalar_inband_t, CountInOut
273 routine io_connect_method_scalarI_structureO(
274 connection : io_connect_t;
275 in selector : uint32_t;
276 in input : io_scalar_inband_t;
277 out output : io_struct_inband_t, CountInOut
280 routine io_connect_method_scalarI_structureI(
281 connection : io_connect_t;
282 in selector : uint32_t;
283 in input : io_scalar_inband_t;
284 in inputStruct : io_struct_inband_t
287 routine io_connect_method_structureI_structureO(
288 connection : io_connect_t;
289 in selector : uint32_t;
290 in input : io_struct_inband_t;
291 out output : io_struct_inband_t, CountInOut
300 routine io_registry_entry_get_path(
301 registry_entry : io_object_t;
302 in plane : io_name_t;
303 out path : io_string_t
306 routine io_registry_get_root_entry(
307 master_port : mach_port_t;
308 out root : io_object_t
311 routine io_registry_entry_set_properties(
312 registry_entry : io_object_t;
313 in properties : io_buf_ptr_t, physicalcopy;
314 out result : kern_return_t
317 routine io_registry_entry_in_plane(
318 registry_entry : io_object_t;
319 in plane : io_name_t;
320 out inPlane : boolean_t
323 routine io_object_get_retain_count(
324 object : io_object_t;
325 out retainCount : uint32_t
328 routine io_service_get_busy_state(
329 service : io_object_t;
330 out busyState : uint32_t
333 routine io_service_wait_quiet(
334 service : io_object_t;
335 wait_time : mach_timespec_t
338 routine io_registry_entry_create_iterator(
339 registry_entry : io_object_t;
340 in plane : io_name_t;
341 in options : uint32_t;
342 out iterator : io_object_t
345 routine io_iterator_is_valid(
346 iterator : io_object_t;
347 out is_valid : boolean_t
350 routine io_make_matching(
351 master_port : mach_port_t;
352 in of_type : uint32_t;
353 in options : uint32_t;
354 in input : io_struct_inband_t;
355 out matching : io_string_t
358 routine io_catalog_send_data(
359 master_port : mach_port_t;
361 in inData : io_buf_ptr_t;
362 out result : kern_return_t
365 routine io_catalog_terminate(
366 master_port : mach_port_t;
371 routine io_catalog_get_data(
372 master_port : mach_port_t;
374 out outData : io_buf_ptr_t
377 routine io_catalog_get_gen_count(
378 master_port : mach_port_t;
379 out genCount : uint32_t
382 routine io_catalog_module_loaded(
383 master_port : mach_port_t;
387 routine io_catalog_reset(
388 master_port : mach_port_t;
392 routine io_service_request_probe(
393 service : io_object_t;
394 in options : uint32_t
397 routine io_registry_entry_get_name_in_plane(
398 registry_entry : io_object_t;
399 in plane : io_name_t;
403 routine io_service_match_property_table(
404 service : io_object_t;
405 in matching : io_string_t;
406 out matches : boolean_t
409 #if KERNEL_SERVER || (__ILP32__ && !MAP_32B_ASYNC_METHODS)
410 routine io_async_method_scalarI_scalarO(
411 connection : io_connect_t;
412 in wake_port : mach_port_make_send_t;
413 in reference : io_async_ref_t;
414 in selector : uint32_t;
415 in input : io_scalar_inband_t;
416 out output : io_scalar_inband_t, CountInOut
418 routine io_async_method_scalarI_structureO(
419 connection : io_connect_t;
420 in wake_port : mach_port_make_send_t;
421 in reference : io_async_ref_t;
422 in selector : uint32_t;
423 in input : io_scalar_inband_t;
424 out output : io_struct_inband_t, CountInOut
426 routine io_async_method_scalarI_structureI(
427 connection : io_connect_t;
428 in wake_port : mach_port_make_send_t;
429 in reference : io_async_ref_t;
430 in selector : uint32_t;
431 in input : io_scalar_inband_t;
432 in inputStruct : io_struct_inband_t
434 routine io_async_method_structureI_structureO(
435 connection : io_connect_t;
436 in wake_port : mach_port_make_send_t;
437 in reference : io_async_ref_t;
438 in selector : uint32_t;
439 in input : io_struct_inband_t;
440 out output : io_struct_inband_t, CountInOut
449 #if KERNEL_SERVER || __ILP32__
450 routine io_service_add_notification(
451 master_port : mach_port_t;
452 in notification_type : io_name_t;
453 in matching : io_string_t;
454 in wake_port : mach_port_make_send_t;
455 in reference : io_async_ref_t;
456 out notification : io_object_t
458 routine io_service_add_interest_notification(
459 service : io_object_t;
460 in type_of_interest : io_name_t;
461 in wake_port : mach_port_make_send_t;
462 in reference : io_async_ref_t;
463 out notification : io_object_t
465 routine io_service_acknowledge_notification(
466 service : io_object_t;
467 in notify_ref : natural_t;
468 in response : natural_t
476 routine io_connect_get_notification_semaphore(
477 connection : io_connect_t;
478 in notification_type : natural_t;
479 out semaphore : semaphore_t
482 #if KERNEL_SERVER || __ILP32__
483 routine io_connect_unmap_memory(
484 connection : io_connect_t;
485 in memory_type : uint32_t;
486 in into_task : task_t;
487 in address : vm_address_t
493 routine io_registry_entry_get_location_in_plane(
494 registry_entry : io_object_t;
495 in plane : io_name_t;
496 out location : io_name_t
499 routine io_registry_entry_get_property_recursively(
500 registry_entry : io_object_t;
501 in plane : io_name_t;
502 in property_name : io_name_t;
503 in options : uint32_t;
504 out properties : io_buf_ptr_t, physicalcopy
508 routine io_service_get_state(
509 service : io_object_t;
513 routine io_service_get_matching_services_ool(
514 master_port : mach_port_t;
515 in matching : io_buf_ptr_t, physicalcopy;
516 out result : kern_return_t;
517 out existing : io_object_t
520 routine io_service_match_property_table_ool(
521 service : io_object_t;
522 in matching : io_buf_ptr_t, physicalcopy;
523 out result : kern_return_t;
524 out matches : boolean_t
527 #if KERNEL_SERVER || __ILP32__
528 routine io_service_add_notification_ool(
529 master_port : mach_port_t;
530 in notification_type : io_name_t;
531 in matching : io_buf_ptr_t, physicalcopy;
532 in wake_port : mach_port_make_send_t;
533 in reference : io_async_ref_t;
534 out result : kern_return_t;
535 out notification : io_object_t
541 routine io_object_get_superclass(
542 master_port : mach_port_t;
543 in obj_name : io_name_t;
544 out class_name : io_name_t
547 routine io_object_get_bundle_identifier(
548 master_port : mach_port_t;
549 in obj_name : io_name_t;
550 out class_name : io_name_t
553 routine io_service_open_extended(
554 service : io_object_t;
555 in owningTask : task_t;
556 in connect_type : uint32_t;
557 in ndr : NDR_record_t;
558 in properties : io_buf_ptr_t, physicalcopy;
559 out result : kern_return_t;
560 out connection : io_connect_t
564 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
566 routine io_connect_map_memory_into_task(
567 connection : io_connect_t;
568 in memory_type : uint32_t;
569 in into_task : task_t;
570 inout address : mach_vm_address_t;
571 inout size : mach_vm_size_t;
575 routine io_connect_unmap_memory_from_task(
576 connection : io_connect_t;
577 in memory_type : uint32_t;
578 in from_task : task_t;
579 in address : mach_vm_address_t
582 routine io_connect_method(
583 connection : io_connect_t;
584 in selector : uint32_t;
586 in scalar_input : io_scalar_inband64_t;
587 in inband_input : io_struct_inband_t;
588 in ool_input : mach_vm_address_t;
589 in ool_input_size : mach_vm_size_t;
591 out scalar_output : io_scalar_inband64_t, CountInOut;
592 out inband_output : io_struct_inband_t, CountInOut;
593 in ool_output : mach_vm_address_t;
594 inout ool_output_size : mach_vm_size_t
597 routine io_connect_async_method(
598 connection : io_connect_t;
599 in wake_port : mach_port_make_send_t;
600 in reference : io_async_ref64_t;
601 in selector : uint32_t;
603 in scalar_input : io_scalar_inband64_t;
604 in inband_input : io_struct_inband_t;
605 in ool_input : mach_vm_address_t;
606 in ool_input_size : mach_vm_size_t;
608 out scalar_output : io_scalar_inband64_t, CountInOut;
609 out inband_output : io_struct_inband_t, CountInOut;
610 in ool_output : mach_vm_address_t;
611 inout ool_output_size : mach_vm_size_t
615 #if KERNEL_SERVER || __LP64__
618 #define FUNC_NAME(name) name ## _64
620 #define FUNC_NAME(name) name
623 routine FUNC_NAME(io_connect_set_notification_port)(
624 connection : io_connect_t;
625 in notification_type : uint32_t;
626 in port : mach_port_make_send_t;
627 in reference : io_user_reference_t
630 routine FUNC_NAME(io_service_add_notification)(
631 master_port : mach_port_t;
632 in notification_type : io_name_t;
633 in matching : io_string_t;
634 in wake_port : mach_port_make_send_t;
635 in reference : io_async_ref64_t;
636 out notification : io_object_t
639 routine FUNC_NAME(io_service_add_interest_notification)(
640 service : io_object_t;
641 in type_of_interest : io_name_t;
642 in wake_port : mach_port_make_send_t;
643 in reference : io_async_ref64_t;
644 out notification : io_object_t
647 routine FUNC_NAME(io_service_add_notification_ool)(
648 master_port : mach_port_t;
649 in notification_type : io_name_t;
650 in matching : io_buf_ptr_t, physicalcopy;
651 in wake_port : mach_port_make_send_t;
652 in reference : io_async_ref64_t;
653 out result : kern_return_t;
654 out notification : io_object_t
658 #endif /* KERNEL_SERVER || __LP64__ */
662 /* vim: set ft=c : */