Performs platform-specific DMA mapping for a single page.
#include <sys/dma.h>
#include <sys/xmem.h>
int d_map_page(*handle, flags, baddr, *busaddr, *xmp)
struct d_handle *handle;
int flags;
caddr_t baddr;
uint *busaddr;
struct xmem *xmp;
int d_map_page(*handle, flags, baddr, *busaddr, *xmp)
struct d_handle *handle;
int flags;
unsigned long long baddr;
unsigned long long *busaddr;
struct xmem *xmp;
Item | Description |
---|---|
handle | Indicates the unique handle returned by the d_map_init kernel service. |
flags | Specifies one of the following flags:
|
baddr | Specifies the buffer address. |
busaddr | Points to the busaddr field. |
xmp | Cross-memory descriptor for the buffer. |
The d_map_page kernel service is a bus-specific utility routine determined by the d_map_init or d_map_init_ext kernel service that performs platform specific mapping of a single 4KB or less transfer for DMA master devices. The d_map_page kernel service is a fast-path version of the d_map_list service. The entire transfer amount must fit within a single page in order to use this service. This service accepts a virtual address and completes the appropriate bus address for the device to use in the DMA transfer. Unless the DMA_BYPASS flag is set, this service also verifies access permissions to the page. If the mapping is for short term (that is, it is unmapped as soon as the I/O is complete), you must set the DMA_STMAP flag.
If the buffer is a global kernel space buffer, the cross-memory descriptor can be set to point to the exported GLOBAL cross-memory descriptor, xmem_global.
If the transfer is unable to be mapped due to resource restrictions, the d_map_page service returns DMA_NORES. If the transfer is unable to be mapped due to page access violations, this service returns DMA_NOACC.
Item | Description |
---|---|
DMA_NORES | Indicates that resources are unavailable. |
Item | Description |
---|---|
DMA_NOACC | Indicates no access permission to the page. |
Item | Description |
---|---|
DMA_SUCC | Indicates that the busaddr parameter contains the bus address to use for the device transfer. |