]> git.saurik.com Git - apple/xnu.git/blob - osfmk/device/device.defs
e465cf72312ad1a1f6a2655421103e4644d9719f
[apple/xnu.git] / osfmk / device / device.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_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 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.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /*
29 * @OSF_COPYRIGHT@
30 */
31 /*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
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.
41 *
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.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56 /*
57 * File: device/device.defs
58 * Author: Douglas Orr
59 * Feb 10, 1988
60 * Abstract:
61 * Mach device support. Mach devices are accessed through
62 * block and character device interfaces to the kernel.
63 */
64
65 subsystem
66 #if KERNEL_SERVER
67 KernelServer
68 #endif /* KERNEL_SERVER */
69 iokit 2800;
70
71 #include <mach/std_types.defs>
72 #include <mach/mach_types.defs>
73 #include <mach/clock_types.defs>
74 #include <mach/clock_types.defs>
75
76 import <device/device_types.h>;
77
78 serverprefix is_;
79
80 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
81 ctype: mach_port_t;
82
83 #if IOKIT
84
85 type io_name_t = c_string[*:128];
86 type io_string_t = c_string[*:512];
87 type io_struct_inband_t = array[*:4096] of char;
88 type io_scalar_inband_t = array[*:16] of int;
89 type io_async_ref_t = array[*:8] of natural_t;
90 type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
91
92 type io_object_t = mach_port_t
93 ctype: mach_port_t
94 #if KERNEL_SERVER
95 intran: io_object_t iokit_lookup_object_port(mach_port_t)
96 outtran: mach_port_t iokit_make_object_port(io_object_t)
97 destructor: iokit_remove_reference(io_object_t)
98 #endif /* KERNEL_SERVER */
99 ;
100
101 type io_connect_t = mach_port_t
102 ctype: mach_port_t
103 #if KERNEL_SERVER
104 intran: io_connect_t iokit_lookup_connect_port(mach_port_t)
105 outtran: mach_port_t iokit_make_connect_port(io_connect_t)
106 destructor: iokit_remove_reference(io_connect_t)
107 #endif /* KERNEL_SERVER */
108 ;
109
110 routine io_object_get_class(
111 object : io_object_t;
112 out className : io_name_t
113 );
114
115 routine io_object_conforms_to(
116 object : io_object_t;
117 in className : io_name_t;
118 out conforms : boolean_t
119 );
120
121 routine io_iterator_next(
122 iterator : io_object_t;
123 out object : io_object_t
124 );
125
126 routine io_iterator_reset(
127 iterator : io_object_t
128 );
129
130 routine io_service_get_matching_services(
131 master_port : mach_port_t;
132 in matching : io_string_t;
133 out existing : io_object_t
134 );
135
136 routine io_registry_entry_get_property(
137 registry_entry : io_object_t;
138 in property_name : io_name_t;
139 out properties : io_buf_ptr_t, physicalcopy
140 );
141
142 routine io_registry_create_iterator(
143 master_port : mach_port_t;
144 in plane : io_name_t;
145 in options : int;
146 out iterator : io_object_t
147 );
148
149 routine io_registry_iterator_enter_entry(
150 iterator : io_object_t
151 );
152
153 routine io_registry_iterator_exit_entry(
154 iterator : io_object_t
155 );
156
157 routine io_registry_entry_from_path(
158 master_port : mach_port_t;
159 in path : io_string_t;
160 out registry_entry : io_object_t
161 );
162
163 routine io_registry_entry_get_name(
164 registry_entry : io_object_t;
165 out name : io_name_t
166 );
167
168 routine io_registry_entry_get_properties(
169 registry_entry : io_object_t;
170 out properties : io_buf_ptr_t, physicalcopy
171 );
172
173 routine io_registry_entry_get_property_bytes(
174 registry_entry : io_object_t;
175 in property_name : io_name_t;
176 out data : io_struct_inband_t, CountInOut
177 );
178
179 routine io_registry_entry_get_child_iterator(
180 registry_entry : io_object_t;
181 in plane : io_name_t;
182 out iterator : io_object_t
183 );
184
185 routine io_registry_entry_get_parent_iterator(
186 registry_entry : io_object_t;
187 in plane : io_name_t;
188 out iterator : io_object_t
189 );
190
191 routine io_service_open(
192 service : io_object_t;
193 in owningTask : task_t;
194 in connect_type : int;
195 out connection : io_connect_t
196 );
197
198 routine io_service_close(
199 connection : io_connect_t
200 );
201
202 routine io_connect_get_service(
203 connection : io_connect_t;
204 out service : io_object_t
205 );
206
207 routine io_connect_set_notification_port(
208 connection : io_connect_t;
209 in notification_type : int;
210 in port : mach_port_make_send_t;
211 in reference : int
212 );
213
214 routine io_connect_map_memory(
215 connection : io_connect_t;
216 in memory_type : int;
217 in into_task : task_t;
218 inout address : vm_address_t;
219 inout size : vm_size_t;
220 in flags : int
221 );
222
223 routine io_connect_add_client(
224 connection : io_connect_t;
225 in connect_to : io_connect_t
226 );
227
228 routine io_connect_set_properties(
229 connection : io_connect_t;
230 in properties : io_buf_ptr_t, physicalcopy;
231 out result : natural_t
232 );
233
234
235 routine io_connect_method_scalarI_scalarO(
236 connection : io_connect_t;
237 in selector : int;
238 in input : io_scalar_inband_t;
239 out output : io_scalar_inband_t, CountInOut
240 );
241
242 routine io_connect_method_scalarI_structureO(
243 connection : io_connect_t;
244 in selector : int;
245 in input : io_scalar_inband_t;
246 out output : io_struct_inband_t, CountInOut
247 );
248
249 routine io_connect_method_scalarI_structureI(
250 connection : io_connect_t;
251 in selector : int;
252 in input : io_scalar_inband_t;
253 in inputStruct : io_struct_inband_t
254 );
255
256 routine io_connect_method_structureI_structureO(
257 connection : io_connect_t;
258 in selector : int;
259 in input : io_struct_inband_t;
260 out output : io_struct_inband_t, CountInOut
261 );
262
263 routine io_registry_entry_get_path(
264 registry_entry : io_object_t;
265 in plane : io_name_t;
266 out path : io_string_t
267 );
268
269 routine io_registry_get_root_entry(
270 master_port : mach_port_t;
271 out root : io_object_t
272 );
273
274 routine io_registry_entry_set_properties(
275 registry_entry : io_object_t;
276 in properties : io_buf_ptr_t, physicalcopy;
277 out result : natural_t
278 );
279
280 routine io_registry_entry_in_plane(
281 registry_entry : io_object_t;
282 in plane : io_name_t;
283 out inPlane : boolean_t
284 );
285
286 routine io_object_get_retain_count(
287 object : io_object_t;
288 out retainCount : int
289 );
290
291 routine io_service_get_busy_state(
292 service : io_object_t;
293 out busyState : int
294 );
295
296 routine io_service_wait_quiet(
297 service : io_object_t;
298 wait_time : mach_timespec_t
299 );
300
301 routine io_registry_entry_create_iterator(
302 registry_entry : io_object_t;
303 in plane : io_name_t;
304 in options : int;
305 out iterator : io_object_t
306 );
307
308 routine io_iterator_is_valid(
309 iterator : io_object_t;
310 out is_valid : boolean_t
311 );
312
313 routine io_make_matching(
314 master_port : mach_port_t;
315 in of_type : int;
316 in options : int;
317 in input : io_struct_inband_t;
318 out matching : io_string_t
319 );
320
321 routine io_catalog_send_data(
322 master_port : mach_port_t;
323 in flag : int;
324 in inData : io_buf_ptr_t;
325 out result : natural_t
326 );
327
328 routine io_catalog_terminate(
329 master_port : mach_port_t;
330 in flag : int;
331 in name : io_name_t
332 );
333
334 routine io_catalog_get_data(
335 master_port : mach_port_t;
336 in flag : int;
337 out outData : io_buf_ptr_t
338 );
339
340 routine io_catalog_get_gen_count(
341 master_port : mach_port_t;
342 out genCount : int
343 );
344
345 routine io_catalog_module_loaded(
346 master_port : mach_port_t;
347 in name : io_name_t
348 );
349
350 routine io_catalog_reset(
351 master_port : mach_port_t;
352 in flag : int
353 );
354
355 routine io_service_request_probe(
356 service : io_object_t;
357 in options : int
358 );
359
360 routine io_registry_entry_get_name_in_plane(
361 registry_entry : io_object_t;
362 in plane : io_name_t;
363 out name : io_name_t
364 );
365
366 routine io_service_match_property_table(
367 service : io_object_t;
368 in matching : io_string_t;
369 out matches : boolean_t
370 );
371
372 routine io_async_method_scalarI_scalarO(
373 connection : io_connect_t;
374 in wake_port : mach_port_make_send_t;
375 in reference : io_async_ref_t;
376 in selector : int;
377 in input : io_scalar_inband_t;
378 out output : io_scalar_inband_t, CountInOut
379 );
380
381 routine io_async_method_scalarI_structureO(
382 connection : io_connect_t;
383 in wake_port : mach_port_make_send_t;
384 in reference : io_async_ref_t;
385 in selector : int;
386 in input : io_scalar_inband_t;
387 out output : io_struct_inband_t, CountInOut
388 );
389
390 routine io_async_method_scalarI_structureI(
391 connection : io_connect_t;
392 in wake_port : mach_port_make_send_t;
393 in reference : io_async_ref_t;
394 in selector : int;
395 in input : io_scalar_inband_t;
396 in inputStruct : io_struct_inband_t
397 );
398
399 routine io_async_method_structureI_structureO(
400 connection : io_connect_t;
401 in wake_port : mach_port_make_send_t;
402 in reference : io_async_ref_t;
403 in selector : int;
404 in input : io_struct_inband_t;
405 out output : io_struct_inband_t, CountInOut
406 );
407
408 routine io_service_add_notification(
409 master_port : mach_port_t;
410 in notification_type : io_name_t;
411 in matching : io_string_t;
412 in wake_port : mach_port_make_send_t;
413 in reference : io_async_ref_t;
414 out notification : io_object_t
415 );
416
417 routine io_service_add_interest_notification(
418 service : io_object_t;
419 in type_of_interest : io_name_t;
420 in wake_port : mach_port_make_send_t;
421 in reference : io_async_ref_t;
422 out notification : io_object_t
423 );
424
425 routine io_service_acknowledge_notification(
426 service : io_object_t;
427 in notify_ref : natural_t;
428 in response : natural_t
429 );
430
431 routine io_connect_get_notification_semaphore(
432 connection : io_connect_t;
433 in notification_type : natural_t;
434 out semaphore : semaphore_t
435 );
436
437 routine io_connect_unmap_memory(
438 connection : io_connect_t;
439 in memory_type : int;
440 in into_task : task_t;
441 in address : vm_address_t
442 );
443
444 routine io_registry_entry_get_location_in_plane(
445 registry_entry : io_object_t;
446 in plane : io_name_t;
447 out location : io_name_t
448 );
449
450 routine io_registry_entry_get_property_recursively(
451 registry_entry : io_object_t;
452 in plane : io_name_t;
453 in property_name : io_name_t;
454 in options : int;
455 out properties : io_buf_ptr_t, physicalcopy
456 );
457
458
459 routine io_service_get_state(
460 service : io_object_t;
461 out state : uint64_t
462 );
463
464 routine io_service_get_matching_services_ool(
465 master_port : mach_port_t;
466 in matching : io_buf_ptr_t, physicalcopy;
467 out result : natural_t;
468 out existing : io_object_t
469 );
470
471 routine io_service_match_property_table_ool(
472 service : io_object_t;
473 in matching : io_buf_ptr_t, physicalcopy;
474 out result : natural_t;
475 out matches : boolean_t
476 );
477
478 routine io_service_add_notification_ool(
479 master_port : mach_port_t;
480 in notification_type : io_name_t;
481 in matching : io_buf_ptr_t, physicalcopy;
482 in wake_port : mach_port_make_send_t;
483 in reference : io_async_ref_t;
484 out result : natural_t;
485 out notification : io_object_t
486 );
487
488 routine io_object_get_superclass(
489 master_port : mach_port_t;
490 in obj_name : io_name_t;
491 out class_name : io_name_t
492 );
493
494 routine io_object_get_bundle_identifier(
495 master_port : mach_port_t;
496 in obj_name : io_name_t;
497 out class_name : io_name_t
498 );
499
500 #endif
501
502