acglobal.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. /******************************************************************************
  2. *
  3. * Name: acglobal.h - Declarations for global variables
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2015, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACGLOBAL_H__
  43. #define __ACGLOBAL_H__
  44. /*****************************************************************************
  45. *
  46. * Globals related to the ACPI tables
  47. *
  48. ****************************************************************************/
  49. /* Master list of all ACPI tables that were found in the RSDT/XSDT */
  50. ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
  51. /* DSDT information. Used to check for DSDT corruption */
  52. ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
  53. ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
  54. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX);
  55. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX);
  56. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX);
  57. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX);
  58. #if (!ACPI_REDUCED_HARDWARE)
  59. ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
  60. #endif /* !ACPI_REDUCED_HARDWARE */
  61. /* These addresses are calculated from the FADT Event Block addresses */
  62. ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus);
  63. ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable);
  64. ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus);
  65. ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable);
  66. /*
  67. * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
  68. * determined by the revision of the DSDT: If the DSDT revision is less than
  69. * 2, use only the lower 32 bits of the internal 64-bit Integer.
  70. */
  71. ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
  72. ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
  73. ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
  74. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
  75. /*****************************************************************************
  76. *
  77. * Mutual exclusion within ACPICA subsystem
  78. *
  79. ****************************************************************************/
  80. /*
  81. * Predefined mutex objects. This array contains the
  82. * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
  83. * (The table maps local handles to the real OS handles)
  84. */
  85. ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]);
  86. /*
  87. * Global lock mutex is an actual AML mutex object
  88. * Global lock semaphore works in conjunction with the actual global lock
  89. * Global lock spinlock is used for "pending" handshake
  90. */
  91. ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex);
  92. ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore);
  93. ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock);
  94. ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle);
  95. ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired);
  96. ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent);
  97. ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending);
  98. /*
  99. * Spinlocks are used for interfaces that can be possibly called at
  100. * interrupt level
  101. */
  102. ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */
  103. ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */
  104. ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock);
  105. /* Mutex for _OSI support */
  106. ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex);
  107. /* Reader/Writer lock is used for namespace walk and dynamic table unload */
  108. ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock);
  109. /*****************************************************************************
  110. *
  111. * Miscellaneous globals
  112. *
  113. ****************************************************************************/
  114. /* Object caches */
  115. ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache);
  116. ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache);
  117. ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache);
  118. ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache);
  119. ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
  120. /* System */
  121. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
  122. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
  123. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_EarlyInitialization, TRUE);
  124. /* Global handlers */
  125. ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]);
  126. ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
  127. ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
  128. ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
  129. ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
  130. ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
  131. ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
  132. /* Owner ID support */
  133. ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]);
  134. ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex);
  135. ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
  136. /* Initialization sequencing */
  137. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsEnabled, FALSE);
  138. /* Misc */
  139. ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
  140. ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
  141. ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
  142. ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
  143. ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration);
  144. ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall);
  145. ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent);
  146. ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized);
  147. ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces);
  148. ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]);
  149. /* Other miscellaneous, declared and initialized in utglobal */
  150. extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
  151. extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS];
  152. extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS];
  153. extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS];
  154. extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
  155. #ifdef ACPI_DBG_TRACK_ALLOCATIONS
  156. /* Lists for tracking memory allocations (debug only) */
  157. ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList);
  158. ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList);
  159. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats);
  160. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
  161. #endif
  162. /*****************************************************************************
  163. *
  164. * Namespace globals
  165. *
  166. ****************************************************************************/
  167. #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
  168. #define NUM_PREDEFINED_NAMES 10
  169. #else
  170. #define NUM_PREDEFINED_NAMES 9
  171. #endif
  172. ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
  173. ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
  174. ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
  175. ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList);
  176. extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
  177. extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
  178. #ifdef ACPI_DEBUG_OUTPUT
  179. ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount);
  180. ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize);
  181. ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount);
  182. ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer);
  183. ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer);
  184. ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting);
  185. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
  186. #endif
  187. /*****************************************************************************
  188. *
  189. * Interpreter globals
  190. *
  191. ****************************************************************************/
  192. ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
  193. /* Maximum number of While() loop iterations before forced abort */
  194. ACPI_GLOBAL (UINT16, AcpiGbl_MaxLoopIterations);
  195. /* Control method single step flag */
  196. ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
  197. /*****************************************************************************
  198. *
  199. * Hardware globals
  200. *
  201. ****************************************************************************/
  202. extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
  203. ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA);
  204. ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB);
  205. /*****************************************************************************
  206. *
  207. * Event and GPE globals
  208. *
  209. ****************************************************************************/
  210. #if (!ACPI_REDUCED_HARDWARE)
  211. ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized);
  212. ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead);
  213. ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]);
  214. ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler);
  215. ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext);
  216. ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]);
  217. extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
  218. #endif /* !ACPI_REDUCED_HARDWARE */
  219. /*****************************************************************************
  220. *
  221. * Debug support
  222. *
  223. ****************************************************************************/
  224. /* Event counters */
  225. ACPI_GLOBAL (UINT32, AcpiMethodCount);
  226. ACPI_GLOBAL (UINT32, AcpiGpeCount);
  227. ACPI_GLOBAL (UINT32, AcpiSciCount);
  228. ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]);
  229. /* Support for dynamic control method tracing mechanism */
  230. ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
  231. ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
  232. /*****************************************************************************
  233. *
  234. * Debugger and Disassembler globals
  235. *
  236. ****************************************************************************/
  237. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
  238. #ifdef ACPI_DISASSEMBLER
  239. /* Do not disassemble buffers to resource descriptors */
  240. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
  241. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
  242. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
  243. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
  244. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE);
  245. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm);
  246. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing);
  247. ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
  248. ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
  249. ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
  250. ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
  251. #endif
  252. #ifdef ACPI_DEBUGGER
  253. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
  254. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
  255. ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID);
  256. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
  257. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
  258. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
  259. ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
  260. ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
  261. ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
  262. ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
  263. ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
  264. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateLoop);
  265. ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbThreadsTerminated);
  266. ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
  267. ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
  268. /* These buffers should all be the same size */
  269. ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]);
  270. ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]);
  271. ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]);
  272. ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]);
  273. /*
  274. * Statistic globals
  275. */
  276. ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TOTAL_TYPES]);
  277. ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TOTAL_TYPES]);
  278. ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc);
  279. ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
  280. ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
  281. ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
  282. ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandReady);
  283. ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandComplete);
  284. #endif /* ACPI_DEBUGGER */
  285. /*****************************************************************************
  286. *
  287. * Application globals
  288. *
  289. ****************************************************************************/
  290. #ifdef ACPI_APPLICATION
  291. ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
  292. ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
  293. /* Print buffer */
  294. ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
  295. ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
  296. #endif /* ACPI_APPLICATION */
  297. /*****************************************************************************
  298. *
  299. * Info/help support
  300. *
  301. ****************************************************************************/
  302. extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
  303. extern const AH_DEVICE_ID AslDeviceIds[];
  304. #endif /* __ACGLOBAL_H__ */