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 #if IOKITSIMD || KERNEL_SERVER
72 #define IOKIT_ALL_IPC 1
75 #include <mach/std_types.defs>
76 #include <mach/mach_types.defs>
77 #include <mach/clock_types.defs>
78 #include <mach/clock_types.defs>
84 import <device/device_types.h>;
88 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
93 type io_name_t = c_string[*:128];
94 type io_string_t = c_string[*:512];
95 type io_struct_inband_t = array[*:4096] of char;
96 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
97 type NDR_record_t = struct[8] of char;
100 type io_user_scalar_t = uint64_t;
101 type io_user_reference_t = uint64_t;
102 type io_scalar_inband_t = array[*:16] of int;
103 // must be the same type as OSAsyncReference
104 type io_async_ref_t = array[*:8] of natural_t;
105 type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
106 type io_async_ref64_t = array[*:8] of io_user_reference_t;
108 type io_user_scalar_t = uint64_t;
109 type io_user_reference_t = uint64_t;
110 type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
111 type io_async_ref_t = array[*:8] of io_user_reference_t;
112 type io_scalar_inband64_t = array[*:16] of io_user_scalar_t;
113 type io_async_ref64_t = array[*:8] of io_user_reference_t;
115 type io_user_scalar_t = int;
116 type io_user_reference_t = natural_t;
117 type io_scalar_inband_t = array[*:16] of io_user_scalar_t;
118 type io_async_ref_t = array[*:8] of io_user_reference_t;
119 type io_scalar_inband64_t = array[*:16] of uint64_t;
120 type io_async_ref64_t = array[*:8] of uint64_t;
123 type io_object_t = mach_port_t
126 intran: io_object_t iokit_lookup_object_port(mach_port_t)
127 outtran: mach_port_t iokit_make_object_port(io_object_t)
128 destructor: iokit_remove_reference(io_object_t)
129 #endif /* KERNEL_SERVER */
132 type io_connect_t = mach_port_t
135 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
136 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
137 destructor: iokit_remove_reference(io_connect_t)
138 #endif /* KERNEL_SERVER */
141 routine io_object_get_class(
142 object : io_object_t;
143 out className : io_name_t
146 routine io_object_conforms_to(
147 object : io_object_t;
148 in className : io_name_t;
149 out conforms : boolean_t
152 routine io_iterator_next(
153 iterator : io_object_t;
154 out object : io_object_t
157 routine io_iterator_reset(
158 iterator : io_object_t
161 routine io_service_get_matching_services(
162 master_port : mach_port_t;
163 in matching : io_string_t;
164 out existing : io_object_t
167 routine io_registry_entry_get_property(
168 registry_entry : io_object_t;
169 in property_name : io_name_t;
170 out properties : io_buf_ptr_t, physicalcopy
173 routine io_registry_create_iterator(
174 master_port : mach_port_t;
175 in plane : io_name_t;
176 in options : uint32_t;
177 out iterator : io_object_t
180 routine io_registry_iterator_enter_entry(
181 iterator : io_object_t
184 routine io_registry_iterator_exit_entry(
185 iterator : io_object_t
188 routine io_registry_entry_from_path(
189 master_port : mach_port_t;
190 in path : io_string_t;
191 out registry_entry : io_object_t
194 routine io_registry_entry_get_name(
195 registry_entry : io_object_t;
199 routine io_registry_entry_get_properties(
200 registry_entry : io_object_t;
201 out properties : io_buf_ptr_t, physicalcopy
204 routine io_registry_entry_get_property_bytes(
205 registry_entry : io_object_t;
206 in property_name : io_name_t;
207 out data : io_struct_inband_t, CountInOut
210 routine io_registry_entry_get_child_iterator(
211 registry_entry : io_object_t;
212 in plane : io_name_t;
213 out iterator : io_object_t
216 routine io_registry_entry_get_parent_iterator(
217 registry_entry : io_object_t;
218 in plane : io_name_t;
219 out iterator : io_object_t
223 /* was routine io_service_open
224 service : io_object_t;
225 in owningTask : task_t;
226 in connect_type : uint32_t;
227 out connection : io_connect_t
231 routine io_service_close(
232 connection : io_connect_t
235 routine io_connect_get_service(
236 connection : io_connect_t;
237 out service : io_object_t
240 #if IOKIT_ALL_IPC || __ILP32__
241 routine io_connect_set_notification_port(
242 connection : io_connect_t;
243 in notification_type : uint32_t;
244 in port : mach_port_make_send_t;
245 in reference : uint32_t
248 routine io_connect_map_memory(
249 connection : io_connect_t;
250 in memory_type : uint32_t;
251 in into_task : task_t;
253 inout address : uint32_t;
254 inout size : uint32_t;
256 inout address : vm_address_t;
257 inout size : vm_size_t;
266 routine io_connect_add_client(
267 connection : io_connect_t;
268 in connect_to : io_connect_t
271 routine io_connect_set_properties(
272 connection : io_connect_t;
273 in properties : io_buf_ptr_t, physicalcopy;
274 out result : kern_return_t
277 #if IOKIT_ALL_IPC || (__ILP32__ && !MAP_32B_METHODS)
278 routine io_connect_method_scalarI_scalarO(
279 connection : io_connect_t;
280 in selector : uint32_t;
281 in input : io_scalar_inband_t;
282 out output : io_scalar_inband_t, CountInOut
285 routine io_connect_method_scalarI_structureO(
286 connection : io_connect_t;
287 in selector : uint32_t;
288 in input : io_scalar_inband_t;
289 out output : io_struct_inband_t, CountInOut
292 routine io_connect_method_scalarI_structureI(
293 connection : io_connect_t;
294 in selector : uint32_t;
295 in input : io_scalar_inband_t;
296 in inputStruct : io_struct_inband_t
299 routine io_connect_method_structureI_structureO(
300 connection : io_connect_t;
301 in selector : uint32_t;
302 in input : io_struct_inband_t;
303 out output : io_struct_inband_t, CountInOut
312 routine io_registry_entry_get_path(
313 registry_entry : io_object_t;
314 in plane : io_name_t;
315 out path : io_string_t
318 routine io_registry_get_root_entry(
319 master_port : mach_port_t;
320 out root : io_object_t
323 routine io_registry_entry_set_properties(
324 registry_entry : io_object_t;
325 in properties : io_buf_ptr_t, physicalcopy;
326 out result : kern_return_t
329 routine io_registry_entry_in_plane(
330 registry_entry : io_object_t;
331 in plane : io_name_t;
332 out inPlane : boolean_t
335 routine io_object_get_retain_count(
336 object : io_object_t;
337 out retainCount : uint32_t
340 routine io_service_get_busy_state(
341 service : io_object_t;
342 out busyState : uint32_t
345 routine io_service_wait_quiet(
346 service : io_object_t;
347 wait_time : mach_timespec_t
350 routine io_registry_entry_create_iterator(
351 registry_entry : io_object_t;
352 in plane : io_name_t;
353 in options : uint32_t;
354 out iterator : io_object_t
357 routine io_iterator_is_valid(
358 iterator : io_object_t;
359 out is_valid : boolean_t
363 /* was routine io_make_matching(
364 master_port : mach_port_t;
365 in of_type : uint32_t;
366 in options : uint32_t;
367 in input : io_struct_inband_t;
368 out matching : io_string_t
372 routine io_catalog_send_data(
373 master_port : mach_port_t;
375 in inData : io_buf_ptr_t;
376 out result : kern_return_t
379 routine io_catalog_terminate(
380 master_port : mach_port_t;
385 routine io_catalog_get_data(
386 master_port : mach_port_t;
388 out outData : io_buf_ptr_t
391 routine io_catalog_get_gen_count(
392 master_port : mach_port_t;
393 out genCount : uint32_t
396 routine io_catalog_module_loaded(
397 master_port : mach_port_t;
401 routine io_catalog_reset(
402 master_port : mach_port_t;
406 routine io_service_request_probe(
407 service : io_object_t;
408 in options : uint32_t
411 routine io_registry_entry_get_name_in_plane(
412 registry_entry : io_object_t;
413 in plane : io_name_t;
417 routine io_service_match_property_table(
418 service : io_object_t;
419 in matching : io_string_t;
420 out matches : boolean_t
423 #if IOKIT_ALL_IPC || (__ILP32__ && !MAP_32B_ASYNC_METHODS)
424 routine io_async_method_scalarI_scalarO(
425 connection : io_connect_t;
426 in wake_port : mach_port_make_send_t;
427 in reference : io_async_ref_t;
428 in selector : uint32_t;
429 in input : io_scalar_inband_t;
430 out output : io_scalar_inband_t, CountInOut
432 routine io_async_method_scalarI_structureO(
433 connection : io_connect_t;
434 in wake_port : mach_port_make_send_t;
435 in reference : io_async_ref_t;
436 in selector : uint32_t;
437 in input : io_scalar_inband_t;
438 out output : io_struct_inband_t, CountInOut
440 routine io_async_method_scalarI_structureI(
441 connection : io_connect_t;
442 in wake_port : mach_port_make_send_t;
443 in reference : io_async_ref_t;
444 in selector : uint32_t;
445 in input : io_scalar_inband_t;
446 in inputStruct : io_struct_inband_t
448 routine io_async_method_structureI_structureO(
449 connection : io_connect_t;
450 in wake_port : mach_port_make_send_t;
451 in reference : io_async_ref_t;
452 in selector : uint32_t;
453 in input : io_struct_inband_t;
454 out output : io_struct_inband_t, CountInOut
463 #if IOKIT_ALL_IPC || __ILP32__
464 routine io_service_add_notification(
465 master_port : mach_port_t;
466 in notification_type : io_name_t;
467 in matching : io_string_t;
468 in wake_port : mach_port_make_send_t;
469 in reference : io_async_ref_t;
470 out notification : io_object_t
472 routine io_service_add_interest_notification(
473 service : io_object_t;
474 in type_of_interest : io_name_t;
475 in wake_port : mach_port_make_send_t;
476 in reference : io_async_ref_t;
477 out notification : io_object_t
479 routine io_service_acknowledge_notification(
480 service : io_object_t;
481 in notify_ref : natural_t;
482 in response : natural_t
490 routine io_connect_get_notification_semaphore(
491 connection : io_connect_t;
492 in notification_type : natural_t;
493 out semaphore : semaphore_t
496 #if IOKIT_ALL_IPC || __ILP32__
497 routine io_connect_unmap_memory(
498 connection : io_connect_t;
499 in memory_type : uint32_t;
500 in into_task : task_t;
502 in address : uint32_t
504 in address : vm_address_t
511 routine io_registry_entry_get_location_in_plane(
512 registry_entry : io_object_t;
513 in plane : io_name_t;
514 out location : io_name_t
517 routine io_registry_entry_get_property_recursively(
518 registry_entry : io_object_t;
519 in plane : io_name_t;
520 in property_name : io_name_t;
521 in options : uint32_t;
522 out properties : io_buf_ptr_t, physicalcopy
525 routine io_service_get_state(
526 service : io_object_t;
527 out state : uint64_t;
528 out busy_state : uint32_t;
529 out accumulated_busy_time : uint64_t
532 routine io_service_get_matching_services_ool(
533 master_port : mach_port_t;
534 in matching : io_buf_ptr_t, physicalcopy;
535 out result : kern_return_t;
536 out existing : io_object_t
539 routine io_service_match_property_table_ool(
540 service : io_object_t;
541 in matching : io_buf_ptr_t, physicalcopy;
542 out result : kern_return_t;
543 out matches : boolean_t
546 #if IOKIT_ALL_IPC || __ILP32__
547 routine io_service_add_notification_ool(
548 master_port : mach_port_t;
549 in notification_type : io_name_t;
550 in matching : io_buf_ptr_t, physicalcopy;
551 in wake_port : mach_port_make_send_t;
552 in reference : io_async_ref_t;
553 out result : kern_return_t;
554 out notification : io_object_t
560 routine io_object_get_superclass(
561 master_port : mach_port_t;
562 in obj_name : io_name_t;
563 out class_name : io_name_t
566 routine io_object_get_bundle_identifier(
567 master_port : mach_port_t;
568 in obj_name : io_name_t;
569 out class_name : io_name_t
572 routine io_service_open_extended(
573 service : io_object_t;
574 in owningTask : task_t;
575 in connect_type : uint32_t;
576 in ndr : NDR_record_t;
577 in properties : io_buf_ptr_t, physicalcopy;
578 out result : kern_return_t;
579 out connection : io_connect_t
583 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
585 routine io_connect_map_memory_into_task(
586 connection : io_connect_t;
587 in memory_type : uint32_t;
588 in into_task : task_t;
589 inout address : mach_vm_address_t;
590 inout size : mach_vm_size_t;
594 routine io_connect_unmap_memory_from_task(
595 connection : io_connect_t;
596 in memory_type : uint32_t;
597 in from_task : task_t;
598 in address : mach_vm_address_t
601 routine io_connect_method(
602 connection : io_connect_t;
603 in selector : uint32_t;
605 in scalar_input : io_scalar_inband64_t;
606 in inband_input : io_struct_inband_t;
607 in ool_input : mach_vm_address_t;
608 in ool_input_size : mach_vm_size_t;
610 out inband_output : io_struct_inband_t, CountInOut;
611 out scalar_output : io_scalar_inband64_t, CountInOut;
612 in ool_output : mach_vm_address_t;
613 inout ool_output_size : mach_vm_size_t
616 routine io_connect_async_method(
617 connection : io_connect_t;
618 in wake_port : mach_port_make_send_t;
619 in reference : io_async_ref64_t;
620 in selector : uint32_t;
622 in scalar_input : io_scalar_inband64_t;
623 in inband_input : io_struct_inband_t;
624 in ool_input : mach_vm_address_t;
625 in ool_input_size : mach_vm_size_t;
627 out inband_output : io_struct_inband_t, CountInOut;
628 out scalar_output : io_scalar_inband64_t, CountInOut;
629 in ool_output : mach_vm_address_t;
630 inout ool_output_size : mach_vm_size_t
634 #if IOKIT_ALL_IPC || __LP64__
637 #define FUNC_NAME(name) name ## _64
639 #define FUNC_NAME(name) name
642 routine FUNC_NAME(io_connect_set_notification_port)(
643 connection : io_connect_t;
644 in notification_type : uint32_t;
645 in port : mach_port_make_send_t;
646 in reference : io_user_reference_t
649 routine FUNC_NAME(io_service_add_notification)(
650 master_port : mach_port_t;
651 in notification_type : io_name_t;
652 in matching : io_string_t;
653 in wake_port : mach_port_make_send_t;
654 in reference : io_async_ref64_t;
655 out notification : io_object_t
658 routine FUNC_NAME(io_service_add_interest_notification)(
659 service : io_object_t;
660 in type_of_interest : io_name_t;
661 in wake_port : mach_port_make_send_t;
662 in reference : io_async_ref64_t;
663 out notification : io_object_t
666 routine FUNC_NAME(io_service_add_notification_ool)(
667 master_port : mach_port_t;
668 in notification_type : io_name_t;
669 in matching : io_buf_ptr_t, physicalcopy;
670 in wake_port : mach_port_make_send_t;
671 in reference : io_async_ref64_t;
672 out result : kern_return_t;
673 out notification : io_object_t
683 #endif /* IOKIT_ALL_IPC || __LP64__ */
685 routine io_registry_entry_get_registry_entry_id(
686 registry_entry : io_object_t;
687 out entry_id : uint64_t
690 routine io_connect_method_var_output(
691 connection : io_connect_t;
692 in selector : uint32_t;
694 in scalar_input : io_scalar_inband64_t;
695 in inband_input : io_struct_inband_t;
696 in ool_input : mach_vm_address_t;
697 in ool_input_size : mach_vm_size_t;
699 out inband_output : io_struct_inband_t, CountInOut;
700 out scalar_output : io_scalar_inband64_t, CountInOut;
701 out var_output : io_buf_ptr_t, physicalcopy
704 routine io_service_get_matching_service(
705 master_port : mach_port_t;
706 in matching : io_string_t;
707 out service : io_object_t
710 routine io_service_get_matching_service_ool(
711 master_port : mach_port_t;
712 in matching : io_buf_ptr_t, physicalcopy;
713 out result : kern_return_t;
714 out service : io_object_t
720 /* vim: set ft=c : */