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.

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