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