Writing Windows WDM Device Drivers

Appendix C: Direct Memory Access

This book does not cover Direct Memory Access (DMA) in detail. However, NT 3.51 and NT 4 driver writers will find that they must access the DMA system routines in a new way. All the same routines are there, you just have to call IoGetDmaAdapter first. This returns a pointer to a DMA_ADAPTER object. The DmaOperations field in there contains pointers to all the familiar routines. Call the DmaOperations PutDmaAdapter callback when you have finished with the DMA_ADAPTER object.

Table C.1 shows the corresponding old and new routines. Just to reiterate, there is no kernel routine directly called PutDmaAdapter. This routine is only available through the DMA_ADAPTER structure, e.g.,

(*DmaAdapter->DmaOperations->PutDmaAdapter)(DmaAdapter);

Table C.1: Old and new DMA routines

Old

New

New DmaOperations routine

Description

HalGetAdapter

IoGetDmaAdapter

PutDmaAdapter

Release

DmaAdapter

HalAllocateCommonBuffer

AllocateCommonBuffer

HalFreeCommonBuffer

FreeCommonBuffer

IoAllocateAdapterChannel

AllocateAdapterChannel

IoFlushAdapterBuffers

FlushAdapterBuffers

IoFreeAdapterChannel

FreeAdapterChannel

IoFreeMapRegisters

FreeMapRegisters

IoMapTransfer

MapTransfer

HalGetDmaAlignmentRequirement

GetDmaAlignment

Get alignment requirements for DMA buffers

HalReadDmaCounter

ReadDmaCounter

Get number of bytes remaining to be transferred

GetScatterGatherList

PutScatterGatherList

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Embedded Systems Software
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.