acglobal.h revision 249112
1/****************************************************************************** 2 * 3 * Name: acglobal.h - Declarations for global variables 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2013, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#ifndef __ACGLOBAL_H__ 45#define __ACGLOBAL_H__ 46 47 48/* 49 * Ensure that the globals are actually defined and initialized only once. 50 * 51 * The use of these macros allows a single list of globals (here) in order 52 * to simplify maintenance of the code. 53 */ 54#ifdef DEFINE_ACPI_GLOBALS 55#define ACPI_EXTERN 56#define ACPI_INIT_GLOBAL(a,b) a=b 57#else 58#define ACPI_EXTERN extern 59#define ACPI_INIT_GLOBAL(a,b) a 60#endif 61 62 63#ifdef DEFINE_ACPI_GLOBALS 64 65/* Public globals, available from outside ACPICA subsystem */ 66 67/***************************************************************************** 68 * 69 * Runtime configuration (static defaults that can be overriden at runtime) 70 * 71 ****************************************************************************/ 72 73/* 74 * Enable "slack" in the AML interpreter? Default is FALSE, and the 75 * interpreter strictly follows the ACPI specification. Setting to TRUE 76 * allows the interpreter to ignore certain errors and/or bad AML constructs. 77 * 78 * Currently, these features are enabled by this flag: 79 * 80 * 1) Allow "implicit return" of last value in a control method 81 * 2) Allow access beyond the end of an operation region 82 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 83 * 4) Allow ANY object type to be a source operand for the Store() operator 84 * 5) Allow unresolved references (invalid target name) in package objects 85 * 6) Enable warning messages for behavior that is not ACPI spec compliant 86 */ 87UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableInterpreterSlack, FALSE); 88 89/* 90 * Automatically serialize ALL control methods? Default is FALSE, meaning 91 * to use the Serialized/NotSerialized method flags on a per method basis. 92 * Only change this if the ASL code is poorly written and cannot handle 93 * reentrancy even though methods are marked "NotSerialized". 94 */ 95UINT8 ACPI_INIT_GLOBAL (AcpiGbl_AllMethodsSerialized, FALSE); 96 97/* 98 * Create the predefined _OSI method in the namespace? Default is TRUE 99 * because ACPI CA is fully compatible with other ACPI implementations. 100 * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. 101 */ 102UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE); 103 104/* 105 * Optionally use default values for the ACPI register widths. Set this to 106 * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. 107 */ 108UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE); 109 110/* 111 * Optionally enable output from the AML Debug Object. 112 */ 113UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE); 114 115/* 116 * Optionally copy the entire DSDT to local memory (instead of simply 117 * mapping it.) There are some BIOSs that corrupt or replace the original 118 * DSDT, creating the need for this option. Default is FALSE, do not copy 119 * the DSDT. 120 */ 121UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE); 122 123/* 124 * Optionally truncate I/O addresses to 16 bits. Provides compatibility 125 * with other ACPI implementations. NOTE: During ACPICA initialization, 126 * this value is set to TRUE if any Windows OSI strings have been 127 * requested by the BIOS. 128 */ 129UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE); 130 131/* 132 * Disable runtime checking and repair of values returned by control methods. 133 * Use only if the repair is causing a problem on a particular machine. 134 */ 135UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE); 136 137 138/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ 139 140ACPI_TABLE_FADT AcpiGbl_FADT; 141UINT32 AcpiCurrentGpeCount; 142UINT32 AcpiGbl_TraceFlags; 143ACPI_NAME AcpiGbl_TraceMethodName; 144BOOLEAN AcpiGbl_SystemAwakeAndRunning; 145 146/* 147 * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning 148 * that the ACPI hardware is no longer required. A flag in the FADT indicates 149 * a reduced HW machine, and that flag is duplicated here for convenience. 150 */ 151BOOLEAN AcpiGbl_ReducedHardware; 152 153#endif /* DEFINE_ACPI_GLOBALS */ 154 155/* Do not disassemble buffers to resource descriptors */ 156 157ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE); 158 159/***************************************************************************** 160 * 161 * ACPI Table globals 162 * 163 ****************************************************************************/ 164 165/* 166 * AcpiGbl_RootTableList is the master list of ACPI tables that were 167 * found in the RSDT/XSDT. 168 */ 169ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList; 170 171#if (!ACPI_REDUCED_HARDWARE) 172ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS; 173 174#endif /* !ACPI_REDUCED_HARDWARE */ 175 176/* These addresses are calculated from the FADT Event Block addresses */ 177 178ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus; 179ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aEnable; 180 181ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bStatus; 182ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bEnable; 183 184/* DSDT information. Used to check for DSDT corruption */ 185 186ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT; 187ACPI_EXTERN ACPI_TABLE_HEADER AcpiGbl_OriginalDsdtHeader; 188 189/* 190 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is 191 * determined by the revision of the DSDT: If the DSDT revision is less than 192 * 2, use only the lower 32 bits of the internal 64-bit Integer. 193 */ 194ACPI_EXTERN UINT8 AcpiGbl_IntegerBitWidth; 195ACPI_EXTERN UINT8 AcpiGbl_IntegerByteWidth; 196ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth; 197 198 199/***************************************************************************** 200 * 201 * Mutual exclusion within ACPICA subsystem 202 * 203 ****************************************************************************/ 204 205/* 206 * Predefined mutex objects. This array contains the 207 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 208 * (The table maps local handles to the real OS handles) 209 */ 210ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]; 211 212/* 213 * Global lock mutex is an actual AML mutex object 214 * Global lock semaphore works in conjunction with the actual global lock 215 * Global lock spinlock is used for "pending" handshake 216 */ 217ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex; 218ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore; 219ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock; 220ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle; 221ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired; 222ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent; 223ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending; 224 225/* 226 * Spinlocks are used for interfaces that can be possibly called at 227 * interrupt level 228 */ 229ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */ 230ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */ 231ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_ReferenceCountLock; 232 233/* Mutex for _OSI support */ 234 235ACPI_EXTERN ACPI_MUTEX AcpiGbl_OsiMutex; 236 237/* Reader/Writer lock is used for namespace walk and dynamic table unload */ 238 239ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock; 240 241 242/***************************************************************************** 243 * 244 * Miscellaneous globals 245 * 246 ****************************************************************************/ 247 248/* Object caches */ 249 250ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_NamespaceCache; 251ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_StateCache; 252ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeCache; 253ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeExtCache; 254ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache; 255 256/* Global handlers */ 257 258ACPI_EXTERN ACPI_GLOBAL_NOTIFY_HANDLER AcpiGbl_GlobalNotify[2]; 259ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler; 260ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler; 261ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler; 262ACPI_EXTERN void *AcpiGbl_TableHandlerContext; 263ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk; 264ACPI_EXTERN ACPI_INTERFACE_HANDLER AcpiGbl_InterfaceHandler; 265 266/* Owner ID support */ 267 268ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]; 269ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex; 270ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset; 271 272/* Initialization sequencing */ 273 274ACPI_EXTERN BOOLEAN AcpiGbl_RegMethodsExecuted; 275 276/* Misc */ 277 278ACPI_EXTERN UINT32 AcpiGbl_OriginalMode; 279ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation; 280ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount; 281ACPI_EXTERN UINT32 AcpiGbl_PsFindCount; 282ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave; 283ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration; 284ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; 285ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; 286ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; 287ACPI_EXTERN UINT8 AcpiGbl_OsiData; 288ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces; 289ACPI_EXTERN ACPI_ADDRESS_RANGE *AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]; 290 291#ifndef DEFINE_ACPI_GLOBALS 292 293/* Other miscellaneous */ 294 295extern BOOLEAN AcpiGbl_Shutdown; 296extern UINT32 AcpiGbl_StartupFlags; 297extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT]; 298extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]; 299extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]; 300extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; 301extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]; 302#endif 303 304 305#ifdef ACPI_DBG_TRACK_ALLOCATIONS 306 307/* Lists for tracking memory allocations */ 308 309ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList; 310ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList; 311ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats; 312ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking; 313#endif 314 315 316/***************************************************************************** 317 * 318 * Namespace globals 319 * 320 ****************************************************************************/ 321 322#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 323#define NUM_PREDEFINED_NAMES 10 324#else 325#define NUM_PREDEFINED_NAMES 9 326#endif 327 328ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct; 329ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode; 330ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice; 331ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList; 332 333 334extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]; 335extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; 336 337#ifdef ACPI_DEBUG_OUTPUT 338ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount; 339ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize; 340ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount; 341ACPI_EXTERN ACPI_SIZE *AcpiGbl_EntryStackPointer; 342ACPI_EXTERN ACPI_SIZE *AcpiGbl_LowestStackPointer; 343ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting; 344#endif 345 346 347/***************************************************************************** 348 * 349 * Interpreter globals 350 * 351 ****************************************************************************/ 352 353ACPI_EXTERN ACPI_THREAD_STATE *AcpiGbl_CurrentWalkList; 354 355/* Control method single step flag */ 356 357ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep; 358 359 360/***************************************************************************** 361 * 362 * Hardware globals 363 * 364 ****************************************************************************/ 365 366extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG]; 367ACPI_EXTERN UINT8 AcpiGbl_SleepTypeA; 368ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB; 369 370 371/***************************************************************************** 372 * 373 * Event and GPE globals 374 * 375 ****************************************************************************/ 376 377#if (!ACPI_REDUCED_HARDWARE) 378 379ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized; 380ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead; 381ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]; 382ACPI_EXTERN ACPI_GBL_EVENT_HANDLER AcpiGbl_GlobalEventHandler; 383ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext; 384ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]; 385extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; 386 387#endif /* !ACPI_REDUCED_HARDWARE */ 388 389/***************************************************************************** 390 * 391 * Debug support 392 * 393 ****************************************************************************/ 394 395/* Procedure nesting level for debug output */ 396 397extern UINT32 AcpiGbl_NestingLevel; 398 399/* Event counters */ 400 401ACPI_EXTERN UINT32 AcpiMethodCount; 402ACPI_EXTERN UINT32 AcpiGpeCount; 403ACPI_EXTERN UINT32 AcpiSciCount; 404ACPI_EXTERN UINT32 AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]; 405 406/* Support for dynamic control method tracing mechanism */ 407 408ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel; 409ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer; 410ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel; 411ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer; 412 413 414/***************************************************************************** 415 * 416 * Debugger and Disassembler globals 417 * 418 ****************************************************************************/ 419 420ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags; 421 422#ifdef ACPI_DISASSEMBLER 423 424ACPI_EXTERN BOOLEAN ACPI_INIT_GLOBAL (AcpiGbl_IgnoreNoopOperator, FALSE); 425 426ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm; 427ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose; 428ACPI_EXTERN BOOLEAN AcpiGbl_NumExternalMethods; 429ACPI_EXTERN UINT32 AcpiGbl_ResolvedExternalMethods; 430ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; 431ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList; 432#endif 433 434 435#ifdef ACPI_DEBUGGER 436 437extern BOOLEAN AcpiGbl_MethodExecuting; 438extern BOOLEAN AcpiGbl_AbortMethod; 439extern BOOLEAN AcpiGbl_DbTerminateThreads; 440 441ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_tables; 442ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_stats; 443ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods; 444ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport; 445 446ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]; 447ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]; 448ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]; 449ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]; 450ACPI_EXTERN char AcpiGbl_DbScopeBuf[80]; 451ACPI_EXTERN char AcpiGbl_DbDebugFilename[80]; 452ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile; 453ACPI_EXTERN char *AcpiGbl_DbBuffer; 454ACPI_EXTERN char *AcpiGbl_DbFilename; 455ACPI_EXTERN UINT32 AcpiGbl_DbDebugLevel; 456ACPI_EXTERN UINT32 AcpiGbl_DbConsoleDebugLevel; 457ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_DbScopeNode; 458 459/* 460 * Statistic globals 461 */ 462ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]; 463ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]; 464ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCountMisc; 465ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCountMisc; 466ACPI_EXTERN UINT32 AcpiGbl_NumNodes; 467ACPI_EXTERN UINT32 AcpiGbl_NumObjects; 468 469 470ACPI_EXTERN UINT32 AcpiGbl_SizeOfParseTree; 471ACPI_EXTERN UINT32 AcpiGbl_SizeOfMethodTrees; 472ACPI_EXTERN UINT32 AcpiGbl_SizeOfNodeEntries; 473ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects; 474 475#endif /* ACPI_DEBUGGER */ 476 477 478/***************************************************************************** 479 * 480 * Info/help support 481 * 482 ****************************************************************************/ 483 484extern const AH_PREDEFINED_NAME AslPredefinedInfo[]; 485 486 487#endif /* __ACGLOBAL_H__ */ 488