167754Smsmith/******************************************************************************
267754Smsmith *
377424Smsmith * Module Name: utglobal - Global variables for the ACPI subsystem
467754Smsmith *
567754Smsmith *****************************************************************************/
667754Smsmith
7217365Sjkim/*
8281075Sdim * Copyright (C) 2000 - 2015, Intel Corp.
970243Smsmith * All rights reserved.
1067754Smsmith *
11217365Sjkim * Redistribution and use in source and binary forms, with or without
12217365Sjkim * modification, are permitted provided that the following conditions
13217365Sjkim * are met:
14217365Sjkim * 1. Redistributions of source code must retain the above copyright
15217365Sjkim *    notice, this list of conditions, and the following disclaimer,
16217365Sjkim *    without modification.
17217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18217365Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
19217365Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
20217365Sjkim *    including a substantially similar Disclaimer requirement for further
21217365Sjkim *    binary redistribution.
22217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
23217365Sjkim *    of any contributors may be used to endorse or promote products derived
24217365Sjkim *    from this software without specific prior written permission.
2567754Smsmith *
26217365Sjkim * Alternatively, this software may be distributed under the terms of the
27217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
28217365Sjkim * Software Foundation.
2967754Smsmith *
30217365Sjkim * NO WARRANTY
31217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32217365Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33217365Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34217365Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35217365Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37217365Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39217365Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40217365Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41217365Sjkim * POSSIBILITY OF SUCH DAMAGES.
42217365Sjkim */
4367754Smsmith
44281075Sdim#define EXPORT_ACPI_INTERFACES
4567754Smsmith#define DEFINE_ACPI_GLOBALS
4667754Smsmith
47193341Sjkim#include <contrib/dev/acpica/include/acpi.h>
48193341Sjkim#include <contrib/dev/acpica/include/accommon.h>
4967754Smsmith
5077424Smsmith#define _COMPONENT          ACPI_UTILITIES
5191116Smsmith        ACPI_MODULE_NAME    ("utglobal")
5267754Smsmith
5367754Smsmith
54151937Sjkim/*******************************************************************************
5567754Smsmith *
5667754Smsmith * Static global variable initialization.
5767754Smsmith *
5867754Smsmith ******************************************************************************/
5967754Smsmith
60281075Sdim/* Various state name strings */
6167754Smsmith
62129684Snjlconst char                  *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] =
63129684Snjl{
64129684Snjl    "\\_S0_",
65129684Snjl    "\\_S1_",
66129684Snjl    "\\_S2_",
67129684Snjl    "\\_S3_",
68129684Snjl    "\\_S4_",
69129684Snjl    "\\_S5_"
70129684Snjl};
7169450Smsmith
72197104Sjkimconst char                  *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] =
73129684Snjl{
74197104Sjkim    "_S0W",
75197104Sjkim    "_S1W",
76197104Sjkim    "_S2W",
77197104Sjkim    "_S3W",
78197104Sjkim    "_S4W"
79197104Sjkim};
80197104Sjkim
81197104Sjkimconst char                  *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] =
82197104Sjkim{
83129684Snjl    "_S1D",
84129684Snjl    "_S2D",
85129684Snjl    "_S3D",
86129684Snjl    "_S4D"
87129684Snjl};
8869450Smsmith
89167802Sjkim
90167802Sjkim/*******************************************************************************
91167802Sjkim *
9267754Smsmith * Namespace globals
9367754Smsmith *
9467754Smsmith ******************************************************************************/
9567754Smsmith
9667754Smsmith/*
97104470Siwasaki * Predefined ACPI Names (Built-in to the Interpreter)
9867754Smsmith *
9977424Smsmith * NOTES:
100127175Snjl * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
10177424Smsmith *    during the initialization sequence.
102151937Sjkim * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to
103213806Sjkim *    perform a Notify() operation on it. 09/2010: Changed to type Device.
104213806Sjkim *    This still allows notifies, but does not confuse host code that
105213806Sjkim *    searches for valid ThermalZone objects.
10667754Smsmith */
10791116Smsmithconst ACPI_PREDEFINED_NAMES     AcpiGbl_PreDefinedNames[] =
10867754Smsmith{
109107325Siwasaki    {"_GPE",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
110107325Siwasaki    {"_PR_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
11199679Siwasaki    {"_SB_",    ACPI_TYPE_DEVICE,           NULL},
112107325Siwasaki    {"_SI_",    ACPI_TYPE_LOCAL_SCOPE,      NULL},
113213806Sjkim    {"_TZ_",    ACPI_TYPE_DEVICE,           NULL},
114281687Sjkim    /*
115281687Sjkim     * March, 2015:
116281687Sjkim     * The _REV object is in the process of being deprecated, because
117281687Sjkim     * other ACPI implementations permanently return 2. Thus, it
118281687Sjkim     * has little or no value. Return 2 for compatibility with
119281687Sjkim     * other ACPI implementations.
120281687Sjkim     */
121281687Sjkim    {"_REV",    ACPI_TYPE_INTEGER,          ACPI_CAST_PTR (char, 2)},
12299146Siwasaki    {"_OS_",    ACPI_TYPE_STRING,           ACPI_OS_NAME},
123281687Sjkim    {"_GL_",    ACPI_TYPE_MUTEX,            ACPI_CAST_PTR (char, 1)},
124102550Siwasaki
125127175Snjl#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
126281687Sjkim    {"_OSI",    ACPI_TYPE_METHOD,           ACPI_CAST_PTR (char, 1)},
127102550Siwasaki#endif
128151937Sjkim
129151937Sjkim    /* Table terminator */
130151937Sjkim
131151937Sjkim    {NULL,      ACPI_TYPE_ANY,              NULL}
13267754Smsmith};
13367754Smsmith
13467754Smsmith
135231844Sjkim#if (!ACPI_REDUCED_HARDWARE)
13691116Smsmith/******************************************************************************
13791116Smsmith *
13891116Smsmith * Event and Hardware globals
13991116Smsmith *
14091116Smsmith ******************************************************************************/
14191116Smsmith
14291116SmsmithACPI_BIT_REGISTER_INFO      AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] =
14391116Smsmith{
14491116Smsmith    /* Name                                     Parent Register             Register Bit Position                   Register Bit Mask       */
14591116Smsmith
14691116Smsmith    /* ACPI_BITREG_TIMER_STATUS         */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_TIMER_STATUS,          ACPI_BITMASK_TIMER_STATUS},
14791116Smsmith    /* ACPI_BITREG_BUS_MASTER_STATUS    */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_BUS_MASTER_STATUS,     ACPI_BITMASK_BUS_MASTER_STATUS},
14891116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_STATUS   */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_STATUS},
14991116Smsmith    /* ACPI_BITREG_POWER_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_STATUS},
15091116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_STATUS  */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_STATUS},
15191116Smsmith    /* ACPI_BITREG_RT_CLOCK_STATUS      */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_STATUS},
15291116Smsmith    /* ACPI_BITREG_WAKE_STATUS          */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_WAKE_STATUS,           ACPI_BITMASK_WAKE_STATUS},
153151937Sjkim    /* ACPI_BITREG_PCIEXP_WAKE_STATUS   */   {ACPI_REGISTER_PM1_STATUS,   ACPI_BITPOSITION_PCIEXP_WAKE_STATUS,    ACPI_BITMASK_PCIEXP_WAKE_STATUS},
15491116Smsmith
15591116Smsmith    /* ACPI_BITREG_TIMER_ENABLE         */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_TIMER_ENABLE,          ACPI_BITMASK_TIMER_ENABLE},
15691116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_ENABLE   */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
15791116Smsmith    /* ACPI_BITREG_POWER_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_POWER_BUTTON_ENABLE,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
15891116Smsmith    /* ACPI_BITREG_SLEEP_BUTTON_ENABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
15991116Smsmith    /* ACPI_BITREG_RT_CLOCK_ENABLE      */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_RT_CLOCK_ENABLE,       ACPI_BITMASK_RT_CLOCK_ENABLE},
160151937Sjkim    /* ACPI_BITREG_PCIEXP_WAKE_DISABLE  */   {ACPI_REGISTER_PM1_ENABLE,   ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE,   ACPI_BITMASK_PCIEXP_WAKE_DISABLE},
16191116Smsmith
16291116Smsmith    /* ACPI_BITREG_SCI_ENABLE           */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SCI_ENABLE,            ACPI_BITMASK_SCI_ENABLE},
16391116Smsmith    /* ACPI_BITREG_BUS_MASTER_RLD       */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_BUS_MASTER_RLD,        ACPI_BITMASK_BUS_MASTER_RLD},
16491116Smsmith    /* ACPI_BITREG_GLOBAL_LOCK_RELEASE  */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE,   ACPI_BITMASK_GLOBAL_LOCK_RELEASE},
165193267Sjkim    /* ACPI_BITREG_SLEEP_TYPE           */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_TYPE,            ACPI_BITMASK_SLEEP_TYPE},
16691116Smsmith    /* ACPI_BITREG_SLEEP_ENABLE         */   {ACPI_REGISTER_PM1_CONTROL,  ACPI_BITPOSITION_SLEEP_ENABLE,          ACPI_BITMASK_SLEEP_ENABLE},
16791116Smsmith
16891116Smsmith    /* ACPI_BITREG_ARB_DIS              */   {ACPI_REGISTER_PM2_CONTROL,  ACPI_BITPOSITION_ARB_DISABLE,           ACPI_BITMASK_ARB_DISABLE}
16991116Smsmith};
17091116Smsmith
17191116Smsmith
17291116SmsmithACPI_FIXED_EVENT_INFO       AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] =
17391116Smsmith{
17491116Smsmith    /* ACPI_EVENT_PMTIMER       */  {ACPI_BITREG_TIMER_STATUS,          ACPI_BITREG_TIMER_ENABLE,        ACPI_BITMASK_TIMER_STATUS,          ACPI_BITMASK_TIMER_ENABLE},
17591116Smsmith    /* ACPI_EVENT_GLOBAL        */  {ACPI_BITREG_GLOBAL_LOCK_STATUS,    ACPI_BITREG_GLOBAL_LOCK_ENABLE,  ACPI_BITMASK_GLOBAL_LOCK_STATUS,    ACPI_BITMASK_GLOBAL_LOCK_ENABLE},
17691116Smsmith    /* ACPI_EVENT_POWER_BUTTON  */  {ACPI_BITREG_POWER_BUTTON_STATUS,   ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS,   ACPI_BITMASK_POWER_BUTTON_ENABLE},
17791116Smsmith    /* ACPI_EVENT_SLEEP_BUTTON  */  {ACPI_BITREG_SLEEP_BUTTON_STATUS,   ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS,   ACPI_BITMASK_SLEEP_BUTTON_ENABLE},
178123315Snjl    /* ACPI_EVENT_RTC           */  {ACPI_BITREG_RT_CLOCK_STATUS,       ACPI_BITREG_RT_CLOCK_ENABLE,     ACPI_BITMASK_RT_CLOCK_STATUS,       ACPI_BITMASK_RT_CLOCK_ENABLE},
17991116Smsmith};
180231844Sjkim#endif /* !ACPI_REDUCED_HARDWARE */
18191116Smsmith
182167802Sjkim/* Public globals */
18367754Smsmith
184193267SjkimACPI_EXPORT_SYMBOL (AcpiGbl_FADT)
185167802SjkimACPI_EXPORT_SYMBOL (AcpiDbgLevel)
186167802SjkimACPI_EXPORT_SYMBOL (AcpiDbgLayer)
187167802SjkimACPI_EXPORT_SYMBOL (AcpiGpeCount)
188193267SjkimACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount)
189