dddf1b218681a442c0d3331c5069fb16af17a16a
[linux-2.6.git] / include / asm-x86_64 / swiotlb.h
1 #ifndef _ASM_SWIOTLB_H
2 #define _ASM_SWTIOLB_H 1
3
4 #include <linux/config.h>
5
6 /* SWIOTLB interface */
7
8 extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, size_t size,
9                                       int dir);
10 extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
11                                   size_t size, int dir);
12 extern void swiotlb_sync_single_for_cpu(struct device *hwdev,
13                                          dma_addr_t dev_addr,
14                                          size_t size, int dir);
15 extern void swiotlb_sync_single_for_device(struct device *hwdev,
16                                             dma_addr_t dev_addr,
17                                             size_t size, int dir);
18 extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev,
19                                               dma_addr_t dev_addr,
20                                               unsigned long offset,
21                                               size_t size, int dir);
22 extern void swiotlb_sync_single_range_for_device(struct device *hwdev,
23                                                  dma_addr_t dev_addr,
24                                                  unsigned long offset,
25                                                  size_t size, int dir);
26 extern void swiotlb_sync_sg_for_cpu(struct device *hwdev,
27                                      struct scatterlist *sg, int nelems,
28                                      int dir);
29 extern void swiotlb_sync_sg_for_device(struct device *hwdev,
30                                         struct scatterlist *sg, int nelems,
31                                         int dir);
32 extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg,
33                       int nents, int direction);
34 extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
35                          int nents, int direction);
36 extern int swiotlb_dma_mapping_error(dma_addr_t dma_addr);
37 extern void *swiotlb_alloc_coherent (struct device *hwdev, size_t size,
38                                      dma_addr_t *dma_handle, gfp_t flags);
39 extern void swiotlb_free_coherent (struct device *hwdev, size_t size,
40                                    void *vaddr, dma_addr_t dma_handle);
41
42 #ifdef CONFIG_SWIOTLB
43 extern int swiotlb;
44 #else
45 #define swiotlb 0
46 #endif
47
48 #endif