DMA 作業介面的第 3 版從 Windows 8 開始提供。 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.