2 #define _ASM_SWTIOLB_H 1
4 #include <linux/config.h>
6 #include <asm/dma-mapping.h>
8 /* SWIOTLB interface */
10 extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr,
11 size_t size, int dir);
12 extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size,
13 dma_addr_t *dma_handle, gfp_t flags);
14 extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
15 size_t size, int dir);
16 extern void swiotlb_sync_single_for_cpu(struct device *hwdev,
18 size_t size, int dir);
19 extern void swiotlb_sync_single_for_device(struct device *hwdev,
21 size_t size, int dir);
22 extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev,
25 size_t size, int dir);
26 extern void swiotlb_sync_single_range_for_device(struct device *hwdev,
29 size_t size, int dir);
30 extern void swiotlb_sync_sg_for_cpu(struct device *hwdev,
31 struct scatterlist *sg, int nelems,
33 extern void swiotlb_sync_sg_for_device(struct device *hwdev,
34 struct scatterlist *sg, int nelems,
36 extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg,
37 int nents, int direction);
38 extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
39 int nents, int direction);
40 extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr);
41 extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
42 void *vaddr, dma_addr_t dma_handle);
43 extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
44 extern void swiotlb_init(void);
52 extern void pci_swiotlb_init(void);
54 #endif /* _ASM_SWTIOLB_H */