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