static dma_addr_t octeon_dma_map_page(struct device *dev, struct page *page,
	unsigned long offset, size_t size, enum dma_data_direction direction,
	struct dma_attrs *attrs)
{
	dma_addr_t daddr = swiotlb_map_page(dev, page, offset, size,
					    direction, attrs);
	mb();

	return daddr;
}
static dma_addr_t loongson_dma_map_page(struct device *dev, struct page *page,
	unsigned long offset, size_t size, enum dma_data_direction direction, 
	struct dma_attrs *attrs)
{
	dma_addr_t daddr = swiotlb_map_page(dev, page, offset, size,
						direction, attrs);

#ifdef LOONGSON_BIGMEM_DEBUG
	if((daddr_ >= 0x90000000) || (daddr < 0x80000000)){
		printk("+++%s %s: daddr(0x%lx)\n", __FILE__, __func__, daddr);
		dump_stack();
	}
#endif

	mb();

	return daddr;
}
Example #3
0
dma_addr_t
dma_map_page(struct device *dev, struct page *page, unsigned long offset,
	     size_t size, enum dma_data_direction direction)
{
	dma_addr_t dma_addr;

	BUG_ON(direction == DMA_NONE);

	if (swiotlb) {
		dma_addr = swiotlb_map_page(
			dev, page, offset, size, direction);
	} else {
		dma_addr = page_to_bus(page) + offset;
		IOMMU_BUG_ON(address_needs_mapping(dev, dma_addr));
	}

	return dma_addr;
}