utglobal.c revision 114237
167754Smsmith/****************************************************************************** 267754Smsmith * 377424Smsmith * Module Name: utglobal - Global variables for the ACPI subsystem 4114237Snjl * $Revision: 180 $ 567754Smsmith * 667754Smsmith *****************************************************************************/ 767754Smsmith 867754Smsmith/****************************************************************************** 967754Smsmith * 1067754Smsmith * 1. Copyright Notice 1167754Smsmith * 12114237Snjl * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp. 1370243Smsmith * All rights reserved. 1467754Smsmith * 1567754Smsmith * 2. License 1667754Smsmith * 1767754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property 1867754Smsmith * rights. You may have additional license terms from the party that provided 1967754Smsmith * you this software, covering your right to use that party's intellectual 2067754Smsmith * property rights. 2167754Smsmith * 2267754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 2367754Smsmith * copy of the source code appearing in this file ("Covered Code") an 2467754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2567754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy, 2667754Smsmith * make derivatives, distribute, use and display any portion of the Covered 2767754Smsmith * Code in any form, with the right to sublicense such rights; and 2867754Smsmith * 2967754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 3067754Smsmith * license (with the right to sublicense), under only those claims of Intel 3167754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell, 3267754Smsmith * offer to sell, and import the Covered Code and derivative works thereof 3367754Smsmith * solely to the minimum extent necessary to exercise the above copyright 3467754Smsmith * license, and in no event shall the patent license extend to any additions 3567754Smsmith * to or modifications of the Original Intel Code. No other license or right 3667754Smsmith * is granted directly or by implication, estoppel or otherwise; 3767754Smsmith * 3867754Smsmith * The above copyright and patent license is granted only if the following 3967754Smsmith * conditions are met: 4067754Smsmith * 4167754Smsmith * 3. Conditions 4267754Smsmith * 4367754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4467754Smsmith * Redistribution of source code of any substantial portion of the Covered 4567754Smsmith * Code or modification with rights to further distribute source must include 4667754Smsmith * the above Copyright Notice, the above License, this list of Conditions, 4767754Smsmith * and the following Disclaimer and Export Compliance provision. In addition, 4867754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to 4967754Smsmith * contain a file documenting the changes Licensee made to create that Covered 5067754Smsmith * Code and the date of any change. Licensee must include in that file the 5167754Smsmith * documentation of any changes made by any predecessor Licensee. Licensee 5267754Smsmith * must include a prominent statement that the modification is derived, 5367754Smsmith * directly or indirectly, from Original Intel Code. 5467754Smsmith * 5567754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5667754Smsmith * Redistribution of source code of any substantial portion of the Covered 5767754Smsmith * Code or modification without rights to further distribute source must 5867754Smsmith * include the following Disclaimer and Export Compliance provision in the 5967754Smsmith * documentation and/or other materials provided with distribution. In 6067754Smsmith * addition, Licensee may not authorize further sublicense of source of any 6167754Smsmith * portion of the Covered Code, and must include terms to the effect that the 6267754Smsmith * license from Licensee to its licensee is limited to the intellectual 6367754Smsmith * property embodied in the software Licensee provides to its licensee, and 6467754Smsmith * not to intellectual property embodied in modifications its licensee may 6567754Smsmith * make. 6667754Smsmith * 6767754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any 6867754Smsmith * substantial portion of the Covered Code or modification must reproduce the 6967754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance 7067754Smsmith * provision in the documentation and/or other materials provided with the 7167754Smsmith * distribution. 7267754Smsmith * 7367754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original 7467754Smsmith * Intel Code. 7567754Smsmith * 7667754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7767754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or 7867754Smsmith * other dealings in products derived from or relating to the Covered Code 7967754Smsmith * without prior written authorization from Intel. 8067754Smsmith * 8167754Smsmith * 4. Disclaimer and Export Compliance 8267754Smsmith * 8367754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8467754Smsmith * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8567754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8667754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8767754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8867754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8967754Smsmith * PARTICULAR PURPOSE. 9067754Smsmith * 9167754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9267754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9367754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9467754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9567754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9667754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9767754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9867754Smsmith * LIMITED REMEDY. 9967754Smsmith * 10067754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this 10167754Smsmith * software or system incorporating such software without first obtaining any 10267754Smsmith * required license or other approval from the U. S. Department of Commerce or 10367754Smsmith * any other agency or department of the United States Government. In the 10467754Smsmith * event Licensee exports any such software from the United States or 10567754Smsmith * re-exports any such software from a foreign destination, Licensee shall 10667754Smsmith * ensure that the distribution and export/re-export of the software is in 10767754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the 10867754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10967754Smsmith * any of its subsidiaries will export/re-export any technical data, process, 11067754Smsmith * software, or service, directly or indirectly, to any country for which the 11167754Smsmith * United States government or any agency thereof requires an export license, 11267754Smsmith * other governmental approval, or letter of assurance, without first obtaining 11367754Smsmith * such license, approval or letter. 11467754Smsmith * 11567754Smsmith *****************************************************************************/ 11667754Smsmith 11777424Smsmith#define __UTGLOBAL_C__ 11867754Smsmith#define DEFINE_ACPI_GLOBALS 11967754Smsmith 12067754Smsmith#include "acpi.h" 12167754Smsmith#include "acnamesp.h" 12267754Smsmith 12377424Smsmith#define _COMPONENT ACPI_UTILITIES 12491116Smsmith ACPI_MODULE_NAME ("utglobal") 12567754Smsmith 12667754Smsmith 12767754Smsmith/****************************************************************************** 12867754Smsmith * 12980062Smsmith * FUNCTION: AcpiFormatException 13080062Smsmith * 13180062Smsmith * PARAMETERS: Status - The ACPI_STATUS code to be formatted 13280062Smsmith * 13380062Smsmith * RETURN: A string containing the exception text 13480062Smsmith * 13580062Smsmith * DESCRIPTION: This function translates an ACPI exception into an ASCII string. 13680062Smsmith * 13780062Smsmith ******************************************************************************/ 13880062Smsmith 13980062Smsmithconst char * 14080062SmsmithAcpiFormatException ( 14180062Smsmith ACPI_STATUS Status) 14280062Smsmith{ 14383174Smsmith const char *Exception = "UNKNOWN_STATUS_CODE"; 14480062Smsmith ACPI_STATUS SubStatus; 14580062Smsmith 14680062Smsmith 14799146Siwasaki ACPI_FUNCTION_NAME ("FormatException"); 14899146Siwasaki 14999146Siwasaki 15080062Smsmith SubStatus = (Status & ~AE_CODE_MASK); 15180062Smsmith 15280062Smsmith switch (Status & AE_CODE_MASK) 15380062Smsmith { 15480062Smsmith case AE_CODE_ENVIRONMENTAL: 15580062Smsmith 15680062Smsmith if (SubStatus <= AE_CODE_ENV_MAX) 15780062Smsmith { 15880062Smsmith Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; 15999146Siwasaki break; 16080062Smsmith } 16199146Siwasaki goto Unknown; 16280062Smsmith 16380062Smsmith case AE_CODE_PROGRAMMER: 16480062Smsmith 16580062Smsmith if (SubStatus <= AE_CODE_PGM_MAX) 16680062Smsmith { 16780062Smsmith Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; 16899146Siwasaki break; 16980062Smsmith } 17099146Siwasaki goto Unknown; 17180062Smsmith 17280062Smsmith case AE_CODE_ACPI_TABLES: 17380062Smsmith 17480062Smsmith if (SubStatus <= AE_CODE_TBL_MAX) 17580062Smsmith { 17680062Smsmith Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; 17799146Siwasaki break; 17880062Smsmith } 17999146Siwasaki goto Unknown; 18080062Smsmith 18180062Smsmith case AE_CODE_AML: 18280062Smsmith 18380062Smsmith if (SubStatus <= AE_CODE_AML_MAX) 18480062Smsmith { 18580062Smsmith Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; 18699146Siwasaki break; 18780062Smsmith } 18899146Siwasaki goto Unknown; 18980062Smsmith 19080062Smsmith case AE_CODE_CONTROL: 19180062Smsmith 19280062Smsmith if (SubStatus <= AE_CODE_CTRL_MAX) 19380062Smsmith { 19480062Smsmith Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; 19599146Siwasaki break; 19680062Smsmith } 19799146Siwasaki goto Unknown; 19880062Smsmith 19980062Smsmith default: 20099146Siwasaki goto Unknown; 20180062Smsmith } 20280062Smsmith 20380062Smsmith 20480062Smsmith return ((const char *) Exception); 20599146Siwasaki 20699146SiwasakiUnknown: 20799146Siwasaki 20899146Siwasaki ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", Status)); 20999146Siwasaki return ((const char *) Exception); 21080062Smsmith} 21180062Smsmith 21280062Smsmith 21380062Smsmith/****************************************************************************** 21480062Smsmith * 21567754Smsmith * Static global variable initialization. 21667754Smsmith * 21767754Smsmith ******************************************************************************/ 21867754Smsmith 21967754Smsmith/* 22067754Smsmith * We want the debug switches statically initialized so they 22167754Smsmith * are already set when the debugger is entered. 22267754Smsmith */ 22367754Smsmith 22467754Smsmith/* Debug switch - level and trace mask */ 22567754Smsmith 226102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT 227114237SnjlUINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; 22867754Smsmith#else 229114237SnjlUINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT; 23067754Smsmith#endif 23167754Smsmith 23267754Smsmith/* Debug switch - layer (component) mask */ 23367754Smsmith 23477424SmsmithUINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT; 23567754SmsmithUINT32 AcpiGbl_NestingLevel = 0; 23667754Smsmith 23767754Smsmith 23867754Smsmith/* Debugger globals */ 23967754Smsmith 24067754SmsmithBOOLEAN AcpiGbl_DbTerminateThreads = FALSE; 241114237SnjlBOOLEAN AcpiGbl_AbortMethod = FALSE; 24267754SmsmithBOOLEAN AcpiGbl_MethodExecuting = FALSE; 24367754Smsmith 24467754Smsmith/* System flags */ 24567754Smsmith 24667754SmsmithUINT32 AcpiGbl_StartupFlags = 0; 24767754Smsmith 24887031Smsmith/* System starts uninitialized */ 24983174Smsmith 25067754SmsmithBOOLEAN AcpiGbl_Shutdown = TRUE; 25167754Smsmith 25283174Smsmithconst UINT8 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; 25367754Smsmith 254114237Snjlconst char *AcpiGbl_DbSleepStates[ACPI_S_STATE_COUNT] = { 255114237Snjl "\\_S0_", 256114237Snjl "\\_S1_", 257114237Snjl "\\_S2_", 258114237Snjl "\\_S3_", 259114237Snjl "\\_S4_", 260114237Snjl "\\_S5_"}; 26169450Smsmith 26269450Smsmith 26367754Smsmith/****************************************************************************** 26467754Smsmith * 26567754Smsmith * Namespace globals 26667754Smsmith * 26767754Smsmith ******************************************************************************/ 26867754Smsmith 26967754Smsmith 27067754Smsmith/* 271104470Siwasaki * Predefined ACPI Names (Built-in to the Interpreter) 27267754Smsmith * 27367754Smsmith * Initial values are currently supported only for types String and Number. 274104470Siwasaki * Both are specified as strings in this table. 27577424Smsmith * 27677424Smsmith * NOTES: 27777424Smsmith * 1) _SB_ is defined to be a device to allow _SB_/_INI to be run 27877424Smsmith * during the initialization sequence. 27967754Smsmith */ 28067754Smsmith 28191116Smsmithconst ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 28267754Smsmith{ 283107325Siwasaki {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 284107325Siwasaki {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 28599679Siwasaki {"_SB_", ACPI_TYPE_DEVICE, NULL}, 286107325Siwasaki {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 287107325Siwasaki {"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 28899146Siwasaki {"_REV", ACPI_TYPE_INTEGER, "2"}, 28999146Siwasaki {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 29099146Siwasaki {"_GL_", ACPI_TYPE_MUTEX, "0"}, 291102550Siwasaki 292102550Siwasaki#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 293102550Siwasaki {"_OSI", ACPI_TYPE_METHOD, "1"}, 294102550Siwasaki#endif 29599679Siwasaki {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ 29667754Smsmith}; 29767754Smsmith 29867754Smsmith 29967754Smsmith/* 30067754Smsmith * Properties of the ACPI Object Types, both internal and external. 301104470Siwasaki * The table is indexed by values of ACPI_OBJECT_TYPE 30267754Smsmith */ 30367754Smsmith 30491116Smsmithconst UINT8 AcpiGbl_NsProperties[] = 30567754Smsmith{ 30691116Smsmith ACPI_NS_NORMAL, /* 00 Any */ 30791116Smsmith ACPI_NS_NORMAL, /* 01 Number */ 30891116Smsmith ACPI_NS_NORMAL, /* 02 String */ 30991116Smsmith ACPI_NS_NORMAL, /* 03 Buffer */ 31099146Siwasaki ACPI_NS_NORMAL, /* 04 Package */ 31191116Smsmith ACPI_NS_NORMAL, /* 05 FieldUnit */ 31299146Siwasaki ACPI_NS_NEWSCOPE, /* 06 Device */ 31399146Siwasaki ACPI_NS_NORMAL, /* 07 Event */ 31499146Siwasaki ACPI_NS_NEWSCOPE, /* 08 Method */ 31599146Siwasaki ACPI_NS_NORMAL, /* 09 Mutex */ 31699146Siwasaki ACPI_NS_NORMAL, /* 10 Region */ 31799146Siwasaki ACPI_NS_NEWSCOPE, /* 11 Power */ 31899146Siwasaki ACPI_NS_NEWSCOPE, /* 12 Processor */ 31999146Siwasaki ACPI_NS_NEWSCOPE, /* 13 Thermal */ 32091116Smsmith ACPI_NS_NORMAL, /* 14 BufferField */ 32191116Smsmith ACPI_NS_NORMAL, /* 15 DdbHandle */ 32291116Smsmith ACPI_NS_NORMAL, /* 16 Debug Object */ 32391116Smsmith ACPI_NS_NORMAL, /* 17 DefField */ 32491116Smsmith ACPI_NS_NORMAL, /* 18 BankField */ 32591116Smsmith ACPI_NS_NORMAL, /* 19 IndexField */ 32691116Smsmith ACPI_NS_NORMAL, /* 20 Reference */ 32791116Smsmith ACPI_NS_NORMAL, /* 21 Alias */ 32891116Smsmith ACPI_NS_NORMAL, /* 22 Notify */ 32991116Smsmith ACPI_NS_NORMAL, /* 23 Address Handler */ 33091116Smsmith ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */ 33191116Smsmith ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */ 332107325Siwasaki ACPI_NS_NEWSCOPE, /* 26 Scope */ 333107325Siwasaki ACPI_NS_NORMAL, /* 27 Extra */ 334107325Siwasaki ACPI_NS_NORMAL, /* 28 Data */ 335107325Siwasaki ACPI_NS_NORMAL /* 29 Invalid */ 33667754Smsmith}; 33767754Smsmith 33867754Smsmith 33971867Smsmith/* Hex to ASCII conversion table */ 34071867Smsmith 341114237Snjlstatic const char AcpiGbl_HexToAscii[] = 34271867Smsmith {'0','1','2','3','4','5','6','7', 34399679Siwasaki '8','9','A','B','C','D','E','F'}; 34471867Smsmith 34583174Smsmith/***************************************************************************** 34683174Smsmith * 34783174Smsmith * FUNCTION: AcpiUtHexToAsciiChar 34883174Smsmith * 34983174Smsmith * PARAMETERS: Integer - Contains the hex digit 35083174Smsmith * Position - bit position of the digit within the 35183174Smsmith * integer 35283174Smsmith * 35383174Smsmith * RETURN: Ascii character 35483174Smsmith * 35583174Smsmith * DESCRIPTION: Convert a hex digit to an ascii character 35683174Smsmith * 35783174Smsmith ****************************************************************************/ 35883174Smsmith 35999679Siwasakichar 36082367SmsmithAcpiUtHexToAsciiChar ( 36182367Smsmith ACPI_INTEGER Integer, 36282367Smsmith UINT32 Position) 36382367Smsmith{ 36471867Smsmith 36582367Smsmith return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]); 36682367Smsmith} 36782367Smsmith 36883174Smsmith 36967754Smsmith/****************************************************************************** 37067754Smsmith * 37191116Smsmith * Table name globals 37267754Smsmith * 37369450Smsmith * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. 37469450Smsmith * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables 37569450Smsmith * that are not used by the subsystem are simply ignored. 37669450Smsmith * 37791116Smsmith * Do NOT add any table to this list that is not consumed directly by this 37891116Smsmith * subsystem. 37991116Smsmith * 38067754Smsmith ******************************************************************************/ 38167754Smsmith 38267754Smsmith 38367754SmsmithACPI_TABLE_DESC AcpiGbl_AcpiTables[NUM_ACPI_TABLES]; 38467754Smsmith 38567754Smsmith 38667754SmsmithACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] = 38767754Smsmith{ 388100966Siwasaki /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ 38967754Smsmith 390100966Siwasaki /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 391100966Siwasaki /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void **) &AcpiGbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, 392100966Siwasaki /* FADT 2 */ {FADT_SIG, FADT_SIG, (void **) &AcpiGbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, 393100966Siwasaki /* FACS 3 */ {FACS_SIG, FACS_SIG, (void **) &AcpiGbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, 394100966Siwasaki /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 395100966Siwasaki /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 396100966Siwasaki /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 39767754Smsmith}; 39867754Smsmith 39967754Smsmith 40091116Smsmith/****************************************************************************** 40191116Smsmith * 40291116Smsmith * Event and Hardware globals 40391116Smsmith * 40491116Smsmith ******************************************************************************/ 40591116Smsmith 40691116SmsmithACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = 40791116Smsmith{ 40891116Smsmith /* Name Parent Register Register Bit Position Register Bit Mask */ 40991116Smsmith 41091116Smsmith /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, 41191116Smsmith /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, 41291116Smsmith /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, 41391116Smsmith /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, 41491116Smsmith /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, 41591116Smsmith /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, 41691116Smsmith /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, 41791116Smsmith 41891116Smsmith /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, 41991116Smsmith /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 42091116Smsmith /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 42191116Smsmith /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 42291116Smsmith /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, 42391116Smsmith /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, 42491116Smsmith 42591116Smsmith /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, 42691116Smsmith /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, 42791116Smsmith /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, 42891116Smsmith /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 42991116Smsmith /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 43091116Smsmith /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, 43191116Smsmith 43291116Smsmith /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} 43391116Smsmith}; 43491116Smsmith 43591116Smsmith 43691116SmsmithACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = 43791116Smsmith{ 43891116Smsmith /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, 43991116Smsmith /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 44091116Smsmith /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 44191116Smsmith /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 44291116Smsmith /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, 0, 0}, 44391116Smsmith}; 44491116Smsmith 44591116Smsmith/***************************************************************************** 44691116Smsmith * 44791116Smsmith * FUNCTION: AcpiUtGetRegionName 44891116Smsmith * 44991116Smsmith * PARAMETERS: None. 45091116Smsmith * 45191116Smsmith * RETURN: Status 45291116Smsmith * 45391116Smsmith * DESCRIPTION: Translate a Space ID into a name string (Debug only) 45491116Smsmith * 45591116Smsmith ****************************************************************************/ 45691116Smsmith 45791116Smsmith/* Region type decoding */ 45891116Smsmith 459114237Snjlconst char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = 46091116Smsmith{ 461114237Snjl/*! [Begin] no source code translation (keep these ASL Keywords as-is) */ 46291116Smsmith "SystemMemory", 46391116Smsmith "SystemIO", 464100966Siwasaki "PCI_Config", 46591116Smsmith "EmbeddedControl", 46691116Smsmith "SMBus", 46791116Smsmith "CMOS", 468100966Siwasaki "PCIBARTarget", 469114237Snjl "DataTable" 470114237Snjl/*! [End] no source code translation !*/ 47191116Smsmith}; 47291116Smsmith 47391116Smsmith 474114237Snjlchar * 47591116SmsmithAcpiUtGetRegionName ( 47691116Smsmith UINT8 SpaceId) 47791116Smsmith{ 47891116Smsmith 47991116Smsmith if (SpaceId >= ACPI_USER_REGION_BEGIN) 48091116Smsmith { 48191116Smsmith return ("UserDefinedRegion"); 48291116Smsmith } 48391116Smsmith 48491116Smsmith else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) 48591116Smsmith { 486114237Snjl return ("InvalidSpaceId"); 48791116Smsmith } 48891116Smsmith 489114237Snjl return ((char *) AcpiGbl_RegionTypes[SpaceId]); 49091116Smsmith} 49191116Smsmith 49291116Smsmith 49391116Smsmith/***************************************************************************** 49491116Smsmith * 49591116Smsmith * FUNCTION: AcpiUtGetEventName 49691116Smsmith * 49791116Smsmith * PARAMETERS: None. 49891116Smsmith * 49991116Smsmith * RETURN: Status 50091116Smsmith * 50191116Smsmith * DESCRIPTION: Translate a Event ID into a name string (Debug only) 50291116Smsmith * 50391116Smsmith ****************************************************************************/ 50491116Smsmith 50591116Smsmith/* Event type decoding */ 50691116Smsmith 507114237Snjlstatic const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = 50891116Smsmith{ 50991116Smsmith "PM_Timer", 51091116Smsmith "GlobalLock", 51191116Smsmith "PowerButton", 51291116Smsmith "SleepButton", 51391116Smsmith "RealTimeClock", 51491116Smsmith}; 51591116Smsmith 51691116Smsmith 517114237Snjlchar * 51891116SmsmithAcpiUtGetEventName ( 51991116Smsmith UINT32 EventId) 52091116Smsmith{ 52191116Smsmith 52291116Smsmith if (EventId > ACPI_EVENT_MAX) 52391116Smsmith { 52491116Smsmith return ("InvalidEventID"); 52591116Smsmith } 52691116Smsmith 527114237Snjl return ((char *) AcpiGbl_EventTypes[EventId]); 52891116Smsmith} 52991116Smsmith 53091116Smsmith 53167754Smsmith/***************************************************************************** 53267754Smsmith * 53391116Smsmith * FUNCTION: AcpiUtGetTypeName 53491116Smsmith * 53591116Smsmith * PARAMETERS: None. 53691116Smsmith * 53791116Smsmith * RETURN: Status 53891116Smsmith * 53991116Smsmith * DESCRIPTION: Translate a Type ID into a name string (Debug only) 54091116Smsmith * 54191116Smsmith ****************************************************************************/ 54291116Smsmith 54367754Smsmith/* 54467754Smsmith * Elements of AcpiGbl_NsTypeNames below must match 54567754Smsmith * one-to-one with values of ACPI_OBJECT_TYPE 54667754Smsmith * 54767754Smsmith * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 54867754Smsmith * stored in a table it really means that we have thus far seen no evidence to 54967754Smsmith * indicatewhat type is actually going to be stored for this entry. 55067754Smsmith */ 55167754Smsmith 552114237Snjlstatic const char AcpiGbl_BadType[] = "UNDEFINED"; 55385756Smsmith#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */ 55467754Smsmith 555114237Snjlstatic const char *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ 55667754Smsmith{ 55767754Smsmith /* 00 */ "Untyped", 55871867Smsmith /* 01 */ "Integer", 55967754Smsmith /* 02 */ "String", 56067754Smsmith /* 03 */ "Buffer", 56167754Smsmith /* 04 */ "Package", 56267754Smsmith /* 05 */ "FieldUnit", 56367754Smsmith /* 06 */ "Device", 56467754Smsmith /* 07 */ "Event", 56567754Smsmith /* 08 */ "Method", 56667754Smsmith /* 09 */ "Mutex", 56767754Smsmith /* 10 */ "Region", 56867754Smsmith /* 11 */ "Power", 56967754Smsmith /* 12 */ "Processor", 57067754Smsmith /* 13 */ "Thermal", 57185756Smsmith /* 14 */ "BufferField", 57267754Smsmith /* 15 */ "DdbHandle", 57385756Smsmith /* 16 */ "DebugObject", 57485756Smsmith /* 17 */ "RegionField", 57577424Smsmith /* 18 */ "BankField", 57685756Smsmith /* 19 */ "IndexField", 57767754Smsmith /* 20 */ "Reference", 57867754Smsmith /* 21 */ "Alias", 57967754Smsmith /* 22 */ "Notify", 58085756Smsmith /* 23 */ "AddrHandler", 58185756Smsmith /* 24 */ "ResourceDesc", 58285756Smsmith /* 25 */ "ResourceFld", 583107325Siwasaki /* 26 */ "Scope", 584107325Siwasaki /* 27 */ "Extra", 585107325Siwasaki /* 28 */ "Data", 586107325Siwasaki /* 39 */ "Invalid" 58767754Smsmith}; 58867754Smsmith 58967754Smsmith 590114237Snjlchar * 59177424SmsmithAcpiUtGetTypeName ( 59291116Smsmith ACPI_OBJECT_TYPE Type) 59367754Smsmith{ 59467754Smsmith 595107325Siwasaki if (Type > ACPI_TYPE_INVALID) 59667754Smsmith { 597114237Snjl return ((char *) AcpiGbl_BadType); 59867754Smsmith } 59967754Smsmith 600114237Snjl return ((char *) AcpiGbl_NsTypeNames[Type]); 60167754Smsmith} 60267754Smsmith 60369746Smsmith 604114237Snjlchar * 60599679SiwasakiAcpiUtGetObjectTypeName ( 60699679Siwasaki ACPI_OPERAND_OBJECT *ObjDesc) 60799679Siwasaki{ 60899679Siwasaki 60999679Siwasaki if (!ObjDesc) 61099679Siwasaki { 61199679Siwasaki return ("[NULL Object Descriptor]"); 61299679Siwasaki } 61399679Siwasaki 61499679Siwasaki return (AcpiUtGetTypeName (ACPI_GET_OBJECT_TYPE (ObjDesc))); 61599679Siwasaki} 61699679Siwasaki 61799679Siwasaki 618102550Siwasaki#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 61999679Siwasaki 620100966Siwasaki/* 621100966Siwasaki * Strings and procedures used for debug only 622100966Siwasaki */ 62399679Siwasaki 62469746Smsmith 625100966Siwasaki/***************************************************************************** 626100966Siwasaki * 627100966Siwasaki * FUNCTION: AcpiUtGetMutexName 628100966Siwasaki * 629100966Siwasaki * PARAMETERS: None. 630100966Siwasaki * 631100966Siwasaki * RETURN: Status 632100966Siwasaki * 633100966Siwasaki * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 634100966Siwasaki * 635100966Siwasaki ****************************************************************************/ 63669746Smsmith 637114237Snjlchar * 638100966SiwasakiAcpiUtGetMutexName ( 639100966Siwasaki UINT32 MutexId) 64069746Smsmith{ 64169746Smsmith 642100966Siwasaki if (MutexId > MAX_MTX) 643100966Siwasaki { 644100966Siwasaki return ("Invalid Mutex ID"); 645100966Siwasaki } 64669746Smsmith 647100966Siwasaki return (AcpiGbl_MutexNames[MutexId]); 648100966Siwasaki} 64969746Smsmith 65069746Smsmith 65167754Smsmith#endif 65267754Smsmith 65367754Smsmith 65467754Smsmith/***************************************************************************** 65567754Smsmith * 65677424Smsmith * FUNCTION: AcpiUtValidObjectType 65767754Smsmith * 658107325Siwasaki * PARAMETERS: Type - Object type to be validated 65967754Smsmith * 66067754Smsmith * RETURN: TRUE if valid object type 66167754Smsmith * 66267754Smsmith * DESCRIPTION: Validate an object type 66367754Smsmith * 66467754Smsmith ****************************************************************************/ 66567754Smsmith 66667754SmsmithBOOLEAN 66777424SmsmithAcpiUtValidObjectType ( 66891116Smsmith ACPI_OBJECT_TYPE Type) 66967754Smsmith{ 67067754Smsmith 671107325Siwasaki if (Type > ACPI_TYPE_LOCAL_MAX) 67267754Smsmith { 673107325Siwasaki /* Note: Assumes all TYPEs are contiguous (external/local) */ 674107325Siwasaki 675107325Siwasaki return (FALSE); 67667754Smsmith } 67767754Smsmith 67867754Smsmith return (TRUE); 67967754Smsmith} 68067754Smsmith 68167754Smsmith 68267754Smsmith/**************************************************************************** 68367754Smsmith * 68477424Smsmith * FUNCTION: AcpiUtAllocateOwnerId 68567754Smsmith * 68667754Smsmith * PARAMETERS: IdType - Type of ID (method or table) 68767754Smsmith * 68867754Smsmith * DESCRIPTION: Allocate a table or method owner id 68967754Smsmith * 69067754Smsmith ***************************************************************************/ 69167754Smsmith 69267754SmsmithACPI_OWNER_ID 69377424SmsmithAcpiUtAllocateOwnerId ( 69467754Smsmith UINT32 IdType) 69567754Smsmith{ 69667754Smsmith ACPI_OWNER_ID OwnerId = 0xFFFF; 69767754Smsmith 69867754Smsmith 69991116Smsmith ACPI_FUNCTION_TRACE ("UtAllocateOwnerId"); 70067754Smsmith 70167754Smsmith 70291116Smsmith if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES))) 70391116Smsmith { 70491116Smsmith return (0); 70591116Smsmith } 70667754Smsmith 70767754Smsmith switch (IdType) 70867754Smsmith { 70991116Smsmith case ACPI_OWNER_TYPE_TABLE: 71067754Smsmith 71167754Smsmith OwnerId = AcpiGbl_NextTableOwnerId; 71267754Smsmith AcpiGbl_NextTableOwnerId++; 71367754Smsmith 71491116Smsmith if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID) 71567754Smsmith { 71691116Smsmith AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 71767754Smsmith } 71867754Smsmith break; 71967754Smsmith 72067754Smsmith 72191116Smsmith case ACPI_OWNER_TYPE_METHOD: 72267754Smsmith 72367754Smsmith OwnerId = AcpiGbl_NextMethodOwnerId; 72467754Smsmith AcpiGbl_NextMethodOwnerId++; 72567754Smsmith 72691116Smsmith if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID) 72767754Smsmith { 72891116Smsmith AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 72967754Smsmith } 73067754Smsmith break; 73199679Siwasaki 73299679Siwasaki default: 73399679Siwasaki break; 73467754Smsmith } 73567754Smsmith 73691116Smsmith (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); 73767754Smsmith return_VALUE (OwnerId); 73867754Smsmith} 73967754Smsmith 74067754Smsmith 74167754Smsmith/**************************************************************************** 74267754Smsmith * 74377424Smsmith * FUNCTION: AcpiUtInitGlobals 74467754Smsmith * 74567754Smsmith * PARAMETERS: none 74667754Smsmith * 74767754Smsmith * DESCRIPTION: Init library globals. All globals that require specific 74867754Smsmith * initialization should be initialized here! 74967754Smsmith * 75067754Smsmith ***************************************************************************/ 75167754Smsmith 75267754Smsmithvoid 75377424SmsmithAcpiUtInitGlobals ( 75467754Smsmith void) 75567754Smsmith{ 75667754Smsmith UINT32 i; 75767754Smsmith 75867754Smsmith 75991116Smsmith ACPI_FUNCTION_TRACE ("UtInitGlobals"); 76067754Smsmith 76182367Smsmith /* Memory allocation and cache lists */ 76282367Smsmith 76391116Smsmith ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS); 76482367Smsmith 76591116Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_GENERIC_STATE *) NULL)->Common.Next), NULL); 76699679Siwasaki AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 76799679Siwasaki AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 76891116Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next), NULL); 76991116Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_WALK_STATE *) NULL)->Next), NULL); 77082367Smsmith 77183174Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize = sizeof (ACPI_NAMESPACE_NODE); 77283174Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize = sizeof (ACPI_GENERIC_STATE); 77399679Siwasaki AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize = sizeof (ACPI_PARSE_OBJ_COMMON); 77499679Siwasaki AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize = sizeof (ACPI_PARSE_OBJ_NAMED); 77583174Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize = sizeof (ACPI_OPERAND_OBJECT); 77683174Smsmith AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize = sizeof (ACPI_WALK_STATE); 77782367Smsmith 778114237Snjl AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth = ACPI_MAX_STATE_CACHE_DEPTH; 779114237Snjl AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth = ACPI_MAX_PARSE_CACHE_DEPTH; 780114237Snjl AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = ACPI_MAX_EXTPARSE_CACHE_DEPTH; 781114237Snjl AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth = ACPI_MAX_OBJECT_CACHE_DEPTH; 782114237Snjl AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth = ACPI_MAX_WALK_CACHE_DEPTH; 78382367Smsmith 78483174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName = "Global Memory Allocation"); 78583174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName = "Namespace Nodes"); 78683174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName = "State Object Cache"); 78783174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName = "Parse Node Cache"); 78883174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName = "Extended Parse Node Cache"); 78983174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName = "Operand Object Cache"); 79083174Smsmith ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName = "Tree Walk Node Cache"); 79182367Smsmith 79267754Smsmith /* ACPI table structure */ 79367754Smsmith 79467754Smsmith for (i = 0; i < NUM_ACPI_TABLES; i++) 79567754Smsmith { 79667754Smsmith AcpiGbl_AcpiTables[i].Prev = &AcpiGbl_AcpiTables[i]; 79767754Smsmith AcpiGbl_AcpiTables[i].Next = &AcpiGbl_AcpiTables[i]; 79867754Smsmith AcpiGbl_AcpiTables[i].Pointer = NULL; 79967754Smsmith AcpiGbl_AcpiTables[i].Length = 0; 80067754Smsmith AcpiGbl_AcpiTables[i].Allocation = ACPI_MEM_NOT_ALLOCATED; 80167754Smsmith AcpiGbl_AcpiTables[i].Count = 0; 80267754Smsmith } 80367754Smsmith 80467754Smsmith /* Mutex locked flags */ 80567754Smsmith 80667754Smsmith for (i = 0; i < NUM_MTX; i++) 80767754Smsmith { 80867754Smsmith AcpiGbl_AcpiMutexInfo[i].Mutex = NULL; 80977424Smsmith AcpiGbl_AcpiMutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED; 81067754Smsmith AcpiGbl_AcpiMutexInfo[i].UseCount = 0; 81167754Smsmith } 81267754Smsmith 813114237Snjl /* GPE support */ 814114237Snjl 815114237Snjl AcpiGbl_GpeBlockListHead = NULL; 816114237Snjl 81767754Smsmith /* Global notify handlers */ 81867754Smsmith 81967754Smsmith AcpiGbl_SysNotify.Handler = NULL; 82067754Smsmith AcpiGbl_DrvNotify.Handler = NULL; 82199679Siwasaki AcpiGbl_InitHandler = NULL; 82267754Smsmith 82367754Smsmith /* Global "typed" ACPI table pointers */ 82467754Smsmith 82567754Smsmith AcpiGbl_RSDP = NULL; 82669450Smsmith AcpiGbl_XSDT = NULL; 82767754Smsmith AcpiGbl_FACS = NULL; 82869450Smsmith AcpiGbl_FADT = NULL; 82967754Smsmith AcpiGbl_DSDT = NULL; 83067754Smsmith 83167754Smsmith /* Global Lock support */ 83267754Smsmith 83367754Smsmith AcpiGbl_GlobalLockAcquired = FALSE; 83467754Smsmith AcpiGbl_GlobalLockThreadCount = 0; 83591116Smsmith AcpiGbl_GlobalLockHandle = 0; 83667754Smsmith 83767754Smsmith /* Miscellaneous variables */ 83867754Smsmith 83999146Siwasaki AcpiGbl_TableFlags = ACPI_PHYSICAL_POINTER; 84067754Smsmith AcpiGbl_RsdpOriginalLocation = 0; 84167754Smsmith AcpiGbl_CmSingleStep = FALSE; 84267754Smsmith AcpiGbl_DbTerminateThreads = FALSE; 84367754Smsmith AcpiGbl_Shutdown = FALSE; 84467754Smsmith AcpiGbl_NsLookupCount = 0; 84567754Smsmith AcpiGbl_PsFindCount = 0; 84667754Smsmith AcpiGbl_AcpiHardwarePresent = TRUE; 84791116Smsmith AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 84891116Smsmith AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 84967754Smsmith AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 85091116Smsmith AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; 85167754Smsmith 85267754Smsmith /* Hardware oriented */ 85367754Smsmith 854104470Siwasaki AcpiGbl_EventsInitialized = FALSE; 85567754Smsmith 85667754Smsmith /* Namespace */ 85767754Smsmith 85867754Smsmith AcpiGbl_RootNode = NULL; 85967754Smsmith 86099146Siwasaki AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; 86191116Smsmith AcpiGbl_RootNodeStruct.Descriptor = ACPI_DESC_TYPE_NAMED; 862107325Siwasaki AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; 86367754Smsmith AcpiGbl_RootNodeStruct.Child = NULL; 86467754Smsmith AcpiGbl_RootNodeStruct.Peer = NULL; 86567754Smsmith AcpiGbl_RootNodeStruct.Object = NULL; 86667754Smsmith AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; 86767754Smsmith 86867754Smsmith 869102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT 87099679Siwasaki AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX; 87183174Smsmith#endif 87283174Smsmith 87367754Smsmith return_VOID; 87467754Smsmith} 87567754Smsmith 87667754Smsmith 877