utglobal.c revision 70243
1/****************************************************************************** 2 * 3 * Module Name: cmglobal - Global variables for the ACPI subsystem 4 * $Revision: 113 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 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_NUMBER, "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/****************************************************************************** 252 * 253 * Table globals 254 * 255 * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. 256 * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables 257 * that are not used by the subsystem are simply ignored. 258 * 259 ******************************************************************************/ 260 261 262ACPI_TABLE_DESC AcpiGbl_AcpiTables[NUM_ACPI_TABLES]; 263 264 265ACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] = 266{ 267 /*********** Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */ 268 269 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, 270 /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_DSDT}, 271 /* FADT 2 */ {FADT_SIG, FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FADT}, 272 /* FACS 3 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &AcpiGbl_FACS}, 273 /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, 274 /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL}, 275 /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL}, 276}; 277 278 279#ifdef ACPI_DEBUG 280 281/****************************************************************************** 282 * 283 * Strings and procedures used for debug only 284 * 285 ******************************************************************************/ 286 287NATIVE_CHAR *MsgAcpiErrorBreak = "*** Break on ACPI_ERROR ***\n"; 288 289 290/***************************************************************************** 291 * 292 * FUNCTION: AcpiCmGetMutexName 293 * 294 * PARAMETERS: None. 295 * 296 * RETURN: Status 297 * 298 * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 299 * 300 ****************************************************************************/ 301 302NATIVE_CHAR * 303AcpiCmGetMutexName ( 304 UINT32 MutexId) 305{ 306 307 if (MutexId > MAX_MTX) 308 { 309 return ("Invalid Mutex ID"); 310 } 311 312 return (AcpiGbl_MutexNames[MutexId]); 313} 314 315 316/* 317 * Elements of AcpiGbl_NsTypeNames below must match 318 * one-to-one with values of ACPI_OBJECT_TYPE 319 * 320 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 321 * stored in a table it really means that we have thus far seen no evidence to 322 * indicatewhat type is actually going to be stored for this entry. 323 */ 324 325static NATIVE_CHAR AcpiGbl_BadType[] = "UNDEFINED"; 326#define TYPE_NAME_LENGTH 9 /* Maximum length of each string */ 327 328static NATIVE_CHAR *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ 329{ 330 /* 00 */ "Untyped", 331 /* 01 */ "Number", 332 /* 02 */ "String", 333 /* 03 */ "Buffer", 334 /* 04 */ "Package", 335 /* 05 */ "FieldUnit", 336 /* 06 */ "Device", 337 /* 07 */ "Event", 338 /* 08 */ "Method", 339 /* 09 */ "Mutex", 340 /* 10 */ "Region", 341 /* 11 */ "Power", 342 /* 12 */ "Processor", 343 /* 13 */ "Thermal", 344 /* 14 */ "BufferFld", 345 /* 15 */ "DdbHandle", 346 /* 16 */ "DebugObj", 347 /* 17 */ "DefField", 348 /* 18 */ "BnkField", 349 /* 19 */ "IdxField", 350 /* 20 */ "Reference", 351 /* 21 */ "Alias", 352 /* 22 */ "Notify", 353 /* 23 */ "AddrHndlr", 354 /* 24 */ "Resource", 355 /* 25 */ "DefFldDfn", 356 /* 26 */ "BnkFldDfn", 357 /* 27 */ "IdxFldDfn", 358 /* 28 */ "If", 359 /* 29 */ "Else", 360 /* 30 */ "While", 361 /* 31 */ "Scope", 362 /* 32 */ "DefAny", 363 /* 33 */ "Extra", 364 /* 34 */ "Invalid" 365}; 366 367 368/***************************************************************************** 369 * 370 * FUNCTION: AcpiCmGetTypeName 371 * 372 * PARAMETERS: None. 373 * 374 * RETURN: Status 375 * 376 * DESCRIPTION: Translate a Type ID into a name string (Debug only) 377 * 378 ****************************************************************************/ 379 380NATIVE_CHAR * 381AcpiCmGetTypeName ( 382 UINT32 Type) 383{ 384 385 if (Type > INTERNAL_TYPE_INVALID) 386 { 387 return (AcpiGbl_BadType); 388 } 389 390 return (AcpiGbl_NsTypeNames[Type]); 391} 392 393 394/* Region type decoding */ 395 396NATIVE_CHAR *AcpiGbl_RegionTypes[NUM_REGION_TYPES] = 397{ 398 "SystemMemory", 399 "SystemIO", 400 "PCIConfig", 401 "EmbeddedControl", 402 "SMBus", 403 "CMOS", 404 "PCIBarTarget", 405}; 406 407 408/***************************************************************************** 409 * 410 * FUNCTION: AcpiCmGetRegionName 411 * 412 * PARAMETERS: None. 413 * 414 * RETURN: Status 415 * 416 * DESCRIPTION: Translate a Space ID into a name string (Debug only) 417 * 418 ****************************************************************************/ 419 420NATIVE_CHAR * 421AcpiCmGetRegionName ( 422 UINT8 SpaceId) 423{ 424 425 if (SpaceId >= USER_REGION_BEGIN) 426 { 427 return ("UserDefinedRegion"); 428 } 429 430 else if (SpaceId >= NUM_REGION_TYPES) 431 { 432 return ("InvalidSpaceID"); 433 } 434 435 return (AcpiGbl_RegionTypes[SpaceId]); 436} 437 438 439/* Data used in keeping track of fields */ 440 441NATIVE_CHAR *AcpiGbl_FENames[NUM_FIELD_NAMES] = 442{ 443 "skip", 444 "?access?" 445}; /* FE = Field Element */ 446 447 448NATIVE_CHAR *AcpiGbl_MatchOps[NUM_MATCH_OPS] = 449{ 450 "Error", 451 "MTR", 452 "MEQ", 453 "MLE", 454 "MLT", 455 "MGE", 456 "MGT" 457}; 458 459 460/* Access type decoding */ 461 462NATIVE_CHAR *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] = 463{ 464 "AnyAcc", 465 "ByteAcc", 466 "WordAcc", 467 "DWordAcc", 468 "BlockAcc", 469 "SMBSendRecvAcc", 470 "SMBQuickAcc" 471}; 472 473 474/* Update rule decoding */ 475 476NATIVE_CHAR *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] = 477{ 478 "Preserve", 479 "WriteAsOnes", 480 "WriteAsZeros" 481}; 482 483#endif 484 485 486/***************************************************************************** 487 * 488 * FUNCTION: AcpiCmValidObjectType 489 * 490 * PARAMETERS: None. 491 * 492 * RETURN: TRUE if valid object type 493 * 494 * DESCRIPTION: Validate an object type 495 * 496 ****************************************************************************/ 497 498BOOLEAN 499AcpiCmValidObjectType ( 500 UINT32 Type) 501{ 502 503 if (Type > ACPI_TYPE_MAX) 504 { 505 if ((Type < INTERNAL_TYPE_BEGIN) || 506 (Type > INTERNAL_TYPE_MAX)) 507 { 508 return (FALSE); 509 } 510 } 511 512 return (TRUE); 513} 514 515 516/***************************************************************************** 517 * 518 * FUNCTION: AcpiCmFormatException 519 * 520 * PARAMETERS: Status - Acpi status to be formatted 521 * 522 * RETURN: Formatted status string 523 * 524 * DESCRIPTION: Convert an ACPI exception to a string 525 * 526 ****************************************************************************/ 527 528NATIVE_CHAR * 529AcpiCmFormatException ( 530 ACPI_STATUS Status) 531{ 532 NATIVE_CHAR *Exception = "UNKNOWN_STATUS"; 533 ACPI_STATUS SubStatus; 534 535 536 SubStatus = (Status & ~AE_CODE_MASK); 537 538 539 switch (Status & AE_CODE_MASK) 540 { 541 case AE_CODE_ENVIRONMENTAL: 542 543 if (SubStatus <= AE_CODE_ENV_MAX) 544 { 545 Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; 546 } 547 break; 548 549 case AE_CODE_PROGRAMMER: 550 551 if (SubStatus <= AE_CODE_PGM_MAX) 552 { 553 Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; 554 } 555 break; 556 557 case AE_CODE_ACPI_TABLES: 558 559 if (SubStatus <= AE_CODE_TBL_MAX) 560 { 561 Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; 562 } 563 break; 564 565 case AE_CODE_AML: 566 567 if (SubStatus <= AE_CODE_AML_MAX) 568 { 569 Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; 570 } 571 break; 572 573 case AE_CODE_CONTROL: 574 575 if (SubStatus <= AE_CODE_CTRL_MAX) 576 { 577 Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; 578 } 579 break; 580 581 default: 582 break; 583 } 584 585 586 return (Exception); 587} 588 589 590/**************************************************************************** 591 * 592 * FUNCTION: AcpiCmAllocateOwnerId 593 * 594 * PARAMETERS: IdType - Type of ID (method or table) 595 * 596 * DESCRIPTION: Allocate a table or method owner id 597 * 598 ***************************************************************************/ 599 600ACPI_OWNER_ID 601AcpiCmAllocateOwnerId ( 602 UINT32 IdType) 603{ 604 ACPI_OWNER_ID OwnerId = 0xFFFF; 605 606 607 FUNCTION_TRACE ("CmAllocateOwnerId"); 608 609 610 AcpiCmAcquireMutex (ACPI_MTX_CACHES); 611 612 switch (IdType) 613 { 614 case OWNER_TYPE_TABLE: 615 616 OwnerId = AcpiGbl_NextTableOwnerId; 617 AcpiGbl_NextTableOwnerId++; 618 619 if (AcpiGbl_NextTableOwnerId == FIRST_METHOD_ID) 620 { 621 AcpiGbl_NextTableOwnerId = FIRST_TABLE_ID; 622 } 623 break; 624 625 626 case OWNER_TYPE_METHOD: 627 628 OwnerId = AcpiGbl_NextMethodOwnerId; 629 AcpiGbl_NextMethodOwnerId++; 630 631 if (AcpiGbl_NextMethodOwnerId == FIRST_TABLE_ID) 632 { 633 AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID; 634 } 635 break; 636 } 637 638 639 AcpiCmReleaseMutex (ACPI_MTX_CACHES); 640 641 return_VALUE (OwnerId); 642} 643 644 645/**************************************************************************** 646 * 647 * FUNCTION: AcpiCmInitGlobals 648 * 649 * PARAMETERS: none 650 * 651 * DESCRIPTION: Init library globals. All globals that require specific 652 * initialization should be initialized here! 653 * 654 ***************************************************************************/ 655 656void 657AcpiCmInitGlobals ( 658 void) 659{ 660 UINT32 i; 661 662 663 FUNCTION_TRACE ("CmInitGlobals"); 664 665 666 /* ACPI table structure */ 667 668 for (i = 0; i < NUM_ACPI_TABLES; i++) 669 { 670 AcpiGbl_AcpiTables[i].Prev = &AcpiGbl_AcpiTables[i]; 671 AcpiGbl_AcpiTables[i].Next = &AcpiGbl_AcpiTables[i]; 672 AcpiGbl_AcpiTables[i].Pointer = NULL; 673 AcpiGbl_AcpiTables[i].Length = 0; 674 AcpiGbl_AcpiTables[i].Allocation = ACPI_MEM_NOT_ALLOCATED; 675 AcpiGbl_AcpiTables[i].Count = 0; 676 } 677 678 679 /* Address Space handler array */ 680 681 for (i = 0; i < ACPI_NUM_ADDRESS_SPACES; i++) 682 { 683 AcpiGbl_AddressSpaces[i].Handler = NULL; 684 AcpiGbl_AddressSpaces[i].Context = NULL; 685 } 686 687 /* Mutex locked flags */ 688 689 for (i = 0; i < NUM_MTX; i++) 690 { 691 AcpiGbl_AcpiMutexInfo[i].Mutex = NULL; 692 AcpiGbl_AcpiMutexInfo[i].Locked = FALSE; 693 AcpiGbl_AcpiMutexInfo[i].UseCount = 0; 694 } 695 696 /* Global notify handlers */ 697 698 AcpiGbl_SysNotify.Handler = NULL; 699 AcpiGbl_DrvNotify.Handler = NULL; 700 701 /* Global "typed" ACPI table pointers */ 702 703 AcpiGbl_RSDP = NULL; 704 AcpiGbl_XSDT = NULL; 705 AcpiGbl_FACS = NULL; 706 AcpiGbl_FADT = NULL; 707 AcpiGbl_DSDT = NULL; 708 709 710 /* Global Lock support */ 711 712 AcpiGbl_GlobalLockAcquired = FALSE; 713 AcpiGbl_GlobalLockThreadCount = 0; 714 715 /* Miscellaneous variables */ 716 717 AcpiGbl_SystemFlags = 0; 718 AcpiGbl_StartupFlags = 0; 719 AcpiGbl_GlobalLockSet = FALSE; 720 AcpiGbl_RsdpOriginalLocation = 0; 721 AcpiGbl_CmSingleStep = FALSE; 722 AcpiGbl_DbTerminateThreads = FALSE; 723 AcpiGbl_Shutdown = FALSE; 724 AcpiGbl_NsLookupCount = 0; 725 AcpiGbl_PsFindCount = 0; 726 AcpiGbl_AcpiHardwarePresent = TRUE; 727 AcpiGbl_NextTableOwnerId = FIRST_TABLE_ID; 728 AcpiGbl_NextMethodOwnerId = FIRST_METHOD_ID; 729 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 730 731 /* Cache of small "state" objects */ 732 733 AcpiGbl_GenericStateCache = NULL; 734 AcpiGbl_GenericStateCacheDepth = 0; 735 AcpiGbl_StateCacheRequests = 0; 736 AcpiGbl_StateCacheHits = 0; 737 738 AcpiGbl_ParseCache = NULL; 739 AcpiGbl_ParseCacheDepth = 0; 740 AcpiGbl_ParseCacheRequests = 0; 741 AcpiGbl_ParseCacheHits = 0; 742 743 AcpiGbl_ExtParseCache = NULL; 744 AcpiGbl_ExtParseCacheDepth = 0; 745 AcpiGbl_ExtParseCacheRequests = 0; 746 AcpiGbl_ExtParseCacheHits = 0; 747 748 AcpiGbl_ObjectCache = NULL; 749 AcpiGbl_ObjectCacheDepth = 0; 750 AcpiGbl_ObjectCacheRequests = 0; 751 AcpiGbl_ObjectCacheHits = 0; 752 753 AcpiGbl_WalkStateCache = NULL; 754 AcpiGbl_WalkStateCacheDepth = 0; 755 AcpiGbl_WalkStateCacheRequests = 0; 756 AcpiGbl_WalkStateCacheHits = 0; 757 758 /* Hardware oriented */ 759 760 AcpiGbl_Gpe0EnableRegisterSave = NULL; 761 AcpiGbl_Gpe1EnableRegisterSave = NULL; 762 AcpiGbl_OriginalMode = SYS_MODE_UNKNOWN; /* original ACPI/legacy mode */ 763 AcpiGbl_GpeRegisters = NULL; 764 AcpiGbl_GpeInfo = NULL; 765 766 /* Namespace */ 767 768 AcpiGbl_RootNode = NULL; 769 770 AcpiGbl_RootNodeStruct.Name = ACPI_ROOT_NAME; 771 AcpiGbl_RootNodeStruct.DataType = ACPI_DESC_TYPE_NAMED; 772 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_ANY; 773 AcpiGbl_RootNodeStruct.Child = NULL; 774 AcpiGbl_RootNodeStruct.Peer = NULL; 775 AcpiGbl_RootNodeStruct.Object = NULL; 776 AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; 777 778 /* Memory allocation metrics - compiled out in non-debug mode. */ 779 780 INITIALIZE_ALLOCATION_METRICS(); 781 782 return_VOID; 783} 784 785 786