Next | Prev | Up | Top | Contents | Index

DMA Address Mapping

DMA devices use a logical address. If your driver passes addresses to bus masters, it must use a special set of DMA mapping routines to map the DMA target into physical addresses. The system uses these special mapping routines to support physical address spaces larger than 32 bits. On Silicon Graphics systems that support EISA, the physical address is used. The map structure returned, dmamap_t, is defined in sys/dmamap.h.

dmamap_t  *dma_mapalloc(int bus, int adap, int npages, int flag)
void       dma_mapfree(dmmap_t *dmamap)
int        dma_map(dmamap_t *dmamap, caddr_t addr, int len)
uint       dma_mapaddr(dmamap_t *dmamap, caddr_t addr)
Indigo2 systems do not support bus address mapping, so calls to dma_map on an Indigo2, as opposed to a CHALLENGE, system are limited to a single page. Multiple virtual pages cannot be mapped into physically contiguous pages with dma_map unless the virtual pages have been allocated to be contiguous.

For a complete description of these routines, refer to "Using DMA Maps" in Chapter 3, "Writing a VME Device Driver."

The mapped address returned by dma_mapaddr() must be used when specifying the bus address used by bus master cards or the following DMA routines. The map type used must be DMA_EISA.


Next | Prev | Up | Top | Contents | Index