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