ReactOS 0.4.16-dev-295-g4aee028
halfuncs.h
Go to the documentation of this file.
1/* Hardware Abstraction Layer Functions */
2
3#if (NTDDI_VERSION >= NTDDI_WIN2K)
4
5#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
6
8__drv_preferredFunction("AllocateCommonBuffer","Obsolete")
13 _In_ PDMA_ADAPTER DmaAdapter,
15 _Out_ PPHYSICAL_ADDRESS LogicalAddress,
16 _In_ BOOLEAN CacheEnabled)
17{
18 PALLOCATE_COMMON_BUFFER allocateCommonBuffer;
19 PVOID commonBuffer;
20
21 allocateCommonBuffer = *(DmaAdapter)->DmaOperations->AllocateCommonBuffer;
22 ASSERT( allocateCommonBuffer != NULL );
23 commonBuffer = allocateCommonBuffer( DmaAdapter, Length, LogicalAddress, CacheEnabled );
24 return commonBuffer;
25}
26
27__drv_preferredFunction("FreeCommonBuffer","Obsolete")
29VOID
32 _In_ PDMA_ADAPTER DmaAdapter,
34 _In_ PHYSICAL_ADDRESS LogicalAddress,
36 _In_ BOOLEAN CacheEnabled)
37{
38 PFREE_COMMON_BUFFER freeCommonBuffer;
39
40 freeCommonBuffer = *(DmaAdapter)->DmaOperations->FreeCommonBuffer;
41 ASSERT( freeCommonBuffer != NULL );
42 freeCommonBuffer( DmaAdapter, Length, LogicalAddress, VirtualAddress, CacheEnabled );
43}
44
45__drv_preferredFunction("ReadDmaCounter","Obsolete")
50 _In_ PDMA_ADAPTER DmaAdapter)
51{
52 PREAD_DMA_COUNTER readDmaCounter;
54
55 readDmaCounter = *(DmaAdapter)->DmaOperations->ReadDmaCounter;
56 ASSERT( readDmaCounter != NULL );
57 counter = readDmaCounter( DmaAdapter );
58 return counter;
59}
60
63HalGetDmaAlignment(
64 _In_ PDMA_ADAPTER DmaAdapter)
65{
66 PGET_DMA_ALIGNMENT getDmaAlignment;
67 ULONG alignment;
68
69 getDmaAlignment = *(DmaAdapter)->DmaOperations->GetDmaAlignment;
70 ASSERT( getDmaAlignment != NULL );
71 alignment = getDmaAlignment( DmaAdapter );
72 return alignment;
73}
74
77/* Nothing here */
78
79#else /* USE_DMA_MACROS ... */
80
81//DECLSPEC_DEPRECATED_DDK
83VOID
86 _In_ PADAPTER_OBJECT AdapterObject);
87
88//DECLSPEC_DEPRECATED_DDK
93 _In_ PADAPTER_OBJECT AdapterObject,
96 _In_ PVOID CurrentVa,
99
100//DECLSPEC_DEPRECATED_DDK
102VOID
103NTAPI
105 _In_ PADAPTER_OBJECT AdapterObject,
108
109//DECLSPEC_DEPRECATED_DDK
111PVOID
112NTAPI
114 _In_ PADAPTER_OBJECT AdapterObject,
116 _Out_ PPHYSICAL_ADDRESS LogicalAddress,
117 _In_ BOOLEAN CacheEnabled);
118
119//DECLSPEC_DEPRECATED_DDK
121VOID
122NTAPI
124 _In_ PADAPTER_OBJECT AdapterObject,
126 _In_ PHYSICAL_ADDRESS LogicalAddress,
128 _In_ BOOLEAN CacheEnabled);
129
130//DECLSPEC_DEPRECATED_DDK
132ULONG
133NTAPI
135 _In_ PADAPTER_OBJECT AdapterObject);
136
139NTAPI
141 _In_ PADAPTER_OBJECT AdapterObject,
145
147#endif /* USE_DMA_MACROS ... */
148
149$if (_NTDDK_)
150#if !defined(NO_LEGACY_DRIVERS)
153NTAPI
163
166ULONG
167NTAPI
175
177ULONG
178NTAPI
180 _In_ BUS_DATA_TYPE BusDataType,
185
187ULONG
188NTAPI
190 _In_ BUS_DATA_TYPE BusDataType,
195
198NTAPI
201#endif /* !defined(NO_LEGACY_DRIVERS) */
202
206NTAPI
210
211VOID
212NTAPI
214 _In_ PADAPTER_OBJECT DmaAdapter);
215
217VOID
218NTAPI
220 _In_ PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
221
223ULONG
224NTAPI
226 _In_ BUS_DATA_TYPE BusDataType,
232
234ULONG
235NTAPI
237 _In_ BUS_DATA_TYPE BusDataType,
243
246NTAPI
253
255PVOID
256NTAPI
258 _In_ PADAPTER_OBJECT AdapterObject,
260
262NTAPI
264 _In_ PADAPTER_OBJECT DmaAdapter,
266 _In_ PMDL Mdl,
267 _In_ PVOID CurrentVa,
272
273VOID
274NTAPI
276 _In_ PADAPTER_OBJECT DmaAdapter,
279
281#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
282
283$if (_NTDDK_)
284#if (NTDDI_VERSION >= NTDDI_WINXP)
287VOID
294#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
295
296#if (NTDDI_VERSION >= NTDDI_WIN7)
297
299NTAPI
301 _In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinty,
302 _In_ ULONG GroupCount,
304 _Out_ PHANDLE CounterSetHandle);
305
307NTAPI
309 _In_ HANDLE CounterSetHandle);
310
311#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
312
313#if defined(_IA64_)
314#if (NTDDI_VERSION >= NTDDI_WIN2K)
316ULONG
317NTAPI
318HalGetDmaAlignmentRequirement(VOID);
319#endif
320#endif /* defined(_IA64_) */
321
322#if defined(_M_IX86) || defined(_M_AMD64)
323#define HalGetDmaAlignmentRequirement() 1L
324#endif
325
326#if (NTDDI_VERSION >= NTDDI_WIN7)
327
328typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR;
329typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
330
332VOID
333NTAPI
336 _In_ PWHEA_ERROR_RECORD ErrorRecord);
337
338#else
339
340typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
341
343VOID
344NTAPI
346 _In_ PWHEA_ERROR_RECORD ErrorRecord);
347
348#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
349
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
KAFFINITY * PKAFFINITY
Definition: basetsd.h:195
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
Definition: cdrom.h:992
Definition: bufpool.h:45
_Out_ PKIRQL Irql
Definition: csq.h:179
#define NULL
Definition: types.h:112
NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(PUNICODE_STRING, PUNICODE_STRING, PDRIVER_OBJECT, PDEVICE_OBJECT, INTERFACE_TYPE, ULONG, ULONG, PCM_RESOURCE_LIST *)
NTHALAPI ULONG NTAPI HalGetInterruptVector(INTERFACE_TYPE, ULONG, ULONG, ULONG, PKIRQL, PKAFFINITY)
#define __drv_preferredFunction(func, why)
Definition: driverspecs.h:311
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
PADAPTER_OBJECT NTAPI HalGetAdapter(IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
Definition: dma.c:22
enum _INTERFACE_TYPE INTERFACE_TYPE
#define ASSERT(a)
Definition: mode.c:44
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
#define FASTCALL
Definition: nt_native.h:50
#define _NTDDK_
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define NTHALAPI
Definition: ntoskrnl.h:40
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define HalExamineMBR
Definition: part_xbox.c:325
enum _BUS_DATA_TYPE BUS_DATA_TYPE
$if(_WDMDDK_) typedef struct _KFLOATING_SAVE
Definition: ke.h:1
static LARGE_INTEGER Frequency
Definition: clock.c:41
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDMATRANSACTION _In_ PFN_WDF_PROGRAM_DMA _In_ WDF_DMA_DIRECTION _In_ PMDL _In_ PVOID VirtualAddress
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
#define FORCEINLINE
Definition: wdftypes.h:67
#define _WDMDDK_
Definition: wdm.template.h:26
#define NTKERNELAPI
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
NTHALAPI VOID NTAPI IoFreeAdapterChannel(_In_ PADAPTER_OBJECT AdapterObject)
NTHALAPI ULONG NTAPI HalGetBusDataByOffset(_In_ BUS_DATA_TYPE BusDataType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _Out_writes_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
NTHALAPI ULONG NTAPI HalSetBusData(_In_ BUS_DATA_TYPE BusDataType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Length)
struct _WHEA_ERROR_SOURCE_DESCRIPTOR * PWHEA_ERROR_SOURCE_DESCRIPTOR
Definition: halfuncs.h:328
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:171
NTHALAPI ULONG NTAPI HalSetBusDataByOffset(_In_ BUS_DATA_TYPE BusDataType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
NTHALAPI BOOLEAN NTAPI HalTranslateBusAddress(_In_ INTERFACE_TYPE InterfaceType, _In_ ULONG BusNumber, _In_ PHYSICAL_ADDRESS BusAddress, _Inout_ PULONG AddressSpace, _Out_ PPHYSICAL_ADDRESS TranslatedAddress)
$endif(_NTDDK_) $if(_NTDDK_) NTHALAPI NTSTATUS NTAPI HalAssignSlotResources(_In_ PUNICODE_STRING RegistryPath
Definition: iofuncs.h:2494
NTHALAPI BOOLEAN NTAPI IoFlushAdapterBuffers(_In_ PADAPTER_OBJECT AdapterObject, _In_ PMDL Mdl, _In_ PVOID MapRegisterBase, _In_ PVOID CurrentVa, _In_ ULONG Length, _In_ BOOLEAN WriteToDevice)
_Out_ PULONG NumberOfMapRegisters
Definition: halfuncs.h:209
NTHALAPI PVOID NTAPI HalAllocateCommonBuffer(_In_ PADAPTER_OBJECT AdapterObject, _In_ ULONG Length, _Out_ PPHYSICAL_ADDRESS LogicalAddress, _In_ BOOLEAN CacheEnabled)
NTSTATUS NTAPI HalFreeHardwareCounters(_In_ HANDLE CounterSetHandle)
NTHALAPI PVOID NTAPI HalAllocateCrashDumpRegisters(_In_ PADAPTER_OBJECT AdapterObject, _Inout_ PULONG NumberOfMapRegisters)
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
NTHALAPI VOID NTAPI IoFreeMapRegisters(_In_ PADAPTER_OBJECT AdapterObject, _In_ PVOID MapRegisterBase, _In_ ULONG NumberOfMapRegisters)
NTHALAPI VOID NTAPI HalAcquireDisplayOwnership(_In_ PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters)
NTHALAPI NTSTATUS NTAPI HalAllocateAdapterChannel(_In_ PADAPTER_OBJECT AdapterObject, _In_ PWAIT_CONTEXT_BLOCK Wcb, _In_ ULONG NumberOfMapRegisters, _In_ PDRIVER_CONTROL ExecutionRoutine)
VOID NTAPI HalPutDmaAdapter(_In_ PADAPTER_OBJECT DmaAdapter)
_In_ ULONG _In_ ULONG _In_ ULONG BusInterruptVector
Definition: halfuncs.h:172
NTSTATUS NTAPI HalGetScatterGatherList(_In_ PADAPTER_OBJECT DmaAdapter, _In_ PDEVICE_OBJECT DeviceObject, _In_ PMDL Mdl, _In_ PVOID CurrentVa, _In_ ULONG Length, _In_ PDRIVER_LIST_CONTROL ExecutionRoutine, _In_ PVOID Context, _In_ BOOLEAN WriteToDevice)
NTHALAPI VOID NTAPI HalFreeCommonBuffer(_In_ PADAPTER_OBJECT AdapterObject, _In_ ULONG Length, _In_ PHYSICAL_ADDRESS LogicalAddress, _In_ PVOID VirtualAddress, _In_ BOOLEAN CacheEnabled)
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174
_In_ ULONG _In_ ULONG MBRTypeIdentifier
Definition: halfuncs.h:292
NTHALAPI VOID NTAPI HalBugCheckSystem(_In_ PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, _In_ PWHEA_ERROR_RECORD ErrorRecord)
_In_ ULONG SectorSize
Definition: halfuncs.h:291
struct _WHEA_ERROR_RECORD * PWHEA_ERROR_RECORD
Definition: halfuncs.h:329
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG _Inout_ PCM_RESOURCE_LIST * AllocatedResources
Definition: halfuncs.h:162
VOID NTAPI HalPutScatterGatherList(_In_ PADAPTER_OBJECT DmaAdapter, _In_ PSCATTER_GATHER_LIST ScatterGather, _In_ BOOLEAN WriteToDevice)
NTHALAPI BOOLEAN NTAPI HalMakeBeep(_In_ ULONG Frequency)
Definition: beep.c:19
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE BusType
Definition: halfuncs.h:159
NTHALAPI ULONG NTAPI HalReadDmaCounter(_In_ PADAPTER_OBJECT AdapterObject)
NTSTATUS NTAPI HalAllocateHardwareCounters(_In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinty, _In_ ULONG GroupCount, _In_ PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, _Out_ PHANDLE CounterSetHandle)
NTHALAPI ULONG NTAPI HalGetBusData(_In_ BUS_DATA_TYPE BusDataType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _Out_writes_bytes_(Length) PVOID Buffer, _In_ ULONG Length)
_In_ PDEVICE_OBJECT _In_ ULONG _In_ PDRIVER_CONTROL ExecutionRoutine
Definition: iofuncs.h:1399
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2273
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2275
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2274
ULONG(NTAPI * PREAD_DMA_COUNTER)(_In_ PDMA_ADAPTER DmaAdapter)
Definition: iotypes.h:2366
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
Definition: iotypes.h:2204
_Inout_ struct _IRP _In_ PVOID MapRegisterBase
Definition: iotypes.h:213
DRIVER_LIST_CONTROL * PDRIVER_LIST_CONTROL
Definition: iotypes.h:2377
_In_ struct _IRP _In_ struct _SCATTER_GATHER_LIST * ScatterGather
Definition: iotypes.h:2375
DRIVER_CONTROL * PDRIVER_CONTROL
Definition: iotypes.h:215
PVOID(NTAPI * PALLOCATE_COMMON_BUFFER)(_In_ PDMA_ADAPTER DmaAdapter, _In_ ULONG Length, _Out_ PPHYSICAL_ADDRESS LogicalAddress, _In_ BOOLEAN CacheEnabled)
Definition: iotypes.h:2311
VOID(NTAPI * PFREE_COMMON_BUFFER)(_In_ PDMA_ADAPTER DmaAdapter, _In_ ULONG Length, _In_ PHYSICAL_ADDRESS LogicalAddress, _In_ PVOID VirtualAddress, _In_ BOOLEAN CacheEnabled)
Definition: iotypes.h:2318
ULONG(NTAPI * PGET_DMA_ALIGNMENT)(_In_ PDMA_ADAPTER DmaAdapter)
Definition: iotypes.h:2362