xref: /freebsd/sys/contrib/dev/acpica/include/acpixf.h (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
1 /******************************************************************************
2  *
3  * Name: acpixf.h - External interfaces to the ACPI subsystem
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2015, 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                 0x20150717
50 
51 #include <contrib/dev/acpica/include/acconfig.h>
52 #include <contrib/dev/acpica/include/actypes.h>
53 #include <contrib/dev/acpica/include/actbl.h>
54 #include <contrib/dev/acpica/include/acbuffer.h>
55 
56 
57 /*****************************************************************************
58  *
59  * Macros used for ACPICA globals and configuration
60  *
61  ****************************************************************************/
62 
63 /*
64  * Ensure that global variables are defined and initialized only once.
65  *
66  * The use of these macros allows for a single list of globals (here)
67  * in order to simplify maintenance of the code.
68  */
69 #ifdef DEFINE_ACPI_GLOBALS
70 #define ACPI_GLOBAL(type,name) \
71     extern type name; \
72     type name
73 
74 #define ACPI_INIT_GLOBAL(type,name,value) \
75     type name=value
76 
77 #else
78 #ifndef ACPI_GLOBAL
79 #define ACPI_GLOBAL(type,name) \
80     extern type name
81 #endif
82 
83 #ifndef ACPI_INIT_GLOBAL
84 #define ACPI_INIT_GLOBAL(type,name,value) \
85     extern type name
86 #endif
87 #endif
88 
89 /*
90  * These macros configure the various ACPICA interfaces. They are
91  * useful for generating stub inline functions for features that are
92  * configured out of the current kernel or ACPICA application.
93  */
94 #ifndef ACPI_EXTERNAL_RETURN_STATUS
95 #define ACPI_EXTERNAL_RETURN_STATUS(Prototype) \
96     Prototype;
97 #endif
98 
99 #ifndef ACPI_EXTERNAL_RETURN_OK
100 #define ACPI_EXTERNAL_RETURN_OK(Prototype) \
101     Prototype;
102 #endif
103 
104 #ifndef ACPI_EXTERNAL_RETURN_VOID
105 #define ACPI_EXTERNAL_RETURN_VOID(Prototype) \
106     Prototype;
107 #endif
108 
109 #ifndef ACPI_EXTERNAL_RETURN_UINT32
110 #define ACPI_EXTERNAL_RETURN_UINT32(Prototype) \
111     Prototype;
112 #endif
113 
114 #ifndef ACPI_EXTERNAL_RETURN_PTR
115 #define ACPI_EXTERNAL_RETURN_PTR(Prototype) \
116     Prototype;
117 #endif
118 
119 
120 /*****************************************************************************
121  *
122  * Public globals and runtime configuration options
123  *
124  ****************************************************************************/
125 
126 /*
127  * Enable "slack mode" of the AML interpreter?  Default is FALSE, and the
128  * interpreter strictly follows the ACPI specification. Setting to TRUE
129  * allows the interpreter to ignore certain errors and/or bad AML constructs.
130  *
131  * Currently, these features are enabled by this flag:
132  *
133  * 1) Allow "implicit return" of last value in a control method
134  * 2) Allow access beyond the end of an operation region
135  * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
136  * 4) Allow ANY object type to be a source operand for the Store() operator
137  * 5) Allow unresolved references (invalid target name) in package objects
138  * 6) Enable warning messages for behavior that is not ACPI spec compliant
139  */
140 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_EnableInterpreterSlack, FALSE);
141 
142 /*
143  * Automatically serialize all methods that create named objects? Default
144  * is TRUE, meaning that all NonSerialized methods are scanned once at
145  * table load time to determine those that create named objects. Methods
146  * that create named objects are marked Serialized in order to prevent
147  * possible run-time problems if they are entered by more than one thread.
148  */
149 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_AutoSerializeMethods, TRUE);
150 
151 /*
152  * Create the predefined _OSI method in the namespace? Default is TRUE
153  * because ACPICA is fully compatible with other ACPI implementations.
154  * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
155  */
156 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_CreateOsiMethod, TRUE);
157 
158 /*
159  * Optionally use default values for the ACPI register widths. Set this to
160  * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
161  */
162 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_UseDefaultRegisterWidths, TRUE);
163 
164 /*
165  * Whether or not to verify the table checksum before installation. Set
166  * this to TRUE to verify the table checksum before install it to the table
167  * manager. Note that enabling this option causes errors to happen in some
168  * OSPMs during early initialization stages. Default behavior is to do such
169  * verification.
170  */
171 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_VerifyTableChecksum, TRUE);
172 
173 /*
174  * Optionally enable output from the AML Debug Object.
175  */
176 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_EnableAmlDebugObject, FALSE);
177 
178 /*
179  * Optionally copy the entire DSDT to local memory (instead of simply
180  * mapping it.) There are some BIOSs that corrupt or replace the original
181  * DSDT, creating the need for this option. Default is FALSE, do not copy
182  * the DSDT.
183  */
184 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_CopyDsdtLocally, FALSE);
185 
186 /*
187  * Optionally ignore an XSDT if present and use the RSDT instead.
188  * Although the ACPI specification requires that an XSDT be used instead
189  * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
190  * some machines. Default behavior is to use the XSDT if present.
191  */
192 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DoNotUseXsdt, FALSE);
193 
194 /*
195  * Optionally use 32-bit FADT addresses if and when there is a conflict
196  * (address mismatch) between the 32-bit and 64-bit versions of the
197  * address. Although ACPICA adheres to the ACPI specification which
198  * requires the use of the corresponding 64-bit address if it is non-zero,
199  * some machines have been found to have a corrupted non-zero 64-bit
200  * address. Default is FALSE, do not favor the 32-bit addresses.
201  */
202 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_Use32BitFadtAddresses, FALSE);
203 
204 /*
205  * Optionally use 32-bit FACS table addresses.
206  * It is reported that some platforms fail to resume from system suspending
207  * if 64-bit FACS table address is selected:
208  * https://bugzilla.kernel.org/show_bug.cgi?id=74021
209  * Default is TRUE, favor the 32-bit addresses.
210  */
211 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_Use32BitFacsAddresses, TRUE);
212 
213 /*
214  * Optionally truncate I/O addresses to 16 bits. Provides compatibility
215  * with other ACPI implementations. NOTE: During ACPICA initialization,
216  * this value is set to TRUE if any Windows OSI strings have been
217  * requested by the BIOS.
218  */
219 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_TruncateIoAddresses, FALSE);
220 
221 /*
222  * Disable runtime checking and repair of values returned by control methods.
223  * Use only if the repair is causing a problem on a particular machine.
224  */
225 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DisableAutoRepair, FALSE);
226 
227 /*
228  * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
229  * This can be useful for debugging ACPI problems on some machines.
230  */
231 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DisableSsdtTableInstall, FALSE);
232 
233 /*
234  * Optionally enable runtime namespace override.
235  */
236 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_RuntimeNamespaceOverride, TRUE);
237 
238 /*
239  * We keep track of the latest version of Windows that has been requested by
240  * the BIOS. ACPI 5.0.
241  */
242 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_OsiData, 0);
243 
244 /*
245  * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
246  * that the ACPI hardware is no longer required. A flag in the FADT indicates
247  * a reduced HW machine, and that flag is duplicated here for convenience.
248  */
249 ACPI_INIT_GLOBAL (BOOLEAN,          AcpiGbl_ReducedHardware, FALSE);
250 
251 /*
252  * This mechanism is used to trace a specified AML method. The method is
253  * traced each time it is executed.
254  */
255 ACPI_INIT_GLOBAL (UINT32,           AcpiGbl_TraceFlags, 0);
256 ACPI_INIT_GLOBAL (const char *,     AcpiGbl_TraceMethodName, NULL);
257 ACPI_INIT_GLOBAL (UINT32,           AcpiGbl_TraceDbgLevel, ACPI_TRACE_LEVEL_DEFAULT);
258 ACPI_INIT_GLOBAL (UINT32,           AcpiGbl_TraceDbgLayer, ACPI_TRACE_LAYER_DEFAULT);
259 
260 /*
261  * Runtime configuration of debug output control masks. We want the debug
262  * switches statically initialized so they are already set when the debugger
263  * is entered.
264  */
265 #ifdef ACPI_DEBUG_OUTPUT
266 ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
267 #else
268 ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
269 #endif
270 ACPI_INIT_GLOBAL (UINT32,           AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
271 
272 /*
273  * Other miscellaneous globals
274  */
275 ACPI_GLOBAL (ACPI_TABLE_FADT,       AcpiGbl_FADT);
276 ACPI_GLOBAL (UINT32,                AcpiCurrentGpeCount);
277 ACPI_GLOBAL (BOOLEAN,               AcpiGbl_SystemAwakeAndRunning);
278 
279 
280 /*****************************************************************************
281  *
282  * ACPICA public interface configuration.
283  *
284  * Interfaces that are configured out of the ACPICA build are replaced
285  * by inlined stubs by default.
286  *
287  ****************************************************************************/
288 
289 /*
290  * Hardware-reduced prototypes (default: Not hardware reduced).
291  *
292  * All ACPICA hardware-related interfaces that use these macros will be
293  * configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
294  * is set to TRUE.
295  *
296  * Note: This static build option for reduced hardware is intended to
297  * reduce ACPICA code size if desired or necessary. However, even if this
298  * option is not specified, the runtime behavior of ACPICA is dependent
299  * on the actual FADT reduced hardware flag (HW_REDUCED_ACPI). If set,
300  * the flag will enable similar behavior -- ACPICA will not attempt
301  * to access any ACPI-relate hardware (SCI, GPEs, Fixed Events, etc.)
302  */
303 #if (!ACPI_REDUCED_HARDWARE)
304 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
305     ACPI_EXTERNAL_RETURN_STATUS(Prototype)
306 
307 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
308     ACPI_EXTERNAL_RETURN_OK(Prototype)
309 
310 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
311     ACPI_EXTERNAL_RETURN_VOID(Prototype)
312 
313 #else
314 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
315     static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
316 
317 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
318     static ACPI_INLINE Prototype {return(AE_OK);}
319 
320 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
321     static ACPI_INLINE Prototype {return;}
322 
323 #endif /* !ACPI_REDUCED_HARDWARE */
324 
325 
326 /*
327  * Error message prototypes (default: error messages enabled).
328  *
329  * All interfaces related to error and warning messages
330  * will be configured out of the ACPICA build if the
331  * ACPI_NO_ERROR_MESSAGE flag is defined.
332  */
333 #ifndef ACPI_NO_ERROR_MESSAGES
334 #define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
335     Prototype;
336 
337 #else
338 #define ACPI_MSG_DEPENDENT_RETURN_VOID(Prototype) \
339     static ACPI_INLINE Prototype {return;}
340 
341 #endif /* ACPI_NO_ERROR_MESSAGES */
342 
343 
344 /*
345  * Debugging output prototypes (default: no debug output).
346  *
347  * All interfaces related to debug output messages
348  * will be configured out of the ACPICA build unless the
349  * ACPI_DEBUG_OUTPUT flag is defined.
350  */
351 #ifdef ACPI_DEBUG_OUTPUT
352 #define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
353     Prototype;
354 
355 #else
356 #define ACPI_DBG_DEPENDENT_RETURN_VOID(Prototype) \
357     static ACPI_INLINE Prototype {return;}
358 
359 #endif /* ACPI_DEBUG_OUTPUT */
360 
361 
362 /*
363  * Application prototypes
364  *
365  * All interfaces used by application will be configured
366  * out of the ACPICA build unless the ACPI_APPLICATION
367  * flag is defined.
368  */
369 #ifdef ACPI_APPLICATION
370 #define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
371     Prototype;
372 
373 #else
374 #define ACPI_APP_DEPENDENT_RETURN_VOID(Prototype) \
375     static ACPI_INLINE Prototype {return;}
376 
377 #endif /* ACPI_APPLICATION */
378 
379 
380 /*****************************************************************************
381  *
382  * ACPICA public interface prototypes
383  *
384  ****************************************************************************/
385 
386 /*
387  * Initialization
388  */
389 ACPI_EXTERNAL_RETURN_STATUS (
390 ACPI_STATUS
391 AcpiInitializeTables (
392     ACPI_TABLE_DESC         *InitialStorage,
393     UINT32                  InitialTableCount,
394     BOOLEAN                 AllowResize))
395 
396 ACPI_EXTERNAL_RETURN_STATUS (
397 ACPI_STATUS
398 AcpiInitializeSubsystem (
399     void))
400 
401 ACPI_EXTERNAL_RETURN_STATUS (
402 ACPI_STATUS
403 AcpiEnableSubsystem (
404     UINT32                  Flags))
405 
406 ACPI_EXTERNAL_RETURN_STATUS (
407 ACPI_STATUS
408 AcpiInitializeObjects (
409     UINT32                  Flags))
410 
411 ACPI_EXTERNAL_RETURN_STATUS (
412 ACPI_STATUS
413 AcpiTerminate (
414     void))
415 
416 
417 /*
418  * Miscellaneous global interfaces
419  */
420 ACPI_HW_DEPENDENT_RETURN_STATUS (
421 ACPI_STATUS
422 AcpiEnable (
423     void))
424 
425 ACPI_HW_DEPENDENT_RETURN_STATUS (
426 ACPI_STATUS
427 AcpiDisable (
428     void))
429 
430 ACPI_EXTERNAL_RETURN_STATUS (
431 ACPI_STATUS
432 AcpiSubsystemStatus (
433     void))
434 
435 ACPI_EXTERNAL_RETURN_STATUS (
436 ACPI_STATUS
437 AcpiGetSystemInfo (
438     ACPI_BUFFER             *RetBuffer))
439 
440 ACPI_EXTERNAL_RETURN_STATUS (
441 ACPI_STATUS
442 AcpiGetStatistics (
443     ACPI_STATISTICS         *Stats))
444 
445 ACPI_EXTERNAL_RETURN_PTR (
446 const char *
447 AcpiFormatException (
448     ACPI_STATUS             Exception))
449 
450 ACPI_EXTERNAL_RETURN_STATUS (
451 ACPI_STATUS
452 AcpiPurgeCachedObjects (
453     void))
454 
455 ACPI_EXTERNAL_RETURN_STATUS (
456 ACPI_STATUS
457 AcpiInstallInterface (
458     ACPI_STRING             InterfaceName))
459 
460 ACPI_EXTERNAL_RETURN_STATUS (
461 ACPI_STATUS
462 AcpiRemoveInterface (
463     ACPI_STRING             InterfaceName))
464 
465 ACPI_EXTERNAL_RETURN_STATUS (
466 ACPI_STATUS
467 AcpiUpdateInterfaces (
468     UINT8                   Action))
469 
470 ACPI_EXTERNAL_RETURN_UINT32 (
471 UINT32
472 AcpiCheckAddressRange (
473     ACPI_ADR_SPACE_TYPE     SpaceId,
474     ACPI_PHYSICAL_ADDRESS   Address,
475     ACPI_SIZE               Length,
476     BOOLEAN                 Warn))
477 
478 ACPI_EXTERNAL_RETURN_STATUS (
479 ACPI_STATUS
480 AcpiDecodePldBuffer (
481     UINT8                   *InBuffer,
482     ACPI_SIZE               Length,
483     ACPI_PLD_INFO           **ReturnBuffer))
484 
485 
486 /*
487  * ACPI table load/unload interfaces
488  */
489 ACPI_EXTERNAL_RETURN_STATUS (
490 ACPI_STATUS
491 AcpiInstallTable (
492     ACPI_PHYSICAL_ADDRESS   Address,
493     BOOLEAN                 Physical))
494 
495 ACPI_EXTERNAL_RETURN_STATUS (
496 ACPI_STATUS
497 AcpiLoadTable (
498     ACPI_TABLE_HEADER       *Table))
499 
500 ACPI_EXTERNAL_RETURN_STATUS (
501 ACPI_STATUS
502 AcpiUnloadParentTable (
503     ACPI_HANDLE             Object))
504 
505 ACPI_EXTERNAL_RETURN_STATUS (
506 ACPI_STATUS
507 AcpiLoadTables (
508     void))
509 
510 
511 /*
512  * ACPI table manipulation interfaces
513  */
514 ACPI_EXTERNAL_RETURN_STATUS (
515 ACPI_STATUS
516 AcpiReallocateRootTable (
517     void))
518 
519 ACPI_EXTERNAL_RETURN_STATUS (
520 ACPI_STATUS
521 AcpiFindRootPointer (
522     ACPI_PHYSICAL_ADDRESS   *RsdpAddress))
523 
524 ACPI_EXTERNAL_RETURN_STATUS (
525 ACPI_STATUS
526 AcpiGetTableHeader (
527     ACPI_STRING             Signature,
528     UINT32                  Instance,
529     ACPI_TABLE_HEADER       *OutTableHeader))
530 
531 ACPI_EXTERNAL_RETURN_STATUS (
532 ACPI_STATUS
533 AcpiGetTable (
534     ACPI_STRING             Signature,
535     UINT32                  Instance,
536     ACPI_TABLE_HEADER       **OutTable))
537 
538 ACPI_EXTERNAL_RETURN_STATUS (
539 ACPI_STATUS
540 AcpiGetTableByIndex (
541     UINT32                  TableIndex,
542     ACPI_TABLE_HEADER       **OutTable))
543 
544 ACPI_EXTERNAL_RETURN_STATUS (
545 ACPI_STATUS
546 AcpiInstallTableHandler (
547     ACPI_TABLE_HANDLER      Handler,
548     void                    *Context))
549 
550 ACPI_EXTERNAL_RETURN_STATUS (
551 ACPI_STATUS
552 AcpiRemoveTableHandler (
553     ACPI_TABLE_HANDLER      Handler))
554 
555 
556 /*
557  * Namespace and name interfaces
558  */
559 ACPI_EXTERNAL_RETURN_STATUS (
560 ACPI_STATUS
561 AcpiWalkNamespace (
562     ACPI_OBJECT_TYPE        Type,
563     ACPI_HANDLE             StartObject,
564     UINT32                  MaxDepth,
565     ACPI_WALK_CALLBACK      DescendingCallback,
566     ACPI_WALK_CALLBACK      AscendingCallback,
567     void                    *Context,
568     void                    **ReturnValue))
569 
570 ACPI_EXTERNAL_RETURN_STATUS (
571 ACPI_STATUS
572 AcpiGetDevices (
573     char                    *HID,
574     ACPI_WALK_CALLBACK      UserFunction,
575     void                    *Context,
576     void                    **ReturnValue))
577 
578 ACPI_EXTERNAL_RETURN_STATUS (
579 ACPI_STATUS
580 AcpiGetName (
581     ACPI_HANDLE             Object,
582     UINT32                  NameType,
583     ACPI_BUFFER             *RetPathPtr))
584 
585 ACPI_EXTERNAL_RETURN_STATUS (
586 ACPI_STATUS
587 AcpiGetHandle (
588     ACPI_HANDLE             Parent,
589     ACPI_STRING             Pathname,
590     ACPI_HANDLE             *RetHandle))
591 
592 ACPI_EXTERNAL_RETURN_STATUS (
593 ACPI_STATUS
594 AcpiAttachData (
595     ACPI_HANDLE             Object,
596     ACPI_OBJECT_HANDLER     Handler,
597     void                    *Data))
598 
599 ACPI_EXTERNAL_RETURN_STATUS (
600 ACPI_STATUS
601 AcpiDetachData (
602     ACPI_HANDLE             Object,
603     ACPI_OBJECT_HANDLER     Handler))
604 
605 ACPI_EXTERNAL_RETURN_STATUS (
606 ACPI_STATUS
607 AcpiGetData (
608     ACPI_HANDLE             Object,
609     ACPI_OBJECT_HANDLER     Handler,
610     void                    **Data))
611 
612 ACPI_EXTERNAL_RETURN_STATUS (
613 ACPI_STATUS
614 AcpiDebugTrace (
615     const char              *Name,
616     UINT32                  DebugLevel,
617     UINT32                  DebugLayer,
618     UINT32                  Flags))
619 
620 
621 /*
622  * Object manipulation and enumeration
623  */
624 ACPI_EXTERNAL_RETURN_STATUS (
625 ACPI_STATUS
626 AcpiEvaluateObject (
627     ACPI_HANDLE             Object,
628     ACPI_STRING             Pathname,
629     ACPI_OBJECT_LIST        *ParameterObjects,
630     ACPI_BUFFER             *ReturnObjectBuffer))
631 
632 ACPI_EXTERNAL_RETURN_STATUS (
633 ACPI_STATUS
634 AcpiEvaluateObjectTyped (
635     ACPI_HANDLE             Object,
636     ACPI_STRING             Pathname,
637     ACPI_OBJECT_LIST        *ExternalParams,
638     ACPI_BUFFER             *ReturnBuffer,
639     ACPI_OBJECT_TYPE        ReturnType))
640 
641 ACPI_EXTERNAL_RETURN_STATUS (
642 ACPI_STATUS
643 AcpiGetObjectInfo (
644     ACPI_HANDLE             Object,
645     ACPI_DEVICE_INFO        **ReturnBuffer))
646 
647 ACPI_EXTERNAL_RETURN_STATUS (
648 ACPI_STATUS
649 AcpiInstallMethod (
650     UINT8                   *Buffer))
651 
652 ACPI_EXTERNAL_RETURN_STATUS (
653 ACPI_STATUS
654 AcpiGetNextObject (
655     ACPI_OBJECT_TYPE        Type,
656     ACPI_HANDLE             Parent,
657     ACPI_HANDLE             Child,
658     ACPI_HANDLE             *OutHandle))
659 
660 ACPI_EXTERNAL_RETURN_STATUS (
661 ACPI_STATUS
662 AcpiGetType (
663     ACPI_HANDLE             Object,
664     ACPI_OBJECT_TYPE        *OutType))
665 
666 ACPI_EXTERNAL_RETURN_STATUS (
667 ACPI_STATUS
668 AcpiGetParent (
669     ACPI_HANDLE             Object,
670     ACPI_HANDLE             *OutHandle))
671 
672 
673 /*
674  * Handler interfaces
675  */
676 ACPI_EXTERNAL_RETURN_STATUS (
677 ACPI_STATUS
678 AcpiInstallInitializationHandler (
679     ACPI_INIT_HANDLER       Handler,
680     UINT32                  Function))
681 
682 ACPI_HW_DEPENDENT_RETURN_STATUS (
683 ACPI_STATUS
684 AcpiInstallSciHandler (
685     ACPI_SCI_HANDLER        Address,
686     void                    *Context))
687 
688 ACPI_HW_DEPENDENT_RETURN_STATUS (
689 ACPI_STATUS
690 AcpiRemoveSciHandler (
691     ACPI_SCI_HANDLER        Address))
692 
693 ACPI_HW_DEPENDENT_RETURN_STATUS (
694 ACPI_STATUS
695 AcpiInstallGlobalEventHandler (
696     ACPI_GBL_EVENT_HANDLER  Handler,
697     void                    *Context))
698 
699 ACPI_HW_DEPENDENT_RETURN_STATUS (
700 ACPI_STATUS
701 AcpiInstallFixedEventHandler (
702     UINT32                  AcpiEvent,
703     ACPI_EVENT_HANDLER      Handler,
704     void                    *Context))
705 
706 ACPI_HW_DEPENDENT_RETURN_STATUS (
707 ACPI_STATUS
708 AcpiRemoveFixedEventHandler (
709     UINT32                  AcpiEvent,
710     ACPI_EVENT_HANDLER      Handler))
711 
712 ACPI_HW_DEPENDENT_RETURN_STATUS (
713 ACPI_STATUS
714 AcpiInstallGpeHandler (
715     ACPI_HANDLE             GpeDevice,
716     UINT32                  GpeNumber,
717     UINT32                  Type,
718     ACPI_GPE_HANDLER        Address,
719     void                    *Context))
720 
721 ACPI_HW_DEPENDENT_RETURN_STATUS (
722 ACPI_STATUS
723 AcpiInstallGpeRawHandler (
724     ACPI_HANDLE             GpeDevice,
725     UINT32                  GpeNumber,
726     UINT32                  Type,
727     ACPI_GPE_HANDLER        Address,
728     void                    *Context))
729 
730 ACPI_HW_DEPENDENT_RETURN_STATUS (
731 ACPI_STATUS
732 AcpiRemoveGpeHandler (
733     ACPI_HANDLE             GpeDevice,
734     UINT32                  GpeNumber,
735     ACPI_GPE_HANDLER        Address))
736 
737 ACPI_EXTERNAL_RETURN_STATUS (
738 ACPI_STATUS
739 AcpiInstallNotifyHandler (
740     ACPI_HANDLE             Device,
741     UINT32                  HandlerType,
742     ACPI_NOTIFY_HANDLER     Handler,
743     void                    *Context))
744 
745 ACPI_EXTERNAL_RETURN_STATUS (
746 ACPI_STATUS
747 AcpiRemoveNotifyHandler (
748     ACPI_HANDLE             Device,
749     UINT32                  HandlerType,
750     ACPI_NOTIFY_HANDLER     Handler))
751 
752 ACPI_EXTERNAL_RETURN_STATUS (
753 ACPI_STATUS
754 AcpiInstallAddressSpaceHandler (
755     ACPI_HANDLE             Device,
756     ACPI_ADR_SPACE_TYPE     SpaceId,
757     ACPI_ADR_SPACE_HANDLER  Handler,
758     ACPI_ADR_SPACE_SETUP    Setup,
759     void                    *Context))
760 
761 ACPI_EXTERNAL_RETURN_STATUS (
762 ACPI_STATUS
763 AcpiRemoveAddressSpaceHandler (
764     ACPI_HANDLE             Device,
765     ACPI_ADR_SPACE_TYPE     SpaceId,
766     ACPI_ADR_SPACE_HANDLER  Handler))
767 
768 ACPI_EXTERNAL_RETURN_STATUS (
769 ACPI_STATUS
770 AcpiInstallExceptionHandler (
771     ACPI_EXCEPTION_HANDLER  Handler))
772 
773 ACPI_EXTERNAL_RETURN_STATUS (
774 ACPI_STATUS
775 AcpiInstallInterfaceHandler (
776     ACPI_INTERFACE_HANDLER  Handler))
777 
778 
779 /*
780  * Global Lock interfaces
781  */
782 ACPI_HW_DEPENDENT_RETURN_STATUS (
783 ACPI_STATUS
784 AcpiAcquireGlobalLock (
785     UINT16                  Timeout,
786     UINT32                  *Handle))
787 
788 ACPI_HW_DEPENDENT_RETURN_STATUS (
789 ACPI_STATUS
790 AcpiReleaseGlobalLock (
791     UINT32                  Handle))
792 
793 
794 /*
795  * Interfaces to AML mutex objects
796  */
797 ACPI_EXTERNAL_RETURN_STATUS (
798 ACPI_STATUS
799 AcpiAcquireMutex (
800     ACPI_HANDLE             Handle,
801     ACPI_STRING             Pathname,
802     UINT16                  Timeout))
803 
804 ACPI_EXTERNAL_RETURN_STATUS (
805 ACPI_STATUS
806 AcpiReleaseMutex (
807     ACPI_HANDLE             Handle,
808     ACPI_STRING             Pathname))
809 
810 
811 /*
812  * Fixed Event interfaces
813  */
814 ACPI_HW_DEPENDENT_RETURN_STATUS (
815 ACPI_STATUS
816 AcpiEnableEvent (
817     UINT32                  Event,
818     UINT32                  Flags))
819 
820 ACPI_HW_DEPENDENT_RETURN_STATUS (
821 ACPI_STATUS
822 AcpiDisableEvent (
823     UINT32                  Event,
824     UINT32                  Flags))
825 
826 ACPI_HW_DEPENDENT_RETURN_STATUS (
827 ACPI_STATUS
828 AcpiClearEvent (
829     UINT32                  Event))
830 
831 ACPI_HW_DEPENDENT_RETURN_STATUS (
832 ACPI_STATUS
833 AcpiGetEventStatus (
834     UINT32                  Event,
835     ACPI_EVENT_STATUS       *EventStatus))
836 
837 
838 /*
839  * General Purpose Event (GPE) Interfaces
840  */
841 ACPI_HW_DEPENDENT_RETURN_STATUS (
842 ACPI_STATUS
843 AcpiUpdateAllGpes (
844     void))
845 
846 ACPI_HW_DEPENDENT_RETURN_STATUS (
847 ACPI_STATUS
848 AcpiEnableGpe (
849     ACPI_HANDLE             GpeDevice,
850     UINT32                  GpeNumber))
851 
852 ACPI_HW_DEPENDENT_RETURN_STATUS (
853 ACPI_STATUS
854 AcpiDisableGpe (
855     ACPI_HANDLE             GpeDevice,
856     UINT32                  GpeNumber))
857 
858 ACPI_HW_DEPENDENT_RETURN_STATUS (
859 ACPI_STATUS
860 AcpiClearGpe (
861     ACPI_HANDLE             GpeDevice,
862     UINT32                  GpeNumber))
863 
864 ACPI_HW_DEPENDENT_RETURN_STATUS (
865 ACPI_STATUS
866 AcpiSetGpe (
867     ACPI_HANDLE             GpeDevice,
868     UINT32                  GpeNumber,
869     UINT8                   Action))
870 
871 ACPI_HW_DEPENDENT_RETURN_STATUS (
872 ACPI_STATUS
873 AcpiFinishGpe (
874     ACPI_HANDLE             GpeDevice,
875     UINT32                  GpeNumber))
876 
877 ACPI_HW_DEPENDENT_RETURN_STATUS (
878 ACPI_STATUS
879 AcpiMarkGpeForWake (
880     ACPI_HANDLE             GpeDevice,
881     UINT32                  GpeNumber))
882 
883 ACPI_HW_DEPENDENT_RETURN_STATUS (
884 ACPI_STATUS
885 AcpiSetupGpeForWake (
886     ACPI_HANDLE             ParentDevice,
887     ACPI_HANDLE             GpeDevice,
888     UINT32                  GpeNumber))
889 
890 ACPI_HW_DEPENDENT_RETURN_STATUS (
891 ACPI_STATUS
892 AcpiSetGpeWakeMask (
893     ACPI_HANDLE             GpeDevice,
894     UINT32                  GpeNumber,
895     UINT8                   Action))
896 
897 ACPI_HW_DEPENDENT_RETURN_STATUS (
898 ACPI_STATUS
899 AcpiGetGpeStatus (
900     ACPI_HANDLE             GpeDevice,
901     UINT32                  GpeNumber,
902     ACPI_EVENT_STATUS       *EventStatus))
903 
904 ACPI_HW_DEPENDENT_RETURN_STATUS (
905 ACPI_STATUS
906 AcpiDisableAllGpes (
907     void))
908 
909 ACPI_HW_DEPENDENT_RETURN_STATUS (
910 ACPI_STATUS
911 AcpiEnableAllRuntimeGpes (
912     void))
913 
914 ACPI_HW_DEPENDENT_RETURN_STATUS (
915 ACPI_STATUS
916 AcpiEnableAllWakeupGpes (
917     void))
918 
919 ACPI_HW_DEPENDENT_RETURN_STATUS (
920 ACPI_STATUS
921 AcpiGetGpeDevice (
922     UINT32                  GpeIndex,
923     ACPI_HANDLE             *GpeDevice))
924 
925 ACPI_HW_DEPENDENT_RETURN_STATUS (
926 ACPI_STATUS
927 AcpiInstallGpeBlock (
928     ACPI_HANDLE             GpeDevice,
929     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
930     UINT32                  RegisterCount,
931     UINT32                  InterruptNumber))
932 
933 ACPI_HW_DEPENDENT_RETURN_STATUS (
934 ACPI_STATUS
935 AcpiRemoveGpeBlock (
936     ACPI_HANDLE             GpeDevice))
937 
938 
939 /*
940  * Resource interfaces
941  */
942 typedef
943 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
944     ACPI_RESOURCE           *Resource,
945     void                    *Context);
946 
947 ACPI_EXTERNAL_RETURN_STATUS (
948 ACPI_STATUS
949 AcpiGetVendorResource (
950     ACPI_HANDLE             Device,
951     char                    *Name,
952     ACPI_VENDOR_UUID        *Uuid,
953     ACPI_BUFFER             *RetBuffer))
954 
955 ACPI_EXTERNAL_RETURN_STATUS (
956 ACPI_STATUS
957 AcpiGetCurrentResources (
958     ACPI_HANDLE             Device,
959     ACPI_BUFFER             *RetBuffer))
960 
961 ACPI_EXTERNAL_RETURN_STATUS (
962 ACPI_STATUS
963 AcpiGetPossibleResources (
964     ACPI_HANDLE             Device,
965     ACPI_BUFFER             *RetBuffer))
966 
967 ACPI_EXTERNAL_RETURN_STATUS (
968 ACPI_STATUS
969 AcpiGetEventResources (
970     ACPI_HANDLE             DeviceHandle,
971     ACPI_BUFFER             *RetBuffer))
972 
973 ACPI_EXTERNAL_RETURN_STATUS (
974 ACPI_STATUS
975 AcpiWalkResourceBuffer (
976     ACPI_BUFFER                 *Buffer,
977     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
978     void                        *Context))
979 
980 ACPI_EXTERNAL_RETURN_STATUS (
981 ACPI_STATUS
982 AcpiWalkResources (
983     ACPI_HANDLE                 Device,
984     char                        *Name,
985     ACPI_WALK_RESOURCE_CALLBACK UserFunction,
986     void                        *Context))
987 
988 ACPI_EXTERNAL_RETURN_STATUS (
989 ACPI_STATUS
990 AcpiSetCurrentResources (
991     ACPI_HANDLE             Device,
992     ACPI_BUFFER             *InBuffer))
993 
994 ACPI_EXTERNAL_RETURN_STATUS (
995 ACPI_STATUS
996 AcpiGetIrqRoutingTable (
997     ACPI_HANDLE             Device,
998     ACPI_BUFFER             *RetBuffer))
999 
1000 ACPI_EXTERNAL_RETURN_STATUS (
1001 ACPI_STATUS
1002 AcpiResourceToAddress64 (
1003     ACPI_RESOURCE           *Resource,
1004     ACPI_RESOURCE_ADDRESS64 *Out))
1005 
1006 ACPI_EXTERNAL_RETURN_STATUS (
1007 ACPI_STATUS
1008 AcpiBufferToResource (
1009     UINT8                   *AmlBuffer,
1010     UINT16                  AmlBufferLength,
1011     ACPI_RESOURCE           **ResourcePtr))
1012 
1013 
1014 /*
1015  * Hardware (ACPI device) interfaces
1016  */
1017 ACPI_EXTERNAL_RETURN_STATUS (
1018 ACPI_STATUS
1019 AcpiReset (
1020     void))
1021 
1022 ACPI_EXTERNAL_RETURN_STATUS (
1023 ACPI_STATUS
1024 AcpiRead (
1025     UINT64                  *Value,
1026     ACPI_GENERIC_ADDRESS    *Reg))
1027 
1028 ACPI_EXTERNAL_RETURN_STATUS (
1029 ACPI_STATUS
1030 AcpiWrite (
1031     UINT64                  Value,
1032     ACPI_GENERIC_ADDRESS    *Reg))
1033 
1034 ACPI_HW_DEPENDENT_RETURN_STATUS (
1035 ACPI_STATUS
1036 AcpiReadBitRegister (
1037     UINT32                  RegisterId,
1038     UINT32                  *ReturnValue))
1039 
1040 ACPI_HW_DEPENDENT_RETURN_STATUS (
1041 ACPI_STATUS
1042 AcpiWriteBitRegister (
1043     UINT32                  RegisterId,
1044     UINT32                  Value))
1045 
1046 
1047 /*
1048  * Sleep/Wake interfaces
1049  */
1050 ACPI_EXTERNAL_RETURN_STATUS (
1051 ACPI_STATUS
1052 AcpiGetSleepTypeData (
1053     UINT8                   SleepState,
1054     UINT8                   *Slp_TypA,
1055     UINT8                   *Slp_TypB))
1056 
1057 ACPI_EXTERNAL_RETURN_STATUS (
1058 ACPI_STATUS
1059 AcpiEnterSleepStatePrep (
1060     UINT8                   SleepState))
1061 
1062 ACPI_EXTERNAL_RETURN_STATUS (
1063 ACPI_STATUS
1064 AcpiEnterSleepState (
1065     UINT8                   SleepState))
1066 
1067 ACPI_HW_DEPENDENT_RETURN_STATUS (
1068 ACPI_STATUS
1069 AcpiEnterSleepStateS4bios (
1070     void))
1071 
1072 ACPI_EXTERNAL_RETURN_STATUS (
1073 ACPI_STATUS
1074 AcpiLeaveSleepStatePrep (
1075     UINT8                   SleepState))
1076 
1077 ACPI_EXTERNAL_RETURN_STATUS (
1078 ACPI_STATUS
1079 AcpiLeaveSleepState (
1080     UINT8                   SleepState))
1081 
1082 ACPI_HW_DEPENDENT_RETURN_STATUS (
1083 ACPI_STATUS
1084 AcpiSetFirmwareWakingVector (
1085     ACPI_PHYSICAL_ADDRESS   PhysicalAddress,
1086     ACPI_PHYSICAL_ADDRESS   PhysicalAddress64))
1087 
1088 
1089 /*
1090  * ACPI Timer interfaces
1091  */
1092 ACPI_HW_DEPENDENT_RETURN_STATUS (
1093 ACPI_STATUS
1094 AcpiGetTimerResolution (
1095     UINT32                  *Resolution))
1096 
1097 ACPI_HW_DEPENDENT_RETURN_STATUS (
1098 ACPI_STATUS
1099 AcpiGetTimer (
1100     UINT32                  *Ticks))
1101 
1102 ACPI_HW_DEPENDENT_RETURN_STATUS (
1103 ACPI_STATUS
1104 AcpiGetTimerDuration (
1105     UINT32                  StartTicks,
1106     UINT32                  EndTicks,
1107     UINT32                  *TimeElapsed))
1108 
1109 
1110 /*
1111  * Error/Warning output
1112  */
1113 ACPI_MSG_DEPENDENT_RETURN_VOID (
1114 ACPI_PRINTF_LIKE(3)
1115 void ACPI_INTERNAL_VAR_XFACE
1116 AcpiError (
1117     const char              *ModuleName,
1118     UINT32                  LineNumber,
1119     const char              *Format,
1120     ...))
1121 
1122 ACPI_MSG_DEPENDENT_RETURN_VOID (
1123 ACPI_PRINTF_LIKE(4)
1124 void  ACPI_INTERNAL_VAR_XFACE
1125 AcpiException (
1126     const char              *ModuleName,
1127     UINT32                  LineNumber,
1128     ACPI_STATUS             Status,
1129     const char              *Format,
1130     ...))
1131 
1132 ACPI_MSG_DEPENDENT_RETURN_VOID (
1133 ACPI_PRINTF_LIKE(3)
1134 void ACPI_INTERNAL_VAR_XFACE
1135 AcpiWarning (
1136     const char              *ModuleName,
1137     UINT32                  LineNumber,
1138     const char              *Format,
1139     ...))
1140 
1141 ACPI_MSG_DEPENDENT_RETURN_VOID (
1142 ACPI_PRINTF_LIKE(3)
1143 void ACPI_INTERNAL_VAR_XFACE
1144 AcpiInfo (
1145     const char              *ModuleName,
1146     UINT32                  LineNumber,
1147     const char              *Format,
1148     ...))
1149 
1150 ACPI_MSG_DEPENDENT_RETURN_VOID (
1151 ACPI_PRINTF_LIKE(3)
1152 void ACPI_INTERNAL_VAR_XFACE
1153 AcpiBiosError (
1154     const char              *ModuleName,
1155     UINT32                  LineNumber,
1156     const char              *Format,
1157     ...))
1158 
1159 ACPI_MSG_DEPENDENT_RETURN_VOID (
1160 ACPI_PRINTF_LIKE(3)
1161 void ACPI_INTERNAL_VAR_XFACE
1162 AcpiBiosWarning (
1163     const char              *ModuleName,
1164     UINT32                  LineNumber,
1165     const char              *Format,
1166     ...))
1167 
1168 
1169 /*
1170  * Debug output
1171  */
1172 ACPI_DBG_DEPENDENT_RETURN_VOID (
1173 ACPI_PRINTF_LIKE(6)
1174 void ACPI_INTERNAL_VAR_XFACE
1175 AcpiDebugPrint (
1176     UINT32                  RequestedDebugLevel,
1177     UINT32                  LineNumber,
1178     const char              *FunctionName,
1179     const char              *ModuleName,
1180     UINT32                  ComponentId,
1181     const char              *Format,
1182     ...))
1183 
1184 ACPI_DBG_DEPENDENT_RETURN_VOID (
1185 ACPI_PRINTF_LIKE(6)
1186 void ACPI_INTERNAL_VAR_XFACE
1187 AcpiDebugPrintRaw (
1188     UINT32                  RequestedDebugLevel,
1189     UINT32                  LineNumber,
1190     const char              *FunctionName,
1191     const char              *ModuleName,
1192     UINT32                  ComponentId,
1193     const char              *Format,
1194     ...))
1195 
1196 ACPI_DBG_DEPENDENT_RETURN_VOID (
1197 void
1198 AcpiTracePoint (
1199     ACPI_TRACE_EVENT_TYPE   Type,
1200     BOOLEAN                 Begin,
1201     UINT8                   *Aml,
1202     char                    *Pathname))
1203 
1204 ACPI_APP_DEPENDENT_RETURN_VOID (
1205 ACPI_PRINTF_LIKE(1)
1206 void ACPI_INTERNAL_VAR_XFACE
1207 AcpiLogError (
1208     const char              *Format,
1209     ...))
1210 
1211 #endif /* __ACXFACE_H__ */
1212