aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/dma-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/dma-mapping.h')
-rw-r--r--arch/x86/include/asm/dma-mapping.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index 1f5b7287d1ad..953b7263f844 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -12,7 +12,6 @@
12#include <linux/dma-attrs.h> 12#include <linux/dma-attrs.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/swiotlb.h> 14#include <asm/swiotlb.h>
15#include <asm-generic/dma-coherent.h>
16#include <linux/dma-contiguous.h> 15#include <linux/dma-contiguous.h>
17 16
18#ifdef CONFIG_ISA 17#ifdef CONFIG_ISA
@@ -41,24 +40,13 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
41#endif 40#endif
42} 41}
43 42
44#include <asm-generic/dma-mapping-common.h> 43bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp);
45 44#define arch_dma_alloc_attrs arch_dma_alloc_attrs
46/* Make sure we keep the same behaviour */
47static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
48{
49 struct dma_map_ops *ops = get_dma_ops(dev);
50 debug_dma_mapping_error(dev, dma_addr);
51 if (ops->mapping_error)
52 return ops->mapping_error(dev, dma_addr);
53
54 return (dma_addr == DMA_ERROR_CODE);
55}
56
57#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
58#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
59 45
46#define HAVE_ARCH_DMA_SUPPORTED 1
60extern int dma_supported(struct device *hwdev, u64 mask); 47extern int dma_supported(struct device *hwdev, u64 mask);
61extern int dma_set_mask(struct device *dev, u64 mask); 48
49#include <asm-generic/dma-mapping-common.h>
62 50
63extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, 51extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
64 dma_addr_t *dma_addr, gfp_t flag, 52 dma_addr_t *dma_addr, gfp_t flag,
@@ -125,16 +113,4 @@ static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
125 return gfp; 113 return gfp;
126} 114}
127 115
128#define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL)
129
130void *
131dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle,
132 gfp_t gfp, struct dma_attrs *attrs);
133
134#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL)
135
136void dma_free_attrs(struct device *dev, size_t size,
137 void *vaddr, dma_addr_t bus,
138 struct dma_attrs *attrs);
139
140#endif 116#endif