linux/arch/hexagon/kernel/dma.c
/**
 * hexagon_map_page() - maps an address for device DMA
 * @dev:	pointer to DMA device
 * @page:	pointer to page struct of DMA memory
 * @offset:	offset within page
 * @size:	size of memory to map
 * @dir:	transfer direction
 * @attrs:	pointer to DMA attrs (not used)
 *
 * Called to map a memory address to a DMA address prior
 * to accesses to/from device.
 *
 * We don't particularly have many hoops to jump through
 * so far.  Straight translation between phys and virtual.
 *
 * DMA is not cache coherent so sync is necessary; this
 * seems to be a convenient place to do it.
 *
 */


Called to map a memory address to a DMA address prior
to accesses to/from device.

We don't particularly have many hoops to jump through
so far.  Straight translation between phys and virtual.

DMA is not cache coherent so sync is necessary; this
seems to be a convenient place to do it.
Called to map a memory address to a DMA address prior to accesses to / from device . We don ' t particularly have many hoops to jump through so far . Straight translation between phys and virtual . DMA is not cache coherent so sync is necessary ; this seems to be a convenient place to do it .
static dma_addr_t hexagon_map_page(struct device *dev, struct page *page,
				   unsigned long offset, size_t size,
				   enum dma_data_direction dir,
				   unsigned long attrs)
{
	dma_addr_t bus = page_to_phys(page) + offset;
	WARN_ON(size == 0);
	if (!check_addr("map_single", dev, bus, size))
		return HEXAGON_MAPPING_ERROR;
	if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
		dma_sync(dma_addr_to_virt(bus), size, dir);
	return bus;
}
static dma_addr_t hexagon_map_page ( struct device * dev , struct page * page , unsigned long offset , size_t size , enum dma_data_direction dir , unsigned long attrs ) { dma_addr_t bus = page_to_phys ( page ) + offset ; WARN_ON ( size == 0 ) ; if ( ! check_addr ( " " , dev , bus , size ) ) return HEXAGON_MAPPING_ERROR ; if ( ! ( attrs & DMA_ATTR_SKIP_CPU_SYNC ) ) dma_sync ( dma_addr_to_virt ( bus ) , size , dir ) ; return bus ; }
hexagon_map_page() - maps an address for device DMA
 @dev:        pointer to DMA device
 @page:       pointer to page struct of DMA memory
 @offset:     offset within page
 @size:       size of memory to map
 @dir:        transfer direction
 @attrs:      pointer to DMA attrs (not used)
hexagon_map_page () - maps an address for device DMA @dev : pointer to DMA device @page : pointer to page struct of DMA memory @offset : offset within page @size : size of memory to map @dir : transfer direction @attrs : pointer to DMA attrs ( not used )