blob: 36293061f4ed6b1416aac1604417d73fbd157765 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_SWIOTLB_H
2#define _ASM_SWTIOLB_H 1
3
4#include <linux/config.h>
5
6/* SWIOTLB interface */
7
8extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, size_t size,
9 int dir);
10extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
11 size_t size, int dir);
12extern void swiotlb_sync_single_for_cpu(struct device *hwdev,
13 dma_addr_t dev_addr,
14 size_t size, int dir);
15extern void swiotlb_sync_single_for_device(struct device *hwdev,
16 dma_addr_t dev_addr,
17 size_t size, int dir);
18extern void swiotlb_sync_sg_for_cpu(struct device *hwdev,
19 struct scatterlist *sg, int nelems,
20 int dir);
21extern void swiotlb_sync_sg_for_device(struct device *hwdev,
22 struct scatterlist *sg, int nelems,
23 int dir);
24extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg,
25 int nents, int direction);
26extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
27 int nents, int direction);
28extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr);
29extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size,
30 dma_addr_t *dma_handle, int flags);
31extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
32 void *vaddr, dma_addr_t dma_handle);
33
34#ifdef CONFIG_SWIOTLB
35extern int swiotlb;
36#else
37#define swiotlb 0
38#endif
39
40#endif