]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - include/acpi/acpixf.h
Linux-2.6.12-rc2
[mirror_ubuntu-artful-kernel.git] / include / acpi / acpixf.h
1
2 /******************************************************************************
3 *
4 * Name: acpixf.h - External interfaces to the ACPI subsystem
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000 - 2005, R. Byron Moore
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
30 *
31 * NO WARRANTY
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
43 */
44
45
46 #ifndef __ACXFACE_H__
47 #define __ACXFACE_H__
48
49 #include "actypes.h"
50 #include "actbl.h"
51
52
53 /*
54 * Global interfaces
55 */
56
57 acpi_status
58 acpi_initialize_subsystem (
59 void);
60
61 acpi_status
62 acpi_enable_subsystem (
63 u32 flags);
64
65 acpi_status
66 acpi_initialize_objects (
67 u32 flags);
68
69 acpi_status
70 acpi_terminate (
71 void);
72
73 #ifdef ACPI_FUTURE_USAGE
74 acpi_status
75 acpi_subsystem_status (
76 void);
77 #endif
78
79 acpi_status
80 acpi_enable (
81 void);
82
83 acpi_status
84 acpi_disable (
85 void);
86
87 #ifdef ACPI_FUTURE_USAGE
88 acpi_status
89 acpi_get_system_info (
90 struct acpi_buffer *ret_buffer);
91 #endif
92
93 const char *
94 acpi_format_exception (
95 acpi_status exception);
96
97 acpi_status
98 acpi_purge_cached_objects (
99 void);
100
101 #ifdef ACPI_FUTURE_USAGE
102 acpi_status
103 acpi_install_initialization_handler (
104 acpi_init_handler handler,
105 u32 function);
106 #endif
107
108 /*
109 * ACPI Memory manager
110 */
111
112 void *
113 acpi_allocate (
114 u32 size);
115
116 void *
117 acpi_callocate (
118 u32 size);
119
120 void
121 acpi_free (
122 void *address);
123
124
125 /*
126 * ACPI table manipulation interfaces
127 */
128
129 acpi_status
130 acpi_find_root_pointer (
131 u32 flags,
132 struct acpi_pointer *rsdp_address);
133
134 acpi_status
135 acpi_load_tables (
136 void);
137
138 #ifdef ACPI_FUTURE_USAGE
139 acpi_status
140 acpi_load_table (
141 struct acpi_table_header *table_ptr);
142
143 acpi_status
144 acpi_unload_table (
145 acpi_table_type table_type);
146
147 acpi_status
148 acpi_get_table_header (
149 acpi_table_type table_type,
150 u32 instance,
151 struct acpi_table_header *out_table_header);
152 #endif /* ACPI_FUTURE_USAGE */
153
154 acpi_status
155 acpi_get_table (
156 acpi_table_type table_type,
157 u32 instance,
158 struct acpi_buffer *ret_buffer);
159
160 acpi_status
161 acpi_get_firmware_table (
162 acpi_string signature,
163 u32 instance,
164 u32 flags,
165 struct acpi_table_header **table_pointer);
166
167
168 /*
169 * Namespace and name interfaces
170 */
171
172 acpi_status
173 acpi_walk_namespace (
174 acpi_object_type type,
175 acpi_handle start_object,
176 u32 max_depth,
177 acpi_walk_callback user_function,
178 void *context,
179 void **return_value);
180
181 acpi_status
182 acpi_get_devices (
183 char *HID,
184 acpi_walk_callback user_function,
185 void *context,
186 void **return_value);
187
188 acpi_status
189 acpi_get_name (
190 acpi_handle handle,
191 u32 name_type,
192 struct acpi_buffer *ret_path_ptr);
193
194 acpi_status
195 acpi_get_handle (
196 acpi_handle parent,
197 acpi_string pathname,
198 acpi_handle *ret_handle);
199
200 acpi_status
201 acpi_attach_data (
202 acpi_handle obj_handle,
203 acpi_object_handler handler,
204 void *data);
205
206 acpi_status
207 acpi_detach_data (
208 acpi_handle obj_handle,
209 acpi_object_handler handler);
210
211 acpi_status
212 acpi_get_data (
213 acpi_handle obj_handle,
214 acpi_object_handler handler,
215 void **data);
216
217
218 /*
219 * Object manipulation and enumeration
220 */
221
222 acpi_status
223 acpi_evaluate_object (
224 acpi_handle object,
225 acpi_string pathname,
226 struct acpi_object_list *parameter_objects,
227 struct acpi_buffer *return_object_buffer);
228
229 #ifdef ACPI_FUTURE_USAGE
230 acpi_status
231 acpi_evaluate_object_typed (
232 acpi_handle object,
233 acpi_string pathname,
234 struct acpi_object_list *external_params,
235 struct acpi_buffer *return_buffer,
236 acpi_object_type return_type);
237 #endif
238
239 acpi_status
240 acpi_get_object_info (
241 acpi_handle handle,
242 struct acpi_buffer *return_buffer);
243
244 acpi_status
245 acpi_get_next_object (
246 acpi_object_type type,
247 acpi_handle parent,
248 acpi_handle child,
249 acpi_handle *out_handle);
250
251 acpi_status
252 acpi_get_type (
253 acpi_handle object,
254 acpi_object_type *out_type);
255
256 acpi_status
257 acpi_get_parent (
258 acpi_handle object,
259 acpi_handle *out_handle);
260
261
262 /*
263 * Event handler interfaces
264 */
265
266 acpi_status
267 acpi_install_fixed_event_handler (
268 u32 acpi_event,
269 acpi_event_handler handler,
270 void *context);
271
272 acpi_status
273 acpi_remove_fixed_event_handler (
274 u32 acpi_event,
275 acpi_event_handler handler);
276
277 acpi_status
278 acpi_install_notify_handler (
279 acpi_handle device,
280 u32 handler_type,
281 acpi_notify_handler handler,
282 void *context);
283
284 acpi_status
285 acpi_remove_notify_handler (
286 acpi_handle device,
287 u32 handler_type,
288 acpi_notify_handler handler);
289
290 acpi_status
291 acpi_install_address_space_handler (
292 acpi_handle device,
293 acpi_adr_space_type space_id,
294 acpi_adr_space_handler handler,
295 acpi_adr_space_setup setup,
296 void *context);
297
298 acpi_status
299 acpi_remove_address_space_handler (
300 acpi_handle device,
301 acpi_adr_space_type space_id,
302 acpi_adr_space_handler handler);
303
304 acpi_status
305 acpi_install_gpe_handler (
306 acpi_handle gpe_device,
307 u32 gpe_number,
308 u32 type,
309 acpi_event_handler address,
310 void *context);
311
312 #ifdef ACPI_FUTURE_USAGE
313 acpi_status
314 acpi_install_exception_handler (
315 acpi_exception_handler handler);
316 #endif
317
318
319 /*
320 * Event interfaces
321 */
322
323 acpi_status
324 acpi_acquire_global_lock (
325 u16 timeout,
326 u32 *handle);
327
328 acpi_status
329 acpi_release_global_lock (
330 u32 handle);
331
332 acpi_status
333 acpi_remove_gpe_handler (
334 acpi_handle gpe_device,
335 u32 gpe_number,
336 acpi_event_handler address);
337
338 acpi_status
339 acpi_enable_event (
340 u32 event,
341 u32 flags);
342
343 acpi_status
344 acpi_disable_event (
345 u32 event,
346 u32 flags);
347
348 acpi_status
349 acpi_clear_event (
350 u32 event);
351
352 #ifdef ACPI_FUTURE_USAGE
353 acpi_status
354 acpi_get_event_status (
355 u32 event,
356 acpi_event_status *event_status);
357 #endif /* ACPI_FUTURE_USAGE */
358
359 acpi_status
360 acpi_set_gpe_type (
361 acpi_handle gpe_device,
362 u32 gpe_number,
363 u8 type);
364
365 acpi_status
366 acpi_enable_gpe (
367 acpi_handle gpe_device,
368 u32 gpe_number,
369 u32 flags);
370
371 acpi_status
372 acpi_disable_gpe (
373 acpi_handle gpe_device,
374 u32 gpe_number,
375 u32 flags);
376
377 acpi_status
378 acpi_clear_gpe (
379 acpi_handle gpe_device,
380 u32 gpe_number,
381 u32 flags);
382
383 #ifdef ACPI_FUTURE_USAGE
384 acpi_status
385 acpi_get_gpe_status (
386 acpi_handle gpe_device,
387 u32 gpe_number,
388 u32 flags,
389 acpi_event_status *event_status);
390 #endif /* ACPI_FUTURE_USAGE */
391
392 acpi_status
393 acpi_install_gpe_block (
394 acpi_handle gpe_device,
395 struct acpi_generic_address *gpe_block_address,
396 u32 register_count,
397 u32 interrupt_level);
398
399 acpi_status
400 acpi_remove_gpe_block (
401 acpi_handle gpe_device);
402
403
404 /*
405 * Resource interfaces
406 */
407
408 typedef
409 acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
410 struct acpi_resource *resource,
411 void *context);
412
413
414 acpi_status
415 acpi_get_current_resources(
416 acpi_handle device_handle,
417 struct acpi_buffer *ret_buffer);
418
419 #ifdef ACPI_FUTURE_USAGE
420 acpi_status
421 acpi_get_possible_resources(
422 acpi_handle device_handle,
423 struct acpi_buffer *ret_buffer);
424 #endif
425
426 acpi_status
427 acpi_walk_resources (
428 acpi_handle device_handle,
429 char *path,
430 ACPI_WALK_RESOURCE_CALLBACK user_function,
431 void *context);
432
433 acpi_status
434 acpi_set_current_resources (
435 acpi_handle device_handle,
436 struct acpi_buffer *in_buffer);
437
438 acpi_status
439 acpi_get_irq_routing_table (
440 acpi_handle bus_device_handle,
441 struct acpi_buffer *ret_buffer);
442
443 acpi_status
444 acpi_resource_to_address64 (
445 struct acpi_resource *resource,
446 struct acpi_resource_address64 *out);
447
448 /*
449 * Hardware (ACPI device) interfaces
450 */
451
452 acpi_status
453 acpi_get_register (
454 u32 register_id,
455 u32 *return_value,
456 u32 flags);
457
458 acpi_status
459 acpi_set_register (
460 u32 register_id,
461 u32 value,
462 u32 flags);
463
464 acpi_status
465 acpi_set_firmware_waking_vector (
466 acpi_physical_address physical_address);
467
468 #ifdef ACPI_FUTURE_USAGE
469 acpi_status
470 acpi_get_firmware_waking_vector (
471 acpi_physical_address *physical_address);
472 #endif
473
474 acpi_status
475 acpi_get_sleep_type_data (
476 u8 sleep_state,
477 u8 *slp_typ_a,
478 u8 *slp_typ_b);
479
480 acpi_status
481 acpi_enter_sleep_state_prep (
482 u8 sleep_state);
483
484 acpi_status asmlinkage
485 acpi_enter_sleep_state (
486 u8 sleep_state);
487
488 acpi_status asmlinkage
489 acpi_enter_sleep_state_s4bios (
490 void);
491
492 acpi_status
493 acpi_leave_sleep_state (
494 u8 sleep_state);
495
496
497 #endif /* __ACXFACE_H__ */