#define pr_fmt(fmt) …
#include <linux/memblock.h>
#include <linux/dma-direct.h>
#include <linux/dma-map-ops.h>
#include <linux/export.h>
#include <xen/swiotlb-xen.h>
#include <xen/page.h>
#include <xen/xen-ops.h>
#include <xen/hvc-console.h>
#include <asm/dma-mapping.h>
#include <trace/events/swiotlb.h>
#define MAX_DMA_BITS …
static inline phys_addr_t xen_phys_to_bus(struct device *dev, phys_addr_t paddr)
{ … }
static inline dma_addr_t xen_phys_to_dma(struct device *dev, phys_addr_t paddr)
{ … }
static inline phys_addr_t xen_bus_to_phys(struct device *dev,
phys_addr_t baddr)
{ … }
static inline phys_addr_t xen_dma_to_phys(struct device *dev,
dma_addr_t dma_addr)
{ … }
static inline int range_straddles_page_boundary(phys_addr_t p, size_t size)
{ … }
static struct io_tlb_pool *xen_swiotlb_find_pool(struct device *dev,
dma_addr_t dma_addr)
{ … }
#ifdef CONFIG_X86
int xen_swiotlb_fixup(void *buf, unsigned long nslabs)
{ … }
static void *
xen_swiotlb_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
{ … }
static void
xen_swiotlb_free_coherent(struct device *dev, size_t size, void *vaddr,
dma_addr_t dma_handle, unsigned long attrs)
{ … }
#endif
static dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
unsigned long offset, size_t size,
enum dma_data_direction dir,
unsigned long attrs)
{ … }
static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
size_t size, enum dma_data_direction dir, unsigned long attrs)
{ … }
static void
xen_swiotlb_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction dir)
{ … }
static void
xen_swiotlb_sync_single_for_device(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction dir)
{ … }
static void
xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
enum dma_data_direction dir, unsigned long attrs)
{ … }
static int
xen_swiotlb_map_sg(struct device *dev, struct scatterlist *sgl, int nelems,
enum dma_data_direction dir, unsigned long attrs)
{ … }
static void
xen_swiotlb_sync_sg_for_cpu(struct device *dev, struct scatterlist *sgl,
int nelems, enum dma_data_direction dir)
{ … }
static void
xen_swiotlb_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
int nelems, enum dma_data_direction dir)
{ … }
static int
xen_swiotlb_dma_supported(struct device *hwdev, u64 mask)
{ … }
const struct dma_map_ops xen_swiotlb_dma_ops = …;