1 /* Hardware Abstraction Layer Functions */
3 #if (NTDDI_VERSION >= NTDDI_WIN2K)
5 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
11 HalAllocateCommonBuffer(
12 IN PDMA_ADAPTER DmaAdapter
,
14 OUT PPHYSICAL_ADDRESS LogicalAddress
,
15 IN BOOLEAN CacheEnabled
)
17 PALLOCATE_COMMON_BUFFER allocateCommonBuffer
;
20 allocateCommonBuffer
= *(DmaAdapter
)->DmaOperations
->AllocateCommonBuffer
;
21 ASSERT( allocateCommonBuffer
!= NULL
);
22 commonBuffer
= allocateCommonBuffer( DmaAdapter
, Length
, LogicalAddress
, CacheEnabled
);
30 IN PDMA_ADAPTER DmaAdapter
,
32 IN PHYSICAL_ADDRESS LogicalAddress
,
33 IN PVOID VirtualAddress
,
34 IN BOOLEAN CacheEnabled
)
36 PFREE_COMMON_BUFFER freeCommonBuffer
;
38 freeCommonBuffer
= *(DmaAdapter
)->DmaOperations
->FreeCommonBuffer
;
39 ASSERT( freeCommonBuffer
!= NULL
);
40 freeCommonBuffer( DmaAdapter
, Length
, LogicalAddress
, VirtualAddress
, CacheEnabled
);
47 IN PDMA_ADAPTER DmaAdapter
)
49 PREAD_DMA_COUNTER readDmaCounter
;
52 readDmaCounter
= *(DmaAdapter
)->DmaOperations
->ReadDmaCounter
;
53 ASSERT( readDmaCounter
!= NULL
);
54 counter
= readDmaCounter( DmaAdapter
);
61 IN PDMA_ADAPTER DmaAdapter
)
63 PGET_DMA_ALIGNMENT getDmaAlignment
;
66 getDmaAlignment
= *(DmaAdapter
)->DmaOperations
->GetDmaAlignment
;
67 ASSERT( getDmaAlignment
!= NULL
);
68 alignment
= getDmaAlignment( DmaAdapter
);
77 #else /* USE_DMA_MACROS ... */
79 //DECLSPEC_DEPRECATED_DDK
84 IN PADAPTER_OBJECT AdapterObject
);
86 //DECLSPEC_DEPRECATED_DDK
90 IoFlushAdapterBuffers(
91 IN PADAPTER_OBJECT AdapterObject
,
93 IN PVOID MapRegisterBase
,
96 IN BOOLEAN WriteToDevice
);
98 //DECLSPEC_DEPRECATED_DDK
103 IN PADAPTER_OBJECT AdapterObject
,
104 IN PVOID MapRegisterBase
,
105 IN ULONG NumberOfMapRegisters
);
107 //DECLSPEC_DEPRECATED_DDK
111 HalAllocateCommonBuffer(
112 IN PADAPTER_OBJECT AdapterObject
,
114 OUT PPHYSICAL_ADDRESS LogicalAddress
,
115 IN BOOLEAN CacheEnabled
);
117 //DECLSPEC_DEPRECATED_DDK
122 IN PADAPTER_OBJECT AdapterObject
,
124 IN PHYSICAL_ADDRESS LogicalAddress
,
125 IN PVOID VirtualAddress
,
126 IN BOOLEAN CacheEnabled
);
128 //DECLSPEC_DEPRECATED_DDK
133 IN PADAPTER_OBJECT AdapterObject
);
138 HalAllocateAdapterChannel(
139 IN PADAPTER_OBJECT AdapterObject
,
140 IN PWAIT_CONTEXT_BLOCK Wcb
,
141 IN ULONG NumberOfMapRegisters
,
142 IN PDRIVER_CONTROL ExecutionRoutine
);
145 #endif /* USE_DMA_MACROS ... */
148 #if !defined(NO_LEGACY_DRIVERS)
152 HalAssignSlotResources(
153 IN PUNICODE_STRING RegistryPath
,
154 IN PUNICODE_STRING DriverClassName
,
155 IN PDRIVER_OBJECT DriverObject
,
156 IN PDEVICE_OBJECT DeviceObject
,
157 IN INTERFACE_TYPE BusType
,
160 IN OUT PCM_RESOURCE_LIST
*AllocatedResources
);
165 HalGetInterruptVector(
166 IN INTERFACE_TYPE InterfaceType
,
168 IN ULONG BusInterruptLevel
,
169 IN ULONG BusInterruptVector
,
171 OUT PKAFFINITY Affinity
);
177 IN BUS_DATA_TYPE BusDataType
,
187 IN BUS_DATA_TYPE BusDataType
,
198 #endif /* !defined(NO_LEGACY_DRIVERS) */
204 IN PDEVICE_DESCRIPTION DeviceDescription
,
205 OUT PULONG NumberOfMapRegisters
);
210 IN PADAPTER_OBJECT DmaAdapter
);
215 HalAcquireDisplayOwnership(
216 IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
);
221 HalGetBusDataByOffset(
222 IN BUS_DATA_TYPE BusDataType
,
232 HalSetBusDataByOffset(
233 IN BUS_DATA_TYPE BusDataType
,
243 HalTranslateBusAddress(
244 IN INTERFACE_TYPE InterfaceType
,
246 IN PHYSICAL_ADDRESS BusAddress
,
247 IN OUT PULONG AddressSpace
,
248 OUT PPHYSICAL_ADDRESS TranslatedAddress
);
253 HalAllocateCrashDumpRegisters(
254 IN PADAPTER_OBJECT AdapterObject
,
255 IN OUT PULONG NumberOfMapRegisters
);
259 HalGetScatterGatherList(
260 IN PADAPTER_OBJECT DmaAdapter
,
261 IN PDEVICE_OBJECT DeviceObject
,
265 IN PDRIVER_LIST_CONTROL ExecutionRoutine
,
267 IN BOOLEAN WriteToDevice
);
271 HalPutScatterGatherList(
272 IN PADAPTER_OBJECT DmaAdapter
,
273 IN PSCATTER_GATHER_LIST ScatterGather
,
274 IN BOOLEAN WriteToDevice
);
277 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
280 #if (NTDDI_VERSION >= NTDDI_WINXP)
285 IN PDEVICE_OBJECT DeviceObject
,
287 IN ULONG MBRTypeIdentifier
,
289 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
291 #if (NTDDI_VERSION >= NTDDI_WIN7)
295 HalAllocateHardwareCounters(
296 IN PGROUP_AFFINITY GroupAffinty
,
298 IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList
,
299 OUT PHANDLE CounterSetHandle
);
303 HalFreeHardwareCounters(
304 IN HANDLE CounterSetHandle
);
306 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
309 #if (NTDDI_VERSION >= NTDDI_WIN2K)
313 HalGetDmaAlignmentRequirement(VOID
);
315 #endif /* defined(_IA64_) */
317 #if defined(_M_IX86) || defined(_M_AMD64)
318 #define HalGetDmaAlignmentRequirement() 1L
321 #if (NTDDI_VERSION >= NTDDI_WIN7)
323 typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR
*PWHEA_ERROR_SOURCE_DESCRIPTOR
;
324 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
330 IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
,
331 IN PWHEA_ERROR_RECORD ErrorRecord
);
335 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
341 IN PWHEA_ERROR_RECORD ErrorRecord
);
343 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */