1#ifndef _ASM_X86_SWIOTLB_H
2#define _ASM_X86_SWIOTLB_H
3
4#include <linux/swiotlb.h>
5
6#ifdef CONFIG_SWIOTLB
7extern int swiotlb;
8extern int __init pci_swiotlb_detect_override(void);
9extern int __init pci_swiotlb_detect_4gb(void);
10extern void __init pci_swiotlb_init(void);
11extern void __init pci_swiotlb_late_init(void);
12#else
13#define swiotlb 0
14static inline int pci_swiotlb_detect_override(void)
15{
16	return 0;
17}
18static inline int pci_swiotlb_detect_4gb(void)
19{
20	return 0;
21}
22static inline void pci_swiotlb_init(void)
23{
24}
25static inline void pci_swiotlb_late_init(void)
26{
27}
28#endif
29
30static inline void dma_mark_clean(void *addr, size_t size) {}
31
32extern void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
33					dma_addr_t *dma_handle, gfp_t flags,
34					struct dma_attrs *attrs);
35extern void x86_swiotlb_free_coherent(struct device *dev, size_t size,
36					void *vaddr, dma_addr_t dma_addr,
37					struct dma_attrs *attrs);
38
39#endif /* _ASM_X86_SWIOTLB_H */
40