80#define MAX_SG_ELEMENTS 0x10
158#define MAX_MAP_REGISTERS 64
160#define TAG_DMA ' AMD'
164#if defined(SARCH_PC98)
169#undef WRITE_PORT_UCHAR
170#undef READ_PORT_UCHAR
172#define WRITE_PORT_UCHAR(Port, Data) \
179#define READ_PORT_UCHAR(Port) 0x00
239 if (AdapterObject->MasterDevice)
241 if (AdapterObject->Dma64BitAddresses)
243 HighestAddress.
QuadPart = 0xFFFFFFFFFFFFFFFFULL;
244 return HighestAddress;
246 else if (AdapterObject->Dma32BitAddresses)
248 HighestAddress.
QuadPart = 0xFFFFFFFF;
249 return HighestAddress;
254 return HighestAddress;
286 DPRINT(
"No more map register slots available! (Current: %d | Requested: %d | Limit: %d)\n",
287 AdapterObject->NumberOfMapRegisters,
300 BoundryAddressMultiple.
QuadPart = 0;
305 BoundryAddressMultiple,
313 BoundryAddressMultiple,
336 CurrentEntry = AdapterObject->MapRegisterBase + AdapterObject->NumberOfMapRegisters;
348 if (CurrentEntry != AdapterObject->MapRegisterBase)
350 PreviousEntry = CurrentEntry - 1;
358 AdapterObject->NumberOfMapRegisters++;
365 AdapterObject->NumberOfMapRegisters++;
370 (
ULONG)(CurrentEntry - AdapterObject->MapRegisterBase));
378 AdapterObject->NumberOfMapRegisters++;
406 Size += (SizeOfBitmap + 7) >> 3;
409 if (!MasterAdapter)
return NULL;
416 MasterAdapter->MapRegisters = (
PVOID)(MasterAdapter + 1);
418 (
PULONG)(MasterAdapter->MapRegisters + 1),
421 MasterAdapter->NumberOfMapRegisters = 0;
422 MasterAdapter->CommittedMapRegisters = 0;
428 if (!MasterAdapter->MapRegisterBase)
442 return MasterAdapter;
477 (
PVOID)&AdapterObject);
497 AdapterObject->MapRegistersPerChannel = 1;
499 AdapterObject->ChannelNumber = 0xFF;
503 return AdapterObject;
533 AdapterObject->AdapterNumber = Controller;
536 AdapterObject->Width16Bits =
FALSE;
537 AdapterObject->AdapterBaseVa = AdapterBaseVa;
584 AdapterObject->Width16Bits =
TRUE;
593 DmaMode.
Channel = AdapterObject->ChannelNumber;
638 AdapterObject->AdapterMode = DmaMode;
732 if (MapRegisters > 16) MapRegisters = 16;
751 if ((AdapterObject->NeedsMapRegisters) &&
752 (MapRegisters > AdapterObject->MapRegistersPerChannel))
754 AdapterObject->MapRegistersPerChannel = MapRegisters;
759 if (AdapterObject ==
NULL)
762 if (AdapterObject ==
NULL)
773 if (MapRegisters > 0)
775 AdapterObject->NeedsMapRegisters =
TRUE;
776 AdapterObject->MapRegistersPerChannel = MapRegisters;
780 AdapterObject->NeedsMapRegisters =
FALSE;
787 AdapterObject->MapRegistersPerChannel = 1;
816 AdapterObject->IgnoreCount = 0;
839 return AdapterObject;
872 if (AdapterObject->ChannelNumber == 0xFF)
921 BoundryAddressMultiple.
QuadPart = 0;
928 if (AdapterObject->MasterDevice)
930 BoundryAddressMultiple.
HighPart = 1;
934 BoundryAddressMultiple.
LowPart = 0x10000;
940 BoundryAddressMultiple,
997 ULONG ElementCount = 0, RemainingLength = AdapterControlContext->
Length;
1005 TempElements[ElementCount].
Length = RemainingLength;
1006 TempElements[ElementCount].
Reserved = 0;
1008 AdapterControlContext->
Mdl,
1010 CurrentVa + (AdapterControlContext->
Length - RemainingLength),
1011 &TempElements[ElementCount].
Length,
1013 if (TempElements[ElementCount].
Length == 0)
1016 DPRINT(
"Allocated one S/G element: 0x%I64u with length: 0x%x\n",
1017 TempElements[ElementCount].
Address.QuadPart,
1018 TempElements[ElementCount].
Length);
1020 ASSERT(TempElements[ElementCount].
Length <= RemainingLength);
1021 RemainingLength -= TempElements[ElementCount].
Length;
1025 if (RemainingLength > 0)
1027 DPRINT1(
"Scatter/gather list construction failed!\n");
1034 ASSERT(ScatterGatherList);
1036 ScatterGatherList->NumberOfElements = ElementCount;
1037 ScatterGatherList->Reserved = (
ULONG_PTR)AdapterControlContext;
1042 DPRINT(
"Initiating S/G DMA with %d element(s)\n", ElementCount);
1133 AdapterControlContext->
Mdl,
1152 DPRINT(
"S/G DMA has finished!\n");
1173 *ScatterGatherListSize = SgSize;
1225 IN ULONG ScatterGatherBufferLength)
1240 if (ScatterGatherBuffer)
1243 if (ScatterGatherBufferLength < SgSize)
1247 UsingUserBuffer =
TRUE;
1252 if (!ScatterGatherBuffer)
1256 UsingUserBuffer =
FALSE;
1265 ScatterGatherContext->
Mdl =
Mdl;
1266 ScatterGatherContext->
CurrentVa = CurrentVa;
1278 &ScatterGatherContext->
Wcb,
1284 if (!UsingUserBuffer)
1335 ASSERT(!AdapterObject->MasterDevice);
1345 if (AdapterObject->AdapterNumber == 1)
1362 }
while (0xffff00 & (OldCount ^
Count));
1381 }
while (0xffff00 & (OldCount ^
Count));
1388 if (AdapterObject->Width16Bits)
Count *= 2;
1480 &WaitContextBlock->WaitQueueEntry))
1485 MasterAdapter = AdapterObject->MasterAdapter;
1488 AdapterObject->CurrentWcb = WaitContextBlock;
1494 AdapterObject->NumberOfMapRegisters = 0;
1528 AdapterObject->MapRegisterBase = MasterAdapter->MapRegisterBase +
Index;
1529 if (!AdapterObject->ScatterGather)
1538 InsertTailList(&MasterAdapter->AdapterQueue, &AdapterObject->AdapterQueue);
1546 WorkItem->AdapterObject = AdapterObject;
1561 AdapterObject->MapRegisterBase =
NULL;
1562 AdapterObject->NumberOfMapRegisters = 0;
1565 AdapterObject->CurrentWcb = WaitContextBlock;
1568 WaitContextBlock->CurrentIrp,
1569 AdapterObject->MapRegisterBase,
1570 WaitContextBlock->DeviceContext);
1597 AdapterObject->NumberOfMapRegisters = 0;
1633 MasterAdapter = AdapterObject->MasterAdapter;
1642 if (AdapterObject->NumberOfMapRegisters)
1645 AdapterObject->MapRegisterBase,
1646 AdapterObject->NumberOfMapRegisters);
1656 AdapterObject->CurrentWcb = WaitContextBlock;
1670 AdapterObject->MapRegisterBase = MasterAdapter->MapRegisterBase +
Index;
1671 if (!AdapterObject->ScatterGather)
1680 InsertTailList(&MasterAdapter->AdapterQueue, &AdapterObject->AdapterQueue);
1689 AdapterObject->MapRegisterBase =
NULL;
1690 AdapterObject->NumberOfMapRegisters = 0;
1696 AdapterObject->MapRegisterBase,
1712 AdapterObject->NumberOfMapRegisters = 0;
1759 (
ULONG)(RealMapRegisterBase - MasterAdapter->MapRegisterBase),
1767 while (!
IsListEmpty(&MasterAdapter->AdapterQueue))
1773 AdapterObject->NumberOfMapRegisters,
1783 AdapterObject->MapRegisterBase = MasterAdapter->MapRegisterBase +
Index;
1784 if (!AdapterObject->ScatterGather)
1786 AdapterObject->MapRegisterBase =
1790 Result = ((
PDRIVER_CONTROL)AdapterObject->CurrentWcb->DeviceRoutine)(AdapterObject->CurrentWcb->DeviceObject,
1791 AdapterObject->CurrentWcb->CurrentIrp,
1792 AdapterObject->MapRegisterBase,
1793 AdapterObject->CurrentWcb->DeviceContext);
1797 AdapterObject->NumberOfMapRegisters = 0;
1801 if (AdapterObject->NumberOfMapRegisters)
1805 (
ULONG)(AdapterObject->MapRegisterBase -
1806 MasterAdapter->MapRegisterBase),
1807 AdapterObject->NumberOfMapRegisters);
1839 ULONG CurrentLength;
1867 (
PVOID)CurrentAddress,
1878 CurrentAddress += CurrentLength;
1933 if (!AdapterObject->MasterDevice)
1936 if (AdapterObject->AdapterNumber == 1)
1962 if ((SlaveDma) && !(AdapterObject->IgnoreCount))
1968 RealMapRegisterBase,
1985 RealMapRegisterBase,
1993 RealMapRegisterBase->
Counter = 0;
2042 ULONG TransferLength;
2085 while (TransferLength < *
Length)
2087 MdlPage1 = *MdlPagesPtr;
2088 MdlPage2 = *(MdlPagesPtr + 1);
2089 if (MdlPage1 + 1 != MdlPage2)
break;
2090 if ((MdlPage1 ^ MdlPage2) & ~0xFFFFF)
break;
2095 if (TransferLength < *
Length) *
Length = TransferLength;
2111 while (TransferLength < *
Length)
2113 MdlPage1 = *MdlPagesPtr;
2114 MdlPage2 = *(MdlPagesPtr + 1);
2115 if (MdlPage1 + 1 != MdlPage2)
break;
2116 if (!
HalpEisaDma && ((MdlPage1 ^ MdlPage2) & ~0xF))
break;
2121 if (TransferLength > *
Length) TransferLength = *
Length;
2130 UseMapRegisters =
TRUE;
2133 TransferLength = *
Length;
2144 UseMapRegisters =
FALSE;
2156 UseMapRegisters =
TRUE;
2175 RealMapRegisterBase +
Counter,
2184 *
Length = TransferLength;
2190 if ((AdapterObject) && !(AdapterObject->MasterDevice))
2192 AdapterMode = AdapterObject->AdapterMode;
2201 if (AdapterObject->IgnoreCount)
2209 if (AdapterObject->Width16Bits)
2211 TransferLength >>= 1;
2217 if (AdapterObject->AdapterNumber == 1)
2244 (
UCHAR)(TransferLength - 1));
2246 (
UCHAR)((TransferLength - 1) >> 8));
2278 (
UCHAR)(TransferLength - 1));
2280 (
UCHAR)((TransferLength - 1) >> 8));
2325 ULONG MapRegisterNumber;
2328 if (AdapterObject->NeedsMapRegisters)
2334 AdapterObject->NumberOfMapRegisters = 0;
2350 MapRegisterNumber = 0;
2354 AdapterObject->MapRegisterBase =
2359 if (!AdapterObject->ScatterGather)
2362 AdapterObject->MapRegisterBase =
2369 AdapterObject->MapRegisterBase =
NULL;
2370 AdapterObject->NumberOfMapRegisters = 0;
2374 return AdapterObject->MapRegisterBase;
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
PVOID NTAPI MmAllocateContiguousMemorySpecifyCache(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS LowestAcceptableAddress OPTIONAL, IN PHYSICAL_ADDRESS HighestAcceptableAddress, IN PHYSICAL_ADDRESS BoundaryAddressMultiple OPTIONAL, IN MEMORY_CACHING_TYPE CacheType OPTIONAL)
VOID NTAPI MmFreeContiguousMemorySpecifyCache(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
#define RtlInitializeBitMap
#define RtlFindClearBitsAndSet
PKDEVICE_QUEUE_ENTRY NTAPI KeRemoveDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue)
BOOLEAN NTAPI KeInsertDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue, IN PKDEVICE_QUEUE_ENTRY DeviceQueueEntry)
VOID NTAPI KeInitializeDeviceQueue(IN PKDEVICE_QUEUE DeviceQueue)
#define NT_SUCCESS(StatCode)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define KeGetCurrentIrql()
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define KeInitializeSpinLock(sl)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
BOOLEAN NTAPI IoFlushAdapterBuffers(IN PADAPTER_OBJECT AdapterObject, IN PMDL Mdl, IN PVOID MapRegisterBase, IN PVOID CurrentVa, IN ULONG Length, IN BOOLEAN WriteToDevice)
VOID NTAPI HalPutDmaAdapter(IN PADAPTER_OBJECT AdapterObject)
PVOID NTAPI HalAllocateCommonBuffer(IN PADAPTER_OBJECT AdapterObject, IN ULONG Length, IN PPHYSICAL_ADDRESS LogicalAddress, IN BOOLEAN CacheEnabled)
VOID NTAPI IoFreeMapRegisters(IN PADAPTER_OBJECT AdapterObject, IN PVOID MapRegisterBase, IN ULONG NumberOfMapRegisters)
PADAPTER_OBJECT NTAPI HalGetAdapter(IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
PHYSICAL_ADDRESS NTAPI IoMapTransfer(IN PADAPTER_OBJECT AdapterObject, IN PMDL Mdl, IN PVOID MapRegisterBase, IN PVOID CurrentVa, IN OUT PULONG Length, IN BOOLEAN WriteToDevice)
NTSTATUS NTAPI HalAllocateAdapterChannel(IN PADAPTER_OBJECT AdapterObject, IN PWAIT_CONTEXT_BLOCK WaitContextBlock, IN ULONG NumberOfMapRegisters, IN PDRIVER_CONTROL ExecutionRoutine)
VOID NTAPI IoFreeAdapterChannel(IN PADAPTER_OBJECT AdapterObject)
VOID NTAPI HalFreeCommonBuffer(IN PADAPTER_OBJECT AdapterObject, IN ULONG Length, IN PHYSICAL_ADDRESS LogicalAddress, IN PVOID VirtualAddress, IN BOOLEAN CacheEnabled)
BOOLEAN NTAPI HalFlushCommonBuffer(IN PADAPTER_OBJECT AdapterObject, IN ULONG Length, IN PHYSICAL_ADDRESS LogicalAddress, IN PVOID VirtualAddress)
ULONG NTAPI HalReadDmaCounter(IN PADAPTER_OBJECT AdapterObject)
PVOID NTAPI HalAllocateCrashDumpRegisters(IN PADAPTER_OBJECT AdapterObject, IN OUT PULONG NumberOfMapRegisters)
VOID FASTCALL KfLowerIrql(IN KIRQL NewIrql)
KIRQL FASTCALL KfRaiseIrql(IN KIRQL NewIrql)
PADAPTER_OBJECT NTAPI HalpDmaAllocateMasterAdapter(VOID)
static KEVENT HalpDmaLock
static PADAPTER_OBJECT HalpMasterAdapter
#define MAX_MAP_REGISTERS
VOID NTAPI HalpGrowMapBufferWorker(IN PVOID DeferredContext)
BOOLEAN NTAPI HalpGrowMapBuffers(IN PADAPTER_OBJECT AdapterObject, IN ULONG SizeOfMapBuffers)
static DMA_OPERATIONS HalpDmaOperations
NTSTATUS NTAPI HalBuildMdlFromScatterGatherList(IN PDMA_ADAPTER DmaAdapter, IN PSCATTER_GATHER_LIST ScatterGather, IN PMDL OriginalMdl, OUT PMDL *TargetMdl)
static BOOLEAN HalpEisaDma
VOID NTAPI HalpCopyBufferMap(IN PMDL Mdl, IN PROS_MAP_REGISTER_ENTRY MapRegisterBase, IN PVOID CurrentVa, IN ULONG Length, IN BOOLEAN WriteToDevice)
static KSPIN_LOCK HalpDmaAdapterListLock
IO_ALLOCATION_ACTION NTAPI HalpScatterGatherAdapterControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID MapRegisterBase, IN PVOID Context)
PHYSICAL_ADDRESS NTAPI HalpGetAdapterMaximumPhysicalAddress(IN PADAPTER_OBJECT AdapterObject)
struct _SCATTER_GATHER_CONTEXT * PSCATTER_GATHER_CONTEXT
PADAPTER_OBJECT NTAPI HalpDmaAllocateChildAdapter(IN ULONG NumberOfMapRegisters, IN PDEVICE_DESCRIPTION DeviceDescription)
ULONG NTAPI HalpDmaGetDmaAlignment(IN PADAPTER_OBJECT AdapterObject)
struct _SCATTER_GATHER_CONTEXT SCATTER_GATHER_CONTEXT
VOID NTAPI HalPutScatterGatherList(IN PADAPTER_OBJECT AdapterObject, IN PSCATTER_GATHER_LIST ScatterGather, IN BOOLEAN WriteToDevice)
static const ULONG_PTR HalpEisaPortPage[8]
static PADAPTER_OBJECT HalpEisaAdapter[8]
NTSTATUS NTAPI HalBuildScatterGatherList(IN PADAPTER_OBJECT AdapterObject, IN PDEVICE_OBJECT DeviceObject, IN PMDL Mdl, IN PVOID CurrentVa, IN ULONG Length, IN PDRIVER_LIST_CONTROL ExecutionRoutine, IN PVOID Context, IN BOOLEAN WriteToDevice, IN PVOID ScatterGatherBuffer, IN ULONG ScatterGatherLength)
PDMA_ADAPTER NTAPI HalpGetDmaAdapter(IN PVOID Context, IN PDEVICE_DESCRIPTION DeviceDescription, OUT PULONG NumberOfMapRegisters)
static LIST_ENTRY HalpDmaAdapterList
NTSTATUS NTAPI HalGetScatterGatherList(IN PADAPTER_OBJECT AdapterObject, IN PDEVICE_OBJECT DeviceObject, IN PMDL Mdl, IN PVOID CurrentVa, IN ULONG Length, IN PDRIVER_LIST_CONTROL ExecutionRoutine, IN PVOID Context, IN BOOLEAN WriteToDevice)
NTSTATUS NTAPI HalCalculateScatterGatherListSize(IN PADAPTER_OBJECT AdapterObject, IN PMDL Mdl OPTIONAL, IN PVOID CurrentVa, IN ULONG Length, OUT PULONG ScatterGatherListSize, OUT PULONG pNumberOfMapRegisters)
BOOLEAN NTAPI HalpDmaInitializeEisaAdapter(IN PADAPTER_OBJECT AdapterObject, IN PDEVICE_DESCRIPTION DeviceDescription)
#define COMPATIBLE_TIMING
struct _ROS_MAP_REGISTER_ENTRY * PROS_MAP_REGISTER_ENTRY
#define DEMAND_REQUEST_MODE
#define SINGLE_REQUEST_MODE
struct _GROW_WORK_ITEM * PGROW_WORK_ITEM
struct _ADAPTER_OBJECT ADAPTER_OBJECT
#define CASCADE_REQUEST_MODE
#define OBJ_KERNEL_HANDLE
#define ExFreePoolWithTag(_P, _T)
#define InitializeObjectAttributes(p, n, a, r, s)
_Out_ PNDIS_HANDLE _Out_ PUINT _In_ PNDIS_STRING _In_ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress
#define MACHINE_TYPE_EISA
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ ULONG _In_ ULONG _In_ ULONG Length
POBJECT_TYPE IoAdapterObjectType
NTSTATUS NTAPI IoAllocateAdapterChannel(IN PADAPTER_OBJECT AdapterObject, IN PDEVICE_OBJECT DeviceObject, IN ULONG NumberOfMapRegisters, IN PDRIVER_CONTROL ExecutionRoutine, IN PVOID Context)
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
#define STATUS_NOT_IMPLEMENTED
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
#define READ_PORT_UCHAR(p)
#define WRITE_PORT_UCHAR(p, d)
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
#define STATUS_BUFFER_TOO_SMALL
PULONG MinorVersion OPTIONAL
DMA1_ADDRESS_COUNT DmaAddressCount[4]
DMA2_ADDRESS_COUNT DmaAddressCount[4]
struct _DMA_OPERATIONS * DmaOperations
PFREE_ADAPTER_CHANNEL FreeAdapterChannel
PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel
PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers
PFREE_MAP_REGISTERS FreeMapRegisters
PMAP_TRANSFER MapTransfer
PHYSICAL_ADDRESS PhysicalAddress
PVOID AdapterListControlContext
PADAPTER_OBJECT AdapterObject
PDRIVER_LIST_CONTROL AdapterListControlRoutine
ULONG NumberOfMapRegisters
PDRIVER_CONTROL DeviceRoutine
static LARGE_INTEGER Counter
#define __WARNING_DEREF_NULL_PTR
#define _PRAGMA_WARNING_SUPPRESS(x)
#define UNIMPLEMENTED_ONCE
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INSUFFICIENT_RESOURCES
struct _LARGE_INTEGER::@2299 u
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_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
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
_In_ WDFDMATRANSACTION _Out_opt_ ULONG * MapRegisterCount
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET TransferOffset
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
#define ExInitializeWorkItem(Item, Routine, Context)
_Out_ PULONG NumberOfMapRegisters
_In_ PDEVICE_OBJECT _In_ ULONG _In_ PDRIVER_CONTROL ExecutionRoutine
VOID(NTAPI * PFREE_ADAPTER_CHANNEL)(_In_ PDMA_ADAPTER DmaAdapter)
NTSTATUS(NTAPI * PBUILD_SCATTER_GATHER_LIST)(_In_ PDMA_ADAPTER 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, _In_ PVOID ScatterGatherBuffer, _In_ ULONG ScatterGatherLength)
VOID(NTAPI * PFREE_MAP_REGISTERS)(_In_ PDMA_ADAPTER DmaAdapter, PVOID MapRegisterBase, ULONG NumberOfMapRegisters)
struct _DMA_OPERATIONS DMA_OPERATIONS
struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
ULONG(NTAPI * PREAD_DMA_COUNTER)(_In_ PDMA_ADAPTER DmaAdapter)
struct _SCATTER_GATHER_LIST * PSCATTER_GATHER_LIST
_Inout_ struct _IRP _In_ PVOID MapRegisterBase
enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION
@ DeallocateObjectKeepRegisters
DRIVER_LIST_CONTROL * PDRIVER_LIST_CONTROL
#define DEVICE_DESCRIPTION_VERSION1
PHYSICAL_ADDRESS(NTAPI * PMAP_TRANSFER)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PMDL Mdl, _In_ PVOID MapRegisterBase, _In_ PVOID CurrentVa, _Inout_ PULONG Length, _In_ BOOLEAN WriteToDevice)
NTSTATUS(NTAPI * PBUILD_MDL_FROM_SCATTER_GATHER_LIST)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PSCATTER_GATHER_LIST ScatterGather, _In_ PMDL OriginalMdl, _Out_ PMDL *TargetMdl)
BOOLEAN(NTAPI * PFLUSH_ADAPTER_BUFFERS)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PMDL Mdl, _In_ PVOID MapRegisterBase, _In_ PVOID CurrentVa, _In_ ULONG Length, _In_ BOOLEAN WriteToDevice)
#define DEVICE_DESCRIPTION_VERSION2
_In_ struct _IRP _In_ struct _SCATTER_GATHER_LIST * ScatterGather
DRIVER_CONTROL * PDRIVER_CONTROL
PVOID(NTAPI * PALLOCATE_COMMON_BUFFER)(_In_ PDMA_ADAPTER DmaAdapter, _In_ ULONG Length, _Out_ PPHYSICAL_ADDRESS LogicalAddress, _In_ BOOLEAN CacheEnabled)
NTSTATUS(NTAPI * PGET_SCATTER_GATHER_LIST)(_In_ PDMA_ADAPTER 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)
NTSTATUS(NTAPI * PCALCULATE_SCATTER_GATHER_LIST_SIZE)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PMDL Mdl OPTIONAL, _In_ PVOID CurrentVa, _In_ ULONG Length, _Out_ PULONG ScatterGatherListSize, _Out_ OPTIONAL PULONG pNumberOfMapRegisters)
VOID(NTAPI * PPUT_SCATTER_GATHER_LIST)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PSCATTER_GATHER_LIST ScatterGather, _In_ BOOLEAN WriteToDevice)
VOID(NTAPI * PPUT_DMA_ADAPTER)(PDMA_ADAPTER DmaAdapter)
NTSTATUS(NTAPI * PALLOCATE_ADAPTER_CHANNEL)(_In_ PDMA_ADAPTER DmaAdapter, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG NumberOfMapRegisters, _In_ PDRIVER_CONTROL ExecutionRoutine, _In_ PVOID Context)
VOID(NTAPI * PFREE_COMMON_BUFFER)(_In_ PDMA_ADAPTER DmaAdapter, _In_ ULONG Length, _In_ PHYSICAL_ADDRESS LogicalAddress, _In_ PVOID VirtualAddress, _In_ BOOLEAN CacheEnabled)
ULONG(NTAPI * PGET_DMA_ALIGNMENT)(_In_ PDMA_ADAPTER DmaAdapter)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
_Inout_ PKDEVICE_QUEUE_ENTRY DeviceQueueEntry
_In_opt_ PVOID DeferredContext
#define MmGetMdlVirtualAddress(_Mdl)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define BYTES_TO_PAGES(Size)
#define MmGetMdlPfnArray(_Mdl)
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS LowestAcceptableAddress
#define ObDereferenceObject
#define ObReferenceObject