blob: ce4d176b3d139d9636f5483103ad1ac9b20d9be9 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_DMA_MAPPING_H
3#define _ASM_X86_DMA_MAPPING_H
Glauber Costa6f536632008-03-25 18:36:20 -03004
5/*
Paul Bolle395cf962011-08-15 02:02:26 +02006 * IOMMU interface. See Documentation/DMA-API-HOWTO.txt and
Randy Dunlap5872fb92009-01-29 16:28:02 -08007 * Documentation/DMA-API.txt for documentation.
Glauber Costa6f536632008-03-25 18:36:20 -03008 */
9
10#include <linux/scatterlist.h>
Joerg Roedel2118d0c2009-01-09 15:13:15 +010011#include <linux/dma-debug.h>
Glauber Costa6f536632008-03-25 18:36:20 -030012#include <asm/io.h>
13#include <asm/swiotlb.h>
Marek Szyprowski0a2b9a62011-12-29 13:09:51 +010014#include <linux/dma-contiguous.h>
Glauber Costa6f536632008-03-25 18:36:20 -030015
Jan Beulicheb647132009-11-08 12:12:14 +010016#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 Costab7107a32008-03-25 18:36:39 -030022extern int iommu_merge;
Joerg Roedel6c505ce2008-08-19 16:32:45 +020023extern struct device x86_dma_fallback_dev;
Glauber Costab7107a32008-03-25 18:36:39 -030024extern int panic_on_overflow;
Glauber Costa7c183412008-03-25 18:36:36 -030025
Bart Van Assche52997092017-01-20 13:04:01 -080026extern const struct dma_map_ops *dma_ops;
Glauber Costa6f536632008-03-25 18:36:20 -030027
Bart Van Assche815dd182017-01-20 13:04:04 -080028static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
Glauber Costac786df02008-03-25 18:36:37 -030029{
FUJITA Tomonori8d8bb392008-07-25 19:44:49 -070030 return dma_ops;
FUJITA Tomonori8d8bb392008-07-25 19:44:49 -070031}
32
Huaisheng Ye884571f2018-05-25 13:00:00 +080033bool arch_dma_alloc_attrs(struct device **dev);
Christoph Hellwig68942582015-09-09 15:39:39 -070034#define arch_dma_alloc_attrs arch_dma_alloc_attrs
35
Glauber Costa6f536632008-03-25 18:36:20 -030036#endif