The pdiag_dd_dma_enable() function enables and disables a DMA operation. The actual function performed depends on the bus type and operation requested.
#include <sys/pdiagex_dds.h> int32 pdiag_dd_dma_enable( handle, daddr, operation ) pdiag_info_handle_t> handle; pdiag_addr_t daddr; uint32 operation;
Where bus type = BUS_MICRO_CHANNEL and operation is PDIAG_DMA_FLUSH
If users need to change data in the DMA address space, they first change the data in their user space and then call pdiag_dd_dma_enable() with a PDIAG_DMA_FLUSH operation. If they need to read data in the DMA address space, they first call pdiag_dd_dma_enable () with a PDIAG_DMA_FLUSH operation, and then reads the data in the user space.
This routine is required only if the user wants to read the data before doing pdiag_dd_dma_complete().
Where bus type = BUS_MICRO_CHANNEL or BUS_BID and operation is PDIAG_DMA_DISABLE
Where bus type = BUS_MICRO_CHANNEL or BUS_BID and operation is PDIAG_DMA_ENABLE
The pdiag_dd_dma_enable() function can be called from the process or the interrupt environment on a BUS_MICRO_CHANNEL system. The function can only be called from the process environment on a BUS_BID system.
handle | Points to pdiag_info_handle_t structure which is returned from pdiag_open (). |
daddr | Pointer to the user's physical DMA address. This is returned by pdiag_dd_dma_setup() routine. |
operation | Type of operation to perform: PDIAG_DMA_ENABLE |
The pdiag_dd_dma_enable function returns one of the following values:
DGX_OK | The operation was successful. The errno is not set. |
DGX_INVALID_HANDLE | Specified handle has been closed or was not generated by the pdiag_open() call. The errno is not set. |
DGX_BADVAL_FAIL | Specified daddr is not valid. The errno is not set. |
DGX_FAIL | Application could not transfer data between the processor and the I/O controller (IOCC) data caches. The errno is set to the d_cflush or d_bflush return code. |
pdiag_dd_dma_setup() and pdiag_dd_dma_complete() functions.