1ae115bc7Smrj /****************************************************************************** 2ae115bc7Smrj * 3ae115bc7Smrj * Module Name: utglobal - Global variables for the ACPI subsystem 4ae115bc7Smrj * 5ae115bc7Smrj *****************************************************************************/ 6ae115bc7Smrj 726f3cdf0SGordon Ross /* 8*385cc6b4SJerry Jelinek * Copyright (C) 2000 - 2016, Intel Corp. 9ae115bc7Smrj * All rights reserved. 10ae115bc7Smrj * 1126f3cdf0SGordon Ross * Redistribution and use in source and binary forms, with or without 1226f3cdf0SGordon Ross * modification, are permitted provided that the following conditions 1326f3cdf0SGordon Ross * are met: 1426f3cdf0SGordon Ross * 1. Redistributions of source code must retain the above copyright 1526f3cdf0SGordon Ross * notice, this list of conditions, and the following disclaimer, 1626f3cdf0SGordon Ross * without modification. 1726f3cdf0SGordon Ross * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1826f3cdf0SGordon Ross * substantially similar to the "NO WARRANTY" disclaimer below 1926f3cdf0SGordon Ross * ("Disclaimer") and any redistribution must be conditioned upon 2026f3cdf0SGordon Ross * including a substantially similar Disclaimer requirement for further 2126f3cdf0SGordon Ross * binary redistribution. 2226f3cdf0SGordon Ross * 3. Neither the names of the above-listed copyright holders nor the names 2326f3cdf0SGordon Ross * of any contributors may be used to endorse or promote products derived 2426f3cdf0SGordon Ross * from this software without specific prior written permission. 25ae115bc7Smrj * 2626f3cdf0SGordon Ross * Alternatively, this software may be distributed under the terms of the 2726f3cdf0SGordon Ross * GNU General Public License ("GPL") version 2 as published by the Free 2826f3cdf0SGordon Ross * Software Foundation. 29ae115bc7Smrj * 3026f3cdf0SGordon Ross * NO WARRANTY 3126f3cdf0SGordon Ross * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3226f3cdf0SGordon Ross * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3326f3cdf0SGordon Ross * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3426f3cdf0SGordon Ross * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3526f3cdf0SGordon Ross * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3626f3cdf0SGordon Ross * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3726f3cdf0SGordon Ross * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3826f3cdf0SGordon Ross * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3926f3cdf0SGordon Ross * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 4026f3cdf0SGordon Ross * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4126f3cdf0SGordon Ross * POSSIBILITY OF SUCH DAMAGES. 4226f3cdf0SGordon Ross */ 43ae115bc7Smrj 44*385cc6b4SJerry Jelinek #define EXPORT_ACPI_INTERFACES 45ae115bc7Smrj #define DEFINE_ACPI_GLOBALS 46ae115bc7Smrj 47ae115bc7Smrj #include "acpi.h" 48aa2aa9a6SDana Myers #include "accommon.h" 49ae115bc7Smrj 50ae115bc7Smrj #define _COMPONENT ACPI_UTILITIES 51ae115bc7Smrj ACPI_MODULE_NAME ("utglobal") 52ae115bc7Smrj 53ae115bc7Smrj 54ae115bc7Smrj /******************************************************************************* 55ae115bc7Smrj * 56ae115bc7Smrj * Static global variable initialization. 57ae115bc7Smrj * 58ae115bc7Smrj ******************************************************************************/ 59ae115bc7Smrj 60*385cc6b4SJerry Jelinek /* Various state name strings */ 61ae115bc7Smrj 62ae115bc7Smrj const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = 63ae115bc7Smrj { 64ae115bc7Smrj "\\_S0_", 65ae115bc7Smrj "\\_S1_", 66ae115bc7Smrj "\\_S2_", 67ae115bc7Smrj "\\_S3_", 68ae115bc7Smrj "\\_S4_", 69ae115bc7Smrj "\\_S5_" 70ae115bc7Smrj }; 71ae115bc7Smrj 7257190917SDana Myers const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS] = 7357190917SDana Myers { 7457190917SDana Myers "_S0W", 7557190917SDana Myers "_S1W", 7657190917SDana Myers "_S2W", 7757190917SDana Myers "_S3W", 7857190917SDana Myers "_S4W" 7957190917SDana Myers }; 8057190917SDana Myers 8157190917SDana Myers const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS] = 82ae115bc7Smrj { 83ae115bc7Smrj "_S1D", 84ae115bc7Smrj "_S2D", 85ae115bc7Smrj "_S3D", 86ae115bc7Smrj "_S4D" 87ae115bc7Smrj }; 88ae115bc7Smrj 89ae115bc7Smrj 90*385cc6b4SJerry Jelinek /* Hex-to-ascii */ 91*385cc6b4SJerry Jelinek 92*385cc6b4SJerry Jelinek const char AcpiGbl_LowerHexDigits[] = "0123456789abcdef"; 93*385cc6b4SJerry Jelinek const char AcpiGbl_UpperHexDigits[] = "0123456789ABCDEF"; 94*385cc6b4SJerry Jelinek 95*385cc6b4SJerry Jelinek 96ae115bc7Smrj /******************************************************************************* 97ae115bc7Smrj * 98ae115bc7Smrj * Namespace globals 99ae115bc7Smrj * 100ae115bc7Smrj ******************************************************************************/ 101ae115bc7Smrj 102ae115bc7Smrj /* 103ae115bc7Smrj * Predefined ACPI Names (Built-in to the Interpreter) 104ae115bc7Smrj * 105ae115bc7Smrj * NOTES: 106ae115bc7Smrj * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run 107ae115bc7Smrj * during the initialization sequence. 108ae115bc7Smrj * 2) _TZ_ is defined to be a thermal zone in order to allow ASL code to 10926f3cdf0SGordon Ross * perform a Notify() operation on it. 09/2010: Changed to type Device. 11026f3cdf0SGordon Ross * This still allows notifies, but does not confuse host code that 11126f3cdf0SGordon Ross * searches for valid ThermalZone objects. 112ae115bc7Smrj */ 113ae115bc7Smrj const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 114ae115bc7Smrj { 115ae115bc7Smrj {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 116ae115bc7Smrj {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 117ae115bc7Smrj {"_SB_", ACPI_TYPE_DEVICE, NULL}, 118ae115bc7Smrj {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 11926f3cdf0SGordon Ross {"_TZ_", ACPI_TYPE_DEVICE, NULL}, 120*385cc6b4SJerry Jelinek /* 121*385cc6b4SJerry Jelinek * March, 2015: 122*385cc6b4SJerry Jelinek * The _REV object is in the process of being deprecated, because 123*385cc6b4SJerry Jelinek * other ACPI implementations permanently return 2. Thus, it 124*385cc6b4SJerry Jelinek * has little or no value. Return 2 for compatibility with 125*385cc6b4SJerry Jelinek * other ACPI implementations. 126*385cc6b4SJerry Jelinek */ 127*385cc6b4SJerry Jelinek {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)}, 128ae115bc7Smrj {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 129*385cc6b4SJerry Jelinek {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)}, 130ae115bc7Smrj 131ae115bc7Smrj #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 132*385cc6b4SJerry Jelinek {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)}, 133ae115bc7Smrj #endif 134ae115bc7Smrj 135ae115bc7Smrj /* Table terminator */ 136ae115bc7Smrj 137ae115bc7Smrj {NULL, ACPI_TYPE_ANY, NULL} 138ae115bc7Smrj }; 139ae115bc7Smrj 140ae115bc7Smrj 141*385cc6b4SJerry Jelinek #if (!ACPI_REDUCED_HARDWARE) 142ae115bc7Smrj /****************************************************************************** 143ae115bc7Smrj * 144ae115bc7Smrj * Event and Hardware globals 145ae115bc7Smrj * 146ae115bc7Smrj ******************************************************************************/ 147ae115bc7Smrj 148ae115bc7Smrj ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = 149ae115bc7Smrj { 150ae115bc7Smrj /* Name Parent Register Register Bit Position Register Bit Mask */ 151ae115bc7Smrj 152ae115bc7Smrj /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, 153ae115bc7Smrj /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, 154ae115bc7Smrj /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, 155ae115bc7Smrj /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, 156ae115bc7Smrj /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, 157ae115bc7Smrj /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, 158ae115bc7Smrj /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, 159ae115bc7Smrj /* ACPI_BITREG_PCIEXP_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_PCIEXP_WAKE_STATUS, ACPI_BITMASK_PCIEXP_WAKE_STATUS}, 160ae115bc7Smrj 161ae115bc7Smrj /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, 162ae115bc7Smrj /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 163ae115bc7Smrj /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 164ae115bc7Smrj /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 165ae115bc7Smrj /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, 166ae115bc7Smrj /* ACPI_BITREG_PCIEXP_WAKE_DISABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE, ACPI_BITMASK_PCIEXP_WAKE_DISABLE}, 167ae115bc7Smrj 168ae115bc7Smrj /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, 169ae115bc7Smrj /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, 170ae115bc7Smrj /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, 171aa2aa9a6SDana Myers /* ACPI_BITREG_SLEEP_TYPE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE, ACPI_BITMASK_SLEEP_TYPE}, 172ae115bc7Smrj /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, 173ae115bc7Smrj 174ae115bc7Smrj /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} 175ae115bc7Smrj }; 176ae115bc7Smrj 177ae115bc7Smrj 178ae115bc7Smrj ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = 179ae115bc7Smrj { 180ae115bc7Smrj /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, 181ae115bc7Smrj /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 182ae115bc7Smrj /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 183ae115bc7Smrj /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 184ae115bc7Smrj /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, 185ae115bc7Smrj }; 186*385cc6b4SJerry Jelinek #endif /* !ACPI_REDUCED_HARDWARE */ 187ae115bc7Smrj 188ae115bc7Smrj 189*385cc6b4SJerry Jelinek #if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER) 190ae115bc7Smrj 191*385cc6b4SJerry Jelinek /* ToPld macro: compile/disassemble strings */ 192*385cc6b4SJerry Jelinek 193*385cc6b4SJerry Jelinek const char *AcpiGbl_PldPanelList[] = 194ae115bc7Smrj { 195*385cc6b4SJerry Jelinek "TOP", 196*385cc6b4SJerry Jelinek "BOTTOM", 197*385cc6b4SJerry Jelinek "LEFT", 198*385cc6b4SJerry Jelinek "RIGHT", 199*385cc6b4SJerry Jelinek "FRONT", 200*385cc6b4SJerry Jelinek "BACK", 201*385cc6b4SJerry Jelinek "UNKNOWN", 202*385cc6b4SJerry Jelinek NULL 203*385cc6b4SJerry Jelinek }; 204ae115bc7Smrj 205*385cc6b4SJerry Jelinek const char *AcpiGbl_PldVerticalPositionList[] = 206ae115bc7Smrj { 207*385cc6b4SJerry Jelinek "UPPER", 208*385cc6b4SJerry Jelinek "CENTER", 209*385cc6b4SJerry Jelinek "LOWER", 210*385cc6b4SJerry Jelinek NULL 211*385cc6b4SJerry Jelinek }; 212ae115bc7Smrj 213*385cc6b4SJerry Jelinek const char *AcpiGbl_PldHorizontalPositionList[] = 214ae115bc7Smrj { 215*385cc6b4SJerry Jelinek "LEFT", 216*385cc6b4SJerry Jelinek "CENTER", 217*385cc6b4SJerry Jelinek "RIGHT", 218*385cc6b4SJerry Jelinek NULL 219*385cc6b4SJerry Jelinek }; 220ae115bc7Smrj 221*385cc6b4SJerry Jelinek const char *AcpiGbl_PldShapeList[] = 222ae115bc7Smrj { 223*385cc6b4SJerry Jelinek "ROUND", 224*385cc6b4SJerry Jelinek "OVAL", 225*385cc6b4SJerry Jelinek "SQUARE", 226*385cc6b4SJerry Jelinek "VERTICALRECTANGLE", 227*385cc6b4SJerry Jelinek "HORIZONTALRECTANGLE", 228*385cc6b4SJerry Jelinek "VERTICALTRAPEZOID", 229*385cc6b4SJerry Jelinek "HORIZONTALTRAPEZOID", 230*385cc6b4SJerry Jelinek "UNKNOWN", 231*385cc6b4SJerry Jelinek "CHAMFERED", 232*385cc6b4SJerry Jelinek NULL 233*385cc6b4SJerry Jelinek }; 23457190917SDana Myers #endif 23557190917SDana Myers 236ae115bc7Smrj 237ae115bc7Smrj /* Public globals */ 238ae115bc7Smrj 239aa2aa9a6SDana Myers ACPI_EXPORT_SYMBOL (AcpiGbl_FADT) 240ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiDbgLevel) 241ae115bc7Smrj ACPI_EXPORT_SYMBOL (AcpiDbgLayer) 242db2bae30SDana Myers ACPI_EXPORT_SYMBOL (AcpiGpeCount) 243aa2aa9a6SDana Myers ACPI_EXPORT_SYMBOL (AcpiCurrentGpeCount) 244