blob: ab05d73e2bb7b24eba0792e8c1dfbb6f22505c65 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_SWIOTLB_H
2#define _ASM_X86_SWIOTLB_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
FUJITA Tomonori1da4f982008-12-28 15:02:05 +09004#include <linux/swiotlb.h>
Muli Ben-Yehuda17a941d2006-01-11 22:44:42 +01005
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#ifdef CONFIG_SWIOTLB
7extern int swiotlb;
Konrad Rzeszutek Wilkefa631c2010-08-26 13:57:59 -04008extern int __init pci_swiotlb_detect_override(void);
9extern int __init pci_swiotlb_detect_4gb(void);
FUJITA Tomonori186a2502009-12-15 20:47:56 +090010extern void __init pci_swiotlb_init(void);
Konrad Rzeszutek Wilkefa631c2010-08-26 13:57:59 -040011extern void __init pci_swiotlb_late_init(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#else
13#define swiotlb 0
Konrad Rzeszutek Wilkefa631c2010-08-26 13:57:59 -040014static inline int pci_swiotlb_detect_override(void)
15{
16 return 0;
17}
18static inline int pci_swiotlb_detect_4gb(void)
FUJITA Tomonoribe54f9d2008-07-11 10:23:45 +090019{
FUJITA Tomonorib18485e2009-11-12 00:03:28 +090020 return 0;
FUJITA Tomonoribe54f9d2008-07-11 10:23:45 +090021}
FUJITA Tomonori186a2502009-12-15 20:47:56 +090022static inline void pci_swiotlb_init(void)
23{
24}
Konrad Rzeszutek Wilkefa631c2010-08-26 13:57:59 -040025static inline void pci_swiotlb_late_init(void)
26{
27}
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#endif
29
Jan Beulichcde14bb2007-02-05 18:46:40 -080030static inline void dma_mark_clean(void *addr, size_t size) {}
31
Akinobu Mita9c5a3622014-06-04 16:06:50 -070032extern 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
H. Peter Anvin1965aae2008-10-22 22:26:29 -070039#endif /* _ASM_X86_SWIOTLB_H */