1 /* Hardware Abstraction Layer Functions */
3 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
10 HalAllocateCommonBuffer(
11 IN PDMA_ADAPTER DmaAdapter
,
13 OUT PPHYSICAL_ADDRESS LogicalAddress
,
14 IN BOOLEAN CacheEnabled
)
16 PALLOCATE_COMMON_BUFFER allocateCommonBuffer
;
19 allocateCommonBuffer
= *(DmaAdapter
)->DmaOperations
->AllocateCommonBuffer
;
20 ASSERT( allocateCommonBuffer
!= NULL
);
21 commonBuffer
= allocateCommonBuffer( DmaAdapter
, Length
, LogicalAddress
, CacheEnabled
);
29 IN PDMA_ADAPTER DmaAdapter
,
31 IN PHYSICAL_ADDRESS LogicalAddress
,
32 IN PVOID VirtualAddress
,
33 IN BOOLEAN CacheEnabled
)
35 PFREE_COMMON_BUFFER freeCommonBuffer
;
37 freeCommonBuffer
= *(DmaAdapter
)->DmaOperations
->FreeCommonBuffer
;
38 ASSERT( freeCommonBuffer
!= NULL
);
39 freeCommonBuffer( DmaAdapter
, Length
, LogicalAddress
, VirtualAddress
, CacheEnabled
);
46 IN PDMA_ADAPTER DmaAdapter
)
48 PREAD_DMA_COUNTER readDmaCounter
;
51 readDmaCounter
= *(DmaAdapter
)->DmaOperations
->ReadDmaCounter
;
52 ASSERT( readDmaCounter
!= NULL
);
53 counter
= readDmaCounter( DmaAdapter
);
60 IN PDMA_ADAPTER DmaAdapter
)
62 PGET_DMA_ALIGNMENT getDmaAlignment
;
65 getDmaAlignment
= *(DmaAdapter
)->DmaOperations
->GetDmaAlignment
;
66 ASSERT( getDmaAlignment
!= NULL
);
67 alignment
= getDmaAlignment( DmaAdapter
);
77 #if (NTDDI_VERSION >= NTDDI_WIN2K)
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
);
143 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
151 #if !defined(NO_LEGACY_DRIVERS)
153 #if (NTDDI_VERSION >= NTDDI_WIN2K)
158 HalAssignSlotResources(
159 IN PUNICODE_STRING RegistryPath
,
160 IN PUNICODE_STRING DriverClassName
,
161 IN PDRIVER_OBJECT DriverObject
,
162 IN PDEVICE_OBJECT DeviceObject
,
163 IN INTERFACE_TYPE BusType
,
166 IN OUT PCM_RESOURCE_LIST
*AllocatedResources
);
171 HalGetInterruptVector(
172 IN INTERFACE_TYPE InterfaceType
,
174 IN ULONG BusInterruptLevel
,
175 IN ULONG BusInterruptVector
,
177 OUT PKAFFINITY Affinity
);
183 IN BUS_DATA_TYPE BusDataType
,
193 IN BUS_DATA_TYPE BusDataType
,
207 #endif /* !defined(NO_LEGACY_DRIVERS) */
209 #if (NTDDI_VERSION >= NTDDI_WIN2K)
215 IN PDEVICE_DESCRIPTION DeviceDescription
,
216 OUT PULONG NumberOfMapRegisters
);
221 IN PADAPTER_OBJECT DmaAdapter
);
226 HalAcquireDisplayOwnership(
227 IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters
);
232 HalGetBusDataByOffset(
233 IN BUS_DATA_TYPE BusDataType
,
243 HalSetBusDataByOffset(
244 IN BUS_DATA_TYPE BusDataType
,
254 HalTranslateBusAddress(
255 IN INTERFACE_TYPE InterfaceType
,
257 IN PHYSICAL_ADDRESS BusAddress
,
258 IN OUT PULONG AddressSpace
,
259 OUT PPHYSICAL_ADDRESS TranslatedAddress
);
264 HalAllocateCrashDumpRegisters(
265 IN PADAPTER_OBJECT AdapterObject
,
266 IN OUT PULONG NumberOfMapRegisters
);
270 HalGetScatterGatherList(
271 IN PADAPTER_OBJECT DmaAdapter
,
272 IN PDEVICE_OBJECT DeviceObject
,
276 IN PDRIVER_LIST_CONTROL ExecutionRoutine
,
278 IN BOOLEAN WriteToDevice
);
282 HalPutScatterGatherList(
283 IN PADAPTER_OBJECT DmaAdapter
,
284 IN PSCATTER_GATHER_LIST ScatterGather
,
285 IN BOOLEAN WriteToDevice
);
287 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
289 #if (NTDDI_VERSION >= NTDDI_WINXP)
294 IN PDEVICE_OBJECT DeviceObject
,
296 IN ULONG MBRTypeIdentifier
,
300 #if (NTDDI_VERSION >= NTDDI_WIN7)
304 HalAllocateHardwareCounters(
305 IN PGROUP_AFFINITY GroupAffinty
,
307 IN PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList
,
308 OUT PHANDLE CounterSetHandle
);
312 HalFreeHardwareCounters(
313 IN HANDLE CounterSetHandle
);
318 #if (NTDDI_VERSION >= NTDDI_WIN2K)
322 HalGetDmaAlignmentRequirement(VOID
);
324 #endif /* defined(_IA64_) */
326 #if defined(_M_IX86) || defined(_M_AMD64)
327 #define HalGetDmaAlignmentRequirement() 1L
330 #if (NTDDI_VERSION >= NTDDI_WIN7)
332 typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR
*PWHEA_ERROR_SOURCE_DESCRIPTOR
;
333 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
339 IN PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource
,
340 IN PWHEA_ERROR_RECORD ErrorRecord
);
344 typedef struct _WHEA_ERROR_RECORD
*PWHEA_ERROR_RECORD
;
350 IN PWHEA_ERROR_RECORD ErrorRecord
);
352 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */