aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-x86/dma-mapping.h19
-rw-r--r--include/asm-x86/dma-mapping_32.h23
-rw-r--r--include/asm-x86/dma-mapping_64.h17
3 files changed, 13 insertions, 46 deletions
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h
index 1c88ce6b50d6..914846d0beaa 100644
--- a/include/asm-x86/dma-mapping.h
+++ b/include/asm-x86/dma-mapping.h
@@ -11,6 +11,9 @@
11#include <asm/swiotlb.h> 11#include <asm/swiotlb.h>
12 12
13extern dma_addr_t bad_dma_address; 13extern dma_addr_t bad_dma_address;
14extern int iommu_merge;
15extern struct device fallback_dev;
16extern int panic_on_overflow;
14 17
15struct dma_mapping_ops { 18struct dma_mapping_ops {
16 int (*mapping_error)(dma_addr_t dma_addr); 19 int (*mapping_error)(dma_addr_t dma_addr);
@@ -75,12 +78,6 @@ void dma_free_coherent(struct device *dev, size_t size,
75extern int dma_supported(struct device *hwdev, u64 mask); 78extern int dma_supported(struct device *hwdev, u64 mask);
76extern int dma_set_mask(struct device *dev, u64 mask); 79extern int dma_set_mask(struct device *dev, u64 mask);
77 80
78#ifdef CONFIG_X86_32
79# include "dma-mapping_32.h"
80#else
81# include "dma-mapping_64.h"
82#endif
83
84static inline dma_addr_t 81static inline dma_addr_t
85dma_map_single(struct device *hwdev, void *ptr, size_t size, 82dma_map_single(struct device *hwdev, void *ptr, size_t size,
86 int direction) 83 int direction)
@@ -205,6 +202,15 @@ dma_cache_sync(struct device *dev, void *vaddr, size_t size,
205 flush_write_buffers(); 202 flush_write_buffers();
206} 203}
207 204
205static inline int dma_get_cache_alignment(void)
206{
207 /* no easy way to get cache size on all x86, so return the
208 * maximum possible, to be safe */
209 return boot_cpu_data.x86_clflush_size;
210}
211
212#define dma_is_consistent(d, h) (1)
213
208#ifdef CONFIG_X86_32 214#ifdef CONFIG_X86_32
209# define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY 215# define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
210extern int 216extern int
@@ -217,5 +223,6 @@ dma_release_declared_memory(struct device *dev);
217extern void * 223extern void *
218dma_mark_declared_memory_occupied(struct device *dev, 224dma_mark_declared_memory_occupied(struct device *dev,
219 dma_addr_t device_addr, size_t size); 225 dma_addr_t device_addr, size_t size);
226extern int forbid_dac;
220#endif /* CONFIG_X86_32 */ 227#endif /* CONFIG_X86_32 */
221#endif 228#endif
diff --git a/include/asm-x86/dma-mapping_32.h b/include/asm-x86/dma-mapping_32.h
deleted file mode 100644
index 4ec4f45446cf..000000000000
--- a/include/asm-x86/dma-mapping_32.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _ASM_I386_DMA_MAPPING_H
2#define _ASM_I386_DMA_MAPPING_H
3
4#include <linux/mm.h>
5#include <linux/scatterlist.h>
6
7#include <asm/cache.h>
8#include <asm/io.h>
9#include <asm/bug.h>
10
11extern int forbid_dac;
12
13static inline int
14dma_get_cache_alignment(void)
15{
16 /* no easy way to get cache size on all x86, so return the
17 * maximum possible, to be safe */
18 return boot_cpu_data.x86_clflush_size;
19}
20
21#define dma_is_consistent(d, h) (1)
22
23#endif
diff --git a/include/asm-x86/dma-mapping_64.h b/include/asm-x86/dma-mapping_64.h
deleted file mode 100644
index 8353025f052d..000000000000
--- a/include/asm-x86/dma-mapping_64.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _X8664_DMA_MAPPING_H
2#define _X8664_DMA_MAPPING_H 1
3
4extern int iommu_merge;
5
6/* same for gart, swiotlb, and nommu */
7static inline int dma_get_cache_alignment(void)
8{
9 return boot_cpu_data.x86_clflush_size;
10}
11
12#define dma_is_consistent(d, h) 1
13
14extern struct device fallback_dev;
15extern int panic_on_overflow;
16
17#endif /* _X8664_DMA_MAPPING_H */