Provides consistent access to system memory that is accessed asynchronously by both a device and the processor on the system.
#include <sys/types.h> #include <sys/errno.h> #include <sys/dma.h>
int d_move (channel_id, flags, baddr, count, dp, daddr) int channel_id; int flags; void *baddr; size_t count; struct xmem *dp; void *daddr;
|channel_id||Specifies the DMA channel ID returned by the d_init service.|
|flags||Specifies the flags that designate the direction of the move. The flags parameter should be set to 0 if the move is to be a write into system memory shared by a bus master device. The flags parameter should be set to the DMA_READ value if the move is to be a read from system memory shared by a bus master device. These flag values are defined in the /usr/include/sys/dma.h file.|
|baddr||Specifies the address of the nonshared buffer. This buffer is either the source buffer for a move to the shared buffer or the destination buffer for a move from the shared buffer. This buffer area must have an associated cross-memory descriptor attached, which is specified by the dp parameter.|
|count||Specifies the length of the transfer in bytes.|
|dp||Specifies the address of the cross-memory descriptor associated with the buffer that is not shared by a device. This buffer is the source buffer for a move to the shared buffer and is the destination buffer for a move from the shared buffer.|
|daddr||Specifies the address of the system memory buffer that is shared with the bus master device. A bus address region containing this address (which consists of the address specified by the daddr parameter plus at least the number of bytes specified by the count parameter) must have been mapped for direct memory access (DMA) by using the d_master service.|
Device handlers can use the d_move kernel service to access a data area in system memory that is also being accessed by a (DMA) direct memory access master. The d_move service uses the same I/O controller data buffers that the DMA master uses when accessing data from the shared data area in system memory. Using the same buffer keeps the processor data accesses and device data access consistent. On the system platform, this is necessary since the I/O controller provides buffer caching of data accessed by bus master devices.
A cross-memory descriptor obtained by using the xmattach service and a buffer address must be provided for the nonshared buffer involved in the data transfer. The d_move service moves the data from the nonshared buffer to the shared buffer when the flags parameter is set to 0. A move of the data from the shared buffer to the nonshared buffer occurs if the flags parameter is specified with a value of DMA_READ. Once the d_move service has returned, a call to the d_complete service with the specified channel_id parameter ensures that the d_move service has successfully moved the data.
Note: The d_move service is not supported on all the system models. If the system model is cache-consistent, the d_move service returns an EINVAL value indicating that the service is not supported. The caller should assume the system model is I/O Channel Controller (IOCC) cache-consistent and perform a direct access to the target memory.
The d_move kernel service can be called from either the process or interrupt environment.
|EINVAL||Indicates that the d_move service is not supported.|
|XMEM_SUCC||Indicates successful completion.|
|XMEM_FAIL|| Indicates one of these errors:
An error can also occur when the d_move kernel service executes on an interrupt level if the nonshared buffer is not in memory.
The d_move kernel service is part of Base Operating System (BOS) Runtime.
The d_move kernel service is available only on the system product platform.
The d_complete kernel service, d_init kernel service, d_master kernel service, xmattach kernel service.
I/O Kernel Services and Understanding Direct Memory Access (DMA) Transfers in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.