Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

12. Direct Memory Access > Loading (DMA) Buffers into DMA Maps

Loading (DMA) Buffers into DMA Maps

The FreeBSD kernel provides four functions for loading a buffer into the device visible address associated with a DMA map:

  • bus_dmamap_load

  • bus_dmamap_load_mbuf

  • bus_dmamap_load_mbuf_sg

  • bus_dmamap_load_uio

Before I describe these functions, an explanation of bus_dma_segment structures is needed.

bus_dma_segment Structures

A bus_dma_segment structure describes a single DMA segment.

typedef struct bus_dma_segment {
        bus_addr_t     ds_addr;
        bus_size_t     ds_len;
} bus_dma_segment_t;

The ds_addr field contains its device visible address and ds_len contains its length.

bus_dmamap_load Function

We first discussed the bus_dmamap_load function in Implementing DMA in Implementing DMA.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint