Jungo WinDriver
Official Documentation
|
DWORD DLLCALLCONV WDC_DMAContigBufLock | ( | _In_ WDC_DEVICE_HANDLE | hDev, |
_Outptr_ PVOID * | ppBuf, | ||
_In_ DWORD | dwOptions, | ||
_In_ DWORD | dwDMABufSize, | ||
_Outptr_ WD_DMA ** | ppDma | ||
) |
Allocates a contiguous DMA buffer, locks it in physical memory, and returns mappings of the allocated buffer to physical address space and to user-mode and kernel virtual address spaces.
[in] | hDev | Handle to a WDC device, returned by WDC_xxxDeviceOpen() |
[out] | ppBuf | Pointer to a pointer to be filled by the function with the user-mode mapped address of the allocated DMA buffer |
[in] | dwOptions | A bit mask of any of the following flags (defined in an enumeration in windrvr.h): DMA_FROM_DEVICE: Synchronize the DMA buffer for transfers from the device to memory. DMA_TO_DEVICE: Synchronize the DMA buffer for transfers from memory to the device. DMA_TO_FROM_DEVICE: Synchronize the DMA buffer for transfers in both directions i.e., from the device to memory and from memory to the device (<=> DMA_FROM_DEVICE | DMA_TO_DEVICE). DMA_ALLOW_CACHE: Allow caching of the memory. DMA_KBUF_BELOW_16M: Allocate the physical DMA buffer within the lower 16MB of the main memory. DMA_ALLOW_64BIT_ADDRESS: Allow allocation of 64-bit DMA addresses. DMA_KBUF_ALLOC_SPECIFY_ADDRESS_WIDTH: When using this flag, the width of the address must be entered in the fourth byte of dwOptions and then the allocated address will be limited to this width. Linux: works with contiguous buffers only. DMA_GET_PREALLOCATED_BUFFERS_ONLY: Windows: Only preallocated buffer is allowed. |
[in] | dwDMABufSize | The size (in bytes) of the DMA buffer. |
[out] | ppDma | Pointer to a pointer to a DMA buffer information structure, which is allocated by the function. The pointer to this structure (*ppDma) should be passed to WDC_DMABufUnlock() when the DMA buffer is no longer needed. |
For more detailed usage of the WDC contiguous-buffer DMA implementaiton, please refer to 11.2.2. Implementing Contiguous-Buffer DMA