DMA操作接口版本 3

从 Windows 8 开始,DMA作接口的版本 3 可用。 The DMA_OPERATIONS structure for this interface contains a number of new routines that are not defined in previous versions of this interface. For a list of the routines in version 3, see DMA_OPERATIONS.

尽管 DMA作接口版本 3 在所有 Windows 硬件平台上都可用,但此接口具有许多功能,使内核模式驱动程序能够使用芯片(SoC)集成电路系统上系统 DMA 控制器的高级功能。 这些功能通常包括执行散点/收集 DMA 传输的功能。 相比之下,以前版本的 DMA作接口将散点/收集 DMA 传输限制到总线主设备。 版本 3 接口简化了散点/收集列表的管理,减少了在复杂的 DMA 传输过程中驱动程序干预的需求。

若要使用 DMA作接口版本 3 来执行 DMA 传输,驱动程序通常调用以下例程:

IoGetDmaAdapter
Allocates a DMA adapter object and returns a pointer to a DMA_ADAPTER structure that contains the DMA operations interface.

GetDmaTransferInfo
提供执行调用方描述的 DMA 传输所需的资源的说明。

AllocateAdapterChannelEx
分配 DMA 传输所需的资源,并将这些资源分配给 DMA 适配器对象。

MapTransferEx
初始化 DMA 传输的映射寄存器和散点/收集缓冲区,并启动传输。

FlushAdapterBuffersEx
执行在 DMA 传输结束时可能需要的任何缓存作。

FreeAdapterChannel
释放 DMA 通道和映射寄存器。

PutDmaAdapter
释放适配器对象。

这些例程既用于使用专用 DMA 控制器的总线主设备,也用于共享系统 DMA 控制器的从属设备。 有关驱动程序在典型 DMA 传输期间进行的调用的分步说明,请参阅 版本 3 DMA 例程的基本调用模式

Note In version 3 of the DMA operations interface, calls to the KeFlushIoBuffers routine are not required either before or after DMA transfers. 原因是以下例程涵盖了在未在硬件中强制实施缓存一致性的平台上刷新数据缓存的需求:

  • MapTransferEx ensures that processor data caches are flushed before write (memory-to-device) transfers.
  • FlushAdapterBuffersEx ensures that caches are invalidated after read (device-to-memory) transfers.

On an x86 or x64 processor, the KeFlushIoBuffers call performs no operations, and this call, while unnecessary, does not interfere with the operation of the hardware platform. On an Arm processor, calls to KeFlushIoBuffers during DMA transfers perform cache operations that are unnecessary and can degrade performance.