diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/dma-coherent.h | 32 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping.h | 22 |
2 files changed, 33 insertions, 21 deletions
diff --git a/include/asm-generic/dma-coherent.h b/include/asm-generic/dma-coherent.h new file mode 100644 index 000000000000..85a3ffaa0242 --- /dev/null +++ b/include/asm-generic/dma-coherent.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef DMA_COHERENT_H | ||
2 | #define DMA_COHERENT_H | ||
3 | |||
4 | #ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT | ||
5 | /* | ||
6 | * These two functions are only for dma allocator. | ||
7 | * Don't use them in device drivers. | ||
8 | */ | ||
9 | int dma_alloc_from_coherent(struct device *dev, ssize_t size, | ||
10 | dma_addr_t *dma_handle, void **ret); | ||
11 | int dma_release_from_coherent(struct device *dev, int order, void *vaddr); | ||
12 | |||
13 | /* | ||
14 | * Standard interface | ||
15 | */ | ||
16 | #define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | ||
17 | extern int | ||
18 | dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
19 | dma_addr_t device_addr, size_t size, int flags); | ||
20 | |||
21 | extern void | ||
22 | dma_release_declared_memory(struct device *dev); | ||
23 | |||
24 | extern void * | ||
25 | dma_mark_declared_memory_occupied(struct device *dev, | ||
26 | dma_addr_t device_addr, size_t size); | ||
27 | #else | ||
28 | #define dma_alloc_from_coherent(dev, size, handle, ret) (0) | ||
29 | #define dma_release_from_coherent(dev, order, vaddr) (0) | ||
30 | #endif | ||
31 | |||
32 | #endif | ||
diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h index a1a4dc7fe6ec..c68f360ef564 100644 --- a/include/asm-x86/dma-mapping.h +++ b/include/asm-x86/dma-mapping.h | |||
@@ -213,25 +213,5 @@ static inline int dma_get_cache_alignment(void) | |||
213 | 213 | ||
214 | #define dma_is_consistent(d, h) (1) | 214 | #define dma_is_consistent(d, h) (1) |
215 | 215 | ||
216 | #ifdef CONFIG_X86_32 | 216 | #include <asm-generic/dma-coherent.h> |
217 | # define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | ||
218 | struct dma_coherent_mem { | ||
219 | void *virt_base; | ||
220 | u32 device_base; | ||
221 | int size; | ||
222 | int flags; | ||
223 | unsigned long *bitmap; | ||
224 | }; | ||
225 | |||
226 | extern int | ||
227 | dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
228 | dma_addr_t device_addr, size_t size, int flags); | ||
229 | |||
230 | extern void | ||
231 | dma_release_declared_memory(struct device *dev); | ||
232 | |||
233 | extern void * | ||
234 | dma_mark_declared_memory_occupied(struct device *dev, | ||
235 | dma_addr_t device_addr, size_t size); | ||
236 | #endif /* CONFIG_X86_32 */ | ||
237 | #endif | 217 | #endif |