utglobal.c revision 197104
167754Smsmith/******************************************************************************
267754Smsmith *
377424Smsmith * Module Name: utglobal - Global variables for the ACPI subsystem
467754Smsmith *
567754Smsmith *****************************************************************************/
667754Smsmith
767754Smsmith/******************************************************************************
867754Smsmith *
967754Smsmith * 1. Copyright Notice
1067754Smsmith *
11193267Sjkim * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
1270243Smsmith * All rights reserved.
1367754Smsmith *
1467754Smsmith * 2. License
1567754Smsmith *
1667754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property
1767754Smsmith * rights.  You may have additional license terms from the party that provided
1867754Smsmith * you this software, covering your right to use that party's intellectual
1967754Smsmith * property rights.
2067754Smsmith *
2167754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2267754Smsmith * copy of the source code appearing in this file ("Covered Code") an
2367754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2467754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy,
2567754Smsmith * make derivatives, distribute, use and display any portion of the Covered
2667754Smsmith * Code in any form, with the right to sublicense such rights; and
2767754Smsmith *
2867754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
2967754Smsmith * license (with the right to sublicense), under only those claims of Intel
3067754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell,
3167754Smsmith * offer to sell, and import the Covered Code and derivative works thereof
3267754Smsmith * solely to the minimum extent necessary to exercise the above copyright
3367754Smsmith * license, and in no event shall the patent license extend to any additions
3467754Smsmith * to or modifications of the Original Intel Code.  No other license or right
3567754Smsmith * is granted directly or by implication, estoppel or otherwise;
3667754Smsmith *
3767754Smsmith * The above copyright and patent license is granted only if the following
3867754Smsmith * conditions are met:
3967754Smsmith *
4067754Smsmith * 3. Conditions
4167754Smsmith *
4267754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4367754Smsmith * Redistribution of source code of any substantial portion of the Covered
4467754Smsmith * Code or modification with rights to further distribute source must include
4567754Smsmith * the above Copyright Notice, the above License, this list of Conditions,
4667754Smsmith * and the following Disclaimer and Export Compliance provision.  In addition,
4767754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to
4867754Smsmith * contain a file documenting the changes Licensee made to create that Covered
4967754Smsmith * Code and the date of any change.  Licensee must include in that file the
5067754Smsmith * documentation of any changes made by any predecessor Licensee.  Licensee
5167754Smsmith * must include a prominent statement that the modification is derived,
5267754Smsmith * directly or indirectly, from Original Intel Code.
5367754Smsmith *
5467754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5567754Smsmith * Redistribution of source code of any substantial portion of the Covered
5667754Smsmith * Code or modification without rights to further distribute source must
5767754Smsmith * include the following Disclaimer and Export Compliance provision in the
5867754Smsmith * documentation and/or other materials provided with distribution.  In
5967754Smsmith * addition, Licensee may not authorize further sublicense of source of any
6067754Smsmith * portion of the Covered Code, and must include terms to the effect that the
6167754Smsmith * license from Licensee to its licensee is limited to the intellectual
6267754Smsmith * property embodied in the software Licensee provides to its licensee, and
6367754Smsmith * not to intellectual property embodied in modifications its licensee may
6467754Smsmith * make.
6567754Smsmith *
6667754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any
6767754Smsmith * substantial portion of the Covered Code or modification must reproduce the
6867754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance
6967754Smsmith * provision in the documentation and/or other materials provided with the
7067754Smsmith * distribution.
7167754Smsmith *
7267754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original
7367754Smsmith * Intel Code.
7467754Smsmith *
7567754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7667754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or
7767754Smsmith * other dealings in products derived from or relating to the Covered Code
7867754Smsmith * without prior written authorization from Intel.
7967754Smsmith *
8067754Smsmith * 4. Disclaimer and Export Compliance
8167754Smsmith *
8267754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8367754Smsmith * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8467754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8567754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8667754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8767754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8867754Smsmith * PARTICULAR PURPOSE.
8967754Smsmith *
9067754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9167754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9267754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9367754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9467754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9567754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9667754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9767754Smsmith * LIMITED REMEDY.
9867754Smsmith *
9967754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this
10067754Smsmith * software or system incorporating such software without first obtaining any
10167754Smsmith * required license or other approval from the U. S. Department of Commerce or
10267754Smsmith * any other agency or department of the United States Government.  In the
10367754Smsmith * event Licensee exports any such software from the United States or
10467754Smsmith * re-exports any such software from a foreign destination, Licensee shall
10567754Smsmith * ensure that the distribution and export/re-export of the software is in
10667754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the
10767754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10867754Smsmith * any of its subsidiaries will export/re-export any technical data, process,
10967754Smsmith * software, or service, directly or indirectly, to any country for which the
11067754Smsmith * United States government or any agency thereof requires an export license,
11167754Smsmith * other governmental approval, or letter of assurance, without first obtaining
11267754Smsmith * such license, approval or letter.
11367754Smsmith *
11467754Smsmith *****************************************************************************/
11567754Smsmith
11677424Smsmith#define __UTGLOBAL_C__
11767754Smsmith#define DEFINE_ACPI_GLOBALS
11867754Smsmith
119193341Sjkim#include <contrib/dev/acpica/include/acpi.h>
120193341Sjkim#include <contrib/dev/acpica/include/accommon.h>
121193341Sjkim#include <contrib/dev/acpica/include/acnamesp.h>
12267754Smsmith
12377424Smsmith#define _COMPONENT          ACPI_UTILITIES
12491116Smsmith        ACPI_MODULE_NAME    ("utglobal")
12567754Smsmith
12667754Smsmith
127151937Sjkim/*******************************************************************************
12867754Smsmith *
12967754Smsmith * Static global variable initialization.
13067754Smsmith *
13167754Smsmith ******************************************************************************/
13267754Smsmith
13367754Smsmith/*
13467754Smsmith * We want the debug switches statically initialized so they
13567754Smsmith * are already set when the debugger is entered.
13667754Smsmith */
13767754Smsmith
13867754Smsmith/* Debug switch - level and trace mask */
13967754Smsmith
140102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT
141114237SnjlUINT32                      AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
14267754Smsmith#else
143114237SnjlUINT32                      AcpiDbgLevel = ACPI_NORMAL_DEFAULT;
14467754Smsmith#endif
14567754Smsmith
14667754Smsmith/* Debug switch - layer (component) mask */
14767754Smsmith
14877424SmsmithUINT32                      AcpiDbgLayer = ACPI_COMPONENT_DEFAULT;
14967754SmsmithUINT32                      AcpiGbl_NestingLevel = 0;
15067754Smsmith
15167754Smsmith/* Debugger globals */
15267754Smsmith
15367754SmsmithBOOLEAN                     AcpiGbl_DbTerminateThreads = FALSE;
154114237SnjlBOOLEAN                     AcpiGbl_AbortMethod = FALSE;
15567754SmsmithBOOLEAN                     AcpiGbl_MethodExecuting = FALSE;
15667754Smsmith
15767754Smsmith/* System flags */
15867754Smsmith
15967754SmsmithUINT32                      AcpiGbl_StartupFlags = 0;
16067754Smsmith
16187031Smsmith/* System starts uninitialized */
16283174Smsmith
16367754SmsmithBOOLEAN                     AcpiGbl_Shutdown = TRUE;
16467754Smsmith
165129684Snjlconst char                  *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
166129684Snjl{
167129684Snjl    "\\_S0_",
168129684Snjl    "\\_S1_",
169129684Snjl    "\\_S2_",
170129684Snjl    "\\_S3_",
171129684Snjl    "\\_S4_",
172129684Snjl    "\\_S5_"
173129684Snjl};
17469450Smsmith
175197104Sjkimconst char                  *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] =
176129684Snjl{
177197104Sjkim    "_S0W",
178197104Sjkim    "_S1W",
179197104Sjkim    "_S2W",
180197104Sjkim    "_S3W",
181197104Sjkim    "_S4W"
182197104Sjkim};
183197104Sjkim
184197104Sjkimconst char                  *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] =
185197104Sjkim{
186129684Snjl    "_S1D",
187129684Snjl    "_S2D",
188129684Snjl    "_S3D",
189129684Snjl    "_S4D"
190129684Snjl};
19169450Smsmith
192167802Sjkim
193167802Sjkim/*******************************************************************************
194167802Sjkim *
195167802Sjkim * FUNCTION:    AcpiFormatException
196167802Sjkim *
197167802Sjkim * PARAMETERS:  Status       - The ACPI_STATUS code to be formatted
198167802Sjkim *
199167802Sjkim * RETURN:      A string containing the exception text. A valid pointer is
200167802Sjkim *              always returned.
201167802Sjkim *
202167802Sjkim * DESCRIPTION: This function translates an ACPI exception into an ASCII string
203167802Sjkim *              It is here instead of utxface.c so it is always present.
204167802Sjkim *
205167802Sjkim ******************************************************************************/
206167802Sjkim
207167802Sjkimconst char *
208167802SjkimAcpiFormatException (
209167802Sjkim    ACPI_STATUS             Status)
210129684Snjl{
211167802Sjkim    const char              *Exception = NULL;
212151937Sjkim
213151937Sjkim
214167802Sjkim    ACPI_FUNCTION_ENTRY ();
215151937Sjkim
216127175Snjl
217167802Sjkim    Exception = AcpiUtValidateException (Status);
218167802Sjkim    if (!Exception)
219167802Sjkim    {
220167802Sjkim        /* Exception code was not recognized */
221127175Snjl
222167802Sjkim        ACPI_ERROR ((AE_INFO,
223167802Sjkim            "Unknown exception code: 0x%8.8X", Status));
224167802Sjkim
225167802Sjkim        Exception = "UNKNOWN_STATUS_CODE";
226167802Sjkim    }
227167802Sjkim
228167802Sjkim    return (ACPI_CAST_PTR (const char, Exception));
229167802Sjkim}
230167802Sjkim
231167802SjkimACPI_EXPORT_SYMBOL (AcpiFormatException)
232167802Sjkim
233167802Sjkim
234151937Sjkim/*******************************************************************************
23567754Smsmith *
23667754Smsmith * Namespace globals
23767754Smsmith *
23867754Smsmith ******************************************************************************/
23967754Smsmith
24067754Smsmith/*
241104470Siwasaki * Predefined ACPI Names (Built-in to the Interpreter)
24267754Smsmith *
24377424Smsmith * NOTES:
244127175Snjl * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
24577424Smsmith *    during the initialization sequence.
246151937Sjkim * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
247151937Sjkim *    perform a Notify() operation on it.
24867754Smsmith */
24991116Smsmithconst ACPI_PREDEFINED_NAMES     AcpiGbl_PreDefinedNames[] =
25067754Smsmith{
251107325Siwasaki    {"_GPE",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
252107325Siwasaki    {"_PR_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
25399679Siwasaki    {"_SB_",    ACPI_TYPE_DEVICE,           NULL},
254107325Siwasaki    {"_SI_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
255129684Snjl    {"_TZ_",    ACPI_TYPE_THERMAL,          NULL},
256151937Sjkim    {"_REV",    ACPI_TYPE_INTEGER,          (char *) ACPI_CA_SUPPORT_LEVEL},
25799146Siwasaki    {"_OS_",    ACPI_TYPE_STRING,           ACPI_OS_NAME},
258151937Sjkim    {"_GL_",    ACPI_TYPE_MUTEX,            (char *) 1},
259102550Siwasaki
260127175Snjl#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
261151937Sjkim    {"_OSI",    ACPI_TYPE_METHOD,           (char *) 1},
262102550Siwasaki#endif
263151937Sjkim
264151937Sjkim    /* Table terminator */
265151937Sjkim
266151937Sjkim    {NULL,      ACPI_TYPE_ANY,              NULL}
26767754Smsmith};
26867754Smsmith
26967754Smsmith/*
27067754Smsmith * Properties of the ACPI Object Types, both internal and external.
271104470Siwasaki * The table is indexed by values of ACPI_OBJECT_TYPE
27267754Smsmith */
273193267Sjkimconst UINT8                     AcpiGbl_NsProperties[ACPI_NUM_NS_TYPES] =
27467754Smsmith{
27591116Smsmith    ACPI_NS_NORMAL,                     /* 00 Any              */
27691116Smsmith    ACPI_NS_NORMAL,                     /* 01 Number           */
27791116Smsmith    ACPI_NS_NORMAL,                     /* 02 String           */
27891116Smsmith    ACPI_NS_NORMAL,                     /* 03 Buffer           */
27999146Siwasaki    ACPI_NS_NORMAL,                     /* 04 Package          */
28091116Smsmith    ACPI_NS_NORMAL,                     /* 05 FieldUnit        */
28199146Siwasaki    ACPI_NS_NEWSCOPE,                   /* 06 Device           */
28299146Siwasaki    ACPI_NS_NORMAL,                     /* 07 Event            */
28399146Siwasaki    ACPI_NS_NEWSCOPE,                   /* 08 Method           */
28499146Siwasaki    ACPI_NS_NORMAL,                     /* 09 Mutex            */
28599146Siwasaki    ACPI_NS_NORMAL,                     /* 10 Region           */
28699146Siwasaki    ACPI_NS_NEWSCOPE,                   /* 11 Power            */
28799146Siwasaki    ACPI_NS_NEWSCOPE,                   /* 12 Processor        */
28899146Siwasaki    ACPI_NS_NEWSCOPE,                   /* 13 Thermal          */
28991116Smsmith    ACPI_NS_NORMAL,                     /* 14 BufferField      */
29091116Smsmith    ACPI_NS_NORMAL,                     /* 15 DdbHandle        */
29191116Smsmith    ACPI_NS_NORMAL,                     /* 16 Debug Object     */
29291116Smsmith    ACPI_NS_NORMAL,                     /* 17 DefField         */
29391116Smsmith    ACPI_NS_NORMAL,                     /* 18 BankField        */
29491116Smsmith    ACPI_NS_NORMAL,                     /* 19 IndexField       */
29591116Smsmith    ACPI_NS_NORMAL,                     /* 20 Reference        */
29691116Smsmith    ACPI_NS_NORMAL,                     /* 21 Alias            */
297128212Snjl    ACPI_NS_NORMAL,                     /* 22 MethodAlias      */
298128212Snjl    ACPI_NS_NORMAL,                     /* 23 Notify           */
299128212Snjl    ACPI_NS_NORMAL,                     /* 24 Address Handler  */
300128212Snjl    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 25 Resource Desc    */
301128212Snjl    ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL,   /* 26 Resource Field   */
302128212Snjl    ACPI_NS_NEWSCOPE,                   /* 27 Scope            */
303128212Snjl    ACPI_NS_NORMAL,                     /* 28 Extra            */
304128212Snjl    ACPI_NS_NORMAL,                     /* 29 Data             */
305128212Snjl    ACPI_NS_NORMAL                      /* 30 Invalid          */
30667754Smsmith};
30767754Smsmith
30867754Smsmith
30971867Smsmith/* Hex to ASCII conversion table */
31071867Smsmith
311114237Snjlstatic const char           AcpiGbl_HexToAscii[] =
312151937Sjkim{
313151937Sjkim    '0','1','2','3','4','5','6','7',
314151937Sjkim    '8','9','A','B','C','D','E','F'
315151937Sjkim};
31671867Smsmith
317151937Sjkim
318151937Sjkim/*******************************************************************************
31983174Smsmith *
32083174Smsmith * FUNCTION:    AcpiUtHexToAsciiChar
32183174Smsmith *
32283174Smsmith * PARAMETERS:  Integer             - Contains the hex digit
32383174Smsmith *              Position            - bit position of the digit within the
324151937Sjkim *                                    integer (multiple of 4)
32583174Smsmith *
326151937Sjkim * RETURN:      The converted Ascii character
32783174Smsmith *
328151937Sjkim * DESCRIPTION: Convert a hex digit to an Ascii character
32983174Smsmith *
330151937Sjkim ******************************************************************************/
33183174Smsmith
33299679Siwasakichar
33382367SmsmithAcpiUtHexToAsciiChar (
33482367Smsmith    ACPI_INTEGER            Integer,
33582367Smsmith    UINT32                  Position)
33682367Smsmith{
33771867Smsmith
33882367Smsmith    return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]);
33982367Smsmith}
34082367Smsmith
34183174Smsmith
34291116Smsmith/******************************************************************************
34391116Smsmith *
34491116Smsmith * Event and Hardware globals
34591116Smsmith *
34691116Smsmith ******************************************************************************/
34791116Smsmith
34891116SmsmithACPI_BIT_REGISTER_INFO      AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] =
34991116Smsmith{
35091116Smsmith    /* Name                                     Parent Register             Register Bit Position                   Register Bit Mask       */
35191116Smsmith
35291116Smsmith    /* ACPI_BITREG_TIMER_STATUS         */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_TIMER_STATUS,          ACPI_BITMASK_TIMER_STATUS},
35391116Smsmith    /* ACPI_BITREG_BUS_MASTER_STATUS    */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_BUS_MASTER_STATUS,     ACPI_BITMASK_BUS_MASTER_STATUS},
35491116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_STATUS   */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_STATUS},
35591116Smsmith    /* ACPI_BITREG_POWER_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_STATUS},
35691116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_STATUS},
35791116Smsmith    /* ACPI_BITREG_RT_CLOCK_STATUS      */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_STATUS},
35891116Smsmith    /* ACPI_BITREG_WAKE_STATUS          */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_WAKE_STATUS,           ACPI_BITMASK_WAKE_STATUS},
359151937Sjkim    /* ACPI_BITREG_PCIEXP_WAKE_STATUS   */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_PCIEXP_WAKE_STATUS,    ACPI_BITMASK_PCIEXP_WAKE_STATUS},
36091116Smsmith
36191116Smsmith    /* ACPI_BITREG_TIMER_ENABLE         */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_TIMER_ENABLE,          ACPI_BITMASK_TIMER_ENABLE},
36291116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_ENABLE   */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
36391116Smsmith    /* ACPI_BITREG_POWER_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_POWER_BUTTON_ENABLE,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
36491116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
36591116Smsmith    /* ACPI_BITREG_RT_CLOCK_ENABLE      */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_RT_CLOCK_ENABLE,       ACPI_BITMASK_RT_CLOCK_ENABLE},
366151937Sjkim    /* ACPI_BITREG_PCIEXP_WAKE_DISABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE,   ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
36791116Smsmith
36891116Smsmith    /* ACPI_BITREG_SCI_ENABLE           */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SCI_ENABLE,            ACPI_BITMASK_SCI_ENABLE},
36991116Smsmith    /* ACPI_BITREG_BUS_MASTER_RLD       */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_BUS_MASTER_RLD,        ACPI_BITMASK_BUS_MASTER_RLD},
37091116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_RELEASE  */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE,   ACPI_BITMASK_GLOBAL_LOCK_RELEASE},
371193267Sjkim    /* ACPI_BITREG_SLEEP_TYPE           */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_TYPE,            ACPI_BITMASK_SLEEP_TYPE},
37291116Smsmith    /* ACPI_BITREG_SLEEP_ENABLE         */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_ENABLE,          ACPI_BITMASK_SLEEP_ENABLE},
37391116Smsmith
37491116Smsmith    /* ACPI_BITREG_ARB_DIS              */   {ACPI_REGISTER_PM2_CONTROL,  ACPI_BITPOSITION_ARB_DISABLE,           ACPI_BITMASK_ARB_DISABLE}
37591116Smsmith};
37691116Smsmith
37791116Smsmith
37891116SmsmithACPI_FIXED_EVENT_INFO       AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
37991116Smsmith{
38091116Smsmith    /* ACPI_EVENT_PMTIMER       */  {ACPI_BITREG_TIMER_STATUS,          ACPI_BITREG_TIMER_ENABLE,        ACPI_BITMASK_TIMER_STATUS,          ACPI_BITMASK_TIMER_ENABLE},
38191116Smsmith    /* ACPI_EVENT_GLOBAL        */  {ACPI_BITREG_GLOBAL_LOCK_STATUS,    ACPI_BITREG_GLOBAL_LOCK_ENABLE,  ACPI_BITMASK_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
38291116Smsmith    /* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
38391116Smsmith    /* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
384123315Snjl    /* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
38591116Smsmith};
38691116Smsmith
387151937Sjkim/*******************************************************************************
38891116Smsmith *
38991116Smsmith * FUNCTION:    AcpiUtGetRegionName
39091116Smsmith *
39191116Smsmith * PARAMETERS:  None.
39291116Smsmith *
39391116Smsmith * RETURN:      Status
39491116Smsmith *
39591116Smsmith * DESCRIPTION: Translate a Space ID into a name string (Debug only)
39691116Smsmith *
397151937Sjkim ******************************************************************************/
39891116Smsmith
39991116Smsmith/* Region type decoding */
40091116Smsmith
401114237Snjlconst char        *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
40291116Smsmith{
40391116Smsmith    "SystemMemory",
40491116Smsmith    "SystemIO",
405100966Siwasaki    "PCI_Config",
40691116Smsmith    "EmbeddedControl",
40791116Smsmith    "SMBus",
408193267Sjkim    "SystemCMOS",
409100966Siwasaki    "PCIBARTarget",
410197104Sjkim    "IPMI",
411114237Snjl    "DataTable"
41291116Smsmith};
41391116Smsmith
41491116Smsmith
415114237Snjlchar *
41691116SmsmithAcpiUtGetRegionName (
41791116Smsmith    UINT8                   SpaceId)
41891116Smsmith{
41991116Smsmith
42091116Smsmith    if (SpaceId >= ACPI_USER_REGION_BEGIN)
42191116Smsmith    {
42291116Smsmith        return ("UserDefinedRegion");
42391116Smsmith    }
42491116Smsmith    else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS)
42591116Smsmith    {
426114237Snjl        return ("InvalidSpaceId");
42791116Smsmith    }
42891116Smsmith
429167802Sjkim    return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
43091116Smsmith}
43191116Smsmith
43291116Smsmith
433151937Sjkim/*******************************************************************************
43491116Smsmith *
43591116Smsmith * FUNCTION:    AcpiUtGetEventName
43691116Smsmith *
43791116Smsmith * PARAMETERS:  None.
43891116Smsmith *
43991116Smsmith * RETURN:      Status
44091116Smsmith *
44191116Smsmith * DESCRIPTION: Translate a Event ID into a name string (Debug only)
44291116Smsmith *
443151937Sjkim ******************************************************************************/
44491116Smsmith
44591116Smsmith/* Event type decoding */
44691116Smsmith
447114237Snjlstatic const char        *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
44891116Smsmith{
44991116Smsmith    "PM_Timer",
45091116Smsmith    "GlobalLock",
45191116Smsmith    "PowerButton",
45291116Smsmith    "SleepButton",
45391116Smsmith    "RealTimeClock",
45491116Smsmith};
45591116Smsmith
45691116Smsmith
457114237Snjlchar *
45891116SmsmithAcpiUtGetEventName (
45991116Smsmith    UINT32                  EventId)
46091116Smsmith{
46191116Smsmith
46291116Smsmith    if (EventId > ACPI_EVENT_MAX)
46391116Smsmith    {
46491116Smsmith        return ("InvalidEventID");
46591116Smsmith    }
46691116Smsmith
467167802Sjkim    return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
46891116Smsmith}
46991116Smsmith
47091116Smsmith
471151937Sjkim/*******************************************************************************
47267754Smsmith *
47391116Smsmith * FUNCTION:    AcpiUtGetTypeName
47491116Smsmith *
47591116Smsmith * PARAMETERS:  None.
47691116Smsmith *
47791116Smsmith * RETURN:      Status
47891116Smsmith *
47991116Smsmith * DESCRIPTION: Translate a Type ID into a name string (Debug only)
48091116Smsmith *
481151937Sjkim ******************************************************************************/
48291116Smsmith
48367754Smsmith/*
48467754Smsmith * Elements of AcpiGbl_NsTypeNames below must match
48567754Smsmith * one-to-one with values of ACPI_OBJECT_TYPE
48667754Smsmith *
487151937Sjkim * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
488151937Sjkim * when stored in a table it really means that we have thus far seen no
489151937Sjkim * evidence to indicate what type is actually going to be stored for this entry.
49067754Smsmith */
491114237Snjlstatic const char           AcpiGbl_BadType[] = "UNDEFINED";
49267754Smsmith
493151937Sjkim/* Printable names of the ACPI object types */
494151937Sjkim
495151937Sjkimstatic const char           *AcpiGbl_NsTypeNames[] =
49667754Smsmith{
49767754Smsmith    /* 00 */ "Untyped",
49871867Smsmith    /* 01 */ "Integer",
49967754Smsmith    /* 02 */ "String",
50067754Smsmith    /* 03 */ "Buffer",
50167754Smsmith    /* 04 */ "Package",
50267754Smsmith    /* 05 */ "FieldUnit",
50367754Smsmith    /* 06 */ "Device",
50467754Smsmith    /* 07 */ "Event",
50567754Smsmith    /* 08 */ "Method",
50667754Smsmith    /* 09 */ "Mutex",
50767754Smsmith    /* 10 */ "Region",
50867754Smsmith    /* 11 */ "Power",
50967754Smsmith    /* 12 */ "Processor",
51067754Smsmith    /* 13 */ "Thermal",
51185756Smsmith    /* 14 */ "BufferField",
51267754Smsmith    /* 15 */ "DdbHandle",
51385756Smsmith    /* 16 */ "DebugObject",
51485756Smsmith    /* 17 */ "RegionField",
51577424Smsmith    /* 18 */ "BankField",
51685756Smsmith    /* 19 */ "IndexField",
51767754Smsmith    /* 20 */ "Reference",
51867754Smsmith    /* 21 */ "Alias",
519128212Snjl    /* 22 */ "MethodAlias",
520128212Snjl    /* 23 */ "Notify",
521128212Snjl    /* 24 */ "AddrHandler",
522128212Snjl    /* 25 */ "ResourceDesc",
523128212Snjl    /* 26 */ "ResourceFld",
524128212Snjl    /* 27 */ "Scope",
525128212Snjl    /* 28 */ "Extra",
526128212Snjl    /* 29 */ "Data",
527128212Snjl    /* 30 */ "Invalid"
52867754Smsmith};
52967754Smsmith
53067754Smsmith
531114237Snjlchar *
53277424SmsmithAcpiUtGetTypeName (
53391116Smsmith    ACPI_OBJECT_TYPE        Type)
53467754Smsmith{
53567754Smsmith
536107325Siwasaki    if (Type > ACPI_TYPE_INVALID)
53767754Smsmith    {
538167802Sjkim        return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
53967754Smsmith    }
54067754Smsmith
541167802Sjkim    return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
54267754Smsmith}
54367754Smsmith
54469746Smsmith
545114237Snjlchar *
54699679SiwasakiAcpiUtGetObjectTypeName (
54799679Siwasaki    ACPI_OPERAND_OBJECT     *ObjDesc)
54899679Siwasaki{
54999679Siwasaki
55099679Siwasaki    if (!ObjDesc)
55199679Siwasaki    {
55299679Siwasaki        return ("[NULL Object Descriptor]");
55399679Siwasaki    }
55499679Siwasaki
555193267Sjkim    return (AcpiUtGetTypeName (ObjDesc->Common.Type));
55699679Siwasaki}
55799679Siwasaki
55899679Siwasaki
559151937Sjkim/*******************************************************************************
560123315Snjl *
561123315Snjl * FUNCTION:    AcpiUtGetNodeName
562123315Snjl *
563123315Snjl * PARAMETERS:  Object               - A namespace node
564123315Snjl *
565123315Snjl * RETURN:      Pointer to a string
566123315Snjl *
567123315Snjl * DESCRIPTION: Validate the node and return the node's ACPI name.
568123315Snjl *
569151937Sjkim ******************************************************************************/
570123315Snjl
571123315Snjlchar *
572123315SnjlAcpiUtGetNodeName (
573123315Snjl    void                    *Object)
574123315Snjl{
575128212Snjl    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) Object;
576123315Snjl
577123315Snjl
578128212Snjl    /* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */
579128212Snjl
580123315Snjl    if (!Object)
581123315Snjl    {
582128212Snjl        return ("NULL");
583123315Snjl    }
584123315Snjl
585128212Snjl    /* Check for Root node */
586123315Snjl
587128212Snjl    if ((Object == ACPI_ROOT_OBJECT) ||
588128212Snjl        (Object == AcpiGbl_RootNode))
589128212Snjl    {
590128212Snjl        return ("\"\\\" ");
591128212Snjl    }
592128212Snjl
593128212Snjl    /* Descriptor must be a namespace node */
594128212Snjl
595167802Sjkim    if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
596123315Snjl    {
597128212Snjl        return ("####");
598123315Snjl    }
599123315Snjl
600193267Sjkim    /*
601193267Sjkim     * Ensure name is valid. The name was validated/repaired when the node
602193267Sjkim     * was created, but make sure it has not been corrupted.
603193267Sjkim     */
604193267Sjkim    AcpiUtRepairName (Node->Name.Ascii);
605128212Snjl
606128212Snjl    /* Return the name */
607128212Snjl
608123315Snjl    return (Node->Name.Ascii);
609123315Snjl}
610123315Snjl
611123315Snjl
612151937Sjkim/*******************************************************************************
613123315Snjl *
614123315Snjl * FUNCTION:    AcpiUtGetDescriptorName
615123315Snjl *
616123315Snjl * PARAMETERS:  Object               - An ACPI object
617123315Snjl *
618123315Snjl * RETURN:      Pointer to a string
619123315Snjl *
620123315Snjl * DESCRIPTION: Validate object and return the descriptor type
621123315Snjl *
622151937Sjkim ******************************************************************************/
623123315Snjl
624151937Sjkim/* Printable names of object descriptor types */
625151937Sjkim
626151937Sjkimstatic const char           *AcpiGbl_DescTypeNames[] =
627123315Snjl{
628123315Snjl    /* 00 */ "Invalid",
629123315Snjl    /* 01 */ "Cached",
630123315Snjl    /* 02 */ "State-Generic",
631123315Snjl    /* 03 */ "State-Update",
632123315Snjl    /* 04 */ "State-Package",
633123315Snjl    /* 05 */ "State-Control",
634123315Snjl    /* 06 */ "State-RootParseScope",
635123315Snjl    /* 07 */ "State-ParseScope",
636123315Snjl    /* 08 */ "State-WalkScope",
637123315Snjl    /* 09 */ "State-Result",
638123315Snjl    /* 10 */ "State-Notify",
639123315Snjl    /* 11 */ "State-Thread",
640123315Snjl    /* 12 */ "Walk",
641123315Snjl    /* 13 */ "Parser",
642123315Snjl    /* 14 */ "Operand",
643123315Snjl    /* 15 */ "Node"
644123315Snjl};
645123315Snjl
646123315Snjl
647123315Snjlchar *
648123315SnjlAcpiUtGetDescriptorName (
649123315Snjl    void                    *Object)
650123315Snjl{
651123315Snjl
652123315Snjl    if (!Object)
653123315Snjl    {
654123315Snjl        return ("NULL OBJECT");
655123315Snjl    }
656123315Snjl
657123315Snjl    if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX)
658123315Snjl    {
659167802Sjkim        return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
660123315Snjl    }
661123315Snjl
662167802Sjkim    return (ACPI_CAST_PTR (char,
663167802Sjkim        AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
664123315Snjl
665123315Snjl}
666123315Snjl
667123315Snjl
668193267Sjkim/*******************************************************************************
669193267Sjkim *
670193267Sjkim * FUNCTION:    AcpiUtGetReferenceName
671193267Sjkim *
672193267Sjkim * PARAMETERS:  Object               - An ACPI reference object
673193267Sjkim *
674193267Sjkim * RETURN:      Pointer to a string
675193267Sjkim *
676193267Sjkim * DESCRIPTION: Decode a reference object sub-type to a string.
677193267Sjkim *
678193267Sjkim ******************************************************************************/
679193267Sjkim
680193267Sjkim/* Printable names of reference object sub-types */
681193267Sjkim
682193267Sjkimstatic const char           *AcpiGbl_RefClassNames[] =
683193267Sjkim{
684193267Sjkim    /* 00 */ "Local",
685193267Sjkim    /* 01 */ "Argument",
686193267Sjkim    /* 02 */ "RefOf",
687193267Sjkim    /* 03 */ "Index",
688193267Sjkim    /* 04 */ "DdbHandle",
689193267Sjkim    /* 05 */ "Named Object",
690193267Sjkim    /* 06 */ "Debug"
691193267Sjkim};
692193267Sjkim
693193267Sjkimconst char *
694193267SjkimAcpiUtGetReferenceName (
695193267Sjkim    ACPI_OPERAND_OBJECT     *Object)
696193267Sjkim{
697193267Sjkim
698193267Sjkim    if (!Object)
699193267Sjkim    {
700193267Sjkim        return ("NULL Object");
701193267Sjkim    }
702193267Sjkim
703193267Sjkim    if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
704193267Sjkim    {
705193267Sjkim        return ("Not an Operand object");
706193267Sjkim    }
707193267Sjkim
708193267Sjkim    if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
709193267Sjkim    {
710193267Sjkim        return ("Not a Reference object");
711193267Sjkim    }
712193267Sjkim
713193267Sjkim    if (Object->Reference.Class > ACPI_REFCLASS_MAX)
714193267Sjkim    {
715193267Sjkim        return ("Unknown Reference class");
716193267Sjkim    }
717193267Sjkim
718193267Sjkim    return (AcpiGbl_RefClassNames[Object->Reference.Class]);
719193267Sjkim}
720193267Sjkim
721193267Sjkim
722102550Siwasaki#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
723100966Siwasaki/*
724100966Siwasaki * Strings and procedures used for debug only
725100966Siwasaki */
72699679Siwasaki
727151937Sjkim/*******************************************************************************
728100966Siwasaki *
729100966Siwasaki * FUNCTION:    AcpiUtGetMutexName
730100966Siwasaki *
731151937Sjkim * PARAMETERS:  MutexId         - The predefined ID for this mutex.
732100966Siwasaki *
733151937Sjkim * RETURN:      String containing the name of the mutex. Always returns a valid
734151937Sjkim *              pointer.
735100966Siwasaki *
736100966Siwasaki * DESCRIPTION: Translate a mutex ID into a name string (Debug only)
737100966Siwasaki *
738151937Sjkim ******************************************************************************/
73969746Smsmith
740114237Snjlchar *
741100966SiwasakiAcpiUtGetMutexName (
742100966Siwasaki    UINT32                  MutexId)
74369746Smsmith{
74469746Smsmith
745167802Sjkim    if (MutexId > ACPI_MAX_MUTEX)
746100966Siwasaki    {
747100966Siwasaki        return ("Invalid Mutex ID");
748100966Siwasaki    }
74969746Smsmith
750100966Siwasaki    return (AcpiGbl_MutexNames[MutexId]);
751100966Siwasaki}
752193267Sjkim
753193267Sjkim
754193267Sjkim/*******************************************************************************
755193267Sjkim *
756193267Sjkim * FUNCTION:    AcpiUtGetNotifyName
757193267Sjkim *
758193267Sjkim * PARAMETERS:  NotifyValue     - Value from the Notify() request
759193267Sjkim *
760193267Sjkim * RETURN:      String corresponding to the Notify Value.
761193267Sjkim *
762193267Sjkim * DESCRIPTION: Translate a Notify Value to a notify namestring.
763193267Sjkim *
764193267Sjkim ******************************************************************************/
765193267Sjkim
766193267Sjkim/* Names for Notify() values, used for debug output */
767193267Sjkim
768193267Sjkimstatic const char        *AcpiGbl_NotifyValueNames[] =
769193267Sjkim{
770193267Sjkim    "Bus Check",
771193267Sjkim    "Device Check",
772193267Sjkim    "Device Wake",
773193267Sjkim    "Eject Request",
774193267Sjkim    "Device Check Light",
775193267Sjkim    "Frequency Mismatch",
776193267Sjkim    "Bus Mode Mismatch",
777193267Sjkim    "Power Fault",
778193267Sjkim    "Capabilities Check",
779193267Sjkim    "Device PLD Check",
780193267Sjkim    "Reserved",
781193267Sjkim    "System Locality Update"
782193267Sjkim};
783193267Sjkim
784193267Sjkimconst char *
785193267SjkimAcpiUtGetNotifyName (
786193267Sjkim    UINT32                  NotifyValue)
787193267Sjkim{
788193267Sjkim
789193267Sjkim    if (NotifyValue <= ACPI_NOTIFY_MAX)
790193267Sjkim    {
791193267Sjkim        return (AcpiGbl_NotifyValueNames[NotifyValue]);
792193267Sjkim    }
793193267Sjkim    else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
794193267Sjkim    {
795193267Sjkim        return ("Reserved");
796193267Sjkim    }
797193267Sjkim    else /* Greater or equal to 0x80 */
798193267Sjkim    {
799193267Sjkim        return ("**Device Specific**");
800193267Sjkim    }
801193267Sjkim}
80267754Smsmith#endif
80367754Smsmith
80467754Smsmith
805151937Sjkim/*******************************************************************************
80667754Smsmith *
80777424Smsmith * FUNCTION:    AcpiUtValidObjectType
80867754Smsmith *
809107325Siwasaki * PARAMETERS:  Type            - Object type to be validated
81067754Smsmith *
811151937Sjkim * RETURN:      TRUE if valid object type, FALSE otherwise
81267754Smsmith *
81367754Smsmith * DESCRIPTION: Validate an object type
81467754Smsmith *
815151937Sjkim ******************************************************************************/
81667754Smsmith
81767754SmsmithBOOLEAN
81877424SmsmithAcpiUtValidObjectType (
81991116Smsmith    ACPI_OBJECT_TYPE        Type)
82067754Smsmith{
82167754Smsmith
822107325Siwasaki    if (Type > ACPI_TYPE_LOCAL_MAX)
82367754Smsmith    {
824107325Siwasaki        /* Note: Assumes all TYPEs are contiguous (external/local) */
825107325Siwasaki
826107325Siwasaki        return (FALSE);
82767754Smsmith    }
82867754Smsmith
82967754Smsmith    return (TRUE);
83067754Smsmith}
83167754Smsmith
83267754Smsmith
833151937Sjkim/*******************************************************************************
83467754Smsmith *
835151937Sjkim * FUNCTION:    AcpiUtInitGlobals
83667754Smsmith *
837151937Sjkim * PARAMETERS:  None
83867754Smsmith *
839193267Sjkim * RETURN:      Status
84067754Smsmith *
84167754Smsmith * DESCRIPTION: Init library globals.  All globals that require specific
84267754Smsmith *              initialization should be initialized here!
84367754Smsmith *
844151937Sjkim ******************************************************************************/
84567754Smsmith
846193267SjkimACPI_STATUS
84777424SmsmithAcpiUtInitGlobals (
84867754Smsmith    void)
84967754Smsmith{
850151937Sjkim    ACPI_STATUS             Status;
85167754Smsmith    UINT32                  i;
85267754Smsmith
85367754Smsmith
854167802Sjkim    ACPI_FUNCTION_TRACE (UtInitGlobals);
85567754Smsmith
856127175Snjl
857151937Sjkim    /* Create all memory caches */
85882367Smsmith
859151937Sjkim    Status = AcpiUtCreateCaches ();
860151937Sjkim    if (ACPI_FAILURE (Status))
861151937Sjkim    {
862193267Sjkim        return_ACPI_STATUS (Status);
863151937Sjkim    }
86482367Smsmith
86567754Smsmith    /* Mutex locked flags */
86667754Smsmith
867167802Sjkim    for (i = 0; i < ACPI_NUM_MUTEX; i++)
86867754Smsmith    {
869117521Snjl        AcpiGbl_MutexInfo[i].Mutex          = NULL;
870151937Sjkim        AcpiGbl_MutexInfo[i].ThreadId       = ACPI_MUTEX_NOT_ACQUIRED;
871117521Snjl        AcpiGbl_MutexInfo[i].UseCount       = 0;
87267754Smsmith    }
87367754Smsmith
874167802Sjkim    for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
875167802Sjkim    {
876167802Sjkim        AcpiGbl_OwnerIdMask[i]              = 0;
877167802Sjkim    }
878167802Sjkim
879193267Sjkim    /* Last OwnerID is never valid */
880193267Sjkim
881193267Sjkim    AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
882193267Sjkim
883193267Sjkim    /* Event counters */
884193267Sjkim
885193267Sjkim    AcpiMethodCount                     = 0;
886193267Sjkim    AcpiSciCount                        = 0;
887193267Sjkim    AcpiGpeCount                        = 0;
888193267Sjkim
889193267Sjkim    for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
890193267Sjkim    {
891193267Sjkim        AcpiFixedEventCount[i]              = 0;
892193267Sjkim    }
893193267Sjkim
894114237Snjl    /* GPE support */
895114237Snjl
896117521Snjl    AcpiGbl_GpeXruptListHead            = NULL;
897117521Snjl    AcpiGbl_GpeFadtBlocks[0]            = NULL;
898117521Snjl    AcpiGbl_GpeFadtBlocks[1]            = NULL;
899193267Sjkim    AcpiCurrentGpeCount                 = 0;
900114237Snjl
901193267Sjkim    /* Global handlers */
90267754Smsmith
903117521Snjl    AcpiGbl_SystemNotify.Handler        = NULL;
904117521Snjl    AcpiGbl_DeviceNotify.Handler        = NULL;
905138287Smarks    AcpiGbl_ExceptionHandler            = NULL;
90699679Siwasaki    AcpiGbl_InitHandler                 = NULL;
907193267Sjkim    AcpiGbl_TableHandler                = NULL;
90867754Smsmith
90967754Smsmith    /* Global Lock support */
91067754Smsmith
911167802Sjkim    AcpiGbl_GlobalLockSemaphore         = NULL;
912167802Sjkim    AcpiGbl_GlobalLockMutex             = NULL;
91367754Smsmith    AcpiGbl_GlobalLockAcquired          = FALSE;
91491116Smsmith    AcpiGbl_GlobalLockHandle            = 0;
915193267Sjkim    AcpiGbl_GlobalLockPresent           = FALSE;
91667754Smsmith
91767754Smsmith    /* Miscellaneous variables */
91867754Smsmith
91967754Smsmith    AcpiGbl_CmSingleStep                = FALSE;
92067754Smsmith    AcpiGbl_DbTerminateThreads          = FALSE;
92167754Smsmith    AcpiGbl_Shutdown                    = FALSE;
92267754Smsmith    AcpiGbl_NsLookupCount               = 0;
92367754Smsmith    AcpiGbl_PsFindCount                 = 0;
92467754Smsmith    AcpiGbl_AcpiHardwarePresent         = TRUE;
925167802Sjkim    AcpiGbl_LastOwnerIdIndex            = 0;
926167802Sjkim    AcpiGbl_NextOwnerIdOffset           = 0;
927151937Sjkim    AcpiGbl_TraceMethodName             = 0;
928151937Sjkim    AcpiGbl_TraceDbgLevel               = 0;
929151937Sjkim    AcpiGbl_TraceDbgLayer               = 0;
93067754Smsmith    AcpiGbl_DebuggerConfiguration       = DEBUGGER_THREADING;
93191116Smsmith    AcpiGbl_DbOutputFlags               = ACPI_DB_CONSOLE_OUTPUT;
932193267Sjkim    AcpiGbl_OsiData                     = 0;
93367754Smsmith
93467754Smsmith    /* Hardware oriented */
93567754Smsmith
936104470Siwasaki    AcpiGbl_EventsInitialized           = FALSE;
937129684Snjl    AcpiGbl_SystemAwakeAndRunning       = TRUE;
93867754Smsmith
93967754Smsmith    /* Namespace */
94067754Smsmith
941197104Sjkim    AcpiGbl_ModuleCodeList              = NULL;
94267754Smsmith    AcpiGbl_RootNode                    = NULL;
94399146Siwasaki    AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
944167802Sjkim    AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
945107325Siwasaki    AcpiGbl_RootNodeStruct.Type         = ACPI_TYPE_DEVICE;
94667754Smsmith    AcpiGbl_RootNodeStruct.Child        = NULL;
94767754Smsmith    AcpiGbl_RootNodeStruct.Peer         = NULL;
94867754Smsmith    AcpiGbl_RootNodeStruct.Object       = NULL;
94967754Smsmith    AcpiGbl_RootNodeStruct.Flags        = ANOBJ_END_OF_PEER_LIST;
95067754Smsmith
95167754Smsmith
952102550Siwasaki#ifdef ACPI_DEBUG_OUTPUT
953193267Sjkim    AcpiGbl_LowestStackPointer          = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
95483174Smsmith#endif
95583174Smsmith
956167802Sjkim#ifdef ACPI_DBG_TRACK_ALLOCATIONS
957167802Sjkim    AcpiGbl_DisplayFinalMemStats        = FALSE;
958167802Sjkim#endif
959167802Sjkim
960193267Sjkim    return_ACPI_STATUS (AE_OK);
96167754Smsmith}
96267754Smsmith
963167802Sjkim/* Public globals */
96467754Smsmith
965193267SjkimACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
966167802SjkimACPI_EXPORT_SYMBOL (AcpiDbgLevel)
967167802SjkimACPI_EXPORT_SYMBOL (AcpiDbgLayer)
968167802SjkimACPI_EXPORT_SYMBOL (AcpiGpeCount)
969193267SjkimACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount)
970167802Sjkim
971167802Sjkim
972