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