]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
d7e50217 | 6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
1c79356b | 7 | * |
d7e50217 A |
8 | * This file contains Original Code and/or Modifications of Original Code |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
d7e50217 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
1c79356b A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * @OSF_COPYRIGHT@ | |
27 | */ | |
28 | /* | |
29 | * Mach Operating System | |
30 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University | |
31 | * All Rights Reserved. | |
32 | * | |
33 | * Permission to use, copy, modify and distribute this software and its | |
34 | * documentation is hereby granted, provided that both the copyright | |
35 | * notice and this permission notice appear in all copies of the | |
36 | * software, derivative works or modified versions, and any portions | |
37 | * thereof, and that both notices appear in supporting documentation. | |
38 | * | |
39 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
40 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
41 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
42 | * | |
43 | * Carnegie Mellon requests users of this software to return to | |
44 | * | |
45 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
46 | * School of Computer Science | |
47 | * Carnegie Mellon University | |
48 | * Pittsburgh PA 15213-3890 | |
49 | * | |
50 | * any improvements or extensions that they make and grant Carnegie Mellon | |
51 | * the rights to redistribute these changes. | |
52 | */ | |
53 | /* | |
54 | * File: device/device.defs | |
55 | * Author: Douglas Orr | |
56 | * Feb 10, 1988 | |
57 | * Abstract: | |
58 | * Mach device support. Mach devices are accessed through | |
59 | * block and character device interfaces to the kernel. | |
60 | */ | |
61 | ||
62 | subsystem | |
63 | #if KERNEL_SERVER | |
64 | KernelServer | |
65 | #endif /* KERNEL_SERVER */ | |
66 | iokit 2800; | |
67 | ||
68 | #include <mach/std_types.defs> | |
69 | #include <mach/mach_types.defs> | |
70 | #include <mach/clock_types.defs> | |
71 | #include <mach/clock_types.defs> | |
72 | ||
73 | import <device/device_types.h>; | |
74 | ||
75 | serverprefix is_; | |
76 | ||
77 | type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic | |
78 | ctype: mach_port_t; | |
79 | ||
80 | #if IOKIT | |
81 | ||
82 | type io_name_t = c_string[*:128]; | |
83 | type io_string_t = c_string[*:512]; | |
84 | type io_struct_inband_t = array[*:4096] of char; | |
85 | type io_scalar_inband_t = array[*:16] of int; | |
86 | type io_async_ref_t = array[*:8] of natural_t; | |
87 | type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8; | |
88 | ||
89 | type io_object_t = mach_port_t | |
90 | ctype: mach_port_t | |
91 | #if KERNEL_SERVER | |
92 | intran: io_object_t iokit_lookup_object_port(mach_port_t) | |
93 | outtran: mach_port_t iokit_make_object_port(io_object_t) | |
94 | destructor: iokit_remove_reference(io_object_t) | |
95 | #endif /* KERNEL_SERVER */ | |
96 | ; | |
97 | ||
98 | type io_connect_t = mach_port_t | |
99 | ctype: mach_port_t | |
100 | #if KERNEL_SERVER | |
101 | intran: io_connect_t iokit_lookup_connect_port(mach_port_t) | |
102 | outtran: mach_port_t iokit_make_connect_port(io_connect_t) | |
103 | destructor: iokit_remove_reference(io_connect_t) | |
104 | #endif /* KERNEL_SERVER */ | |
105 | ; | |
106 | ||
107 | routine io_object_get_class( | |
108 | object : io_object_t; | |
109 | out className : io_name_t | |
110 | ); | |
111 | ||
112 | routine io_object_conforms_to( | |
113 | object : io_object_t; | |
114 | in className : io_name_t; | |
115 | out conforms : boolean_t | |
116 | ); | |
117 | ||
118 | routine io_iterator_next( | |
119 | iterator : io_object_t; | |
120 | out object : io_object_t | |
121 | ); | |
122 | ||
123 | routine io_iterator_reset( | |
124 | iterator : io_object_t | |
125 | ); | |
126 | ||
127 | routine io_service_get_matching_services( | |
128 | master_port : mach_port_t; | |
129 | in matching : io_string_t; | |
130 | out existing : io_object_t | |
131 | ); | |
132 | ||
0b4e3aa0 A |
133 | routine io_registry_entry_get_property( |
134 | registry_entry : io_object_t; | |
135 | in property_name : io_name_t; | |
136 | out properties : io_buf_ptr_t, physicalcopy | |
1c79356b A |
137 | ); |
138 | ||
139 | routine io_registry_create_iterator( | |
140 | master_port : mach_port_t; | |
141 | in plane : io_name_t; | |
142 | in options : int; | |
143 | out iterator : io_object_t | |
144 | ); | |
145 | ||
146 | routine io_registry_iterator_enter_entry( | |
147 | iterator : io_object_t | |
148 | ); | |
149 | ||
150 | routine io_registry_iterator_exit_entry( | |
151 | iterator : io_object_t | |
152 | ); | |
153 | ||
154 | routine io_registry_entry_from_path( | |
155 | master_port : mach_port_t; | |
156 | in path : io_string_t; | |
157 | out registry_entry : io_object_t | |
158 | ); | |
159 | ||
160 | routine io_registry_entry_get_name( | |
161 | registry_entry : io_object_t; | |
162 | out name : io_name_t | |
163 | ); | |
164 | ||
165 | routine io_registry_entry_get_properties( | |
166 | registry_entry : io_object_t; | |
167 | out properties : io_buf_ptr_t, physicalcopy | |
168 | ); | |
169 | ||
0b4e3aa0 | 170 | routine io_registry_entry_get_property_bytes( |
1c79356b A |
171 | registry_entry : io_object_t; |
172 | in property_name : io_name_t; | |
173 | out data : io_struct_inband_t, CountInOut | |
174 | ); | |
175 | ||
176 | routine io_registry_entry_get_child_iterator( | |
177 | registry_entry : io_object_t; | |
178 | in plane : io_name_t; | |
179 | out iterator : io_object_t | |
180 | ); | |
181 | ||
182 | routine io_registry_entry_get_parent_iterator( | |
183 | registry_entry : io_object_t; | |
184 | in plane : io_name_t; | |
185 | out iterator : io_object_t | |
186 | ); | |
187 | ||
188 | routine io_service_open( | |
189 | service : io_object_t; | |
190 | in owningTask : task_t; | |
191 | in connect_type : int; | |
192 | out connection : io_connect_t | |
193 | ); | |
194 | ||
195 | routine io_service_close( | |
196 | connection : io_connect_t | |
197 | ); | |
198 | ||
199 | routine io_connect_get_service( | |
200 | connection : io_connect_t; | |
201 | out service : io_object_t | |
202 | ); | |
203 | ||
204 | routine io_connect_set_notification_port( | |
205 | connection : io_connect_t; | |
206 | in notification_type : int; | |
207 | in port : mach_port_make_send_t; | |
208 | in reference : int | |
209 | ); | |
210 | ||
211 | routine io_connect_map_memory( | |
212 | connection : io_connect_t; | |
213 | in memory_type : int; | |
214 | in into_task : task_t; | |
215 | inout address : vm_address_t; | |
216 | inout size : vm_size_t; | |
217 | in flags : int | |
218 | ); | |
219 | ||
220 | routine io_connect_add_client( | |
221 | connection : io_connect_t; | |
222 | in connect_to : io_connect_t | |
223 | ); | |
224 | ||
225 | routine io_connect_set_properties( | |
226 | connection : io_connect_t; | |
227 | in properties : io_buf_ptr_t, physicalcopy; | |
228 | out result : natural_t | |
229 | ); | |
230 | ||
231 | ||
232 | routine io_connect_method_scalarI_scalarO( | |
233 | connection : io_connect_t; | |
234 | in selector : int; | |
235 | in input : io_scalar_inband_t; | |
236 | out output : io_scalar_inband_t, CountInOut | |
237 | ); | |
238 | ||
239 | routine io_connect_method_scalarI_structureO( | |
240 | connection : io_connect_t; | |
241 | in selector : int; | |
242 | in input : io_scalar_inband_t; | |
243 | out output : io_struct_inband_t, CountInOut | |
244 | ); | |
245 | ||
246 | routine io_connect_method_scalarI_structureI( | |
247 | connection : io_connect_t; | |
248 | in selector : int; | |
249 | in input : io_scalar_inband_t; | |
250 | in inputStruct : io_struct_inband_t | |
251 | ); | |
252 | ||
253 | routine io_connect_method_structureI_structureO( | |
254 | connection : io_connect_t; | |
255 | in selector : int; | |
256 | in input : io_struct_inband_t; | |
257 | out output : io_struct_inband_t, CountInOut | |
258 | ); | |
259 | ||
260 | routine io_registry_entry_get_path( | |
261 | registry_entry : io_object_t; | |
262 | in plane : io_name_t; | |
263 | out path : io_string_t | |
264 | ); | |
265 | ||
266 | routine io_registry_get_root_entry( | |
267 | master_port : mach_port_t; | |
268 | out root : io_object_t | |
269 | ); | |
270 | ||
271 | routine io_registry_entry_set_properties( | |
272 | registry_entry : io_object_t; | |
273 | in properties : io_buf_ptr_t, physicalcopy; | |
274 | out result : natural_t | |
275 | ); | |
276 | ||
277 | routine io_registry_entry_in_plane( | |
278 | registry_entry : io_object_t; | |
279 | in plane : io_name_t; | |
280 | out inPlane : boolean_t | |
281 | ); | |
282 | ||
283 | routine io_object_get_retain_count( | |
284 | object : io_object_t; | |
285 | out retainCount : int | |
286 | ); | |
287 | ||
288 | routine io_service_get_busy_state( | |
289 | service : io_object_t; | |
290 | out busyState : int | |
291 | ); | |
292 | ||
293 | routine io_service_wait_quiet( | |
294 | service : io_object_t; | |
295 | wait_time : mach_timespec_t | |
296 | ); | |
297 | ||
298 | routine io_registry_entry_create_iterator( | |
299 | registry_entry : io_object_t; | |
300 | in plane : io_name_t; | |
301 | in options : int; | |
302 | out iterator : io_object_t | |
303 | ); | |
304 | ||
305 | routine io_iterator_is_valid( | |
306 | iterator : io_object_t; | |
307 | out is_valid : boolean_t | |
308 | ); | |
309 | ||
310 | routine io_make_matching( | |
311 | master_port : mach_port_t; | |
312 | in of_type : int; | |
313 | in options : int; | |
314 | in input : io_struct_inband_t; | |
315 | out matching : io_string_t | |
316 | ); | |
317 | ||
318 | routine io_catalog_send_data( | |
319 | master_port : mach_port_t; | |
320 | in flag : int; | |
321 | in inData : io_buf_ptr_t; | |
322 | out result : natural_t | |
323 | ); | |
324 | ||
325 | routine io_catalog_terminate( | |
326 | master_port : mach_port_t; | |
327 | in flag : int; | |
328 | in name : io_name_t | |
329 | ); | |
330 | ||
331 | routine io_catalog_get_data( | |
332 | master_port : mach_port_t; | |
333 | in flag : int; | |
334 | out outData : io_buf_ptr_t | |
335 | ); | |
336 | ||
337 | routine io_catalog_get_gen_count( | |
338 | master_port : mach_port_t; | |
339 | out genCount : int | |
340 | ); | |
341 | ||
342 | routine io_catalog_module_loaded( | |
343 | master_port : mach_port_t; | |
344 | in name : io_name_t | |
345 | ); | |
346 | ||
347 | routine io_catalog_reset( | |
348 | master_port : mach_port_t; | |
349 | in flag : int | |
350 | ); | |
351 | ||
352 | routine io_service_request_probe( | |
353 | service : io_object_t; | |
354 | in options : int | |
355 | ); | |
356 | ||
357 | routine io_registry_entry_get_name_in_plane( | |
358 | registry_entry : io_object_t; | |
359 | in plane : io_name_t; | |
360 | out name : io_name_t | |
361 | ); | |
362 | ||
363 | routine io_service_match_property_table( | |
364 | service : io_object_t; | |
365 | in matching : io_string_t; | |
366 | out matches : boolean_t | |
367 | ); | |
368 | ||
369 | routine io_async_method_scalarI_scalarO( | |
370 | connection : io_connect_t; | |
371 | in wake_port : mach_port_make_send_t; | |
372 | in reference : io_async_ref_t; | |
373 | in selector : int; | |
374 | in input : io_scalar_inband_t; | |
375 | out output : io_scalar_inband_t, CountInOut | |
376 | ); | |
377 | ||
378 | routine io_async_method_scalarI_structureO( | |
379 | connection : io_connect_t; | |
380 | in wake_port : mach_port_make_send_t; | |
381 | in reference : io_async_ref_t; | |
382 | in selector : int; | |
383 | in input : io_scalar_inband_t; | |
384 | out output : io_struct_inband_t, CountInOut | |
385 | ); | |
386 | ||
387 | routine io_async_method_scalarI_structureI( | |
388 | connection : io_connect_t; | |
389 | in wake_port : mach_port_make_send_t; | |
390 | in reference : io_async_ref_t; | |
391 | in selector : int; | |
392 | in input : io_scalar_inband_t; | |
393 | in inputStruct : io_struct_inband_t | |
394 | ); | |
395 | ||
396 | routine io_async_method_structureI_structureO( | |
397 | connection : io_connect_t; | |
398 | in wake_port : mach_port_make_send_t; | |
399 | in reference : io_async_ref_t; | |
400 | in selector : int; | |
401 | in input : io_struct_inband_t; | |
402 | out output : io_struct_inband_t, CountInOut | |
403 | ); | |
404 | ||
405 | routine io_service_add_notification( | |
406 | master_port : mach_port_t; | |
407 | in notification_type : io_name_t; | |
408 | in matching : io_string_t; | |
409 | in wake_port : mach_port_make_send_t; | |
410 | in reference : io_async_ref_t; | |
411 | out notification : io_object_t | |
412 | ); | |
413 | ||
414 | routine io_service_add_interest_notification( | |
415 | service : io_object_t; | |
416 | in type_of_interest : io_name_t; | |
417 | in wake_port : mach_port_make_send_t; | |
418 | in reference : io_async_ref_t; | |
419 | out notification : io_object_t | |
420 | ); | |
421 | ||
422 | routine io_service_acknowledge_notification( | |
423 | service : io_object_t; | |
424 | in notify_ref : natural_t; | |
425 | in response : natural_t | |
426 | ); | |
427 | ||
428 | routine io_connect_get_notification_semaphore( | |
429 | connection : io_connect_t; | |
430 | in notification_type : natural_t; | |
431 | out semaphore : semaphore_t | |
432 | ); | |
433 | ||
1c79356b A |
434 | routine io_connect_unmap_memory( |
435 | connection : io_connect_t; | |
436 | in memory_type : int; | |
437 | in into_task : task_t; | |
438 | in address : vm_address_t | |
439 | ); | |
440 | ||
0b4e3aa0 A |
441 | routine io_registry_entry_get_location_in_plane( |
442 | registry_entry : io_object_t; | |
443 | in plane : io_name_t; | |
444 | out location : io_name_t | |
445 | ); | |
446 | ||
447 | routine io_registry_entry_get_property_recursively( | |
448 | registry_entry : io_object_t; | |
449 | in plane : io_name_t; | |
450 | in property_name : io_name_t; | |
451 | in options : int; | |
452 | out properties : io_buf_ptr_t, physicalcopy | |
453 | ); | |
454 | ||
1c79356b A |
455 | #endif |
456 | ||
457 |