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