]> git.karo-electronics.de Git - karo-tx-linux.git/blob - include/acpi/acpixf.h
ac04985017c5b15f06bcf3b23310028a261a1782
[karo-tx-linux.git] / include / acpi / acpixf.h
1 /******************************************************************************
2  *
3  * Name: acpixf.h - External interfaces to the ACPI subsystem
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2014, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43
44 #ifndef __ACXFACE_H__
45 #define __ACXFACE_H__
46
47 /* Current ACPICA subsystem version in YYYYMMDD format */
48
49 #define ACPI_CA_VERSION                 0x20140325
50
51 #include <acpi/acconfig.h>
52 #include <acpi/actypes.h>
53 #include <acpi/actbl.h>
54 #include <acpi/acbuffer.h>
55
56 extern u8 acpi_gbl_permanent_mmap;
57
58 /*
59  * Ensure that the globals are actually defined and initialized only once.
60  *
61  * The use of these macros allows a single list of globals (here) in order
62  * to simplify maintenance of the code.
63  */
64 #ifdef DEFINE_ACPI_GLOBALS
65 #define ACPI_GLOBAL(type,name) \
66         extern type name; \
67         type name
68
69 #define ACPI_INIT_GLOBAL(type,name,value) \
70         type name=value
71
72 #else
73 #ifndef ACPI_GLOBAL
74 #define ACPI_GLOBAL(type,name) \
75         extern type name
76 #endif
77
78 #ifndef ACPI_INIT_GLOBAL
79 #define ACPI_INIT_GLOBAL(type,name,value) \
80         extern type name
81 #endif
82 #endif
83
84 /* ACPICA prototypes */
85
86 #ifndef ACPI_EXTERNAL_RETURN_STATUS
87 #define ACPI_EXTERNAL_RETURN_STATUS(prototype) \
88         prototype;
89 #endif
90
91 #ifndef ACPI_EXTERNAL_RETURN_OK
92 #define ACPI_EXTERNAL_RETURN_OK(prototype) \
93         prototype;
94 #endif
95
96 #ifndef ACPI_EXTERNAL_RETURN_VOID
97 #define ACPI_EXTERNAL_RETURN_VOID(prototype) \
98         prototype;
99 #endif
100
101 #ifndef ACPI_EXTERNAL_RETURN_UINT32
102 #define ACPI_EXTERNAL_RETURN_UINT32(prototype) \
103         prototype;
104 #endif
105
106 #ifndef ACPI_EXTERNAL_RETURN_PTR
107 #define ACPI_EXTERNAL_RETURN_PTR(prototype) \
108         prototype;
109 #endif
110
111 /* Public globals, available from outside ACPICA subsystem */
112
113 /*****************************************************************************
114  *
115  * Runtime configuration (static defaults that can be overriden at runtime)
116  *
117  ****************************************************************************/
118
119 /*
120  * Enable "slack" in the AML interpreter?  Default is FALSE, and the
121  * interpreter strictly follows the ACPI specification. Setting to TRUE
122  * allows the interpreter to ignore certain errors and/or bad AML constructs.
123  *
124  * Currently, these features are enabled by this flag:
125  *
126  * 1) Allow "implicit return" of last value in a control method
127  * 2) Allow access beyond the end of an operation region
128  * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
129  * 4) Allow ANY object type to be a source operand for the Store() operator
130  * 5) Allow unresolved references (invalid target name) in package objects
131  * 6) Enable warning messages for behavior that is not ACPI spec compliant
132  */
133 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_interpreter_slack, FALSE);
134
135 /*
136  * Automatically serialize all methods that create named objects? Default
137  * is TRUE, meaning that all non_serialized methods are scanned once at
138  * table load time to determine those that create named objects. Methods
139  * that create named objects are marked Serialized in order to prevent
140  * possible run-time problems if they are entered by more than one thread.
141  */
142 ACPI_INIT_GLOBAL(u8, acpi_gbl_auto_serialize_methods, TRUE);
143
144 /*
145  * Create the predefined _OSI method in the namespace? Default is TRUE
146  * because ACPICA is fully compatible with other ACPI implementations.
147  * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
148  */
149 ACPI_INIT_GLOBAL(u8, acpi_gbl_create_osi_method, TRUE);
150
151 /*
152  * Optionally use default values for the ACPI register widths. Set this to
153  * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
154  */
155 ACPI_INIT_GLOBAL(u8, acpi_gbl_use_default_register_widths, TRUE);
156
157 /*
158  * Optionally enable output from the AML Debug Object.
159  */
160 ACPI_INIT_GLOBAL(u8, acpi_gbl_enable_aml_debug_object, FALSE);
161
162 /*
163  * Optionally copy the entire DSDT to local memory (instead of simply
164  * mapping it.) There are some BIOSs that corrupt or replace the original
165  * DSDT, creating the need for this option. Default is FALSE, do not copy
166  * the DSDT.
167  */
168 ACPI_INIT_GLOBAL(u8, acpi_gbl_copy_dsdt_locally, FALSE);
169
170 /*
171  * Optionally ignore an XSDT if present and use the RSDT instead.
172  * Although the ACPI specification requires that an XSDT be used instead
173  * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
174  * some machines. Default behavior is to use the XSDT if present.
175  */
176 ACPI_INIT_GLOBAL(u8, acpi_gbl_do_not_use_xsdt, FALSE);
177
178 /*
179  * Optionally use 32-bit FADT addresses if and when there is a conflict
180  * (address mismatch) between the 32-bit and 64-bit versions of the
181  * address. Although ACPICA adheres to the ACPI specification which
182  * requires the use of the corresponding 64-bit address if it is non-zero,
183  * some machines have been found to have a corrupted non-zero 64-bit
184  * address. Default is FALSE, do not favor the 32-bit addresses.
185  */
186 ACPI_INIT_GLOBAL(u8, acpi_gbl_use32_bit_fadt_addresses, FALSE);
187
188 /*
189  * Optionally truncate I/O addresses to 16 bits. Provides compatibility
190  * with other ACPI implementations. NOTE: During ACPICA initialization,
191  * this value is set to TRUE if any Windows OSI strings have been
192  * requested by the BIOS.
193  */
194 ACPI_INIT_GLOBAL(u8, acpi_gbl_truncate_io_addresses, FALSE);
195
196 /*
197  * Disable runtime checking and repair of values returned by control methods.
198  * Use only if the repair is causing a problem on a particular machine.
199  */
200 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_auto_repair, FALSE);
201
202 /*
203  * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
204  * This can be useful for debugging ACPI problems on some machines.
205  */
206 ACPI_INIT_GLOBAL(u8, acpi_gbl_disable_ssdt_table_install, FALSE);
207
208 /*
209  * We keep track of the latest version of Windows that has been requested by
210  * the BIOS.  ACPI 5.0.
211  */
212 ACPI_INIT_GLOBAL(u8, acpi_gbl_osi_data, 0);
213
214 /*
215  * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
216  * that the ACPI hardware is no longer required. A flag in the FADT indicates
217  * a reduced HW machine, and that flag is duplicated here for convenience.
218  */
219 ACPI_INIT_GLOBAL(u8, acpi_gbl_reduced_hardware, FALSE);
220
221 /*
222  * This mechanism is used to trace a specified AML method. The method is
223  * traced each time it is executed.
224  */
225 ACPI_INIT_GLOBAL(u32, acpi_gbl_trace_flags, 0);
226 ACPI_INIT_GLOBAL(acpi_name, acpi_gbl_trace_method_name, 0);
227
228 /*
229  * Runtime configuration of debug output control masks. We want the debug
230  * switches statically initialized so they are already set when the debugger
231  * is entered.
232  */
233 ACPI_INIT_GLOBAL(u32, acpi_dbg_level, ACPI_DEBUG_DEFAULT);
234 ACPI_INIT_GLOBAL(u32, acpi_dbg_layer, 0);
235
236 /*
237  * Globals that are publically available
238  */
239 ACPI_GLOBAL(u32, acpi_current_gpe_count);
240 ACPI_GLOBAL(struct acpi_table_fadt, acpi_gbl_FADT);
241 ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
242
243 /*
244  * Hardware-reduced prototypes. All interfaces that use these macros will
245  * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
246  * is set to TRUE.
247  */
248 #if (!ACPI_REDUCED_HARDWARE)
249 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
250         ACPI_EXTERNAL_RETURN_STATUS(prototype)
251
252 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
253         ACPI_EXTERNAL_RETURN_OK(prototype)
254
255 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
256         ACPI_EXTERNAL_RETURN_VOID(prototype)
257
258 #else
259 #define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
260         static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
261
262 #define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
263         static ACPI_INLINE prototype {return(AE_OK);}
264
265 #define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
266         static ACPI_INLINE prototype {return;}
267
268 #endif                          /* !ACPI_REDUCED_HARDWARE */
269
270 /*
271  * Error-message prototypes. All interfaces that use these macros will
272  * be configured out of the ACPICA build if the ACPI_NO_ERROR_MESSAGE flag
273  * is defined.
274  */
275 #ifndef ACPI_NO_ERROR_MESSAGES
276 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
277         prototype;
278
279 #else
280 #define ACPI_MSG_DEPENDENT_RETURN_VOID(prototype) \
281         static ACPI_INLINE prototype {return;}
282
283 #endif                          /* ACPI_NO_ERROR_MESSAGES */
284
285 /*
286  * Debugging-output prototypes. All interfaces that use these macros will
287  * be configured out of the ACPICA build if the ACPI_DEBUG_OUTPUT flag is
288  * not defined.
289  */
290 #ifdef ACPI_DEBUG_OUTPUT
291 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
292         prototype;
293
294 #else
295 #define ACPI_DBG_DEPENDENT_RETURN_VOID(prototype) \
296         static ACPI_INLINE prototype {return;}
297
298 #endif                          /* ACPI_DEBUG_OUTPUT */
299
300 /*
301  * Initialization
302  */
303 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
304                             acpi_initialize_tables(struct acpi_table_desc
305                                                    *initial_storage,
306                                                    u32 initial_table_count,
307                                                    u8 allow_resize))
308 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_initialize_subsystem(void))
309
310 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_enable_subsystem(u32 flags))
311
312 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
313                             acpi_initialize_objects(u32 flags))
314 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_terminate(void))
315
316 /*
317  * Miscellaneous global interfaces
318  */
319 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
320 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
321 #ifdef ACPI_FUTURE_USAGE
322 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_subsystem_status(void))
323 #endif
324
325 #ifdef ACPI_FUTURE_USAGE
326 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
327                             acpi_get_system_info(struct acpi_buffer
328                                                  *ret_buffer))
329 #endif
330 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
331                              acpi_get_statistics(struct acpi_statistics *stats))
332 ACPI_EXTERNAL_RETURN_PTR(const char
333                           *acpi_format_exception(acpi_status exception))
334 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_purge_cached_objects(void))
335
336 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
337                             acpi_install_interface(acpi_string interface_name))
338
339 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
340                             acpi_remove_interface(acpi_string interface_name))
341 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_update_interfaces(u8 action))
342
343 ACPI_EXTERNAL_RETURN_UINT32(u32
344                             acpi_check_address_range(acpi_adr_space_type
345                                                      space_id,
346                                                      acpi_physical_address
347                                                      address, acpi_size length,
348                                                      u8 warn))
349 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
350                              acpi_decode_pld_buffer(u8 *in_buffer,
351                                                     acpi_size length,
352                                                     struct acpi_pld_info
353                                                     **return_buffer))
354
355 /*
356  * ACPI table load/unload interfaces
357  */
358 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
359                             acpi_install_table(acpi_physical_address address,
360                                                u8 physical))
361
362 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
363                             acpi_load_table(struct acpi_table_header *table))
364
365 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
366                             acpi_unload_parent_table(acpi_handle object))
367 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_load_tables(void))
368
369 /*
370  * ACPI table manipulation interfaces
371  */
372 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init acpi_reallocate_root_table(void))
373
374 ACPI_EXTERNAL_RETURN_STATUS(acpi_status __init
375                             acpi_find_root_pointer(acpi_size * rsdp_address))
376
377 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
378                             acpi_get_table_header(acpi_string signature,
379                                                   u32 instance,
380                                                   struct acpi_table_header
381                                                   *out_table_header))
382 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
383                              acpi_get_table(acpi_string signature, u32 instance,
384                                             struct acpi_table_header
385                                             **out_table))
386 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
387                              acpi_get_table_by_index(u32 table_index,
388                                                      struct acpi_table_header
389                                                      **out_table))
390 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
391                              acpi_install_table_handler(acpi_table_handler
392                                                         handler, void *context))
393 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
394                              acpi_remove_table_handler(acpi_table_handler
395                                                        handler))
396
397 /*
398  * Namespace and name interfaces
399  */
400 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
401                             acpi_walk_namespace(acpi_object_type type,
402                                                 acpi_handle start_object,
403                                                 u32 max_depth,
404                                                 acpi_walk_callback
405                                                 descending_callback,
406                                                 acpi_walk_callback
407                                                 ascending_callback,
408                                                 void *context,
409                                                 void **return_value))
410 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
411                              acpi_get_devices(const char *HID,
412                                               acpi_walk_callback user_function,
413                                               void *context,
414                                               void **return_value))
415 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
416                              acpi_get_name(acpi_handle object, u32 name_type,
417                                            struct acpi_buffer *ret_path_ptr))
418 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
419                              acpi_get_handle(acpi_handle parent,
420                                              acpi_string pathname,
421                                              acpi_handle * ret_handle))
422 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
423                              acpi_attach_data(acpi_handle object,
424                                               acpi_object_handler handler,
425                                               void *data))
426 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
427                              acpi_detach_data(acpi_handle object,
428                                               acpi_object_handler handler))
429 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
430                              acpi_get_data(acpi_handle object,
431                                            acpi_object_handler handler,
432                                            void **data))
433 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
434                              acpi_debug_trace(char *name, u32 debug_level,
435                                               u32 debug_layer, u32 flags))
436
437 /*
438  * Object manipulation and enumeration
439  */
440 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
441                             acpi_evaluate_object(acpi_handle object,
442                                                  acpi_string pathname,
443                                                  struct acpi_object_list
444                                                  *parameter_objects,
445                                                  struct acpi_buffer
446                                                  *return_object_buffer))
447 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
448                              acpi_evaluate_object_typed(acpi_handle object,
449                                                         acpi_string pathname,
450                                                         struct acpi_object_list
451                                                         *external_params,
452                                                         struct acpi_buffer
453                                                         *return_buffer,
454                                                         acpi_object_type
455                                                         return_type))
456 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
457                              acpi_get_object_info(acpi_handle object,
458                                                   struct acpi_device_info
459                                                   **return_buffer))
460 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_install_method(u8 *buffer))
461
462 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
463                             acpi_get_next_object(acpi_object_type type,
464                                                  acpi_handle parent,
465                                                  acpi_handle child,
466                                                  acpi_handle * out_handle))
467
468 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
469                             acpi_get_type(acpi_handle object,
470                                           acpi_object_type * out_type))
471
472 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
473                             acpi_get_parent(acpi_handle object,
474                                             acpi_handle * out_handle))
475
476 /*
477  * Handler interfaces
478  */
479 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
480                             acpi_install_initialization_handler
481                             (acpi_init_handler handler, u32 function))
482 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
483                                  acpi_install_sci_handler(acpi_sci_handler
484                                                           address,
485                                                           void *context))
486 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
487                                  acpi_remove_sci_handler(acpi_sci_handler
488                                                          address))
489 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
490                                  acpi_install_global_event_handler
491                                  (acpi_gbl_event_handler handler,
492                                   void *context))
493 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
494                                  acpi_install_fixed_event_handler(u32
495                                                                   acpi_event,
496                                                                   acpi_event_handler
497                                                                   handler,
498                                                                   void
499                                                                   *context))
500 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
501                                  acpi_remove_fixed_event_handler(u32 acpi_event,
502                                                                  acpi_event_handler
503                                                                  handler))
504 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
505                                  acpi_install_gpe_handler(acpi_handle
506                                                           gpe_device,
507                                                           u32 gpe_number,
508                                                           u32 type,
509                                                           acpi_gpe_handler
510                                                           address,
511                                                           void *context))
512 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
513                                  acpi_remove_gpe_handler(acpi_handle gpe_device,
514                                                          u32 gpe_number,
515                                                          acpi_gpe_handler
516                                                          address))
517 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
518                              acpi_install_notify_handler(acpi_handle device,
519                                                          u32 handler_type,
520                                                          acpi_notify_handler
521                                                          handler,
522                                                          void *context))
523 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
524                              acpi_remove_notify_handler(acpi_handle device,
525                                                         u32 handler_type,
526                                                         acpi_notify_handler
527                                                         handler))
528 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
529                              acpi_install_address_space_handler(acpi_handle
530                                                                 device,
531                                                                 acpi_adr_space_type
532                                                                 space_id,
533                                                                 acpi_adr_space_handler
534                                                                 handler,
535                                                                 acpi_adr_space_setup
536                                                                 setup,
537                                                                 void *context))
538 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
539                              acpi_remove_address_space_handler(acpi_handle
540                                                                device,
541                                                                acpi_adr_space_type
542                                                                space_id,
543                                                                acpi_adr_space_handler
544                                                                handler))
545 #ifdef ACPI_FUTURE_USAGE
546 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
547                              acpi_install_exception_handler
548                              (acpi_exception_handler handler))
549 #endif
550 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
551                              acpi_install_interface_handler
552                              (acpi_interface_handler handler))
553
554 /*
555  * Global Lock interfaces
556  */
557 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
558                                 acpi_acquire_global_lock(u16 timeout,
559                                                          u32 *handle))
560
561 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
562                                 acpi_release_global_lock(u32 handle))
563
564 /*
565  * Interfaces to AML mutex objects
566  */
567 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
568                             acpi_acquire_mutex(acpi_handle handle,
569                                                acpi_string pathname,
570                                                u16 timeout))
571
572 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
573                             acpi_release_mutex(acpi_handle handle,
574                                                acpi_string pathname))
575
576 /*
577  * Fixed Event interfaces
578  */
579 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
580                                 acpi_enable_event(u32 event, u32 flags))
581
582 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
583                                 acpi_disable_event(u32 event, u32 flags))
584 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
585
586 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
587                                 acpi_get_event_status(u32 event,
588                                                       acpi_event_status
589                                                       *event_status))
590
591 /*
592  * General Purpose Event (GPE) Interfaces
593  */
594 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
595
596 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
597                                 acpi_enable_gpe(acpi_handle gpe_device,
598                                                 u32 gpe_number))
599
600 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
601                                 acpi_disable_gpe(acpi_handle gpe_device,
602                                                  u32 gpe_number))
603
604 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
605                                 acpi_clear_gpe(acpi_handle gpe_device,
606                                                u32 gpe_number))
607
608 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
609                                 acpi_set_gpe(acpi_handle gpe_device,
610                                              u32 gpe_number, u8 action))
611
612 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
613                                 acpi_finish_gpe(acpi_handle gpe_device,
614                                                 u32 gpe_number))
615
616 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
617                                 acpi_setup_gpe_for_wake(acpi_handle
618                                                         parent_device,
619                                                         acpi_handle gpe_device,
620                                                         u32 gpe_number))
621 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
622                                  acpi_set_gpe_wake_mask(acpi_handle gpe_device,
623                                                         u32 gpe_number,
624                                                         u8 action))
625 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
626                                  acpi_get_gpe_status(acpi_handle gpe_device,
627                                                      u32 gpe_number,
628                                                      acpi_event_status
629                                                      *event_status))
630 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
631 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
632
633 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
634                                 acpi_get_gpe_device(u32 gpe_index,
635                                                     acpi_handle * gpe_device))
636
637 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
638                                 acpi_install_gpe_block(acpi_handle gpe_device,
639                                                        struct
640                                                        acpi_generic_address
641                                                        *gpe_block_address,
642                                                        u32 register_count,
643                                                        u32 interrupt_number))
644 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
645                                  acpi_remove_gpe_block(acpi_handle gpe_device))
646
647 /*
648  * Resource interfaces
649  */
650 typedef
651 acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
652                                            void *context);
653
654 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
655                             acpi_get_vendor_resource(acpi_handle device,
656                                                      char *name,
657                                                      struct acpi_vendor_uuid
658                                                      *uuid,
659                                                      struct acpi_buffer
660                                                      *ret_buffer))
661 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
662                              acpi_get_current_resources(acpi_handle device,
663                                                         struct acpi_buffer
664                                                         *ret_buffer))
665 #ifdef ACPI_FUTURE_USAGE
666 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
667                              acpi_get_possible_resources(acpi_handle device,
668                                                          struct acpi_buffer
669                                                          *ret_buffer))
670 #endif
671 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
672                              acpi_get_event_resources(acpi_handle device_handle,
673                                                       struct acpi_buffer
674                                                       *ret_buffer))
675 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
676                              acpi_walk_resource_buffer(struct acpi_buffer
677                                                        *buffer,
678                                                        acpi_walk_resource_callback
679                                                        user_function,
680                                                        void *context))
681 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
682                              acpi_walk_resources(acpi_handle device, char *name,
683                                                  acpi_walk_resource_callback
684                                                  user_function, void *context))
685 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
686                              acpi_set_current_resources(acpi_handle device,
687                                                         struct acpi_buffer
688                                                         *in_buffer))
689 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
690                              acpi_get_irq_routing_table(acpi_handle device,
691                                                         struct acpi_buffer
692                                                         *ret_buffer))
693 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
694                              acpi_resource_to_address64(struct acpi_resource
695                                                         *resource,
696                                                         struct
697                                                         acpi_resource_address64
698                                                         *out))
699 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
700                              acpi_buffer_to_resource(u8 *aml_buffer,
701                                                      u16 aml_buffer_length,
702                                                      struct acpi_resource
703                                                      **resource_ptr))
704
705 /*
706  * Hardware (ACPI device) interfaces
707  */
708 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_reset(void))
709
710 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
711                             acpi_read(u64 *value,
712                                       struct acpi_generic_address *reg))
713
714 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
715                             acpi_write(u64 value,
716                                        struct acpi_generic_address *reg))
717
718 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
719                                 acpi_read_bit_register(u32 register_id,
720                                                        u32 *return_value))
721
722 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
723                                 acpi_write_bit_register(u32 register_id,
724                                                         u32 value))
725
726 /*
727  * Sleep/Wake interfaces
728  */
729 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
730                             acpi_get_sleep_type_data(u8 sleep_state,
731                                                      u8 *slp_typ_a,
732                                                      u8 *slp_typ_b))
733
734 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
735                             acpi_enter_sleep_state_prep(u8 sleep_state))
736 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_enter_sleep_state(u8 sleep_state))
737
738 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
739
740 ACPI_EXTERNAL_RETURN_STATUS(acpi_status
741                             acpi_leave_sleep_state_prep(u8 sleep_state))
742 ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_leave_sleep_state(u8 sleep_state))
743
744 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
745                                 acpi_set_firmware_waking_vector(u32
746                                                                 physical_address))
747 #if ACPI_MACHINE_WIDTH == 64
748 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
749                                 acpi_set_firmware_waking_vector64(u64
750                                                                   physical_address))
751 #endif
752 /*
753  * ACPI Timer interfaces
754  */
755 #ifdef ACPI_FUTURE_USAGE
756 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
757                                 acpi_get_timer_resolution(u32 *resolution))
758 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
759
760 ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
761                                 acpi_get_timer_duration(u32 start_ticks,
762                                                         u32 end_ticks,
763                                                         u32 *time_elapsed))
764 #endif                          /* ACPI_FUTURE_USAGE */
765
766 /*
767  * Error/Warning output
768  */
769 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
770                                void ACPI_INTERNAL_VAR_XFACE
771                                acpi_error(const char *module_name,
772                                           u32 line_number,
773                                           const char *format, ...))
774 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
775                                 void ACPI_INTERNAL_VAR_XFACE
776                                 acpi_exception(const char *module_name,
777                                                u32 line_number,
778                                                acpi_status status,
779                                                const char *format, ...))
780 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
781                                 void ACPI_INTERNAL_VAR_XFACE
782                                 acpi_warning(const char *module_name,
783                                              u32 line_number,
784                                              const char *format, ...))
785 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
786                                 void ACPI_INTERNAL_VAR_XFACE
787                                 acpi_info(const char *module_name,
788                                           u32 line_number,
789                                           const char *format, ...))
790 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
791                                 void ACPI_INTERNAL_VAR_XFACE
792                                 acpi_bios_error(const char *module_name,
793                                                 u32 line_number,
794                                                 const char *format, ...))
795 ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
796                                 void ACPI_INTERNAL_VAR_XFACE
797                                 acpi_bios_warning(const char *module_name,
798                                                   u32 line_number,
799                                                   const char *format, ...))
800
801 /*
802  * Debug output
803  */
804 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
805                                void ACPI_INTERNAL_VAR_XFACE
806                                acpi_debug_print(u32 requested_debug_level,
807                                                 u32 line_number,
808                                                 const char *function_name,
809                                                 const char *module_name,
810                                                 u32 component_id,
811                                                 const char *format, ...))
812 ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
813                                 void ACPI_INTERNAL_VAR_XFACE
814                                 acpi_debug_print_raw(u32 requested_debug_level,
815                                                      u32 line_number,
816                                                      const char *function_name,
817                                                      const char *module_name,
818                                                      u32 component_id,
819                                                      const char *format, ...))
820
821 /*
822  * Divergences
823  */
824 acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
825
826 acpi_status acpi_unload_table_id(acpi_owner_id id);
827
828 acpi_status
829 acpi_get_table_with_size(acpi_string signature,
830                u32 instance, struct acpi_table_header **out_table,
831                acpi_size *tbl_size);
832
833 acpi_status
834 acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data,
835                    void (*callback)(void *));
836
837 #endif                          /* __ACXFACE_H__ */