Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 2 | #ifndef _ASM_X86_DMA_MAPPING_H |
| 3 | #define _ASM_X86_DMA_MAPPING_H |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 4 | |
| 5 | /* |
Paul Bolle | 395cf96 | 2011-08-15 02:02:26 +0200 | [diff] [blame] | 6 | * IOMMU interface. See Documentation/DMA-API-HOWTO.txt and |
Randy Dunlap | 5872fb9 | 2009-01-29 16:28:02 -0800 | [diff] [blame] | 7 | * Documentation/DMA-API.txt for documentation. |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <linux/scatterlist.h> |
Joerg Roedel | 2118d0c | 2009-01-09 15:13:15 +0100 | [diff] [blame] | 11 | #include <linux/dma-debug.h> |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 12 | #include <asm/io.h> |
| 13 | #include <asm/swiotlb.h> |
Marek Szyprowski | 0a2b9a6 | 2011-12-29 13:09:51 +0100 | [diff] [blame] | 14 | #include <linux/dma-contiguous.h> |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 15 | |
Jan Beulich | eb64713 | 2009-11-08 12:12:14 +0100 | [diff] [blame] | 16 | #ifdef CONFIG_ISA |
| 17 | # define ISA_DMA_BIT_MASK DMA_BIT_MASK(24) |
| 18 | #else |
| 19 | # define ISA_DMA_BIT_MASK DMA_BIT_MASK(32) |
| 20 | #endif |
| 21 | |
Glauber Costa | b7107a3 | 2008-03-25 18:36:39 -0300 | [diff] [blame] | 22 | extern int iommu_merge; |
Joerg Roedel | 6c505ce | 2008-08-19 16:32:45 +0200 | [diff] [blame] | 23 | extern struct device x86_dma_fallback_dev; |
Glauber Costa | b7107a3 | 2008-03-25 18:36:39 -0300 | [diff] [blame] | 24 | extern int panic_on_overflow; |
Glauber Costa | 7c18341 | 2008-03-25 18:36:36 -0300 | [diff] [blame] | 25 | |
Bart Van Assche | 5299709 | 2017-01-20 13:04:01 -0800 | [diff] [blame] | 26 | extern const struct dma_map_ops *dma_ops; |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 27 | |
Bart Van Assche | 815dd18 | 2017-01-20 13:04:04 -0800 | [diff] [blame] | 28 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
Glauber Costa | c786df0 | 2008-03-25 18:36:37 -0300 | [diff] [blame] | 29 | { |
FUJITA Tomonori | 8d8bb39 | 2008-07-25 19:44:49 -0700 | [diff] [blame] | 30 | return dma_ops; |
FUJITA Tomonori | 8d8bb39 | 2008-07-25 19:44:49 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Huaisheng Ye | 884571f | 2018-05-25 13:00:00 +0800 | [diff] [blame] | 33 | bool arch_dma_alloc_attrs(struct device **dev); |
Christoph Hellwig | 6894258 | 2015-09-09 15:39:39 -0700 | [diff] [blame] | 34 | #define arch_dma_alloc_attrs arch_dma_alloc_attrs |
| 35 | |
Glauber Costa | 6f53663 | 2008-03-25 18:36:20 -0300 | [diff] [blame] | 36 | #endif |