2010-03-23 00:27:32 +00:00
|
|
|
/* Hardware Abstraction Layer Functions */
|
2010-03-13 00:34:48 +00:00
|
|
|
|
2010-03-24 20:19:04 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-24 20:19:04 +00:00
|
|
|
#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$if (_WDMDDK_)
|
2012-01-22 14:43:53 +00:00
|
|
|
__drv_preferredFunction("AllocateCommonBuffer","Obsolete")
|
2010-03-13 00:34:48 +00:00
|
|
|
FORCEINLINE
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
HalAllocateCommonBuffer(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDMA_ADAPTER DmaAdapter,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_Out_ PPHYSICAL_ADDRESS LogicalAddress,
|
|
|
|
_In_ BOOLEAN CacheEnabled)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
|
|
|
PALLOCATE_COMMON_BUFFER allocateCommonBuffer;
|
|
|
|
PVOID commonBuffer;
|
|
|
|
|
|
|
|
allocateCommonBuffer = *(DmaAdapter)->DmaOperations->AllocateCommonBuffer;
|
|
|
|
ASSERT( allocateCommonBuffer != NULL );
|
|
|
|
commonBuffer = allocateCommonBuffer( DmaAdapter, Length, LogicalAddress, CacheEnabled );
|
|
|
|
return commonBuffer;
|
|
|
|
}
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
__drv_preferredFunction("FreeCommonBuffer","Obsolete")
|
2010-03-13 00:34:48 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalFreeCommonBuffer(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDMA_ADAPTER DmaAdapter,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ PHYSICAL_ADDRESS LogicalAddress,
|
|
|
|
_In_ PVOID VirtualAddress,
|
|
|
|
_In_ BOOLEAN CacheEnabled)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
|
|
|
PFREE_COMMON_BUFFER freeCommonBuffer;
|
|
|
|
|
|
|
|
freeCommonBuffer = *(DmaAdapter)->DmaOperations->FreeCommonBuffer;
|
|
|
|
ASSERT( freeCommonBuffer != NULL );
|
|
|
|
freeCommonBuffer( DmaAdapter, Length, LogicalAddress, VirtualAddress, CacheEnabled );
|
|
|
|
}
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
__drv_preferredFunction("ReadDmaCounter","Obsolete")
|
2010-03-13 00:34:48 +00:00
|
|
|
FORCEINLINE
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalReadDmaCounter(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDMA_ADAPTER DmaAdapter)
|
2010-03-13 00:34:48 +00:00
|
|
|
{
|
|
|
|
PREAD_DMA_COUNTER readDmaCounter;
|
|
|
|
ULONG counter;
|
|
|
|
|
|
|
|
readDmaCounter = *(DmaAdapter)->DmaOperations->ReadDmaCounter;
|
|
|
|
ASSERT( readDmaCounter != NULL );
|
|
|
|
counter = readDmaCounter( DmaAdapter );
|
|
|
|
return counter;
|
|
|
|
}
|
|
|
|
|
[PSDK]
- Add devpropdef.h and evntprov.h
- Fix UOW redefinition.
[DDK]
- Fix PGUID redefinition.
[XDK]
- Add wmitypes.h and include it in wdm.h autogeneration template.
- Move several definitions to their appropriate places.
- Add HalGetDmaAlignment, LEGACY_BUS_INFORMATION, IO_DEVICE_EJECT_CALLBACK, PLUGPLAY_PROPERTY_PERSISTENT, and several missing Io*, DEVICE_*, REENUMERATE_*, PCI_*, PNP_*, Ob*, OB_*, PO_*, Wmi*, Etw* and ACPI related definitions.
- Add CmKeyObjectType to exported object types.
- Fix UOW redefinition.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46329
2010-03-22 01:00:05 +00:00
|
|
|
FORCEINLINE
|
|
|
|
ULONG
|
|
|
|
HalGetDmaAlignment(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDMA_ADAPTER DmaAdapter)
|
[PSDK]
- Add devpropdef.h and evntprov.h
- Fix UOW redefinition.
[DDK]
- Fix PGUID redefinition.
[XDK]
- Add wmitypes.h and include it in wdm.h autogeneration template.
- Move several definitions to their appropriate places.
- Add HalGetDmaAlignment, LEGACY_BUS_INFORMATION, IO_DEVICE_EJECT_CALLBACK, PLUGPLAY_PROPERTY_PERSISTENT, and several missing Io*, DEVICE_*, REENUMERATE_*, PCI_*, PNP_*, Ob*, OB_*, PO_*, Wmi*, Etw* and ACPI related definitions.
- Add CmKeyObjectType to exported object types.
- Fix UOW redefinition.
- Group some related definitions.
[WDM]
- Update wdm.h to reflect XDK changes.
svn path=/branches/header-work/; revision=46329
2010-03-22 01:00:05 +00:00
|
|
|
{
|
|
|
|
PGET_DMA_ALIGNMENT getDmaAlignment;
|
|
|
|
ULONG alignment;
|
|
|
|
|
|
|
|
getDmaAlignment = *(DmaAdapter)->DmaOperations->GetDmaAlignment;
|
|
|
|
ASSERT( getDmaAlignment != NULL );
|
|
|
|
alignment = getDmaAlignment( DmaAdapter );
|
|
|
|
return alignment;
|
|
|
|
}
|
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$endif (_WDMDDK_)
|
2010-03-23 00:27:32 +00:00
|
|
|
$if (_NTDDK_)
|
2010-03-24 20:19:04 +00:00
|
|
|
/* Nothing here */
|
|
|
|
|
|
|
|
#else /* USE_DMA_MACROS ... */
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
IoFreeAdapterChannel(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
IoFlushAdapterBuffers(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_In_ PMDL Mdl,
|
|
|
|
_In_ PVOID MapRegisterBase,
|
|
|
|
_In_ PVOID CurrentVa,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ BOOLEAN WriteToDevice);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
IoFreeMapRegisters(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_In_ PVOID MapRegisterBase,
|
|
|
|
_In_ ULONG NumberOfMapRegisters);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
HalAllocateCommonBuffer(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_Out_ PPHYSICAL_ADDRESS LogicalAddress,
|
|
|
|
_In_ BOOLEAN CacheEnabled);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalFreeCommonBuffer(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ PHYSICAL_ADDRESS LogicalAddress,
|
|
|
|
_In_ PVOID VirtualAddress,
|
|
|
|
_In_ BOOLEAN CacheEnabled);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
//DECLSPEC_DEPRECATED_DDK
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalReadDmaCounter(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalAllocateAdapterChannel(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_In_ PWAIT_CONTEXT_BLOCK Wcb,
|
|
|
|
_In_ ULONG NumberOfMapRegisters,
|
|
|
|
_In_ PDRIVER_CONTROL ExecutionRoutine);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$endif (_NTDDK_)
|
2010-03-24 20:19:04 +00:00
|
|
|
#endif /* USE_DMA_MACROS ... */
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$if (_NTDDK_)
|
2010-03-23 00:27:32 +00:00
|
|
|
#if !defined(NO_LEGACY_DRIVERS)
|
|
|
|
NTHALAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalAssignSlotResources(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PUNICODE_STRING RegistryPath,
|
|
|
|
_In_opt_ PUNICODE_STRING DriverClassName,
|
|
|
|
_In_ PDRIVER_OBJECT DriverObject,
|
|
|
|
_In_ PDEVICE_OBJECT DeviceObject,
|
|
|
|
_In_ INTERFACE_TYPE BusType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_Inout_ PCM_RESOURCE_LIST *AllocatedResources);
|
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2010-03-23 00:27:32 +00:00
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetInterruptVector(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ INTERFACE_TYPE InterfaceType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG BusInterruptLevel,
|
|
|
|
_In_ ULONG BusInterruptVector,
|
|
|
|
_Out_ PKIRQL Irql,
|
|
|
|
_Out_ PKAFFINITY Affinity);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalSetBusData(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ BUS_DATA_TYPE BusDataType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_In_reads_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Length);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetBusData(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ BUS_DATA_TYPE BusDataType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_Out_writes_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Length);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalMakeBeep(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ ULONG Frequency);
|
2010-03-23 00:27:32 +00:00
|
|
|
#endif /* !defined(NO_LEGACY_DRIVERS) */
|
|
|
|
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2010-03-23 00:27:32 +00:00
|
|
|
NTHALAPI
|
|
|
|
PADAPTER_OBJECT
|
|
|
|
NTAPI
|
|
|
|
HalGetAdapter(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDEVICE_DESCRIPTION DeviceDescription,
|
|
|
|
_Out_ PULONG NumberOfMapRegisters);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalPutDmaAdapter(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT DmaAdapter);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalAcquireDisplayOwnership(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetBusDataByOffset(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ BUS_DATA_TYPE BusDataType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_Out_writes_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Offset,
|
|
|
|
_In_ ULONG Length);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalSetBusDataByOffset(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ BUS_DATA_TYPE BusDataType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ ULONG SlotNumber,
|
|
|
|
_In_reads_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Offset,
|
|
|
|
_In_ ULONG Length);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalTranslateBusAddress(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ INTERFACE_TYPE InterfaceType,
|
|
|
|
_In_ ULONG BusNumber,
|
|
|
|
_In_ PHYSICAL_ADDRESS BusAddress,
|
|
|
|
_Inout_ PULONG AddressSpace,
|
|
|
|
_Out_ PPHYSICAL_ADDRESS TranslatedAddress);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
PVOID
|
|
|
|
NTAPI
|
|
|
|
HalAllocateCrashDumpRegisters(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT AdapterObject,
|
|
|
|
_Inout_ PULONG NumberOfMapRegisters);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalGetScatterGatherList(
|
2012-01-22 14:43:53 +00:00
|
|
|
_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);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalPutScatterGatherList(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PADAPTER_OBJECT DmaAdapter,
|
|
|
|
_In_ PSCATTER_GATHER_LIST ScatterGather,
|
|
|
|
_In_ BOOLEAN WriteToDevice);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$endif (_NTDDK_)
|
2010-03-23 00:27:32 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
|
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$if (_NTDDK_)
|
2010-03-23 00:27:32 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2012-01-22 14:43:53 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2010-03-23 00:27:32 +00:00
|
|
|
NTKERNELAPI
|
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
HalExamineMBR(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PDEVICE_OBJECT DeviceObject,
|
|
|
|
_In_ ULONG SectorSize,
|
|
|
|
_In_ ULONG MBRTypeIdentifier,
|
|
|
|
_Out_ PVOID *Buffer);
|
2010-03-24 20:19:04 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalAllocateHardwareCounters(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinty,
|
|
|
|
_In_ ULONG GroupCount,
|
|
|
|
_In_ PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList,
|
|
|
|
_Out_ PHANDLE CounterSetHandle);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalFreeHardwareCounters(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ HANDLE CounterSetHandle);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
2010-03-24 20:19:04 +00:00
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
#if defined(_IA64_)
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN2K)
|
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalGetDmaAlignmentRequirement(VOID);
|
|
|
|
#endif
|
|
|
|
#endif /* defined(_IA64_) */
|
|
|
|
|
|
|
|
#if defined(_M_IX86) || defined(_M_AMD64)
|
|
|
|
#define HalGetDmaAlignmentRequirement() 1L
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
|
|
|
|
|
|
|
typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR;
|
|
|
|
typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
|
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalBugCheckSystem(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource,
|
|
|
|
_In_ PWHEA_ERROR_RECORD ErrorRecord);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
|
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalBugCheckSystem(
|
2012-01-22 14:43:53 +00:00
|
|
|
_In_ PWHEA_ERROR_RECORD ErrorRecord);
|
2010-03-23 00:27:32 +00:00
|
|
|
|
|
|
|
#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
|
|
|
|
|
2010-03-27 10:45:04 +00:00
|
|
|
$endif (_NTDDK_)
|