]> git.saurik.com Git - apple/xnu.git/blob - osfmk/device/device.defs
xnu-792.13.8.tar.gz
[apple/xnu.git] / osfmk / device / device.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
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
14 * agreement.
15 *
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
18 * file.
19 *
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.
27 *
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
29 */
30 /*
31 * @OSF_COPYRIGHT@
32 */
33 /*
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
36 * All Rights Reserved.
37 *
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.
43 *
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.
47 *
48 * Carnegie Mellon requests users of this software to return to
49 *
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
54 *
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
57 */
58 /*
59 * File: device/device.defs
60 * Author: Douglas Orr
61 * Feb 10, 1988
62 * Abstract:
63 * Mach device support. Mach devices are accessed through
64 * block and character device interfaces to the kernel.
65 */
66
67 subsystem
68 #if KERNEL_SERVER
69 KernelServer
70 #endif /* KERNEL_SERVER */
71 iokit 2800;
72
73 #include <mach/std_types.defs>
74 #include <mach/mach_types.defs>
75 #include <mach/clock_types.defs>
76 #include <mach/clock_types.defs>
77
78 import <device/device_types.h>;
79
80 serverprefix is_;
81
82 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
83 ctype: mach_port_t;
84
85 #if IOKIT
86
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;
94
95 type io_object_t = mach_port_t
96 ctype: mach_port_t
97 #if KERNEL_SERVER
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 */
102 ;
103
104 type io_connect_t = mach_port_t
105 ctype: mach_port_t
106 #if KERNEL_SERVER
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 */
111 ;
112
113 routine io_object_get_class(
114 object : io_object_t;
115 out className : io_name_t
116 );
117
118 routine io_object_conforms_to(
119 object : io_object_t;
120 in className : io_name_t;
121 out conforms : boolean_t
122 );
123
124 routine io_iterator_next(
125 iterator : io_object_t;
126 out object : io_object_t
127 );
128
129 routine io_iterator_reset(
130 iterator : io_object_t
131 );
132
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
137 );
138
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
143 );
144
145 routine io_registry_create_iterator(
146 master_port : mach_port_t;
147 in plane : io_name_t;
148 in options : int;
149 out iterator : io_object_t
150 );
151
152 routine io_registry_iterator_enter_entry(
153 iterator : io_object_t
154 );
155
156 routine io_registry_iterator_exit_entry(
157 iterator : io_object_t
158 );
159
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
164 );
165
166 routine io_registry_entry_get_name(
167 registry_entry : io_object_t;
168 out name : io_name_t
169 );
170
171 routine io_registry_entry_get_properties(
172 registry_entry : io_object_t;
173 out properties : io_buf_ptr_t, physicalcopy
174 );
175
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
180 );
181
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
186 );
187
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
192 );
193
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
199 );
200
201 routine io_service_close(
202 connection : io_connect_t
203 );
204
205 routine io_connect_get_service(
206 connection : io_connect_t;
207 out service : io_object_t
208 );
209
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;
214 in reference : int
215 );
216
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;
223 in flags : int
224 );
225
226 routine io_connect_add_client(
227 connection : io_connect_t;
228 in connect_to : io_connect_t
229 );
230
231 routine io_connect_set_properties(
232 connection : io_connect_t;
233 in properties : io_buf_ptr_t, physicalcopy;
234 out result : natural_t
235 );
236
237
238 routine io_connect_method_scalarI_scalarO(
239 connection : io_connect_t;
240 in selector : int;
241 in input : io_scalar_inband_t;
242 out output : io_scalar_inband_t, CountInOut
243 );
244
245 routine io_connect_method_scalarI_structureO(
246 connection : io_connect_t;
247 in selector : int;
248 in input : io_scalar_inband_t;
249 out output : io_struct_inband_t, CountInOut
250 );
251
252 routine io_connect_method_scalarI_structureI(
253 connection : io_connect_t;
254 in selector : int;
255 in input : io_scalar_inband_t;
256 in inputStruct : io_struct_inband_t
257 );
258
259 routine io_connect_method_structureI_structureO(
260 connection : io_connect_t;
261 in selector : int;
262 in input : io_struct_inband_t;
263 out output : io_struct_inband_t, CountInOut
264 );
265
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
270 );
271
272 routine io_registry_get_root_entry(
273 master_port : mach_port_t;
274 out root : io_object_t
275 );
276
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
281 );
282
283 routine io_registry_entry_in_plane(
284 registry_entry : io_object_t;
285 in plane : io_name_t;
286 out inPlane : boolean_t
287 );
288
289 routine io_object_get_retain_count(
290 object : io_object_t;
291 out retainCount : int
292 );
293
294 routine io_service_get_busy_state(
295 service : io_object_t;
296 out busyState : int
297 );
298
299 routine io_service_wait_quiet(
300 service : io_object_t;
301 wait_time : mach_timespec_t
302 );
303
304 routine io_registry_entry_create_iterator(
305 registry_entry : io_object_t;
306 in plane : io_name_t;
307 in options : int;
308 out iterator : io_object_t
309 );
310
311 routine io_iterator_is_valid(
312 iterator : io_object_t;
313 out is_valid : boolean_t
314 );
315
316 routine io_make_matching(
317 master_port : mach_port_t;
318 in of_type : int;
319 in options : int;
320 in input : io_struct_inband_t;
321 out matching : io_string_t
322 );
323
324 routine io_catalog_send_data(
325 master_port : mach_port_t;
326 in flag : int;
327 in inData : io_buf_ptr_t;
328 out result : natural_t
329 );
330
331 routine io_catalog_terminate(
332 master_port : mach_port_t;
333 in flag : int;
334 in name : io_name_t
335 );
336
337 routine io_catalog_get_data(
338 master_port : mach_port_t;
339 in flag : int;
340 out outData : io_buf_ptr_t
341 );
342
343 routine io_catalog_get_gen_count(
344 master_port : mach_port_t;
345 out genCount : int
346 );
347
348 routine io_catalog_module_loaded(
349 master_port : mach_port_t;
350 in name : io_name_t
351 );
352
353 routine io_catalog_reset(
354 master_port : mach_port_t;
355 in flag : int
356 );
357
358 routine io_service_request_probe(
359 service : io_object_t;
360 in options : int
361 );
362
363 routine io_registry_entry_get_name_in_plane(
364 registry_entry : io_object_t;
365 in plane : io_name_t;
366 out name : io_name_t
367 );
368
369 routine io_service_match_property_table(
370 service : io_object_t;
371 in matching : io_string_t;
372 out matches : boolean_t
373 );
374
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;
379 in selector : int;
380 in input : io_scalar_inband_t;
381 out output : io_scalar_inband_t, CountInOut
382 );
383
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;
388 in selector : int;
389 in input : io_scalar_inband_t;
390 out output : io_struct_inband_t, CountInOut
391 );
392
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;
397 in selector : int;
398 in input : io_scalar_inband_t;
399 in inputStruct : io_struct_inband_t
400 );
401
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;
406 in selector : int;
407 in input : io_struct_inband_t;
408 out output : io_struct_inband_t, CountInOut
409 );
410
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
418 );
419
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
426 );
427
428 routine io_service_acknowledge_notification(
429 service : io_object_t;
430 in notify_ref : natural_t;
431 in response : natural_t
432 );
433
434 routine io_connect_get_notification_semaphore(
435 connection : io_connect_t;
436 in notification_type : natural_t;
437 out semaphore : semaphore_t
438 );
439
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
445 );
446
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
451 );
452
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;
457 in options : int;
458 out properties : io_buf_ptr_t, physicalcopy
459 );
460
461
462 routine io_service_get_state(
463 service : io_object_t;
464 out state : uint64_t
465 );
466
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
472 );
473
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
479 );
480
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
489 );
490
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
495 );
496
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
501 );
502
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
511 );
512
513 #endif
514
515