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;
Note: The following is the interface definition for d_map_page when the DMA_ADDRESS_64 and DMA_ENABLE_64 flags are set on the d_map_init call.
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;
The d_map_page kernel service is a bus-specific utility routine determined by the d_map_init 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 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.
Note: You can use the D_MAP_PAGE macro provided in the /usr/include/sys/dma.h file to code calls to the d_map_page kernel service.
DMA_NORES | Indicates that resources are unavailable. |
Note: d_map_page no mapping is done, device driver must wait until resources are freed and attempt the d_map_page call again.
DMA_NOACC | Indicates no access permission to the page. |
Note: d_map_page no mapping is done, device driver must fail the corresponding I/O request.
DMA_SUCC | Indicates that the busaddr parameter contains the bus address to use for the device transfer. |
Note: d_map_page successful mapping was done, device driver must call d_unmap_page when I/O is complete, or when device driver is finished with the mapped area in the case of a long-term mapping.
The d_map_page kernel service is part of the base device package of your platform.
The d_map_init kernel service, d_map_list kernel service.