acglobal.h revision 69450
1139969Simp/****************************************************************************** 21556Srgrimes * 31556Srgrimes * Name: acglobal.h - Declarations for global variables 41556Srgrimes * $Revision: 92 $ 51556Srgrimes * 61556Srgrimes *****************************************************************************/ 71556Srgrimes 81556Srgrimes/****************************************************************************** 91556Srgrimes * 101556Srgrimes * 1. Copyright Notice 111556Srgrimes * 121556Srgrimes * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights 131556Srgrimes * reserved. 141556Srgrimes * 151556Srgrimes * 2. License 161556Srgrimes * 171556Srgrimes * 2.1. This is your license from Intel Corp. under its intellectual property 181556Srgrimes * rights. You may have additional license terms from the party that provided 191556Srgrimes * you this software, covering your right to use that party's intellectual 201556Srgrimes * property rights. 211556Srgrimes * 221556Srgrimes * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 231556Srgrimes * copy of the source code appearing in this file ("Covered Code") an 241556Srgrimes * irrevocable, perpetual, worldwide license under Intel's copyrights in the 251556Srgrimes * base code distributed originally by Intel ("Original Intel Code") to copy, 261556Srgrimes * make derivatives, distribute, use and display any portion of the Covered 271556Srgrimes * Code in any form, with the right to sublicense such rights; and 281556Srgrimes * 291556Srgrimes * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 301556Srgrimes * license (with the right to sublicense), under only those claims of Intel 311556Srgrimes * patents that are infringed by the Original Intel Code, to make, use, sell, 321556Srgrimes * offer to sell, and import the Covered Code and derivative works thereof 331556Srgrimes * solely to the minimum extent necessary to exercise the above copyright 3427958Ssteve * license, and in no event shall the patent license extend to any additions 351556Srgrimes * to or modifications of the Original Intel Code. No other license or right 361556Srgrimes * is granted directly or by implication, estoppel or otherwise; 3727967Ssteve * 3827967Ssteve * The above copyright and patent license is granted only if the following 3990153Smarkm * conditions are met: 4027967Ssteve * 4127967Ssteve * 3. Conditions 4290153Smarkm * 4327967Ssteve * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4499109Sobrien * Redistribution of source code of any substantial portion of the Covered 4599109Sobrien * Code or modification with rights to further distribute source must include 461556Srgrimes * the above Copyright Notice, the above License, this list of Conditions, 47226509Sdes * and the following Disclaimer and Export Compliance provision. In addition, 481556Srgrimes * Licensee must cause all Covered Code to which Licensee contributes to 491556Srgrimes * contain a file documenting the changes Licensee made to create that Covered 50105832Srwatson * Code and the date of any change. Licensee must include in that file the 511556Srgrimes * documentation of any changes made by any predecessor Licensee. Licensee 521556Srgrimes * must include a prominent statement that the modification is derived, 531556Srgrimes * directly or indirectly, from Original Intel Code. 541556Srgrimes * 551556Srgrimes * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5690878Simp * Redistribution of source code of any substantial portion of the Covered 57114583Smarkm * Code or modification without rights to further distribute source must 5850050Ssheldonh * include the following Disclaimer and Export Compliance provision in the 5950050Ssheldonh * documentation and/or other materials provided with distribution. In 6090878Simp * addition, Licensee may not authorize further sublicense of source of any 611556Srgrimes * portion of the Covered Code, and must include terms to the effect that the 621556Srgrimes * license from Licensee to its licensee is limited to the intellectual 631556Srgrimes * property embodied in the software Licensee provides to its licensee, and 6461289Sache * not to intellectual property embodied in modifications its licensee may 6561268Sjoe * make. 6661289Sache * 6761289Sache * 3.3. Redistribution of Executable. Redistribution in executable form of any 6861268Sjoe * substantial portion of the Covered Code or modification must reproduce the 691556Srgrimes * above Copyright Notice, and the following Disclaimer and Export Compliance 701556Srgrimes * provision in the documentation and/or other materials provided with the 711556Srgrimes * distribution. 721556Srgrimes * 7350050Ssheldonh * 3.4. Intel retains all right, title, and interest in and to the Original 7450050Ssheldonh * Intel Code. 7550050Ssheldonh * 7650050Ssheldonh * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7750050Ssheldonh * Intel shall be used in advertising or otherwise to promote the sale, use or 7850051Ssheldonh * other dealings in products derived from or relating to the Covered Code 7950050Ssheldonh * without prior written authorization from Intel. 80114583Smarkm * 81242840Speter * 4. Disclaimer and Export Compliance 82114583Smarkm * 83114583Smarkm * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84114583Smarkm * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85114583Smarkm * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86114583Smarkm * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87114583Smarkm * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88114583Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89114583Smarkm * PARTICULAR PURPOSE. 90114583Smarkm * 91114583Smarkm * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92114583Smarkm * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93114583Smarkm * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94114583Smarkm * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95114583Smarkm * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96103726Swollman * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9790110Simp * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 981556Srgrimes * LIMITED REMEDY. 99114583Smarkm * 10090110Simp * 4.3. Licensee shall not export, either directly or indirectly, any of this 1011556Srgrimes * software or system incorporating such software without first obtaining any 1021556Srgrimes * required license or other approval from the U. S. Department of Commerce or 1031556Srgrimes * any other agency or department of the United States Government. In the 1041556Srgrimes * event Licensee exports any such software from the United States or 1051556Srgrimes * re-exports any such software from a foreign destination, Licensee shall 10690150Smarkm * ensure that the distribution and export/re-export of the software is in 107157098Sjhb * compliance with all laws, regulations, orders, or other restrictions of the 10890150Smarkm * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10990150Smarkm * any of its subsidiaries will export/re-export any technical data, process, 11090150Smarkm * software, or service, directly or indirectly, to any country for which the 11190150Smarkm * United States government or any agency thereof requires an export license, 112242725Sgrog * other governmental approval, or letter of assurance, without first obtaining 11390150Smarkm * such license, approval or letter. 11490150Smarkm * 115242725Sgrog *****************************************************************************/ 116152469Sru 117203665Sjh#ifndef __ACGLOBAL_H__ 11890150Smarkm#define __ACGLOBAL_H__ 11990150Smarkm 12090150Smarkm 12190150Smarkm/* 12290150Smarkm * Ensure that the globals are actually defined only once. 12390150Smarkm * 12490150Smarkm * The use of these defines allows a single list of globals (here) in order 12590150Smarkm * to simplify maintenance of the code. 126242725Sgrog */ 127242725Sgrog#ifdef DEFINE_ACPI_GLOBALS 12890150Smarkm#define ACPI_EXTERN 12990150Smarkm#else 130242725Sgrog#define ACPI_EXTERN extern 13196892Stjr#endif 132177907Sgrog 13390150Smarkm 134114583Smarkmextern NATIVE_CHAR *MsgAcpiErrorBreak; 135242725Sgrog 136242807Sgrog/***************************************************************************** 13790150Smarkm * 13890150Smarkm * Debug support 13990150Smarkm * 140242725Sgrog ****************************************************************************/ 14161268Sjoe 14290150Smarkm/* Runtime configuration of debug print levels */ 14361271Sjoe 14461271Sjoeextern UINT32 AcpiDbgLevel; 14561271Sjoeextern UINT32 AcpiDbgLayer; 14661271Sjoe 14788583Sjoe 14888583Sjoe/* Procedure nesting level for debug output */ 14961268Sjoe 1501556Srgrimesextern UINT32 AcpiGbl_NestingLevel; 15190150Smarkm 15217852Sadam 1531556Srgrimes/***************************************************************************** 15490110Simp * 1551556Srgrimes * ACPI Table globals 15688602Sjoe * 1571556Srgrimes ****************************************************************************/ 1581556Srgrimes 1591556Srgrimes/* 16061271Sjoe * Table pointers. 16188602Sjoe * Although these pointers are somewhat redundant with the global AcpiTable, 16288602Sjoe * they are convenient because they are typed pointers. 16361271Sjoe * 16461271Sjoe * These tables are single-table only; meaning that there can be at most one 16561271Sjoe * of each in the system. Each global points to the actual table. 16688602Sjoe * 16711808Sache */ 1681556SrgrimesACPI_EXTERN RSDP_DESCRIPTOR *AcpiGbl_RSDP; 1691556SrgrimesACPI_EXTERN XSDT_DESCRIPTOR *AcpiGbl_XSDT; 17097803StjrACPI_EXTERN FADT_DESCRIPTOR *AcpiGbl_FADT; 17197803StjrACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT; 17297803StjrACPI_EXTERN ACPI_COMMON_FACS *AcpiGbl_FACS; 17397803Stjr 17497803Stjr/* 1751556Srgrimes * Since there may be multiple SSDTs and PSDTS, a single pointer is not 17690150Smarkm * sufficient; Therefore, there isn't one! 1775158Sjoerg */ 1781556Srgrimes 1795158Sjoerg 18090150Smarkm/* 18190150Smarkm * ACPI Table info arrays 1825158Sjoerg */ 1835158Sjoergextern ACPI_TABLE_DESC AcpiGbl_AcpiTables[NUM_ACPI_TABLES]; 1841556Srgrimesextern ACPI_TABLE_SUPPORT AcpiGbl_AcpiTableData[NUM_ACPI_TABLES]; 1851556Srgrimes 186242725Sgrog/* 187242725Sgrog * Predefined mutex objects. This array contains the 188242807Sgrog * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 189242725Sgrog * (The table maps local handles to the real OS handles) 1901556Srgrimes */ 1911556SrgrimesACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_AcpiMutexInfo [NUM_MTX]; 19296892Stjr 19396892Stjr 1941556Srgrimes/***************************************************************************** 1951556Srgrimes * 1961556Srgrimes * Miscellaneous globals 19790150Smarkm * 19896892Stjr ****************************************************************************/ 1991556Srgrimes 2001556Srgrimes 20196892StjrACPI_EXTERN UINT8 *AcpiGbl_Gpe0EnableRegisterSave; 2021556SrgrimesACPI_EXTERN UINT8 *AcpiGbl_Gpe1EnableRegisterSave; 2031556SrgrimesACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk; 2041556SrgrimesACPI_EXTERN ACPI_GENERIC_STATE *AcpiGbl_GenericStateCache; 20590150SmarkmACPI_EXTERN ACPI_PARSE_OBJECT *AcpiGbl_ParseCache; 20696892StjrACPI_EXTERN ACPI_PARSE2_OBJECT *AcpiGbl_ExtParseCache; 2071556SrgrimesACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ObjectCache; 20896892StjrACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_WalkStateCache; 20996892StjrACPI_EXTERN ACPI_HANDLE AcpiGbl_GlobalLockSemaphore; 21096892Stjr 21196892Stjr 21296892StjrACPI_EXTERN UINT32 AcpiGbl_GlobalLockThreadCount; 213157098SjhbACPI_EXTERN UINT32 AcpiGbl_RestoreAcpiChipset; 2141556SrgrimesACPI_EXTERN UINT32 AcpiGbl_OriginalMode; 2151556SrgrimesACPI_EXTERN UINT32 AcpiGbl_EdgeLevelSave; 2161556SrgrimesACPI_EXTERN UINT32 AcpiGbl_IrqEnableSave; 217157098SjhbACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation; 2181556Srgrimes 2191556SrgrimesACPI_EXTERN UINT32 AcpiGbl_StateCacheRequests; 2201556SrgrimesACPI_EXTERN UINT32 AcpiGbl_StateCacheHits; 2211556SrgrimesACPI_EXTERN UINT32 AcpiGbl_ParseCacheRequests; 222157098SjhbACPI_EXTERN UINT32 AcpiGbl_ParseCacheHits; 2231556SrgrimesACPI_EXTERN UINT32 AcpiGbl_ExtParseCacheRequests; 224157098SjhbACPI_EXTERN UINT32 AcpiGbl_ExtParseCacheHits; 225157098SjhbACPI_EXTERN UINT32 AcpiGbl_ObjectCacheRequests; 226157098SjhbACPI_EXTERN UINT32 AcpiGbl_ObjectCacheHits; 227157098SjhbACPI_EXTERN UINT32 AcpiGbl_WalkStateCacheRequests; 228157098SjhbACPI_EXTERN UINT32 AcpiGbl_WalkStateCacheHits; 229242722SgrogACPI_EXTERN UINT32 AcpiGbl_NsLookupCount; 230242722SgrogACPI_EXTERN UINT32 AcpiGbl_PsFindCount; 231242722Sgrog 232242722Sgrog 233242722SgrogACPI_EXTERN UINT16 AcpiGbl_GenericStateCacheDepth; 234242722SgrogACPI_EXTERN UINT16 AcpiGbl_ParseCacheDepth; 235242722SgrogACPI_EXTERN UINT16 AcpiGbl_ExtParseCacheDepth; 236242722SgrogACPI_EXTERN UINT16 AcpiGbl_ObjectCacheDepth; 237242722SgrogACPI_EXTERN UINT16 AcpiGbl_WalkStateCacheDepth; 238242722SgrogACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave; 239242722SgrogACPI_EXTERN UINT16 AcpiGbl_NextTableOwnerId; 240242722SgrogACPI_EXTERN UINT16 AcpiGbl_NextMethodOwnerId; 241242722Sgrog 242242722SgrogACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration; 243242722SgrogACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired; 244242840SpeterACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockSet; /* TBD: [Restructure] OBSOLETE?? */ 245242725SgrogACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; 246242725SgrogACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; 247242725Sgrog 248242722Sgrog 249242722SgrogACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DrvNotify; 250242722SgrogACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SysNotify; 251242722Sgrog 252242722Sgrog 253242807Sgrogextern BOOLEAN AcpiGbl_Shutdown; 254242807Sgrogextern UINT32 AcpiGbl_SystemFlags; 255242807Sgrogextern UINT32 AcpiGbl_StartupFlags; 256242807Sgrogextern UINT8 AcpiGbl_DecodeTo8bit[]; 2571556Srgrimes 25896892Stjr 2591556Srgrimes/***************************************************************************** 260242722Sgrog * 261242722Sgrog * Namespace globals 262242722Sgrog * 26335426Sdes ****************************************************************************/ 26488602Sjoe 265203665Sjh#define NUM_NS_TYPES INTERNAL_TYPE_INVALID+1 26635426Sdes#define NUM_PREDEFINED_NAMES 9 267242722Sgrog 268242722Sgrog 26961178SjoeACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct; 2701556SrgrimesACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode; 2711556Srgrimes 2721556Srgrimesextern UINT8 AcpiGbl_NsProperties[NUM_NS_TYPES]; 273203665Sjhextern PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; 2741556Srgrimes 27535426Sdes 27688602Sjoe/* Used to detect memory leaks (DEBUG ONLY) */ 27735426Sdes 27835426Sdes#ifdef ACPI_DEBUG 279203665SjhACPI_EXTERN ALLOCATION_INFO *AcpiGbl_HeadAllocPtr; 28035426SdesACPI_EXTERN ALLOCATION_INFO *AcpiGbl_TailAllocPtr; 2811556Srgrimes#endif 2821556Srgrimes 2831556Srgrimes 284242722Sgrog/***************************************************************************** 285242722Sgrog * 2861556Srgrimes * Interpreter globals 287242722Sgrog * 288242722Sgrog ****************************************************************************/ 289152256Smux 290242722Sgrog 291242722SgrogACPI_EXTERN ACPI_WALK_LIST *AcpiGbl_CurrentWalkList; 292242722Sgrog 293242722Sgrog/* 294242722Sgrog * Handle to the last method found - used during pass1 of load 295242722Sgrog */ 296242722SgrogACPI_EXTERN ACPI_HANDLE AcpiGbl_LastMethod; 297242722Sgrog 2981556Srgrimes/* 2991556Srgrimes * Table of Address Space handlers 3001556Srgrimes */ 3011556Srgrimes 3021556SrgrimesACPI_EXTERN ACPI_ADDRESS_SPACE_INFO AcpiGbl_AddressSpaces[ACPI_NUM_ADDRESS_SPACES]; 3031556Srgrimes 3041556Srgrimes 3051556Srgrimes/* Control method single step flag */ 30688602Sjoe 3071556SrgrimesACPI_EXTERN UINT8 AcpiGbl_CmSingleStep; 30888591Sjoe 30988591Sjoe 31088591Sjoe/***************************************************************************** 3111556Srgrimes * 3121556Srgrimes * Parser globals 3131556Srgrimes * 3142889Spst ****************************************************************************/ 315123089Sobrien 3162889SpstACPI_EXTERN ACPI_PARSE_OBJECT *AcpiGbl_ParsedNamespaceRoot; 3172889Spst 31896892Stjr/***************************************************************************** 31996892Stjr * 32096892Stjr * Hardware globals 32196892Stjr * 32296892Stjr ****************************************************************************/ 32349373Ssheldonh 32449373Ssheldonhextern ACPI_C_STATE_HANDLER AcpiHwCxHandlers[MAX_CX_STATES]; 32549373Ssheldonhextern UINT32 AcpiHwActiveCxState; 3261556Srgrimes 3271556Srgrimes 3281556Srgrimes/***************************************************************************** 32996892Stjr * 33096892Stjr * Event globals 33196892Stjr * 33296892Stjr ****************************************************************************/ 3331556Srgrimes 3341556SrgrimesACPI_EXTERN ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventHandlers[NUM_FIXED_EVENTS]; 33535373Sdes 33688602SjoeACPI_EXTERN ACPI_HANDLE AcpiGbl_GpeObjHandle; 3371556SrgrimesACPI_EXTERN UINT32 AcpiGbl_GpeRegisterCount; 3381556SrgrimesACPI_EXTERN ACPI_GPE_REGISTERS *AcpiGbl_GpeRegisters; 3391556SrgrimesACPI_EXTERN ACPI_GPE_LEVEL_INFO *AcpiGbl_GpeInfo; 3401556Srgrimes 3411556Srgrimes/* 3421556Srgrimes * Gpe validation and translation table 3431556Srgrimes * Indexed by the GPE number, returns GPE_INVALID if the GPE is not supported. 34488603Sjoe * Otherwise, returns a valid index into the global GPE table. 34588603Sjoe * 34688603Sjoe * This table is needed because the GPE numbers supported by block 1 do not 34788603Sjoe * have to be contiguous with the GPE numbers supported by block 0. 34888603Sjoe */ 349242725SgrogACPI_EXTERN UINT8 AcpiGbl_GpeValid [NUM_GPE]; 350242725Sgrog 351242725Sgrog/* AcpiEvent counter for debug only */ 3521556Srgrimes 3531556Srgrimes#ifdef ACPI_DEBUG 3541556SrgrimesACPI_EXTERN UINT32 AcpiGbl_EventCount[NUM_FIXED_EVENTS]; 3551556Srgrimes#endif 3561556Srgrimes 3571556Srgrimes 3581556Srgrimes/***************************************************************************** 3591556Srgrimes * 360152469Sru * Debugger globals 361152469Sru * 362152256Smux ****************************************************************************/ 363152256Smux 36464568Sjoe#ifdef ENABLE_DEBUGGER 36564568SjoeACPI_EXTERN BOOLEAN AcpiGbl_MethodExecuting; 36664568SjoeACPI_EXTERN BOOLEAN AcpiGbl_DbTerminateThreads; 36764604Sjoe#endif 36864568Sjoe 36964568Sjoe/* Memory allocation metrics - Debug Only! */ 37064568Sjoe 37188583Sjoe#ifdef ACPI_DEBUG 37288583Sjoe 37364568SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentAllocSize; 37464568SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentAllocCount; 37564568SjoeACPI_EXTERN UINT32 AcpiGbl_RunningAllocSize; 37664568SjoeACPI_EXTERN UINT32 AcpiGbl_RunningAllocCount; 37764568SjoeACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentAllocSize; 37864568SjoeACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentAllocCount; 37964568SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentObjectCount; 38064568SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentObjectSize; 38164568SjoeACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentObjectCount; 38264568SjoeACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentObjectSize; 38364604SjoeACPI_EXTERN UINT32 AcpiGbl_RunningObjectCount; 384106479StjrACPI_EXTERN UINT32 AcpiGbl_RunningObjectSize; 38564604SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount; 38664568SjoeACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize; 38764604SjoeACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount; 38861289Sache 38961337Sache#endif 39061337Sache 39161337Sache 39261337Sache#endif /* __ACGLOBAL_H__ */ 39361337Sache