utglobal.c revision 71867
1/****************************************************************************** 2 * 3 * Module Name: cmglobal - Global variables for the ACPI subsystem 4 * $Revision: 116 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __CMGLOBAL_C__ 118#define DEFINE_ACPI_GLOBALS 119 120#include "acpi.h" 121#include "acevents.h" 122#include "acnamesp.h" 123#include "acinterp.h" 124#include "amlcode.h" 125 126 127#define _COMPONENT MISCELLANEOUS 128 MODULE_NAME ("cmglobal") 129 130 131/****************************************************************************** 132 * 133 * Static global variable initialization. 134 * 135 ******************************************************************************/ 136 137/* 138 * We want the debug switches statically initialized so they 139 * are already set when the debugger is entered. 140 */ 141 142/* Debug switch - level and trace mask */ 143 144#ifdef ACPI_DEBUG 145UINT32 AcpiDbgLevel = DEBUG_DEFAULT; 146#else 147UINT32 AcpiDbgLevel = NORMAL_DEFAULT; 148#endif 149 150/* Debug switch - layer (component) mask */ 151 152UINT32 AcpiDbgLayer = COMPONENT_DEFAULT; 153UINT32 AcpiGbl_NestingLevel = 0; 154 155 156/* Debugger globals */ 157 158BOOLEAN AcpiGbl_DbTerminateThreads = FALSE; 159BOOLEAN AcpiGbl_MethodExecuting = FALSE; 160 161/* System flags */ 162 163UINT32 AcpiGbl_SystemFlags = 0; 164UINT32 AcpiGbl_StartupFlags = 0; 165 166/* System starts unitialized! */ 167BOOLEAN AcpiGbl_Shutdown = TRUE; 168 169 170UINT8 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; 171 172 173/****************************************************************************** 174 * 175 * Namespace globals 176 * 177 ******************************************************************************/ 178 179 180/* 181 * Names built-in to the interpreter 182 * 183 * Initial values are currently supported only for types String and Number. 184 * To avoid type punning, both are specified as strings in this table. 185 */ 186 187PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 188{ 189 {"_GPE", INTERNAL_TYPE_DEF_ANY}, 190 {"_PR_", INTERNAL_TYPE_DEF_ANY}, 191 {"_SB_", INTERNAL_TYPE_DEF_ANY}, 192 {"_SI_", INTERNAL_TYPE_DEF_ANY}, 193 {"_TZ_", INTERNAL_TYPE_DEF_ANY}, 194 {"_REV", ACPI_TYPE_INTEGER, "2"}, 195 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 196 {"_GL_", ACPI_TYPE_MUTEX, "0"}, 197 198 /* Table terminator */ 199 200 {NULL, ACPI_TYPE_ANY} 201}; 202 203 204/* 205 * Properties of the ACPI Object Types, both internal and external. 206 * 207 * Elements of AcpiNsProperties are bit significant 208 * and the table is indexed by values of ACPI_OBJECT_TYPE 209 */ 210 211UINT8 AcpiGbl_NsProperties[] = 212{ 213 NSP_NORMAL, /* 00 Any */ 214 NSP_NORMAL, /* 01 Number */ 215 NSP_NORMAL, /* 02 String */ 216 NSP_NORMAL, /* 03 Buffer */ 217 NSP_LOCAL, /* 04 Package */ 218 NSP_NORMAL, /* 05 FieldUnit */ 219 NSP_NEWSCOPE | NSP_LOCAL, /* 06 Device */ 220 NSP_LOCAL, /* 07 AcpiEvent */ 221 NSP_NEWSCOPE | NSP_LOCAL, /* 08 Method */ 222 NSP_LOCAL, /* 09 Mutex */ 223 NSP_LOCAL, /* 10 Region */ 224 NSP_NEWSCOPE | NSP_LOCAL, /* 11 Power */ 225 NSP_NEWSCOPE | NSP_LOCAL, /* 12 Processor */ 226 NSP_NEWSCOPE | NSP_LOCAL, /* 13 Thermal */ 227 NSP_NORMAL, /* 14 BufferField */ 228 NSP_NORMAL, /* 15 DdbHandle */ 229 NSP_NORMAL, /* 16 Debug Object */ 230 NSP_NORMAL, /* 17 DefField */ 231 NSP_NORMAL, /* 18 BankField */ 232 NSP_NORMAL, /* 19 IndexField */ 233 NSP_NORMAL, /* 20 Reference */ 234 NSP_NORMAL, /* 21 Alias */ 235 NSP_NORMAL, /* 22 Notify */ 236 NSP_NORMAL, /* 23 Address Handler */ 237 NSP_NEWSCOPE | NSP_LOCAL, /* 24 Resource */ 238 NSP_NORMAL, /* 25 DefFieldDefn */ 239 NSP_NORMAL, /* 26 BankFieldDefn */ 240 NSP_NORMAL, /* 27 IndexFieldDefn */ 241 NSP_NORMAL, /* 28 If */ 242 NSP_NORMAL, /* 29 Else */ 243 NSP_NORMAL, /* 30 While */ 244 NSP_NEWSCOPE, /* 31 Scope */ 245 NSP_LOCAL, /* 32 DefAny */ 246 NSP_NORMAL, /* 33 Extra */ 247 NSP_NORMAL /* 34 Invalid */ 248}; 249 250 251/* Hex to ASCII conversion table */ 252 253NATIVE_CHAR AcpiGbl_HexToAscii[] = 254 {'0','1','2','3','4','5','6','7', 255 '8','9','A','B','C','D','E','F'}; 256 257 258/****************************************************************************** 259 * 260 * Table globals 261 * 262 * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. 263 * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables 264 * that are not used by the subsystem are simply ignored. 265 * 266 ******************************************************************************/ 267 268 269ACPI_TABLE_DESC AcpiGbl_AcpiTables[NUM_ACPI_TABLES]; 270 271 272ACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] = 273{ 274 /*********** Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */ 275 276 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, 277 /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_DSDT}, 278 /* FADT 2 */ {FADT_SIG, FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FADT}, 279 /* FACS 3 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FACS}, 280 /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, 281 /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, 282 /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, 283}; 284 285 286#ifdef ACPI_DEBUG 287 288/****************************************************************************** 289 * 290 * Strings and procedures used for debug only 291 * 292 ******************************************************************************/ 293 294NATIVE_CHAR *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n"; 295 296 297/***************************************************************************** 298 * 299 * FUNCTION: AcpiCmGetMutexName 300 * 301 * PARAMETERS: None. 302 * 303 * RETURN: Status 304 * 305 * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 306 * 307 ****************************************************************************/ 308 309NATIVE_CHAR * 310AcpiCmGetMutexName ( 311 UINT32 MutexId) 312{ 313 314 if (MutexId > MAX_MTX) 315 { 316 return ("Invalid Mutex ID"); 317 } 318 319 return (AcpiGbl_MutexNames[MutexId]); 320} 321 322 323/* 324 * Elements of AcpiGbl_NsTypeNames below must match 325 * one-to-one with values of ACPI_OBJECT_TYPE 326 * 327 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 328 * stored in a table it really means that we have thus far seen no evidence to 329 * indicatewhat type is actually going to be stored for this entry. 330 */ 331 332static NATIVE_CHAR AcpiGbl_BadType[] = "UNDEFINED"; 333#define TYPE_NAME_LENGTH 9 /* Maximum length of each string */ 334 335static NATIVE_CHAR *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ 336{ 337 /* 00 */ "Untyped", 338 /* 01 */ "Integer", 339 /* 02 */ "String", 340 /* 03 */ "Buffer", 341 /* 04 */ "Package", 342 /* 05 */ "FieldUnit", 343 /* 06 */ "Device", 344 /* 07 */ "Event", 345 /* 08 */ "Method", 346 /* 09 */ "Mutex", 347 /* 10 */ "Region", 348 /* 11 */ "Power", 349 /* 12 */ "Processor", 350 /* 13 */ "Thermal", 351 /* 14 */ "BufferFld", 352 /* 15 */ "DdbHandle", 353 /* 16 */ "DebugObj", 354 /* 17 */ "DefField", 355 /* 18 */ "BnkField", 356 /* 19 */ "IdxField", 357 /* 20 */ "Reference", 358 /* 21 */ "Alias", 359 /* 22 */ "Notify", 360 /* 23 */ "AddrHndlr", 361 /* 24 */ "Resource", 362 /* 25 */ "DefFldDfn", 363 /* 26 */ "BnkFldDfn", 364 /* 27 */ "IdxFldDfn", 365 /* 28 */ "If", 366 /* 29 */ "Else", 367 /* 30 */ "While", 368 /* 31 */ "Scope", 369 /* 32 */ "DefAny", 370 /* 33 */ "Extra", 371 /* 34 */ "Invalid" 372}; 373 374 375/***************************************************************************** 376 * 377 * FUNCTION: AcpiCmGetTypeName 378 * 379 * PARAMETERS: None. 380 * 381 * RETURN: Status 382 * 383 * DESCRIPTION: Translate a Type ID into a name string (Debug only) 384 * 385 ****************************************************************************/ 386 387NATIVE_CHAR * 388AcpiCmGetTypeName ( 389 UINT32 Type) 390{ 391 392 if (Type > INTERNAL_TYPE_INVALID) 393 { 394 return (AcpiGbl_BadType); 395 } 396 397 return (AcpiGbl_NsTypeNames[Type]); 398} 399 400 401/* Region type decoding */ 402 403NATIVE_CHAR *AcpiGbl_RegionTypes[NUM_REGION_TYPES] = 404{ 405 "SystemMemory", 406 "SystemIO", 407 "PCIConfig", 408 "EmbeddedControl", 409 "SMBus", 410 "CMOS", 411 "PCIBarTarget", 412}; 413 414 415/***************************************************************************** 416 * 417 * FUNCTION: AcpiCmGetRegionName 418 * 419 * PARAMETERS: None. 420 * 421 * RETURN: Status 422 * 423 * DESCRIPTION: Translate a Space ID into a name string (Debug only) 424 * 425 ****************************************************************************/ 426 427NATIVE_CHAR * 428AcpiCmGetRegionName ( 429 UINT8 SpaceId) 430{ 431 432 if (SpaceId >= USER_REGION_BEGIN) 433 { 434 return ("UserDefinedRegion"); 435 } 436 437 else if (SpaceId >= NUM_REGION_TYPES) 438 { 439 return ("InvalidSpaceID"); 440 } 441 442 return (AcpiGbl_RegionTypes[SpaceId]); 443} 444 445 446/* Data used in keeping track of fields */ 447 448NATIVE_CHAR *AcpiGbl_FENames[NUM_FIELD_NAMES] = 449{ 450 "skip", 451 "?access?" 452}; /* FE = Field Element */ 453 454 455NATIVE_CHAR *AcpiGbl_MatchOps[NUM_MATCH_OPS] = 456{ 457 "Error", 458 "MTR", 459 "MEQ", 460 "MLE", 461 "MLT", 462 "MGE", 463 "MGT" 464}; 465 466 467/* Access type decoding */ 468 469NATIVE_CHAR *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] = 470{ 471 "AnyAcc", 472 "ByteAcc", 473 "WordAcc", 474 "DWordAcc", 475 "BlockAcc", 476 "SMBSendRecvAcc", 477 "SMBQuickAcc" 478}; 479 480 481/* Update rule decoding */ 482 483NATIVE_CHAR *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] = 484{ 485 "Preserve", 486 "WriteAsOnes", 487 "WriteAsZeros" 488}; 489 490#endif 491 492 493/***************************************************************************** 494 * 495 * FUNCTION: AcpiCmValidObjectType 496 * 497 * PARAMETERS: None. 498 * 499 * RETURN: TRUE if valid object type 500 * 501 * DESCRIPTION: Validate an object type 502 * 503 ****************************************************************************/ 504 505BOOLEAN 506AcpiCmValidObjectType ( 507 UINT32 Type) 508{ 509 510 if (Type > ACPI_TYPE_MAX) 511 { 512 if ((Type < INTERNAL_TYPE_BEGIN) || 513 (Type > INTERNAL_TYPE_MAX)) 514 { 515 return (FALSE); 516 } 517 } 518 519 return (TRUE); 520} 521 522 523/***************************************************************************** 524 * 525 * FUNCTION: AcpiCmFormatException 526 * 527 * PARAMETERS: Status - Acpi status to be formatted 528 * 529 * RETURN: Formatted status string 530 * 531 * DESCRIPTION: Convert an ACPI exception to a string 532 * 533 ****************************************************************************/ 534 535NATIVE_CHAR * 536AcpiCmFormatException ( 537 ACPI_STATUS Status) 538{ 539 NATIVE_CHAR *Exception = "UNKNOWN_STATUS"; 540 ACPI_STATUS SubStatus; 541 542 543 SubStatus = (Status & ~AE_CODE_MASK); 544 545 546 switch (Status & AE_CODE_MASK) 547 { 548 case AE_CODE_ENVIRONMENTAL: 549 550 if (SubStatus <= AE_CODE_ENV_MAX) 551 { 552 Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; 553 } 554 break; 555 556 case AE_CODE_PROGRAMMER: 557 558 if (SubStatus <= AE_CODE_PGM_MAX) 559 { 560 Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; 561 } 562 break; 563 564 case AE_CODE_ACPI_TABLES: 565 566 if (SubStatus <= AE_CODE_TBL_MAX) 567 { 568 Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; 569 } 570 break; 571 572 case AE_CODE_AML: 573 574 if (SubStatus <= AE_CODE_AML_MAX) 575 { 576 Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; 577 } 578 break; 579 580 case AE_CODE_CONTROL: 581 582 if (SubStatus <= AE_CODE_CTRL_MAX) 583 { 584 Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; 585 } 586 break; 587 588 default: 589 break; 590 } 591 592 593 return (Exception); 594} 595 596 597/**************************************************************************** 598 * 599 * FUNCTION: AcpiCmAllocateOwnerId 600 * 601 * PARAMETERS: IdType - Type of ID (method or table) 602 * 603 * DESCRIPTION: Allocate a table or method owner id 604 * 605 ***************************************************************************/ 606 607ACPI_OWNER_ID 608AcpiCmAllocateOwnerId ( 609 UINT32 IdType) 610{ 611 ACPI_OWNER_ID OwnerId = 0xFFFF; 612 613 614 FUNCTION_TRACE ("CmAllocateOwnerId"); 615 616 617 AcpiCmAcquireMutex (ACPI_MTX_CACHES); 618 619 switch (IdType) 620 { 621 case OWNER_TYPE_TABLE: 622 623 OwnerId = AcpiGbl_NextTableOwnerId; 624 AcpiGbl_NextTableOwnerId++; 625 626 if (AcpiGbl_NextTableOwnerId == FIRST_METHOD_ID) 627 { 628 AcpiGbl_NextTableOwnerId = FIRST_TABLE_ID; 629 } 630 break; 631 632 633 case OWNER_TYPE_METHOD: 634 635 OwnerId = AcpiGbl_NextMethodOwnerId; 636 AcpiGbl_NextMethodOwnerId++; 637 638 if (AcpiGbl_NextMethodOwnerId == FIRST_TABLE_ID) 639 { 640 AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID; 641 } 642 break; 643 } 644 645 646 AcpiCmReleaseMutex (ACPI_MTX_CACHES); 647 648 return_VALUE (OwnerId); 649} 650 651 652/**************************************************************************** 653 * 654 * FUNCTION: AcpiCmInitGlobals 655 * 656 * PARAMETERS: none 657 * 658 * DESCRIPTION: Init library globals. All globals that require specific 659 * initialization should be initialized here! 660 * 661 ***************************************************************************/ 662 663void 664AcpiCmInitGlobals ( 665 void) 666{ 667 UINT32 i; 668 669 670 FUNCTION_TRACE ("CmInitGlobals"); 671 672 673 /* ACPI table structure */ 674 675 for (i = 0; i < NUM_ACPI_TABLES; i++) 676 { 677 AcpiGbl_AcpiTables[i].Prev = &AcpiGbl_AcpiTables[i]; 678 AcpiGbl_AcpiTables[i].Next = &AcpiGbl_AcpiTables[i]; 679 AcpiGbl_AcpiTables[i].Pointer = NULL; 680 AcpiGbl_AcpiTables[i].Length = 0; 681 AcpiGbl_AcpiTables[i].Allocation = ACPI_MEM_NOT_ALLOCATED; 682 AcpiGbl_AcpiTables[i].Count = 0; 683 } 684 685 686 /* Address Space handler array */ 687 688 for (i = 0; i < ACPI_NUM_ADDRESS_SPACES; i++) 689 { 690 AcpiGbl_AddressSpaces[i].Handler = NULL; 691 AcpiGbl_AddressSpaces[i].Context = NULL; 692 } 693 694 /* Mutex locked flags */ 695 696 for (i = 0; i < NUM_MTX; i++) 697 { 698 AcpiGbl_AcpiMutexInfo[i].Mutex = NULL; 699 AcpiGbl_AcpiMutexInfo[i].Locked = FALSE; 700 AcpiGbl_AcpiMutexInfo[i].UseCount = 0; 701 } 702 703 /* Global notify handlers */ 704 705 AcpiGbl_SysNotify.Handler = NULL; 706 AcpiGbl_DrvNotify.Handler = NULL; 707 708 /* Global "typed" ACPI table pointers */ 709 710 AcpiGbl_RSDP = NULL; 711 AcpiGbl_XSDT = NULL; 712 AcpiGbl_FACS = NULL; 713 AcpiGbl_FADT = NULL; 714 AcpiGbl_DSDT = NULL; 715 716 717 /* Global Lock support */ 718 719 AcpiGbl_GlobalLockAcquired = FALSE; 720 AcpiGbl_GlobalLockThreadCount = 0; 721 722 /* Miscellaneous variables */ 723 724 AcpiGbl_SystemFlags = 0; 725 AcpiGbl_StartupFlags = 0; 726 AcpiGbl_GlobalLockSet = FALSE; 727 AcpiGbl_RsdpOriginalLocation = 0; 728 AcpiGbl_CmSingleStep = FALSE; 729 AcpiGbl_DbTerminateThreads = FALSE; 730 AcpiGbl_Shutdown = FALSE; 731 AcpiGbl_NsLookupCount = 0; 732 AcpiGbl_PsFindCount = 0; 733 AcpiGbl_AcpiHardwarePresent = TRUE; 734 AcpiGbl_NextTableOwnerId = FIRST_TABLE_ID; 735 AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID; 736 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 737 738 /* Cache of small "state" objects */ 739 740 AcpiGbl_GenericStateCache = NULL; 741 AcpiGbl_GenericStateCacheDepth = 0; 742 AcpiGbl_StateCacheRequests = 0; 743 AcpiGbl_StateCacheHits = 0; 744 745 AcpiGbl_ParseCache = NULL; 746 AcpiGbl_ParseCacheDepth = 0; 747 AcpiGbl_ParseCacheRequests = 0; 748 AcpiGbl_ParseCacheHits = 0; 749 750 AcpiGbl_ExtParseCache = NULL; 751 AcpiGbl_ExtParseCacheDepth = 0; 752 AcpiGbl_ExtParseCacheRequests = 0; 753 AcpiGbl_ExtParseCacheHits = 0; 754 755 AcpiGbl_ObjectCache = NULL; 756 AcpiGbl_ObjectCacheDepth = 0; 757 AcpiGbl_ObjectCacheRequests = 0; 758 AcpiGbl_ObjectCacheHits = 0; 759 760 AcpiGbl_WalkStateCache = NULL; 761 AcpiGbl_WalkStateCacheDepth = 0; 762 AcpiGbl_WalkStateCacheRequests = 0; 763 AcpiGbl_WalkStateCacheHits = 0; 764 765 /* Hardware oriented */ 766 767 AcpiGbl_Gpe0EnableRegisterSave = NULL; 768 AcpiGbl_Gpe1EnableRegisterSave = NULL; 769 AcpiGbl_OriginalMode = SYS_MODE_UNKNOWN; /* original ACPI/legacy mode */ 770 AcpiGbl_GpeRegisters = NULL; 771 AcpiGbl_GpeInfo = NULL; 772 773 /* Namespace */ 774 775 AcpiGbl_RootNode = NULL; 776 777 AcpiGbl_RootNodeStruct.Name = ACPI_ROOT_NAME; 778 AcpiGbl_RootNodeStruct.DataType = ACPI_DESC_TYPE_NAMED; 779 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_ANY; 780 AcpiGbl_RootNodeStruct.Child = NULL; 781 AcpiGbl_RootNodeStruct.Peer = NULL; 782 AcpiGbl_RootNodeStruct.Object = NULL; 783 AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; 784 785 /* Memory allocation metrics - compiled out in non-debug mode. */ 786 787 INITIALIZE_ALLOCATION_METRICS(); 788 789 return_VOID; 790} 791 792 793