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