swiotlb-xen.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef __LINUX_SWIOTLB_XEN_H
  2. #define __LINUX_SWIOTLB_XEN_H
  3. #include <linux/dma-direction.h>
  4. #include <linux/swiotlb.h>
  5. extern int xen_swiotlb_init(int verbose, bool early);
  6. extern void
  7. *xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
  8. dma_addr_t *dma_handle, gfp_t flags,
  9. struct dma_attrs *attrs);
  10. extern void
  11. xen_swiotlb_free_coherent(struct device *hwdev, size_t size,
  12. void *vaddr, dma_addr_t dma_handle,
  13. struct dma_attrs *attrs);
  14. extern dma_addr_t xen_swiotlb_map_page(struct device *dev, struct page *page,
  15. unsigned long offset, size_t size,
  16. enum dma_data_direction dir,
  17. struct dma_attrs *attrs);
  18. extern void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr,
  19. size_t size, enum dma_data_direction dir,
  20. struct dma_attrs *attrs);
  21. extern int
  22. xen_swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
  23. int nelems, enum dma_data_direction dir,
  24. struct dma_attrs *attrs);
  25. extern void
  26. xen_swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl,
  27. int nelems, enum dma_data_direction dir,
  28. struct dma_attrs *attrs);
  29. extern void
  30. xen_swiotlb_sync_single_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
  31. size_t size, enum dma_data_direction dir);
  32. extern void
  33. xen_swiotlb_sync_sg_for_cpu(struct device *hwdev, struct scatterlist *sg,
  34. int nelems, enum dma_data_direction dir);
  35. extern void
  36. xen_swiotlb_sync_single_for_device(struct device *hwdev, dma_addr_t dev_addr,
  37. size_t size, enum dma_data_direction dir);
  38. extern void
  39. xen_swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
  40. int nelems, enum dma_data_direction dir);
  41. extern int
  42. xen_swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
  43. extern int
  44. xen_swiotlb_dma_supported(struct device *hwdev, u64 mask);
  45. extern int
  46. xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask);
  47. #endif /* __LINUX_SWIOTLB_XEN_H */