1/****************************************************************************** 2 * 3 * Name: acglobal.h - Declarations for global variables 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2015, 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 * 50 * Globals related to the ACPI tables 51 * 52 ****************************************************************************/ 53 54/* Master list of all ACPI tables that were found in the RSDT/XSDT */ 55 56ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList); 57 58/* DSDT information. Used to check for DSDT corruption */ 59 60ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT); 61ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); 62 63#if (!ACPI_REDUCED_HARDWARE) 64ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); 65 66#endif /* !ACPI_REDUCED_HARDWARE */ 67 68/* These addresses are calculated from the FADT Event Block addresses */ 69 70ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus); 71ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable); 72 73ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus); 74ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable); 75 76/* 77 * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is 78 * determined by the revision of the DSDT: If the DSDT revision is less than 79 * 2, use only the lower 32 bits of the internal 64-bit Integer. 80 */ 81ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth); 82ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth); 83ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth); 84 85 86/***************************************************************************** 87 * 88 * Mutual exclusion within ACPICA subsystem 89 * 90 ****************************************************************************/ 91 92/* 93 * Predefined mutex objects. This array contains the 94 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 95 * (The table maps local handles to the real OS handles) 96 */ 97ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]); 98 99/* 100 * Global lock mutex is an actual AML mutex object 101 * Global lock semaphore works in conjunction with the actual global lock 102 * Global lock spinlock is used for "pending" handshake 103 */ 104ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex); 105ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore); 106ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock); 107ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle); 108ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired); 109ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent); 110ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending); 111 112/* 113 * Spinlocks are used for interfaces that can be possibly called at 114 * interrupt level 115 */ 116ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */ 117ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */ 118ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock); 119 120/* Mutex for _OSI support */ 121 122ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex); 123 124/* Reader/Writer lock is used for namespace walk and dynamic table unload */ 125 126ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock); 127 128 129/***************************************************************************** 130 * 131 * Miscellaneous globals 132 * 133 ****************************************************************************/ 134 135/* Object caches */ 136 137ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache); 138ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache); 139ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache); 140ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache); 141ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache); 142 143/* System */ 144 145ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0); 146ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE); 147 148/* Global handlers */ 149 150ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]); 151ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler); 152ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler); 153ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler); 154ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext); 155ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler); 156ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList); 157 158/* Owner ID support */ 159 160ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]); 161ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex); 162ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset); 163 164/* Initialization sequencing */ 165 166ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted); 167 168/* Misc */ 169 170ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode); 171ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount); 172ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount); 173ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave); 174ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration); 175ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall); 176ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent); 177ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized); 178ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces); 179ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]); 180 181/* Other miscellaneous, declared and initialized in utglobal */ 182 183extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT]; 184extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]; 185extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]; 186extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]; 187extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; 188 189 190#ifdef ACPI_DBG_TRACK_ALLOCATIONS 191 192/* Lists for tracking memory allocations (debug only) */ 193 194ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList); 195ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList); 196ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats); 197ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking); 198#endif 199 200 201/***************************************************************************** 202 * 203 * Namespace globals 204 * 205 ****************************************************************************/ 206 207#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 208#define NUM_PREDEFINED_NAMES 10 209#else 210#define NUM_PREDEFINED_NAMES 9 211#endif 212 213ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct); 214ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode); 215ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice); 216ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList); 217 218 219extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]; 220extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; 221 222#ifdef ACPI_DEBUG_OUTPUT 223ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount); 224ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize); 225ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount); 226ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); 227ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer); 228ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting); 229ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); 230#endif 231 232 233/***************************************************************************** 234 * 235 * Interpreter globals 236 * 237 ****************************************************************************/ 238 239ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList); 240 241/* Control method single step flag */ 242 243ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep); 244 245 246/***************************************************************************** 247 * 248 * Hardware globals 249 * 250 ****************************************************************************/ 251 252extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG]; 253 254ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA); 255ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB); 256 257 258/***************************************************************************** 259 * 260 * Event and GPE globals 261 * 262 ****************************************************************************/ 263 264#if (!ACPI_REDUCED_HARDWARE) 265 266ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized); 267ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead); 268ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]); 269ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler); 270ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext); 271ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]); 272 273extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; 274 275#endif /* !ACPI_REDUCED_HARDWARE */ 276 277/***************************************************************************** 278 * 279 * Debug support 280 * 281 ****************************************************************************/ 282 283/* Event counters */ 284 285ACPI_GLOBAL (UINT32, AcpiMethodCount); 286ACPI_GLOBAL (UINT32, AcpiGpeCount); 287ACPI_GLOBAL (UINT32, AcpiSciCount); 288ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]); 289 290/* Support for dynamic control method tracing mechanism */ 291 292ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel); 293ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer); 294ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel); 295ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer); 296 297 298/***************************************************************************** 299 * 300 * Debugger and Disassembler globals 301 * 302 ****************************************************************************/ 303 304ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT); 305 306#ifdef ACPI_DISASSEMBLER 307 308/* Do not disassemble buffers to resource descriptors */ 309 310ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE); 311ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); 312ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE); 313ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE); 314 315ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Disasm); 316ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose); 317ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods); 318ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods); 319ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList); 320ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList); 321#endif 322 323#ifdef ACPI_DEBUGGER 324 325ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE); 326ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE); 327ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE); 328 329ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods); 330ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport); 331ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile); 332ACPI_GLOBAL (char *, AcpiGbl_DbBuffer); 333ACPI_GLOBAL (char *, AcpiGbl_DbFilename); 334ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel); 335ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel); 336ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode); 337 338ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]); 339ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]); 340 341/* These buffers should all be the same size */ 342 343ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]); 344ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]); 345ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]); 346ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]); 347 348/* 349 * Statistic globals 350 */ 351ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); 352ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); 353ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc); 354ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); 355ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); 356ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects); 357 358#endif /* ACPI_DEBUGGER */ 359 360 361/***************************************************************************** 362 * 363 * Application globals 364 * 365 ****************************************************************************/ 366 367#ifdef ACPI_APPLICATION 368 369ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL); 370ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL); 371 372/* Print buffer */ 373 374ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */ 375ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]); 376 377#endif /* ACPI_APPLICATION */ 378 379 380/***************************************************************************** 381 * 382 * Info/help support 383 * 384 ****************************************************************************/ 385 386extern const AH_PREDEFINED_NAME AslPredefinedInfo[]; 387extern const AH_DEVICE_ID AslDeviceIds[]; 388 389 390#endif /* __ACGLOBAL_H__ */ 391