Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

369 lines
14 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. acpidbg.h
  5. Abstract:
  6. This module contains the debug stubs
  7. Author:
  8. Stephane Plante (splante)
  9. Environment:
  10. NT Kernel Model Driver only, Win9x driver mode
  11. --*/
  12. #ifndef _ACPIDBG_H_
  13. #define _ACPIDBG_H_
  14. //
  15. // ACPI BugCheck Definitions
  16. //
  17. //
  18. // ACPI cannot find the SCI Interrupt vector in the resources handed
  19. // to it when ACPI is started.
  20. // Argument 0 - ACPI's deviceExtension
  21. // Argument 1 - ACPI's ResourceList
  22. // Argument 2 - 0 <- Means no resource list found
  23. // Argument 2 - 1 <- Means no IRQ resource found in list
  24. //
  25. #define ACPI_ROOT_RESOURCES_FAILURE 0x0001
  26. //
  27. // ACPI could not process the resource list for the PCI root buses
  28. // There is an White Paper on the Web Site about this problem
  29. // Argument 0 - The ACPI Extension for the PCI bus
  30. // Argument 1 - 0
  31. // Argument 2 - Pointer to the QUERY_RESOURCES irp
  32. // Argument 1 - 1
  33. // Argument 2 - Pointer to the QUERY_RESOURCE_REQUIREMENTS irp
  34. // Argument 1 - 2
  35. // Argument 2 - 0 <- Indicates that we found an empty resource list
  36. // Argument 1 - 3 <- Could not find the current bus number in the CRS
  37. // Argument 2 - Pointer to the PNP CRS descriptor
  38. // Argument 1 - Pointer to the Resource List for PCI
  39. // Argument 2 - Number of errors/conflicts found in the resource list
  40. //
  41. #define ACPI_ROOT_PCI_RESOURCE_FAILURE 0x0002
  42. //
  43. // ACPI tried to run a control method while creating device extensions
  44. // to represent the ACPI namespace, but this control method failed
  45. // Argument 0 - The ACPI Object that was being run
  46. // Argument 1 - return value from the interpreter
  47. // Argument 2 - Name of the control method (in ULONG format)
  48. //
  49. #define ACPI_FAILED_MUST_SUCCEED_METHOD 0x0003
  50. //
  51. // ACPI evaluated a _PRW and expected to find an integer as a
  52. // package element
  53. // Argument 0 - The ACPI Extension for which the _PRW belongs to
  54. // Argument 1 - Pointer to the method
  55. // Argument 2 - The DataType returned (see amli.h)
  56. //
  57. #define ACPI_PRW_PACKAGE_EXPECTED_INTEGER 0x0004
  58. //
  59. // ACPI evaluated a _PRW and the package that came back failed to
  60. // contain at least 2 elements. The ACPI specification requires that
  61. // two elements to always be present in a _PRW.
  62. // Argument 0 - The ACPI Extension for which the _PRW belongs to
  63. // Argument 1 - Pointer to the _PRW
  64. // Argument 2 - Number of elements in the _PRW
  65. //
  66. #define ACPI_PRW_PACKAGE_TOO_SMALL 0x0005
  67. //
  68. // ACPI tried to find a named object named, but could not find it.
  69. // Argument 0 - The ACPI Extension for which the _PRx belongs to
  70. // Argument 1 - Pointer to the _PRx
  71. // Argument 2 - Pointer to the name of the object to look for
  72. //
  73. #define ACPI_PRX_CANNOT_FIND_OBJECT 0x0006
  74. //
  75. // ACPI evaluated a method and expected to receive a Buffer in return.
  76. // However, the method returned some other data type
  77. // Argument 0 - The ACPI Extension for which the method belongs to
  78. // Argument 1 - Pointer to the method
  79. // Argument 2 - The DataType returned (see amli.h)
  80. //
  81. #define ACPI_EXPECTED_BUFFER 0x0007
  82. //
  83. // ACPI evaluated a method and expected to receive an Integer in return.
  84. // However, the method returned some other data type
  85. // Argument 0 - The ACPI Extension for which the method belongs to
  86. // Argument 1 - Pointer to the method
  87. // Argument 2 - The DataType returned (see amli.h)
  88. //
  89. #define ACPI_EXPECTED_INTEGER 0x0008
  90. //
  91. // ACPI evaluated a method and expected to receive a Package in return.
  92. // However, the method returned some other data type
  93. // Argument 0 - The ACPI Extension for which the method belongs to
  94. // Argument 1 - Pointer to the method
  95. // Argument 2 - The DataType returned (see amli.h)
  96. //
  97. #define ACPI_EXPECTED_PACKAGE 0x0009
  98. //
  99. // ACPI evaluated a method and expected to receive a String in return.
  100. // However, the method returned some other data type
  101. // Argument 0 - The ACPI Extension for which the method belongs to
  102. // Argument 1 - Pointer to the method
  103. // Argument 2 - The DataType returned (see amli.h)
  104. //
  105. #define ACPI_EXPECTED_STRING 0x000A
  106. //
  107. // ACPI cannot find the object referenced to by an _EJD string
  108. // Argument 0 - The ACPI Extension for which which the _EJD belongs to
  109. // Argument 1 - The status returned by the interpreter
  110. // Argument 2 - Name of the object we are trying to find
  111. //
  112. #define ACPI_EJD_CANNOT_FIND_OBJECT 0x000B
  113. //
  114. // ACPI provides faulty/insufficient information for dock support
  115. // Argument 0 - The ACPI Extension for which ACPI found a dock device
  116. // Argument 1 - Pointer to the _EJD method
  117. // Argument 2 - 0 <- Bios does not claim system is dockage
  118. // 1 <- Duplicate device extensions for dock device
  119. //
  120. #define ACPI_CLAIMS_BOGUS_DOCK_SUPPORT 0x000C
  121. //
  122. // ACPI could not find a required method/object in the namespace
  123. // This is the bugcheck that is used if a vendor does not have an
  124. // _HID or _ADR present
  125. // Argument 0 - The ACPI Extension that we need the object for
  126. // Argument 1 - The (ULONG) name of the method we looked for
  127. // Argument 2 - 0 <- Base Case
  128. // Argument 2 - 1 <- Conflict
  129. //
  130. #define ACPI_REQUIRED_METHOD_NOT_PRESENT 0x000D
  131. //
  132. // ACPI could not find a requird method/object in the namespace for
  133. // a power resource (or entity other than a "device"). This is the
  134. // bugcheck used if a vendor does not have an _ON, _OFF, or _STA present
  135. // for a power resource
  136. // Argument 0 - The NS PowerResource that we need the object for
  137. // Argument 1 - The (ULONG) name of the method we looked for
  138. // Argument 2 - 0 <- Base Case
  139. //
  140. #define ACPI_POWER_NODE_REQUIRED_METHOD_NOT_PRESENT 0x000E
  141. //
  142. // ACPI could not parse the resource descriptor
  143. // Argument 0 - The current buffer that ACPI was parsing
  144. // Argument 1 - The buffer's tag
  145. // Argument 2 - The specified length of the buffer
  146. //
  147. #define ACPI_PNP_RESOURCE_LIST_BUFFER_TOO_SMALL 0x000F
  148. //
  149. // ACPI could not map determine the system to device state mapping
  150. // correctly
  151. //
  152. // There is a very long white paper about this topic
  153. //
  154. // Argument 0 - The ACPI Extension for which are trying to do the mapping
  155. // Argument 1 - 0 The _PRx mapped back to a non-supported S-state
  156. // Argument 2 - The DEVICE_POWER_STATE (ie: x+1)
  157. // Argument 1 - 1 We cannot find a D-state to associate with the S-state
  158. // Argument 2 - The SYSTEM_POWER_STATE that is causing us grief
  159. // Argument 1 - 2 The device claims to support wake from this s-state but
  160. // the s-state is not supported by the system
  161. // Argument 2 - The SYSTEM_POWER_STATE that is causing us grief
  162. //
  163. #define ACPI_CANNOT_MAP_SYSTEM_TO_DEVICE_STATES 0x0010
  164. //
  165. // The system could not enter ACPI mode
  166. //
  167. // Argument 0 - 0 <- System could not initialize AML interpreter
  168. // Argument 0 - 1 <- System could not find RSDT
  169. // Argument 0 - 2 <- System could not allocate critical driver structures
  170. // Argument 0 - 3 <- System could not load RSDT
  171. // Argument 0 - 4 <- System could not load DDBs
  172. // Argument 0 - 5 <- System cannot connect Interrupt vector
  173. // Argument 0 - 6 <- SCI_EN never becomes set in PM1 Control Register
  174. // Argument 0 - 7 <- Table checksum is incorrect
  175. // Argument 1 - Pointer to the table that had a bad checksum
  176. // Argument 2 - Creator Revision
  177. // Argument 0 - 8 <- Failed to load DDB
  178. // Argument 1 - Pointer to the table that we failed to load
  179. // Argument 2 - Creator Revision
  180. //
  181. #define ACPI_SYSTEM_CANNOT_START_ACPI 0x0011
  182. //
  183. // The ACPI driver was expecting a power resource object.
  184. // Argument 0 - The ACPI Extension for which is looking for powerres
  185. // Argument 1 - Pointer to the object that returned the bogus powerres
  186. // Argument 2 - Pointer to the name of the object to look for
  187. //
  188. #define ACPI_EXPECTED_POWERRES 0x0012
  189. //
  190. // The ACPI driver attempted to unload a table and an error occured
  191. // Argument 0 - The NSOBj that we were trying to unload
  192. // Argument 1 - 0 - The NSOBj has not been unloaded by the current
  193. // operation, but its parent object is marked as
  194. // requiring an unload
  195. // Argument 1 - 1 - The NSOBJ has been marked as requiring an unload
  196. // buts it device parent has not.
  197. //
  198. #define ACPI_TABLE_UNLOAD 0x0013
  199. //
  200. // ACPI could not parse the resource descriptor
  201. // Argument 0 - The current buffer that ACPI was parsing
  202. // Argument 1 - The buffer's tag
  203. // Argument 2 - pointer to a variable containing ULONGLONG length of
  204. // the buffer
  205. //
  206. #define ACPI_PNP_RESOURCE_LIST_LENGTH_TOO_LARGE 0x0014
  207. //
  208. // ACPI tried to evaluate the PIC control method and but failed
  209. // Argument 0 - InterruptModel (Integer)
  210. // Argument 1 - return value from interpreter
  211. // Argument 2 - Pointer to the PIC control method
  212. //
  213. #define ACPI_FAILED_PIC_METHOD 0x2001
  214. //
  215. // ACPI tried to do interrupt routing, but failed
  216. //
  217. // Argument 0 - Pointer to the device object
  218. // Argument 1 - Pointer to the parent of the device object
  219. // Argument 2 - Pointer to the PRT
  220. //
  221. #define ACPI_CANNOT_ROUTE_INTERRUPTS 0x10001
  222. //
  223. // ACPI could not find the link node referenced in a _PRT
  224. // Argument 0 - Pointer to the device object
  225. // Argument 1 - Pointer to the name we are looking for
  226. // Argument 2 - Pointer to the PRT
  227. //
  228. #define ACPI_PRT_CANNOT_FIND_LINK_NODE 0x10002
  229. //
  230. // ACPI could not find a mapping in the _PRT package for a device
  231. // Argument 0 - Pointer to the device object
  232. // Argument 1 - The Device ID / Function Number
  233. // Argument 2 - Pointer to the PRT
  234. //
  235. #define ACPI_PRT_CANNOT_FIND_DEVICE_ENTRY 0x10003
  236. //
  237. // ACPI found an entry in the _PRT for which the function ID isn't
  238. // all F's. The Win98 behaviour is to bugcheck if it see this condition,
  239. // so we do so all well. The generic format for a _PRT entry is such
  240. // that the device number is specified, but the function number isn't.
  241. // If it isn't done this way, then the machine vendor can introduce
  242. // dangerous ambiguities
  243. //
  244. // Argument 0 - Pointer to the PRT object
  245. // Argument 1 - Pointer to the current PRT Element
  246. // Argument 2 - The DeviceID/FunctionID of the element
  247. //
  248. #define ACPI_PRT_HAS_INVALID_FUNCTION_NUMBERS 0x10005
  249. //
  250. // ACPI found a link node, but cannot disable it. Link nodes must
  251. // be disable to allow for reprogramming
  252. // Argument 0 - Pointer to the link node
  253. //
  254. #define ACPI_LINK_NODE_CANNOT_BE_DISABLED 0x10006
  255. #ifdef ACPIPrint
  256. #undef ACPIPrint
  257. #endif
  258. //
  259. // Define the various debug masks and levels
  260. //
  261. #define ACPI_PRINT_CRITICAL DPFLTR_ERROR_LEVEL
  262. #define ACPI_PRINT_FAILURE DPFLTR_ERROR_LEVEL
  263. #define ACPI_PRINT_WARNING DPFLTR_WARNING_LEVEL
  264. #define ACPI_PRINT_INFO DPFLTR_INFO_LEVEL
  265. #define ACPI_PRINT_DPC DPFLTR_INFO_LEVEL + 1
  266. #define ACPI_PRINT_IO DPFLTR_INFO_LEVEL + 2
  267. #define ACPI_PRINT_ISR DPFLTR_INFO_LEVEL + 3
  268. #define ACPI_PRINT_IRP DPFLTR_INFO_LEVEL + 4
  269. #define ACPI_PRINT_LOADING DPFLTR_INFO_LEVEL + 5
  270. #define ACPI_PRINT_MSI DPFLTR_INFO_LEVEL + 6
  271. #define ACPI_PRINT_PNP DPFLTR_INFO_LEVEL + 7
  272. #define ACPI_PRINT_PNP_STATE DPFLTR_INFO_LEVEL + 8
  273. #define ACPI_PRINT_POWER DPFLTR_INFO_LEVEL + 9
  274. #define ACPI_PRINT_REGISTRY DPFLTR_INFO_LEVEL + 10
  275. #define ACPI_PRINT_REMOVE DPFLTR_INFO_LEVEL + 11
  276. #define ACPI_PRINT_RESOURCES_1 DPFLTR_INFO_LEVEL + 12
  277. #define ACPI_PRINT_RESOURCES_2 DPFLTR_INFO_LEVEL + 13
  278. #define ACPI_PRINT_SXD DPFLTR_INFO_LEVEL + 14
  279. #define ACPI_PRINT_THERMAL DPFLTR_INFO_LEVEL + 15
  280. #define ACPI_PRINT_WAKE DPFLTR_INFO_LEVEL + 16
  281. #define ACPIDebugEnter(name)
  282. #define ACPIDebugExit(name)
  283. #if DBG
  284. VOID
  285. ACPIDebugPrint(
  286. ULONG DebugPrintLevel,
  287. PCCHAR DebugMessage,
  288. ...
  289. );
  290. VOID
  291. ACPIDebugDevicePrint(
  292. ULONG DebugPrintLevel,
  293. PVOID DebugExtension,
  294. PCCHAR DebugMessage,
  295. ...
  296. );
  297. VOID
  298. ACPIDebugThermalPrint(
  299. ULONG DebugPrintLevel,
  300. PVOID DebugExtension,
  301. ULONGLONG DebugTime,
  302. PCCHAR DebugMessage,
  303. ...
  304. );
  305. #define ACPIPrint(x) ACPIDebugPrint x
  306. #define ACPIDevPrint(x) ACPIDebugDevicePrint x
  307. #define ACPIThermalPrint(x) ACPIDebugThermalPrint x
  308. #define ACPIBreakPoint() KdBreakPoint()
  309. #else
  310. #define ACPIPrint(x)
  311. #define ACPIDevPrint(x)
  312. #define ACPIThermalPrint(x)
  313. #define ACPIBreakPoint()
  314. #endif
  315. #endif