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