]> git.saurik.com Git - apple/xnu.git/blob - osfmk/device/device.defs
xnu-792.6.56.tar.gz
[apple/xnu.git] / osfmk / device / device.defs
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26 /*
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
29 * All Rights Reserved.
30 *
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.
36 *
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.
40 *
41 * Carnegie Mellon requests users of this software to return to
42 *
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
47 *
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
50 */
51 /*
52 * File: device/device.defs
53 * Author: Douglas Orr
54 * Feb 10, 1988
55 * Abstract:
56 * Mach device support. Mach devices are accessed through
57 * block and character device interfaces to the kernel.
58 */
59
60 subsystem
61 #if KERNEL_SERVER
62 KernelServer
63 #endif /* KERNEL_SERVER */
64 iokit 2800;
65
66 #include <mach/std_types.defs>
67 #include <mach/mach_types.defs>
68 #include <mach/clock_types.defs>
69 #include <mach/clock_types.defs>
70
71 import <device/device_types.h>;
72
73 serverprefix is_;
74
75 type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
76 ctype: mach_port_t;
77
78 #if IOKIT
79
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;
86
87 type io_object_t = mach_port_t
88 ctype: mach_port_t
89 #if KERNEL_SERVER
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 */
94 ;
95
96 type io_connect_t = mach_port_t
97 ctype: mach_port_t
98 #if KERNEL_SERVER
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 */
103 ;
104
105 routine io_object_get_class(
106 object : io_object_t;
107 out className : io_name_t
108 );
109
110 routine io_object_conforms_to(
111 object : io_object_t;
112 in className : io_name_t;
113 out conforms : boolean_t
114 );
115
116 routine io_iterator_next(
117 iterator : io_object_t;
118 out object : io_object_t
119 );
120
121 routine io_iterator_reset(
122 iterator : io_object_t
123 );
124
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
129 );
130
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
135 );
136
137 routine io_registry_create_iterator(
138 master_port : mach_port_t;
139 in plane : io_name_t;
140 in options : int;
141 out iterator : io_object_t
142 );
143
144 routine io_registry_iterator_enter_entry(
145 iterator : io_object_t
146 );
147
148 routine io_registry_iterator_exit_entry(
149 iterator : io_object_t
150 );
151
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
156 );
157
158 routine io_registry_entry_get_name(
159 registry_entry : io_object_t;
160 out name : io_name_t
161 );
162
163 routine io_registry_entry_get_properties(
164 registry_entry : io_object_t;
165 out properties : io_buf_ptr_t, physicalcopy
166 );
167
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
172 );
173
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
178 );
179
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
184 );
185
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
191 );
192
193 routine io_service_close(
194 connection : io_connect_t
195 );
196
197 routine io_connect_get_service(
198 connection : io_connect_t;
199 out service : io_object_t
200 );
201
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;
206 in reference : int
207 );
208
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;
215 in flags : int
216 );
217
218 routine io_connect_add_client(
219 connection : io_connect_t;
220 in connect_to : io_connect_t
221 );
222
223 routine io_connect_set_properties(
224 connection : io_connect_t;
225 in properties : io_buf_ptr_t, physicalcopy;
226 out result : natural_t
227 );
228
229
230 routine io_connect_method_scalarI_scalarO(
231 connection : io_connect_t;
232 in selector : int;
233 in input : io_scalar_inband_t;
234 out output : io_scalar_inband_t, CountInOut
235 );
236
237 routine io_connect_method_scalarI_structureO(
238 connection : io_connect_t;
239 in selector : int;
240 in input : io_scalar_inband_t;
241 out output : io_struct_inband_t, CountInOut
242 );
243
244 routine io_connect_method_scalarI_structureI(
245 connection : io_connect_t;
246 in selector : int;
247 in input : io_scalar_inband_t;
248 in inputStruct : io_struct_inband_t
249 );
250
251 routine io_connect_method_structureI_structureO(
252 connection : io_connect_t;
253 in selector : int;
254 in input : io_struct_inband_t;
255 out output : io_struct_inband_t, CountInOut
256 );
257
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
262 );
263
264 routine io_registry_get_root_entry(
265 master_port : mach_port_t;
266 out root : io_object_t
267 );
268
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
273 );
274
275 routine io_registry_entry_in_plane(
276 registry_entry : io_object_t;
277 in plane : io_name_t;
278 out inPlane : boolean_t
279 );
280
281 routine io_object_get_retain_count(
282 object : io_object_t;
283 out retainCount : int
284 );
285
286 routine io_service_get_busy_state(
287 service : io_object_t;
288 out busyState : int
289 );
290
291 routine io_service_wait_quiet(
292 service : io_object_t;
293 wait_time : mach_timespec_t
294 );
295
296 routine io_registry_entry_create_iterator(
297 registry_entry : io_object_t;
298 in plane : io_name_t;
299 in options : int;
300 out iterator : io_object_t
301 );
302
303 routine io_iterator_is_valid(
304 iterator : io_object_t;
305 out is_valid : boolean_t
306 );
307
308 routine io_make_matching(
309 master_port : mach_port_t;
310 in of_type : int;
311 in options : int;
312 in input : io_struct_inband_t;
313 out matching : io_string_t
314 );
315
316 routine io_catalog_send_data(
317 master_port : mach_port_t;
318 in flag : int;
319 in inData : io_buf_ptr_t;
320 out result : natural_t
321 );
322
323 routine io_catalog_terminate(
324 master_port : mach_port_t;
325 in flag : int;
326 in name : io_name_t
327 );
328
329 routine io_catalog_get_data(
330 master_port : mach_port_t;
331 in flag : int;
332 out outData : io_buf_ptr_t
333 );
334
335 routine io_catalog_get_gen_count(
336 master_port : mach_port_t;
337 out genCount : int
338 );
339
340 routine io_catalog_module_loaded(
341 master_port : mach_port_t;
342 in name : io_name_t
343 );
344
345 routine io_catalog_reset(
346 master_port : mach_port_t;
347 in flag : int
348 );
349
350 routine io_service_request_probe(
351 service : io_object_t;
352 in options : int
353 );
354
355 routine io_registry_entry_get_name_in_plane(
356 registry_entry : io_object_t;
357 in plane : io_name_t;
358 out name : io_name_t
359 );
360
361 routine io_service_match_property_table(
362 service : io_object_t;
363 in matching : io_string_t;
364 out matches : boolean_t
365 );
366
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;
371 in selector : int;
372 in input : io_scalar_inband_t;
373 out output : io_scalar_inband_t, CountInOut
374 );
375
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;
380 in selector : int;
381 in input : io_scalar_inband_t;
382 out output : io_struct_inband_t, CountInOut
383 );
384
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;
389 in selector : int;
390 in input : io_scalar_inband_t;
391 in inputStruct : io_struct_inband_t
392 );
393
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;
398 in selector : int;
399 in input : io_struct_inband_t;
400 out output : io_struct_inband_t, CountInOut
401 );
402
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
410 );
411
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
418 );
419
420 routine io_service_acknowledge_notification(
421 service : io_object_t;
422 in notify_ref : natural_t;
423 in response : natural_t
424 );
425
426 routine io_connect_get_notification_semaphore(
427 connection : io_connect_t;
428 in notification_type : natural_t;
429 out semaphore : semaphore_t
430 );
431
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
437 );
438
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
443 );
444
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;
449 in options : int;
450 out properties : io_buf_ptr_t, physicalcopy
451 );
452
453
454 routine io_service_get_state(
455 service : io_object_t;
456 out state : uint64_t
457 );
458
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
464 );
465
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
471 );
472
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
481 );
482
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
487 );
488
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
493 );
494
495 #endif
496
497