utglobal.c revision 91116
167754Smsmith/******************************************************************************
267754Smsmith *
377424Smsmith * Module Name: utglobal - Global variables for the ACPI subsystem
491116Smsmith *              $Revision: 153 $
567754Smsmith *
667754Smsmith *****************************************************************************/
767754Smsmith
867754Smsmith/******************************************************************************
967754Smsmith *
1067754Smsmith * 1. Copyright Notice
1167754Smsmith *
1291116Smsmith * Some or all of this work - Copyright (c) 1999 - 2002, 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 "acevents.h"
12267754Smsmith#include "acnamesp.h"
12367754Smsmith#include "acinterp.h"
12469746Smsmith#include "amlcode.h"
12567754Smsmith
12667754Smsmith
12777424Smsmith#define _COMPONENT          ACPI_UTILITIES
12891116Smsmith        ACPI_MODULE_NAME    ("utglobal")
12967754Smsmith
13067754Smsmith
13167754Smsmith/******************************************************************************
13267754Smsmith *
13380062Smsmith * FUNCTION:    AcpiFormatException
13480062Smsmith *
13580062Smsmith * PARAMETERS:  Status       - The ACPI_STATUS code to be formatted
13680062Smsmith *
13780062Smsmith * RETURN:      A string containing the exception  text
13880062Smsmith *
13980062Smsmith * DESCRIPTION: This function translates an ACPI exception into an ASCII string.
14080062Smsmith *
14180062Smsmith ******************************************************************************/
14280062Smsmith
14380062Smsmithconst char *
14480062SmsmithAcpiFormatException (
14580062Smsmith    ACPI_STATUS             Status)
14680062Smsmith{
14783174Smsmith    const char              *Exception = "UNKNOWN_STATUS_CODE";
14880062Smsmith    ACPI_STATUS             SubStatus;
14980062Smsmith
15080062Smsmith
15180062Smsmith    SubStatus = (Status & ~AE_CODE_MASK);
15280062Smsmith
15380062Smsmith
15480062Smsmith    switch (Status & AE_CODE_MASK)
15580062Smsmith    {
15680062Smsmith    case AE_CODE_ENVIRONMENTAL:
15780062Smsmith
15880062Smsmith        if (SubStatus <= AE_CODE_ENV_MAX)
15980062Smsmith        {
16080062Smsmith            Exception = AcpiGbl_ExceptionNames_Env [SubStatus];
16180062Smsmith        }
16280062Smsmith        break;
16380062Smsmith
16480062Smsmith    case AE_CODE_PROGRAMMER:
16580062Smsmith
16680062Smsmith        if (SubStatus <= AE_CODE_PGM_MAX)
16780062Smsmith        {
16880062Smsmith            Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1];
16980062Smsmith        }
17080062Smsmith        break;
17180062Smsmith
17280062Smsmith    case AE_CODE_ACPI_TABLES:
17380062Smsmith
17480062Smsmith        if (SubStatus <= AE_CODE_TBL_MAX)
17580062Smsmith        {
17680062Smsmith            Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1];
17780062Smsmith        }
17880062Smsmith        break;
17980062Smsmith
18080062Smsmith    case AE_CODE_AML:
18180062Smsmith
18280062Smsmith        if (SubStatus <= AE_CODE_AML_MAX)
18380062Smsmith        {
18480062Smsmith            Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1];
18580062Smsmith        }
18680062Smsmith        break;
18780062Smsmith
18880062Smsmith    case AE_CODE_CONTROL:
18980062Smsmith
19080062Smsmith        if (SubStatus <= AE_CODE_CTRL_MAX)
19180062Smsmith        {
19280062Smsmith            Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1];
19380062Smsmith        }
19480062Smsmith        break;
19580062Smsmith
19680062Smsmith    default:
19780062Smsmith        break;
19880062Smsmith    }
19980062Smsmith
20080062Smsmith
20180062Smsmith    return ((const char *) Exception);
20280062Smsmith}
20380062Smsmith
20480062Smsmith
20580062Smsmith/******************************************************************************
20680062Smsmith *
20767754Smsmith * Static global variable initialization.
20867754Smsmith *
20967754Smsmith ******************************************************************************/
21067754Smsmith
21167754Smsmith/*
21267754Smsmith * We want the debug switches statically initialized so they
21367754Smsmith * are already set when the debugger is entered.
21467754Smsmith */
21567754Smsmith
21667754Smsmith/* Debug switch - level and trace mask */
21767754Smsmith
21867754Smsmith#ifdef ACPI_DEBUG
21967754SmsmithUINT32                      AcpiDbgLevel = DEBUG_DEFAULT;
22067754Smsmith#else
22167754SmsmithUINT32                      AcpiDbgLevel = NORMAL_DEFAULT;
22267754Smsmith#endif
22367754Smsmith
22467754Smsmith/* Debug switch - layer (component) mask */
22567754Smsmith
22677424SmsmithUINT32                      AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
22767754SmsmithUINT32                      AcpiGbl_NestingLevel = 0;
22867754Smsmith
22967754Smsmith
23067754Smsmith/* Debugger globals */
23167754Smsmith
23267754SmsmithBOOLEAN                     AcpiGbl_DbTerminateThreads = FALSE;
23367754SmsmithBOOLEAN                     AcpiGbl_MethodExecuting = FALSE;
23467754Smsmith
23567754Smsmith/* System flags */
23667754Smsmith
23767754SmsmithUINT32                      AcpiGbl_StartupFlags = 0;
23867754Smsmith
23987031Smsmith/* System starts uninitialized */
24083174Smsmith
24167754SmsmithBOOLEAN                     AcpiGbl_Shutdown = TRUE;
24267754Smsmith
24383174Smsmithconst UINT8                 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128};
24467754Smsmith
24583174Smsmithconst NATIVE_CHAR           *AcpiGbl_DbSleepStates[ACPI_NUM_SLEEP_STATES] = {
24683174Smsmith                                "\\_S0_","\\_S1_","\\_S2_","\\_S3_",
24783174Smsmith                                "\\_S4_","\\_S5_","\\_S4B"};
24869450Smsmith
24969450Smsmith
25067754Smsmith/******************************************************************************
25167754Smsmith *
25267754Smsmith * Namespace globals
25367754Smsmith *
25467754Smsmith ******************************************************************************/
25567754Smsmith
25667754Smsmith
25767754Smsmith/*
25867754Smsmith * Names built-in to the interpreter
25967754Smsmith *
26067754Smsmith * Initial values are currently supported only for types String and Number.
26167754Smsmith * To avoid type punning, both are specified as strings in this table.
26277424Smsmith *
26377424Smsmith * NOTES:
26477424Smsmith * 1) _SB_ is defined to be a device to allow _SB_/_INI to be run
26577424Smsmith *    during the initialization sequence.
26667754Smsmith */
26767754Smsmith
26891116Smsmithconst ACPI_PREDEFINED_NAMES     AcpiGbl_PreDefinedNames[] =
26967754Smsmith{
27067754Smsmith    {"_GPE",    INTERNAL_TYPE_DEF_ANY},
27167754Smsmith    {"_PR_",    INTERNAL_TYPE_DEF_ANY},
27277424Smsmith    {"_SB_",    ACPI_TYPE_DEVICE},
27367754Smsmith    {"_SI_",    INTERNAL_TYPE_DEF_ANY},
27467754Smsmith    {"_TZ_",    INTERNAL_TYPE_DEF_ANY},
27571867Smsmith    {"_REV",    ACPI_TYPE_INTEGER, "2"},
27667754Smsmith    {"_OS_",    ACPI_TYPE_STRING, ACPI_OS_NAME},
27767754Smsmith    {"_GL_",    ACPI_TYPE_MUTEX, "0"},
27877424Smsmith    {NULL,      ACPI_TYPE_ANY}           /* Table terminator */
27967754Smsmith};
28067754Smsmith
28167754Smsmith
28267754Smsmith/*
28367754Smsmith * Properties of the ACPI Object Types, both internal and external.
28467754Smsmith *
28567754Smsmith * Elements of AcpiNsProperties are bit significant
28667754Smsmith * and the table is indexed by values of ACPI_OBJECT_TYPE
28767754Smsmith */
28867754Smsmith
28991116Smsmithconst UINT8                     AcpiGbl_NsProperties[] =
29067754Smsmith{
29191116Smsmith    ACPI_NS_NORMAL,                     /* 00 Any              */
29291116Smsmith    ACPI_NS_NORMAL,                     /* 01 Number           */
29391116Smsmith    ACPI_NS_NORMAL,                     /* 02 String           */
29491116Smsmith    ACPI_NS_NORMAL,                     /* 03 Buffer           */
29591116Smsmith    ACPI_NS_LOCAL,                      /* 04 Package          */
29691116Smsmith    ACPI_NS_NORMAL,                     /* 05 FieldUnit        */
29791116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 06 Device           */
29891116Smsmith    ACPI_NS_LOCAL,                      /* 07 AcpiEvent        */
29991116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 08 Method           */
30091116Smsmith    ACPI_NS_LOCAL,                      /* 09 Mutex            */
30191116Smsmith    ACPI_NS_LOCAL,                      /* 10 Region           */
30291116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 11 Power            */
30391116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 12 Processor        */
30491116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 13 Thermal          */
30591116Smsmith    ACPI_NS_NORMAL,                     /* 14 BufferField      */
30691116Smsmith    ACPI_NS_NORMAL,                     /* 15 DdbHandle        */
30791116Smsmith    ACPI_NS_NORMAL,                     /* 16 Debug Object     */
30891116Smsmith    ACPI_NS_NORMAL,                     /* 17 DefField         */
30991116Smsmith    ACPI_NS_NORMAL,                     /* 18 BankField        */
31091116Smsmith    ACPI_NS_NORMAL,                     /* 19 IndexField       */
31191116Smsmith    ACPI_NS_NORMAL,                     /* 20 Reference        */
31291116Smsmith    ACPI_NS_NORMAL,                     /* 21 Alias            */
31391116Smsmith    ACPI_NS_NORMAL,                     /* 22 Notify           */
31491116Smsmith    ACPI_NS_NORMAL,                     /* 23 Address Handler  */
31591116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 24 Resource Desc    */
31691116Smsmith    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 25 Resource Field   */
31791116Smsmith    ACPI_NS_NORMAL,                     /* 26 DefFieldDefn     */
31891116Smsmith    ACPI_NS_NORMAL,                     /* 27 BankFieldDefn    */
31991116Smsmith    ACPI_NS_NORMAL,                     /* 28 IndexFieldDefn   */
32091116Smsmith    ACPI_NS_NORMAL,                     /* 29 If               */
32191116Smsmith    ACPI_NS_NORMAL,                     /* 30 Else             */
32291116Smsmith    ACPI_NS_NORMAL,                     /* 31 While            */
32391116Smsmith    ACPI_NS_NEWSCOPE,                   /* 32 Scope            */
32491116Smsmith    ACPI_NS_LOCAL,                      /* 33 DefAny           */
32591116Smsmith    ACPI_NS_NORMAL,                     /* 34 Extra            */
32691116Smsmith    ACPI_NS_NORMAL,                     /* 35 Data             */
32791116Smsmith    ACPI_NS_NORMAL                      /* 36 Invalid          */
32867754Smsmith};
32967754Smsmith
33067754Smsmith
33171867Smsmith/* Hex to ASCII conversion table */
33271867Smsmith
33383174Smsmithconst NATIVE_CHAR           AcpiGbl_HexToAscii[] =
33471867Smsmith                                {'0','1','2','3','4','5','6','7',
33571867Smsmith                                '8','9','A','B','C','D','E','F'};
33671867Smsmith
33783174Smsmith/*****************************************************************************
33883174Smsmith *
33983174Smsmith * FUNCTION:    AcpiUtHexToAsciiChar
34083174Smsmith *
34183174Smsmith * PARAMETERS:  Integer             - Contains the hex digit
34283174Smsmith *              Position            - bit position of the digit within the
34383174Smsmith *                                    integer
34483174Smsmith *
34583174Smsmith * RETURN:      Ascii character
34683174Smsmith *
34783174Smsmith * DESCRIPTION: Convert a hex digit to an ascii character
34883174Smsmith *
34983174Smsmith ****************************************************************************/
35083174Smsmith
35182367SmsmithUINT8
35282367SmsmithAcpiUtHexToAsciiChar (
35382367Smsmith    ACPI_INTEGER            Integer,
35482367Smsmith    UINT32                  Position)
35582367Smsmith{
35671867Smsmith
35782367Smsmith    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
35882367Smsmith}
35982367Smsmith
36083174Smsmith
36167754Smsmith/******************************************************************************
36267754Smsmith *
36391116Smsmith * Table name globals
36467754Smsmith *
36569450Smsmith * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes.
36669450Smsmith * it is NOT an exhaustive list of all possible ACPI tables.  All ACPI tables
36769450Smsmith * that are not used by the subsystem are simply ignored.
36869450Smsmith *
36991116Smsmith * Do NOT add any table to this list that is not consumed directly by this
37091116Smsmith * subsystem.
37191116Smsmith *
37267754Smsmith ******************************************************************************/
37367754Smsmith
37467754Smsmith
37567754SmsmithACPI_TABLE_DESC             AcpiGbl_AcpiTables[NUM_ACPI_TABLES];
37667754Smsmith
37767754Smsmith
37867754SmsmithACPI_TABLE_SUPPORT          AcpiGbl_AcpiTableData[NUM_ACPI_TABLES] =
37967754Smsmith{
38091116Smsmith    /***********    Name,   Signature, Global typed pointer     Signature size,      How many allowed?,    Contains valid AML? */
38167754Smsmith
38291116Smsmith    /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL,                    sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE},
38391116Smsmith    /* DSDT 1 */ {DSDT_SIG,  DSDT_SIG, (void **) &AcpiGbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE   | ACPI_TABLE_EXECUTABLE},
38491116Smsmith    /* FADT 2 */ {FADT_SIG,  FADT_SIG, (void **) &AcpiGbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE},
38591116Smsmith    /* FACS 3 */ {FACS_SIG,  FACS_SIG, (void **) &AcpiGbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE},
38691116Smsmith    /* PSDT 4 */ {PSDT_SIG,  PSDT_SIG, NULL,                    sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
38791116Smsmith    /* SSDT 5 */ {SSDT_SIG,  SSDT_SIG, NULL,                    sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE},
38891116Smsmith    /* XSDT 6 */ {XSDT_SIG,  XSDT_SIG, NULL,                    sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE},
38967754Smsmith};
39067754Smsmith
39167754Smsmith
39291116Smsmith/******************************************************************************
39391116Smsmith *
39491116Smsmith * Event and Hardware globals
39591116Smsmith *
39691116Smsmith ******************************************************************************/
39791116Smsmith
39891116SmsmithACPI_BIT_REGISTER_INFO      AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] =
39991116Smsmith{
40091116Smsmith    /* Name                                     Parent Register             Register Bit Position                   Register Bit Mask       */
40191116Smsmith
40291116Smsmith    /* ACPI_BITREG_TIMER_STATUS         */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_TIMER_STATUS,          ACPI_BITMASK_TIMER_STATUS},
40391116Smsmith    /* ACPI_BITREG_BUS_MASTER_STATUS    */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_BUS_MASTER_STATUS,     ACPI_BITMASK_BUS_MASTER_STATUS},
40491116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_STATUS   */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_STATUS},
40591116Smsmith    /* ACPI_BITREG_POWER_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_STATUS},
40691116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_STATUS},
40791116Smsmith    /* ACPI_BITREG_RT_CLOCK_STATUS      */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_STATUS},
40891116Smsmith    /* ACPI_BITREG_WAKE_STATUS          */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_WAKE_STATUS,           ACPI_BITMASK_WAKE_STATUS},
40991116Smsmith
41091116Smsmith    /* ACPI_BITREG_TIMER_ENABLE         */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_TIMER_ENABLE,          ACPI_BITMASK_TIMER_ENABLE},
41191116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_ENABLE   */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
41291116Smsmith    /* ACPI_BITREG_POWER_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_POWER_BUTTON_ENABLE,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
41391116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
41491116Smsmith    /* ACPI_BITREG_RT_CLOCK_ENABLE      */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_RT_CLOCK_ENABLE,       ACPI_BITMASK_RT_CLOCK_ENABLE},
41591116Smsmith    /* ACPI_BITREG_WAKE_ENABLE          */   {ACPI_REGISTER_PM1_ENABLE,   0,                                      0},
41691116Smsmith
41791116Smsmith    /* ACPI_BITREG_SCI_ENABLE           */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SCI_ENABLE,            ACPI_BITMASK_SCI_ENABLE},
41891116Smsmith    /* ACPI_BITREG_BUS_MASTER_RLD       */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_BUS_MASTER_RLD,        ACPI_BITMASK_BUS_MASTER_RLD},
41991116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_RELEASE  */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE,   ACPI_BITMASK_GLOBAL_LOCK_RELEASE},
42091116Smsmith    /* ACPI_BITREG_SLEEP_TYPE_A         */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_TYPE_X,          ACPI_BITMASK_SLEEP_TYPE_X},
42191116Smsmith    /* ACPI_BITREG_SLEEP_TYPE_B         */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_TYPE_X,          ACPI_BITMASK_SLEEP_TYPE_X},
42291116Smsmith    /* ACPI_BITREG_SLEEP_ENABLE         */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_ENABLE,          ACPI_BITMASK_SLEEP_ENABLE},
42391116Smsmith
42491116Smsmith    /* ACPI_BITREG_ARB_DIS              */   {ACPI_REGISTER_PM2_CONTROL,  ACPI_BITPOSITION_ARB_DISABLE,           ACPI_BITMASK_ARB_DISABLE}
42591116Smsmith};
42691116Smsmith
42791116Smsmith
42891116SmsmithACPI_FIXED_EVENT_INFO       AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
42991116Smsmith{
43091116Smsmith    /* ACPI_EVENT_PMTIMER       */  {ACPI_BITREG_TIMER_STATUS,          ACPI_BITREG_TIMER_ENABLE,        ACPI_BITMASK_TIMER_STATUS,          ACPI_BITMASK_TIMER_ENABLE},
43191116Smsmith    /* ACPI_EVENT_GLOBAL        */  {ACPI_BITREG_GLOBAL_LOCK_STATUS,    ACPI_BITREG_GLOBAL_LOCK_ENABLE,  ACPI_BITMASK_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
43291116Smsmith    /* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
43391116Smsmith    /* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
43491116Smsmith    /* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     0,                                  0},
43591116Smsmith};
43691116Smsmith
43791116Smsmith/*****************************************************************************
43891116Smsmith *
43991116Smsmith * FUNCTION:    AcpiUtGetRegionName
44091116Smsmith *
44191116Smsmith * PARAMETERS:  None.
44291116Smsmith *
44391116Smsmith * RETURN:      Status
44491116Smsmith *
44591116Smsmith * DESCRIPTION: Translate a Space ID into a name string (Debug only)
44691116Smsmith *
44791116Smsmith ****************************************************************************/
44891116Smsmith
44991116Smsmith/* Region type decoding */
45091116Smsmith
45191116Smsmithconst NATIVE_CHAR *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
45291116Smsmith{
45391116Smsmith    "SystemMemory",
45491116Smsmith    "SystemIO",
45591116Smsmith    "PCIConfig",
45691116Smsmith    "EmbeddedControl",
45791116Smsmith    "SMBus",
45891116Smsmith    "CMOS",
45991116Smsmith    "PCIBarTarget",
46091116Smsmith    "DataTable",
46191116Smsmith};
46291116Smsmith
46391116Smsmith
46491116SmsmithNATIVE_CHAR *
46591116SmsmithAcpiUtGetRegionName (
46691116Smsmith    UINT8                   SpaceId)
46791116Smsmith{
46891116Smsmith
46991116Smsmith    if (SpaceId >= ACPI_USER_REGION_BEGIN)
47091116Smsmith    {
47191116Smsmith        return ("UserDefinedRegion");
47291116Smsmith    }
47391116Smsmith
47491116Smsmith    else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
47591116Smsmith    {
47691116Smsmith        return ("InvalidSpaceID");
47791116Smsmith    }
47891116Smsmith
47991116Smsmith    return ((NATIVE_CHAR *) AcpiGbl_RegionTypes[SpaceId]);
48091116Smsmith}
48191116Smsmith
48291116Smsmith
48391116Smsmith/*****************************************************************************
48491116Smsmith *
48591116Smsmith * FUNCTION:    AcpiUtGetEventName
48691116Smsmith *
48791116Smsmith * PARAMETERS:  None.
48891116Smsmith *
48991116Smsmith * RETURN:      Status
49091116Smsmith *
49191116Smsmith * DESCRIPTION: Translate a Event ID into a name string (Debug only)
49291116Smsmith *
49391116Smsmith ****************************************************************************/
49491116Smsmith
49591116Smsmith/* Event type decoding */
49691116Smsmith
49791116Smsmithconst NATIVE_CHAR *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
49891116Smsmith{
49991116Smsmith    "PM_Timer",
50091116Smsmith    "GlobalLock",
50191116Smsmith    "PowerButton",
50291116Smsmith    "SleepButton",
50391116Smsmith    "RealTimeClock",
50491116Smsmith};
50591116Smsmith
50691116Smsmith
50791116SmsmithNATIVE_CHAR *
50891116SmsmithAcpiUtGetEventName (
50991116Smsmith    UINT32                  EventId)
51091116Smsmith{
51191116Smsmith
51291116Smsmith    if (EventId > ACPI_EVENT_MAX)
51391116Smsmith    {
51491116Smsmith        return ("InvalidEventID");
51591116Smsmith    }
51691116Smsmith
51791116Smsmith    return ((NATIVE_CHAR *) AcpiGbl_EventTypes[EventId]);
51891116Smsmith}
51991116Smsmith
52091116Smsmith
52167754Smsmith#ifdef ACPI_DEBUG
52267754Smsmith
52383174Smsmith/*
52467754Smsmith * Strings and procedures used for debug only
52567754Smsmith *
52683174Smsmith */
52767754Smsmith
52867754Smsmith
52967754Smsmith/*****************************************************************************
53067754Smsmith *
53177424Smsmith * FUNCTION:    AcpiUtGetMutexName
53267754Smsmith *
53367754Smsmith * PARAMETERS:  None.
53467754Smsmith *
53567754Smsmith * RETURN:      Status
53667754Smsmith *
53767754Smsmith * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
53867754Smsmith *
53967754Smsmith ****************************************************************************/
54067754Smsmith
54167754SmsmithNATIVE_CHAR *
54277424SmsmithAcpiUtGetMutexName (
54367754Smsmith    UINT32                  MutexId)
54467754Smsmith{
54567754Smsmith
54667754Smsmith    if (MutexId > MAX_MTX)
54767754Smsmith    {
54867754Smsmith        return ("Invalid Mutex ID");
54967754Smsmith    }
55067754Smsmith
55167754Smsmith    return (AcpiGbl_MutexNames[MutexId]);
55267754Smsmith}
55367754Smsmith
55467754Smsmith
55591116Smsmith/*****************************************************************************
55691116Smsmith *
55791116Smsmith * FUNCTION:    AcpiUtGetTypeName
55891116Smsmith *
55991116Smsmith * PARAMETERS:  None.
56091116Smsmith *
56191116Smsmith * RETURN:      Status
56291116Smsmith *
56391116Smsmith * DESCRIPTION: Translate a Type ID into a name string (Debug only)
56491116Smsmith *
56591116Smsmith ****************************************************************************/
56691116Smsmith
56767754Smsmith/*
56867754Smsmith * Elements of AcpiGbl_NsTypeNames below must match
56967754Smsmith * one-to-one with values of ACPI_OBJECT_TYPE
57067754Smsmith *
57167754Smsmith * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when
57267754Smsmith * stored in a table it really means that we have thus far seen no evidence to
57367754Smsmith * indicatewhat type is actually going to be stored for this entry.
57467754Smsmith */
57567754Smsmith
57683174Smsmithstatic const NATIVE_CHAR    AcpiGbl_BadType[] = "UNDEFINED";
57785756Smsmith#define TYPE_NAME_LENGTH    12                           /* Maximum length of each string */
57867754Smsmith
57983174Smsmithstatic const NATIVE_CHAR    *AcpiGbl_NsTypeNames[] =    /* printable names of ACPI types */
58067754Smsmith{
58167754Smsmith    /* 00 */ "Untyped",
58271867Smsmith    /* 01 */ "Integer",
58367754Smsmith    /* 02 */ "String",
58467754Smsmith    /* 03 */ "Buffer",
58567754Smsmith    /* 04 */ "Package",
58667754Smsmith    /* 05 */ "FieldUnit",
58767754Smsmith    /* 06 */ "Device",
58867754Smsmith    /* 07 */ "Event",
58967754Smsmith    /* 08 */ "Method",
59067754Smsmith    /* 09 */ "Mutex",
59167754Smsmith    /* 10 */ "Region",
59267754Smsmith    /* 11 */ "Power",
59367754Smsmith    /* 12 */ "Processor",
59467754Smsmith    /* 13 */ "Thermal",
59585756Smsmith    /* 14 */ "BufferField",
59667754Smsmith    /* 15 */ "DdbHandle",
59785756Smsmith    /* 16 */ "DebugObject",
59885756Smsmith    /* 17 */ "RegionField",
59977424Smsmith    /* 18 */ "BankField",
60085756Smsmith    /* 19 */ "IndexField",
60167754Smsmith    /* 20 */ "Reference",
60267754Smsmith    /* 21 */ "Alias",
60367754Smsmith    /* 22 */ "Notify",
60485756Smsmith    /* 23 */ "AddrHandler",
60585756Smsmith    /* 24 */ "ResourceDesc",
60685756Smsmith    /* 25 */ "ResourceFld",
60785756Smsmith    /* 26 */ "RegionFldDfn",
60885756Smsmith    /* 27 */ "BankFldDfn",
60985756Smsmith    /* 28 */ "IndexFldDfn",
61078986Smsmith    /* 29 */ "If",
61178986Smsmith    /* 30 */ "Else",
61278986Smsmith    /* 31 */ "While",
61378986Smsmith    /* 32 */ "Scope",
61478986Smsmith    /* 33 */ "DefAny",
61578986Smsmith    /* 34 */ "Extra",
61687031Smsmith    /* 35 */ "Data",
61787031Smsmith    /* 36 */ "Invalid"
61867754Smsmith};
61967754Smsmith
62067754Smsmith
62167754SmsmithNATIVE_CHAR *
62277424SmsmithAcpiUtGetTypeName (
62391116Smsmith    ACPI_OBJECT_TYPE        Type)
62467754Smsmith{
62567754Smsmith
62667754Smsmith    if (Type > INTERNAL_TYPE_INVALID)
62767754Smsmith    {
62883174Smsmith        return ((NATIVE_CHAR *) AcpiGbl_BadType);
62967754Smsmith    }
63067754Smsmith
63183174Smsmith    return ((NATIVE_CHAR *) AcpiGbl_NsTypeNames[Type]);
63267754Smsmith}
63367754Smsmith
63469746Smsmith
63569746Smsmith/* Data used in keeping track of fields */
63669746Smsmith
63783174Smsmithconst NATIVE_CHAR *AcpiGbl_FENames[NUM_FIELD_NAMES] =
63869746Smsmith{
63969746Smsmith    "skip",
64069746Smsmith    "?access?"
64169746Smsmith};              /* FE = Field Element */
64269746Smsmith
64369746Smsmith
64483174Smsmithconst NATIVE_CHAR *AcpiGbl_MatchOps[NUM_MATCH_OPS] =
64569746Smsmith{
64669746Smsmith    "Error",
64769746Smsmith    "MTR",
64869746Smsmith    "MEQ",
64969746Smsmith    "MLE",
65069746Smsmith    "MLT",
65169746Smsmith    "MGE",
65269746Smsmith    "MGT"
65369746Smsmith};
65469746Smsmith
65569746Smsmith
65669746Smsmith/* Access type decoding */
65769746Smsmith
65883174Smsmithconst NATIVE_CHAR *AcpiGbl_AccessTypes[NUM_ACCESS_TYPES] =
65969746Smsmith{
66069746Smsmith    "AnyAcc",
66169746Smsmith    "ByteAcc",
66269746Smsmith    "WordAcc",
66369746Smsmith    "DWordAcc",
66487031Smsmith    "QWordAcc",
66587031Smsmith    "BufferAcc",
66669746Smsmith};
66769746Smsmith
66869746Smsmith
66969746Smsmith/* Update rule decoding */
67069746Smsmith
67183174Smsmithconst NATIVE_CHAR *AcpiGbl_UpdateRules[NUM_UPDATE_RULES] =
67269746Smsmith{
67369746Smsmith    "Preserve",
67469746Smsmith    "WriteAsOnes",
67569746Smsmith    "WriteAsZeros"
67669746Smsmith};
67769746Smsmith
67867754Smsmith#endif
67967754Smsmith
68067754Smsmith
68167754Smsmith/*****************************************************************************
68267754Smsmith *
68377424Smsmith * FUNCTION:    AcpiUtValidObjectType
68467754Smsmith *
68567754Smsmith * PARAMETERS:  None.
68667754Smsmith *
68767754Smsmith * RETURN:      TRUE if valid object type
68867754Smsmith *
68967754Smsmith * DESCRIPTION: Validate an object type
69067754Smsmith *
69167754Smsmith ****************************************************************************/
69267754Smsmith
69367754SmsmithBOOLEAN
69477424SmsmithAcpiUtValidObjectType (
69591116Smsmith    ACPI_OBJECT_TYPE        Type)
69667754Smsmith{
69767754Smsmith
69867754Smsmith    if (Type > ACPI_TYPE_MAX)
69967754Smsmith    {
70067754Smsmith        if ((Type < INTERNAL_TYPE_BEGIN) ||
70167754Smsmith            (Type > INTERNAL_TYPE_MAX))
70267754Smsmith        {
70367754Smsmith            return (FALSE);
70467754Smsmith        }
70567754Smsmith    }
70667754Smsmith
70767754Smsmith    return (TRUE);
70867754Smsmith}
70967754Smsmith
71067754Smsmith
71167754Smsmith/****************************************************************************
71267754Smsmith *
71377424Smsmith * FUNCTION:    AcpiUtAllocateOwnerId
71467754Smsmith *
71567754Smsmith * PARAMETERS:  IdType          - Type of ID (method or table)
71667754Smsmith *
71767754Smsmith * DESCRIPTION: Allocate a table or method owner id
71867754Smsmith *
71967754Smsmith ***************************************************************************/
72067754Smsmith
72167754SmsmithACPI_OWNER_ID
72277424SmsmithAcpiUtAllocateOwnerId (
72367754Smsmith    UINT32                  IdType)
72467754Smsmith{
72567754Smsmith    ACPI_OWNER_ID           OwnerId = 0xFFFF;
72667754Smsmith
72767754Smsmith
72891116Smsmith    ACPI_FUNCTION_TRACE ("UtAllocateOwnerId");
72967754Smsmith
73067754Smsmith
73191116Smsmith    if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES)))
73291116Smsmith    {
73391116Smsmith        return (0);
73491116Smsmith    }
73567754Smsmith
73667754Smsmith    switch (IdType)
73767754Smsmith    {
73891116Smsmith    case ACPI_OWNER_TYPE_TABLE:
73967754Smsmith
74067754Smsmith        OwnerId = AcpiGbl_NextTableOwnerId;
74167754Smsmith        AcpiGbl_NextTableOwnerId++;
74267754Smsmith
74391116Smsmith        if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID)
74467754Smsmith        {
74591116Smsmith            AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID;
74667754Smsmith        }
74767754Smsmith        break;
74867754Smsmith
74967754Smsmith
75091116Smsmith    case ACPI_OWNER_TYPE_METHOD:
75167754Smsmith
75267754Smsmith        OwnerId = AcpiGbl_NextMethodOwnerId;
75367754Smsmith        AcpiGbl_NextMethodOwnerId++;
75467754Smsmith
75591116Smsmith        if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID)
75667754Smsmith        {
75791116Smsmith            AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID;
75867754Smsmith        }
75967754Smsmith        break;
76067754Smsmith    }
76167754Smsmith
76291116Smsmith    (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
76367754Smsmith    return_VALUE (OwnerId);
76467754Smsmith}
76567754Smsmith
76667754Smsmith
76767754Smsmith/****************************************************************************
76867754Smsmith *
76977424Smsmith * FUNCTION:    AcpiUtInitGlobals
77067754Smsmith *
77167754Smsmith * PARAMETERS:  none
77267754Smsmith *
77367754Smsmith * DESCRIPTION: Init library globals.  All globals that require specific
77467754Smsmith *              initialization should be initialized here!
77567754Smsmith *
77667754Smsmith ***************************************************************************/
77767754Smsmith
77867754Smsmithvoid
77977424SmsmithAcpiUtInitGlobals (
78067754Smsmith    void)
78167754Smsmith{
78267754Smsmith    UINT32                  i;
78367754Smsmith
78467754Smsmith
78591116Smsmith    ACPI_FUNCTION_TRACE ("UtInitGlobals");
78667754Smsmith
78782367Smsmith    /* Memory allocation and cache lists */
78882367Smsmith
78991116Smsmith    ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS);
79082367Smsmith
79191116Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset         = (UINT16) ACPI_PTR_DIFF (&(((ACPI_GENERIC_STATE *) NULL)->Common.Next), NULL);
79291116Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset        = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Next), NULL);
79391116Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset    = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE2_OBJECT *) NULL)->Next), NULL);
79491116Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset       = (UINT16) ACPI_PTR_DIFF (&(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next), NULL);
79591116Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset          = (UINT16) ACPI_PTR_DIFF (&(((ACPI_WALK_STATE *) NULL)->Next), NULL);
79682367Smsmith
79783174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize        = sizeof (ACPI_NAMESPACE_NODE);
79883174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize         = sizeof (ACPI_GENERIC_STATE);
79983174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize        = sizeof (ACPI_PARSE_OBJECT);
80083174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize    = sizeof (ACPI_PARSE2_OBJECT);
80183174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize       = sizeof (ACPI_OPERAND_OBJECT);
80283174Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize          = sizeof (ACPI_WALK_STATE);
80382367Smsmith
80482367Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth      = MAX_STATE_CACHE_DEPTH;
80582367Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth     = MAX_PARSE_CACHE_DEPTH;
80682367Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = MAX_EXTPARSE_CACHE_DEPTH;
80782367Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth    = MAX_OBJECT_CACHE_DEPTH;
80882367Smsmith    AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth       = MAX_WALK_CACHE_DEPTH;
80982367Smsmith
81083174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName       = "Global Memory Allocation");
81183174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName       = "Namespace Nodes");
81283174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName        = "State Object Cache");
81383174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName       = "Parse Node Cache");
81483174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName   = "Extended Parse Node Cache");
81583174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName      = "Operand Object Cache");
81683174Smsmith    ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName         = "Tree Walk Node Cache");
81782367Smsmith
81867754Smsmith    /* ACPI table structure */
81967754Smsmith
82067754Smsmith    for (i = 0; i < NUM_ACPI_TABLES; i++)
82167754Smsmith    {
82267754Smsmith        AcpiGbl_AcpiTables[i].Prev          = &AcpiGbl_AcpiTables[i];
82367754Smsmith        AcpiGbl_AcpiTables[i].Next          = &AcpiGbl_AcpiTables[i];
82467754Smsmith        AcpiGbl_AcpiTables[i].Pointer       = NULL;
82567754Smsmith        AcpiGbl_AcpiTables[i].Length        = 0;
82667754Smsmith        AcpiGbl_AcpiTables[i].Allocation    = ACPI_MEM_NOT_ALLOCATED;
82767754Smsmith        AcpiGbl_AcpiTables[i].Count         = 0;
82867754Smsmith    }
82967754Smsmith
83067754Smsmith    /* Mutex locked flags */
83167754Smsmith
83267754Smsmith    for (i = 0; i < NUM_MTX; i++)
83367754Smsmith    {
83467754Smsmith        AcpiGbl_AcpiMutexInfo[i].Mutex      = NULL;
83577424Smsmith        AcpiGbl_AcpiMutexInfo[i].OwnerId    = ACPI_MUTEX_NOT_ACQUIRED;
83667754Smsmith        AcpiGbl_AcpiMutexInfo[i].UseCount   = 0;
83767754Smsmith    }
83867754Smsmith
83967754Smsmith    /* Global notify handlers */
84067754Smsmith
84167754Smsmith    AcpiGbl_SysNotify.Handler           = NULL;
84267754Smsmith    AcpiGbl_DrvNotify.Handler           = NULL;
84367754Smsmith
84467754Smsmith    /* Global "typed" ACPI table pointers */
84567754Smsmith
84667754Smsmith    AcpiGbl_RSDP                        = NULL;
84769450Smsmith    AcpiGbl_XSDT                        = NULL;
84867754Smsmith    AcpiGbl_FACS                        = NULL;
84969450Smsmith    AcpiGbl_FADT                        = NULL;
85067754Smsmith    AcpiGbl_DSDT                        = NULL;
85167754Smsmith
85267754Smsmith    /* Global Lock support */
85367754Smsmith
85467754Smsmith    AcpiGbl_GlobalLockAcquired          = FALSE;
85567754Smsmith    AcpiGbl_GlobalLockThreadCount       = 0;
85691116Smsmith    AcpiGbl_GlobalLockHandle            = 0;
85767754Smsmith
85867754Smsmith    /* Miscellaneous variables */
85967754Smsmith
86067754Smsmith    AcpiGbl_RsdpOriginalLocation        = 0;
86167754Smsmith    AcpiGbl_CmSingleStep                = FALSE;
86267754Smsmith    AcpiGbl_DbTerminateThreads          = FALSE;
86367754Smsmith    AcpiGbl_Shutdown                    = FALSE;
86467754Smsmith    AcpiGbl_NsLookupCount               = 0;
86567754Smsmith    AcpiGbl_PsFindCount                 = 0;
86667754Smsmith    AcpiGbl_AcpiHardwarePresent         = TRUE;
86791116Smsmith    AcpiGbl_NextTableOwnerId            = ACPI_FIRST_TABLE_ID;
86891116Smsmith    AcpiGbl_NextMethodOwnerId           = ACPI_FIRST_METHOD_ID;
86967754Smsmith    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
87091116Smsmith    AcpiGbl_DbOutputFlags               = ACPI_DB_CONSOLE_OUTPUT;
87167754Smsmith
87267754Smsmith    /* Hardware oriented */
87367754Smsmith
87491116Smsmith    AcpiGbl_GpeRegisterInfo             = NULL;
87591116Smsmith    AcpiGbl_GpeNumberInfo               = NULL;
87667754Smsmith
87767754Smsmith    /* Namespace */
87867754Smsmith
87967754Smsmith    AcpiGbl_RootNode                    = NULL;
88067754Smsmith
88167754Smsmith    AcpiGbl_RootNodeStruct.Name         = ACPI_ROOT_NAME;
88291116Smsmith    AcpiGbl_RootNodeStruct.Descriptor   = ACPI_DESC_TYPE_NAMED;
88367754Smsmith    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_ANY;
88467754Smsmith    AcpiGbl_RootNodeStruct.Child        = NULL;
88567754Smsmith    AcpiGbl_RootNodeStruct.Peer         = NULL;
88667754Smsmith    AcpiGbl_RootNodeStruct.Object       = NULL;
88767754Smsmith    AcpiGbl_RootNodeStruct.Flags        = ANOBJ_END_OF_PEER_LIST;
88867754Smsmith
88967754Smsmith
89083174Smsmith#ifdef ACPI_DEBUG
89183174Smsmith    AcpiGbl_LowestStackPointer          = ACPI_UINT32_MAX;
89283174Smsmith#endif
89383174Smsmith
89467754Smsmith    return_VOID;
89567754Smsmith}
89667754Smsmith
89767754Smsmith
898