Source code of Windows XP (NT5)
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.

334 lines
6.2 KiB

  1. /*++ BUILD Version: 0001
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. haldisp.h
  5. Abstract:
  6. This module contains the private structure definitions and APIs used by
  7. the NT haldisp
  8. Author:
  9. Revision History:
  10. --*/
  11. //
  12. // Strcuture definitions.
  13. //
  14. typedef struct _ADAPTER_OBJECT {
  15. DMA_ADAPTER DmaAdapter;
  16. PADAPTER_OBJECT RealAdapterObject;
  17. }ADAPTER_OBJECT;
  18. typedef struct _XHAL_WAIT_CONTEXT_BLOCK {
  19. PMDL Mdl;
  20. PVOID CurrentVa;
  21. ULONG Length;
  22. PADAPTER_OBJECT RealAdapterObject;
  23. PDRIVER_LIST_CONTROL DriverExecutionRoutine;
  24. PVOID DriverContext;
  25. PIRP CurrentIrp;
  26. ULONG MapRegisterLock;
  27. UCHAR WriteToDevice;
  28. UCHAR MdlCount;
  29. PVOID MapRegisterBase[];
  30. } XHAL_WAIT_CONTEXT_BLOCK, *PXHAL_WAIT_CONTEXT_BLOCK;
  31. //
  32. // Function prototypes
  33. //
  34. NTSTATUS
  35. xHalQuerySystemInformation(
  36. IN HAL_QUERY_INFORMATION_CLASS InformationClass,
  37. IN ULONG BufferSize,
  38. OUT PVOID Buffer,
  39. OUT PULONG ReturnedLength
  40. );
  41. NTSTATUS
  42. xHalSetSystemInformation(
  43. IN HAL_SET_INFORMATION_CLASS InformationClass,
  44. IN ULONG BufferSize,
  45. OUT PVOID Buffer
  46. );
  47. NTSTATUS
  48. xHalQueryBusSlots(
  49. IN PBUS_HANDLER BusHandler,
  50. IN ULONG BufferSize,
  51. OUT PULONG SlotNumbers,
  52. OUT PULONG ReturnedLength
  53. );
  54. VOID
  55. xHalSetWakeEnable(
  56. IN BOOLEAN Enable
  57. );
  58. VOID
  59. xHalSetWakeAlarm(
  60. IN ULONGLONG WakeTime,
  61. IN PTIME_FIELDS WakeTimeFields
  62. );
  63. VOID
  64. xHalLocateHiberRanges(
  65. IN PVOID MemoryMap
  66. );
  67. NTSTATUS
  68. xHalRegisterBusHandler(
  69. IN INTERFACE_TYPE InterfaceType,
  70. IN BUS_DATA_TYPE ConfigurationSpace,
  71. IN ULONG BusNumber,
  72. IN INTERFACE_TYPE ParentBusType,
  73. IN ULONG ParentBusNumber,
  74. IN ULONG SizeofBusExtensionData,
  75. IN PINSTALL_BUS_HANDLER InstallBusHandlers,
  76. OUT PBUS_HANDLER *BusHandler
  77. );
  78. PBUS_HANDLER
  79. FASTCALL
  80. xHalHandlerForBus (
  81. IN INTERFACE_TYPE InterfaceType,
  82. IN ULONG BusNumber
  83. );
  84. VOID
  85. FASTCALL
  86. xHalReferenceHandler (
  87. IN PBUS_HANDLER Handler
  88. );
  89. NTSTATUS
  90. xHalInitPnpDriver(
  91. VOID
  92. );
  93. NTSTATUS
  94. xHalInitPowerManagement(
  95. IN PPM_DISPATCH_TABLE PmDriverDispatchTable,
  96. IN OUT PPM_DISPATCH_TABLE *PmHalDispatchTable
  97. );
  98. PDMA_ADAPTER
  99. xHalGetDmaAdapter (
  100. IN PVOID Context,
  101. IN struct _DEVICE_DESCRIPTION *DeviceDescriptor,
  102. OUT PULONG NumberOfMapRegisters
  103. );
  104. VOID
  105. xHalPutDmaAdapter (
  106. PDMA_ADAPTER DmaAdapter
  107. );
  108. PVOID
  109. xHalAllocateCommonBuffer (
  110. IN PDMA_ADAPTER DmaAdapter,
  111. IN ULONG Length,
  112. OUT PPHYSICAL_ADDRESS LogicalAddress,
  113. IN BOOLEAN CacheEnabled
  114. );
  115. VOID
  116. xHalFreeCommonBuffer (
  117. IN PDMA_ADAPTER DmaAdapter,
  118. IN ULONG Length,
  119. IN PHYSICAL_ADDRESS LogicalAddress,
  120. IN PVOID VirtualAddress,
  121. IN BOOLEAN CacheEnabled
  122. );
  123. NTSTATUS
  124. xHalAllocateAdapterChannel (
  125. IN PDMA_ADAPTER DmaAdapter,
  126. IN PDEVICE_OBJECT DeviceObject,
  127. IN ULONG NumberOfMapRegisters,
  128. IN PDRIVER_CONTROL ExecutionRoutine,
  129. IN PVOID Context
  130. );
  131. BOOLEAN
  132. xHalFlushAdapterBuffers (
  133. IN PDMA_ADAPTER DmaAdapter,
  134. IN PMDL Mdl,
  135. IN PVOID MapRegisterBase,
  136. IN PVOID CurrentVa,
  137. IN ULONG Length,
  138. IN BOOLEAN WriteToDevice
  139. );
  140. VOID
  141. xHalFreeAdapterChannel (
  142. IN PDMA_ADAPTER DmaAdapter
  143. );
  144. VOID
  145. xHalFreeMapRegisters (
  146. IN PDMA_ADAPTER DmaAdapter,
  147. PVOID MapRegisterBase,
  148. ULONG NumberOfMapRegisters
  149. );
  150. PHYSICAL_ADDRESS
  151. xHalMapTransfer (
  152. IN PDMA_ADAPTER DmaAdapter,
  153. IN PMDL Mdl,
  154. IN PVOID MapRegisterBase,
  155. IN PVOID CurrentVa,
  156. IN OUT PULONG Length,
  157. IN BOOLEAN WriteToDevice
  158. );
  159. ULONG
  160. xHalGetDmaAlignment (
  161. IN PDMA_ADAPTER DmaAdapter
  162. );
  163. ULONG
  164. xHalReadDmaCounter (
  165. IN PDMA_ADAPTER DmaAdapter
  166. );
  167. NTSTATUS
  168. xHalGetScatterGatherList (
  169. IN PDMA_ADAPTER DmaAdapter,
  170. IN PDEVICE_OBJECT DeviceObject,
  171. IN PMDL Mdl,
  172. IN PVOID CurrentVa,
  173. IN ULONG Length,
  174. IN PDRIVER_LIST_CONTROL ExecutionRoutine,
  175. IN PVOID Context,
  176. IN BOOLEAN WriteToDevice
  177. );
  178. VOID
  179. xHalPutScatterGatherList (
  180. IN PDMA_ADAPTER DmaAdapter,
  181. IN PSCATTER_GATHER_LIST ScatterGather,
  182. IN BOOLEAN WriteToDevice
  183. );
  184. IO_ALLOCATION_ACTION
  185. xHalpAllocateAdapterCallback (
  186. IN struct _DEVICE_OBJECT *DeviceObject,
  187. IN struct _IRP *Irp,
  188. IN PVOID MapRegisterBase,
  189. IN PVOID Context
  190. );
  191. NTSTATUS
  192. xHalGetInterruptTranslator(
  193. IN INTERFACE_TYPE ParentInterfaceType,
  194. IN ULONG ParentBusNumber,
  195. IN INTERFACE_TYPE BridgeInterfaceType,
  196. IN USHORT Size,
  197. IN USHORT Version,
  198. OUT PTRANSLATOR_INTERFACE Translator,
  199. OUT PULONG BridgeBusNumber
  200. );
  201. BOOLEAN
  202. xHalTranslateBusAddress(
  203. IN INTERFACE_TYPE InterfaceType,
  204. IN ULONG BusNumber,
  205. IN PHYSICAL_ADDRESS BusAddress,
  206. IN OUT PULONG AddressSpace,
  207. OUT PPHYSICAL_ADDRESS TranslatedAddress
  208. );
  209. NTSTATUS
  210. xHalAssignSlotResources (
  211. IN PUNICODE_STRING RegistryPath,
  212. IN PUNICODE_STRING DriverClassName OPTIONAL,
  213. IN PDRIVER_OBJECT DriverObject,
  214. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  215. IN INTERFACE_TYPE BusType,
  216. IN ULONG BusNumber,
  217. IN ULONG SlotNumber,
  218. IN OUT PCM_RESOURCE_LIST *AllocatedResources
  219. );
  220. VOID
  221. xHalHaltSystem(
  222. VOID
  223. );
  224. NTSTATUS
  225. xHalStartMirroring(
  226. VOID
  227. );
  228. NTSTATUS
  229. xHalEndMirroring(
  230. IN ULONG PassNumber
  231. );
  232. NTSTATUS
  233. xHalMirrorPhysicalMemory(
  234. IN PHYSICAL_ADDRESS PhysicalAddress,
  235. IN LARGE_INTEGER NumberOfBytes
  236. );
  237. NTSTATUS
  238. xHalMirrorVerify(
  239. IN PHYSICAL_ADDRESS PhysicalAddress,
  240. IN LARGE_INTEGER NumberOfBytes
  241. );
  242. NTSTATUS
  243. xKdSetupPciDeviceForDebugging(
  244. IN PVOID LoaderBlock, OPTIONAL
  245. IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice
  246. );
  247. NTSTATUS
  248. xKdReleasePciDeviceForDebugging(
  249. IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice
  250. );
  251. PVOID
  252. xKdGetAcpiTablePhase0(
  253. IN PLOADER_PARAMETER_BLOCK LoaderBlock,
  254. IN ULONG Signature
  255. );
  256. VOID
  257. xKdCheckPowerButton(
  258. VOID
  259. );
  260. VOID
  261. xHalEndOfBoot(
  262. VOID
  263. );
  264. UCHAR
  265. xHalVectorToIDTEntry(
  266. ULONG Vector
  267. );
  268. PVOID
  269. xKdMapPhysicalMemory64(
  270. IN PHYSICAL_ADDRESS PhysicalAddress,
  271. IN ULONG NumberPages
  272. );
  273. VOID
  274. xKdUnmapVirtualAddress(
  275. IN PVOID VirtualAddress,
  276. IN ULONG NumberPages
  277. );