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.

361 lines
7.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. kdext.h
  5. Abstract:
  6. Header files for KD extension
  7. Author:
  8. Stephane Plante (splante) 21-Mar-1997
  9. Based on Code by:
  10. Peter Wieland (peterwie) 16-Oct-1995
  11. Environment:
  12. User Mode.
  13. Revision History:
  14. --*/
  15. #ifndef _KDEXT_H_
  16. #define _KDEXT_H_
  17. //
  18. // Various Defines
  19. //
  20. #define Move(dst, src) \
  21. try { \
  22. b = ReadMemory( (ULONG_PTR) (src), &(dst), sizeof(dst), NULL ); \
  23. if (!b) { \
  24. return; \
  25. } \
  26. } except (EXCEPTION_EXECUTE_HANDLER) { \
  27. return; \
  28. }
  29. #define MoveBlock( dst, src, size ) \
  30. try { \
  31. b = ReadMemory( (ULONG_PTR) (src), &(ds), size, NULL ); \
  32. if (!b) { \
  33. return; \
  34. } \
  35. } except (EXCEPTION_EXECUTE_HANDLER) { \
  36. return; \
  37. }
  38. //
  39. // Various Structures
  40. //
  41. typedef struct _EXTERNAL_HELP_TABLE {
  42. PUCHAR ExternalName;
  43. PUCHAR ExternalDescription;
  44. } EXTERNAL_HELP_TABLE, *PEXTERNAL_HELP_TABLE;
  45. //
  46. // Verbose flags (for contexts)
  47. //
  48. #define VERBOSE_CONTEXT 0x01
  49. #define VERBOSE_CALL 0x02
  50. #define VERBOSE_HEAP 0x04
  51. #define VERBOSE_OBJECT 0x08
  52. #define VERBOSE_NSOBJ 0x10
  53. #define VERBOSE_RECURSE 0x20
  54. //
  55. // Verbose flags (for device extensions)
  56. //
  57. #define VERBOSE_1 0x01
  58. #define VERBOSE_2 0x02
  59. #define VERBOSE_3 0x04
  60. #define VERBOSE_4 0x08
  61. #define VERBOSE_ALL 0x0f
  62. //
  63. // Verbose Flags (for walking the tree)
  64. //
  65. #define VERBOSE_LOOP 0x10
  66. #define VERBOSE_THERMAL 0x20
  67. #define VERBOSE_PRESENT 0x40
  68. //
  69. // Various data and externs
  70. //
  71. extern UCHAR Buffer[2048];
  72. BOOL
  73. GetUlong(
  74. IN PCHAR Name,
  75. IN PULONG Value
  76. );
  77. BOOL
  78. GetUlongPtr(
  79. IN PCHAR Name,
  80. IN PULONG_PTR Address
  81. );
  82. BOOL
  83. ReadPhysicalOrVirtual(
  84. IN ULONG_PTR Address,
  85. IN PVOID Buffer,
  86. IN ULONG Size,
  87. IN OUT PULONG ReturnLength,
  88. IN BOOL Virtual
  89. );
  90. VOID
  91. displayAcpiDeviceExtension(
  92. IN PDEVICE_EXTENSION DeviceExtension,
  93. IN ULONG_PTR Address,
  94. IN ULONG Verbose,
  95. IN ULONG IndentLevel
  96. );
  97. VOID
  98. displayAcpiDeviceExtensionBrief(
  99. IN PDEVICE_EXTENSION DeviceExtension,
  100. IN ULONG_PTR Address,
  101. IN ULONG Verbose,
  102. IN ULONG IndentLevel
  103. );
  104. VOID
  105. displayAcpiDeviceExtensionFlags(
  106. IN PDEVICE_EXTENSION DeviceExtension
  107. );
  108. VOID
  109. displayAcpiDeviceExtensionName(
  110. IN ULONG_PTR DeviceExtensionAddress
  111. );
  112. VOID
  113. displayThermalInfo(
  114. IN PTHRM_INFO Thrm,
  115. IN ULONG_PTR Address,
  116. IN ULONG Verbose,
  117. IN ULONG IndentLevel
  118. );
  119. VOID
  120. displayThermalInfoEx(
  121. IN PTHRM_INFO Thrm,
  122. IN ULONG_PTR Address,
  123. IN ULONG Verbose,
  124. IN ULONG IndentLevel
  125. );
  126. VOID
  127. dumpAccessFieldObject(
  128. IN ULONG_PTR AccessFieldAddress,
  129. IN ULONG Verbose,
  130. IN ULONG IndentLevel
  131. );
  132. VOID
  133. dumpAccessFieldUnit(
  134. IN ULONG_PTR AccessFieldAddress,
  135. IN ULONG Verbose,
  136. IN ULONG IndentLevel
  137. );
  138. VOID
  139. dumpAcpiDeviceNode(
  140. IN PACPI_DEVICE_POWER_NODE DeviceNode,
  141. IN ULONG_PTR Address,
  142. IN ULONG Verbose,
  143. IN ULONG IndentLevel
  144. );
  145. VOID
  146. dumpAcpiDeviceNodes(
  147. IN ULONG_PTR Address,
  148. IN ULONG Verbose,
  149. IN ULONG IndentLevel
  150. );
  151. VOID
  152. dumpAcpiExtension(
  153. IN ULONG_PTR Address,
  154. IN ULONG Verbose,
  155. IN ULONG IndentLevel
  156. );
  157. VOID
  158. dumpAcpiGpeInformation(
  159. VOID
  160. );
  161. VOID
  162. dumpAcpiInformation(
  163. VOID
  164. );
  165. VOID
  166. dumpAcpiPowerList(
  167. PUCHAR ListName
  168. );
  169. VOID
  170. dumpAcpiPowerLists(
  171. VOID
  172. );
  173. VOID
  174. dumpAcpiPowerNode(
  175. IN PACPI_POWER_DEVICE_NODE PowerNode,
  176. IN ULONG_PTR Address,
  177. IN ULONG Verbose,
  178. IN ULONG IndentLevel
  179. );
  180. VOID
  181. dumpAcpiPowerNodes(
  182. VOID
  183. );
  184. VOID
  185. dumpAmlTerm(
  186. IN ULONG_PTR AmlTermAddress,
  187. IN ULONG Verbose,
  188. IN ULONG IndentLevel
  189. );
  190. VOID
  191. dumpCall(
  192. IN ULONG_PTR CallAddress,
  193. IN ULONG Verbose,
  194. IN ULONG IndentLevel
  195. );
  196. VOID
  197. dumpContext(
  198. IN ULONG_PTR ContextAddress,
  199. IN ULONG Verbose
  200. );
  201. VOID
  202. dumpDeviceListEntry(
  203. IN PLIST_ENTRY ListEntry,
  204. IN ULONG_PTR Address
  205. );
  206. VOID
  207. dumpFieldAddress(
  208. IN ULONG_PTR FieldAddress,
  209. IN ULONG Verbose,
  210. IN ULONG IndentLevel
  211. );
  212. VOID
  213. dumpIrpListEntry(
  214. IN PLIST_ENTRY ListEntry,
  215. IN ULONG_PTR Address
  216. );
  217. VOID
  218. dumpMemory(
  219. IN ULONG_PTR Address,
  220. IN ULONG Length,
  221. IN PUCHAR FileName
  222. );
  223. VOID
  224. dumpNSObject(
  225. IN ULONG_PTR Address,
  226. IN ULONG Verbose,
  227. IN ULONG IndentLevel
  228. );
  229. VOID
  230. dumpNSTree(
  231. IN ULONG_PTR Address,
  232. IN ULONG Level
  233. );
  234. VOID
  235. dumpObject(
  236. IN ULONG_PTR Address,
  237. IN POBJDATA Object,
  238. IN ULONG Verbose,
  239. IN ULONG IndentLevel
  240. );
  241. VOID
  242. dumpObjectOwner(
  243. IN ULONG_PTR ObjOwnerAddress,
  244. IN ULONG IndentLevel
  245. );
  246. VOID
  247. dumpPM1StatusRegister(
  248. IN ULONG Value,
  249. IN ULONG IndentLevel
  250. );
  251. VOID
  252. dumpPM1ControlRegister(
  253. IN ULONG Value,
  254. IN ULONG IndentLevel
  255. );
  256. VOID
  257. dumpPnPResources(
  258. IN ULONG_PTR Address
  259. );
  260. VOID
  261. dumpPObject(
  262. IN ULONG_PTR Address,
  263. IN ULONG Verbose,
  264. IN ULONG IndentLevel
  265. );
  266. VOID
  267. dumpScope(
  268. IN ULONG_PTR ScopeAddress,
  269. IN ULONG Verbose,
  270. IN ULONG IndentLevel
  271. );
  272. VOID
  273. dumpStack(
  274. IN ULONG_PTR ContextAddress,
  275. IN PCTXT Context,
  276. IN ULONG Verbose,
  277. IN ULONG IndentLevel
  278. );
  279. VOID
  280. dumpTerm(
  281. IN ULONG_PTR TermAddress,
  282. IN ULONG Verbose,
  283. IN ULONG IndentLevel
  284. );
  285. VOID
  286. dumpIrqArb(
  287. IN PVOID IrqArb
  288. );
  289. PUCHAR
  290. TempToKelvins(
  291. IN ULONG Temp
  292. );
  293. PUCHAR
  294. TimeToSeconds(
  295. IN ULONG Time
  296. );
  297. #endif