swiotlb-xen.h 2.0 KB

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