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
);
76 #else /* USE_DMA_MACROS ... */
78 //DECLSPEC_DEPRECATED_DDK
83 IN PADAPTER_OBJECT AdapterObject
);
85 //DECLSPEC_DEPRECATED_DDK
89 IoFlushAdapterBuffers(
90 IN PADAPTER_OBJECT AdapterObject
,
92 IN PVOID MapRegisterBase
,
95 IN BOOLEAN WriteToDevice
);
97 //DECLSPEC_DEPRECATED_DDK
102 IN PADAPTER_OBJECT AdapterObject
,
103 IN PVOID MapRegisterBase
,
104 IN ULONG NumberOfMapRegisters
);
106 //DECLSPEC_DEPRECATED_DDK
110 HalAllocateCommonBuffer(
111 IN PADAPTER_OBJECT AdapterObject
,
113 OUT PPHYSICAL_ADDRESS LogicalAddress
,
114 IN BOOLEAN CacheEnabled
);
116 //DECLSPEC_DEPRECATED_DDK
121 IN PADAPTER_OBJECT AdapterObject
,
123 IN PHYSICAL_ADDRESS LogicalAddress
,
124 IN PVOID VirtualAddress
,
125 IN BOOLEAN CacheEnabled
);
127 //DECLSPEC_DEPRECATED_DDK
132 IN PADAPTER_OBJECT AdapterObject
);
137 HalAllocateAdapterChannel(
138 IN PADAPTER_OBJECT AdapterObject
,
139 IN PWAIT_CONTEXT_BLOCK Wcb
,
140 IN ULONG NumberOfMapRegisters
,
141 IN PDRIVER_CONTROL ExecutionRoutine
);
144 #endif /* USE_DMA_MACROS ... */
147 #if !defined(NO_LEGACY_DRIVERS)
151 HalAssignSlotResources(
152 IN PUNICODE_STRING RegistryPath
,
153 IN PUNICODE_STRING DriverClassName
,
154 IN PDRIVER_OBJECT DriverObject
,
155 IN PDEVICE_OBJECT DeviceObject
,
156 IN INTERFACE_TYPE BusType
,
159 IN OUT PCM_RESOURCE_LIST
*AllocatedResources
);
164 HalGetInterruptVector(
165 IN INTERFACE_TYPE InterfaceType
,
167 IN ULONG BusInterruptLevel
,
168 IN ULONG BusInterruptVector
,
170 OUT PKAFFINITY Affinity
);
176 IN BUS_DATA_TYPE BusDataType
,
186 IN BUS_DATA_TYPE BusDataType
,
197 #endif /* !defined(NO_LEGACY_DRIVERS) */
203 IN PDEVICE_DESCRIPTION DeviceDescription
,
204 OUT PULONG NumberOfMapRegisters
);
209 IN PADAPTER_OBJECT DmaAdapter
);
214 HalAcquireDisplayOwnership(
215 IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
);
220 HalGetBusDataByOffset(
221 IN BUS_DATA_TYPE BusDataType
,
231 HalSetBusDataByOffset(
232 IN BUS_DATA_TYPE BusDataType
,
242 HalTranslateBusAddress(
243 IN INTERFACE_TYPE InterfaceType
,
245 IN PHYSICAL_ADDRESS BusAddress
,
246 IN OUT PULONG AddressSpace
,
247 OUT PPHYSICAL_ADDRESS TranslatedAddress
);
252 HalAllocateCrashDumpRegisters(
253 IN PADAPTER_OBJECT AdapterObject
,
254 IN OUT PULONG NumberOfMapRegisters
);
258 HalGetScatterGatherList(
259 IN PADAPTER_OBJECT DmaAdapter
,
260 IN PDEVICE_OBJECT DeviceObject
,
264 IN PDRIVER_LIST_CONTROL ExecutionRoutine
,
266 IN BOOLEAN WriteToDevice
);
270 HalPutScatterGatherList(
271 IN PADAPTER_OBJECT DmaAdapter
,
272 IN PSCATTER_GATHER_LIST ScatterGather
,
273 IN BOOLEAN WriteToDevice
);
276 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
279 #if (NTDDI_VERSION >= NTDDI_WINXP)
284 IN PDEVICE_OBJECT DeviceObject
,
286 IN ULONG MBRTypeIdentifier
,
288 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
290 #if (NTDDI_VERSION >= NTDDI_WIN7)
294 HalAllocateHardwareCounters(
295 IN PGROUP_AFFINITY GroupAffinty
,
297 IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList
,
298 OUT PHANDLE CounterSetHandle
);
302 HalFreeHardwareCounters(
303 IN HANDLE CounterSetHandle
);
305 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
308 #if (NTDDI_VERSION >= NTDDI_WIN2K)
312 HalGetDmaAlignmentRequirement(VOID
);
314 #endif /* defined(_IA64_) */
316 #if defined(_M_IX86) || defined(_M_AMD64)
317 #define HalGetDmaAlignmentRequirement() 1L
320 #if (NTDDI_VERSION >= NTDDI_WIN7)
322 typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR
*PWHEA_ERROR_SOURCE_DESCRIPTOR
;
323 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
329 IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
,
330 IN PWHEA_ERROR_RECORD ErrorRecord
);
334 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
340 IN PWHEA_ERROR_RECORD ErrorRecord
);
342 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */