1
1

acpiinit.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*****************************************************************************
  2. *
  3. * Macros used for ACPICA globals and configuration
  4. *
  5. ****************************************************************************/
  6. /*
  7. * Ensure that global variables are defined and initialized only once.
  8. *
  9. * The use of these macros allows for a single list of globals (here)
  10. * in order to simplify maintenance of the code.
  11. */
  12. #ifdef DEFINE_ACPI_GLOBALS
  13. #define ACPI_GLOBAL(type,name) \
  14. extern type name; \
  15. type name
  16. #define ACPI_INIT_GLOBAL(type,name,value) \
  17. type name=value
  18. #else
  19. #ifndef CUSTOM_INIT_GLOBALS
  20. #ifndef ACPI_GLOBAL
  21. #define ACPI_GLOBAL(type,name) \
  22. extern type name
  23. #endif
  24. #ifndef ACPI_INIT_GLOBAL
  25. #define ACPI_INIT_GLOBAL(type,name,value) \
  26. extern type name
  27. #endif
  28. #else
  29. #ifndef ACPI_GLOBAL
  30. #define ACPI_GLOBAL(type,name)
  31. #endif
  32. #ifndef ACPI_INIT_GLOBAL
  33. #define ACPI_INIT_GLOBAL(type,name,value) \
  34. name=value
  35. #endif
  36. #endif
  37. #endif
  38. /*****************************************************************************
  39. *
  40. * Public globals and runtime configuration options
  41. *
  42. ****************************************************************************/
  43. /*
  44. * Enable "slack mode" of the AML interpreter? Default is FALSE, and the
  45. * interpreter strictly follows the ACPI specification. Setting to TRUE
  46. * allows the interpreter to ignore certain errors and/or bad AML constructs.
  47. *
  48. * Currently, these features are enabled by this flag:
  49. *
  50. * 1) Allow "implicit return" of last value in a control method
  51. * 2) Allow access beyond the end of an operation region
  52. * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
  53. * 4) Allow ANY object type to be a source operand for the Store() operator
  54. * 5) Allow unresolved references (invalid target name) in package objects
  55. * 6) Enable warning messages for behavior that is not ACPI spec compliant
  56. */
  57. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE);
  58. /*
  59. * Automatically serialize all methods that create named objects? Default
  60. * is TRUE, meaning that all NonSerialized methods are scanned once at
  61. * table load time to determine those that create named objects. Methods
  62. * that create named objects are marked Serialized in order to prevent
  63. * possible run-time problems if they are entered by more than one thread.
  64. */
  65. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE);
  66. /*
  67. * Create the predefined _OSI method in the namespace? Default is TRUE
  68. * because ACPICA is fully compatible with other ACPI implementations.
  69. * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior.
  70. */
  71. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE);
  72. /*
  73. * Optionally use default values for the ACPI register widths. Set this to
  74. * TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
  75. */
  76. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE);
  77. /*
  78. * Whether or not to validate (map) an entire table to verify
  79. * checksum/duplication in early stage before install. Set this to TRUE to
  80. * allow early table validation before install it to the table manager.
  81. * Note that enabling this option causes errors to happen in some OSPMs
  82. * during early initialization stages. Default behavior is to allow such
  83. * validation.
  84. */
  85. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableTableValidation, TRUE);
  86. /*
  87. * Optionally enable output from the AML Debug Object.
  88. */
  89. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE);
  90. /*
  91. * Optionally copy the entire DSDT to local memory (instead of simply
  92. * mapping it.) There are some BIOSs that corrupt or replace the original
  93. * DSDT, creating the need for this option. Default is FALSE, do not copy
  94. * the DSDT.
  95. */
  96. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
  97. /*
  98. * Optionally ignore an XSDT if present and use the RSDT instead.
  99. * Although the ACPI specification requires that an XSDT be used instead
  100. * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
  101. * some machines. Default behavior is to use the XSDT if present.
  102. */
  103. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
  104. /*
  105. * Optionally use 32-bit FADT addresses if and when there is a conflict
  106. * (address mismatch) between the 32-bit and 64-bit versions of the
  107. * address. Although ACPICA adheres to the ACPI specification which
  108. * requires the use of the corresponding 64-bit address if it is non-zero,
  109. * some machines have been found to have a corrupted non-zero 64-bit
  110. * address. Default is FALSE, do not favor the 32-bit addresses.
  111. */
  112. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
  113. /*
  114. * Optionally use 32-bit FACS table addresses.
  115. * It is reported that some platforms fail to resume from system suspending
  116. * if 64-bit FACS table address is selected:
  117. * https://bugzilla.kernel.org/show_bug.cgi?id=74021
  118. * Default is TRUE, favor the 32-bit addresses.
  119. */
  120. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFacsAddresses, TRUE);
  121. /*
  122. * Optionally truncate I/O addresses to 16 bits. Provides compatibility
  123. * with other ACPI implementations. NOTE: During ACPICA initialization,
  124. * this value is set to TRUE if any Windows OSI strings have been
  125. * requested by the BIOS.
  126. */
  127. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE);
  128. /*
  129. * Disable runtime checking and repair of values returned by control methods.
  130. * Use only if the repair is causing a problem on a particular machine.
  131. */
  132. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
  133. /*
  134. * Optionally do not install any SSDTs from the RSDT/XSDT during initialization.
  135. * This can be useful for debugging ACPI problems on some machines.
  136. */
  137. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
  138. /*
  139. * Optionally enable runtime namespace override.
  140. */
  141. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_RuntimeNamespaceOverride, TRUE);
  142. /*
  143. * We keep track of the latest version of Windows that has been requested by
  144. * the BIOS. ACPI 5.0.
  145. */
  146. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0);
  147. /*
  148. * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
  149. * that the ACPI hardware is no longer required. A flag in the FADT indicates
  150. * a reduced HW machine, and that flag is duplicated here for convenience.
  151. */
  152. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
  153. /*
  154. * Maximum timeout for While() loop iterations before forced method abort.
  155. * This mechanism is intended to prevent infinite loops during interpreter
  156. * execution within a host kernel.
  157. */
  158. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT);
  159. /*
  160. * Optionally ignore AE_NOT_FOUND errors from named reference package elements
  161. * during DSDT/SSDT table loading. This reduces error "noise" in platforms
  162. * whose firmware is carrying around a bunch of unused package objects that
  163. * refer to non-existent named objects. However, If the AML actually tries to
  164. * use such a package, the unresolved element(s) will be replaced with NULL
  165. * elements.
  166. */
  167. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnorePackageResolutionErrors, FALSE);
  168. /*
  169. * This mechanism is used to trace a specified AML method. The method is
  170. * traced each time it is executed.
  171. */
  172. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
  173. ACPI_INIT_GLOBAL (const char *, AcpiGbl_TraceMethodName, NULL);
  174. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel, ACPI_TRACE_LEVEL_DEFAULT);
  175. ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer, ACPI_TRACE_LAYER_DEFAULT);
  176. /*
  177. * Runtime configuration of debug output control masks. We want the debug
  178. * switches statically initialized so they are already set when the debugger
  179. * is entered.
  180. */
  181. #ifdef ACPI_DEBUG_OUTPUT
  182. ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_DEBUG_DEFAULT);
  183. #else
  184. ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
  185. #endif
  186. ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
  187. /* Optionally enable timer output with Debug Object output */
  188. ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisplayDebugTimer, FALSE);
  189. /*
  190. * Debugger command handshake globals. Host OSes need to access these
  191. * variables to implement their own command handshake mechanism.
  192. */
  193. #ifdef ACPI_DEBUGGER
  194. ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
  195. ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]);
  196. #endif
  197. /*
  198. * Other miscellaneous globals
  199. */
  200. ACPI_GLOBAL (ACPI_TABLE_FADT, AcpiGbl_FADT);
  201. ACPI_GLOBAL (UINT32, AcpiCurrentGpeCount);
  202. ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);