Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/driver...
[linux-2.6/verdex.git] / include / linux / dma-mapping.h
blob806c305332c1c5c05102d9fc5d4537b49be5f4e7
1 #ifndef _ASM_LINUX_DMA_MAPPING_H
2 #define _ASM_LINUX_DMA_MAPPING_H
4 #include <linux/device.h>
5 #include <linux/err.h>
7 /* These definitions mirror those in pci.h, so they can be used
8 * interchangeably with their PCI_ counterparts */
9 enum dma_data_direction {
10 DMA_BIDIRECTIONAL = 0,
11 DMA_TO_DEVICE = 1,
12 DMA_FROM_DEVICE = 2,
13 DMA_NONE = 3,
16 #define DMA_64BIT_MASK 0xffffffffffffffffULL
17 #define DMA_32BIT_MASK 0x00000000ffffffffULL
19 #include <asm/dma-mapping.h>
21 /* Backwards compat, remove in 2.7.x */
22 #define dma_sync_single dma_sync_single_for_cpu
23 #define dma_sync_sg dma_sync_sg_for_cpu
25 extern u64 dma_get_required_mask(struct device *dev);
27 /* flags for the coherent memory api */
28 #define DMA_MEMORY_MAP 0x01
29 #define DMA_MEMORY_IO 0x02
30 #define DMA_MEMORY_INCLUDES_CHILDREN 0x04
31 #define DMA_MEMORY_EXCLUSIVE 0x08
33 #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
34 static inline int
35 dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
36 dma_addr_t device_addr, size_t size, int flags)
38 return 0;
41 static inline void
42 dma_release_declared_memory(struct device *dev)
46 static inline void *
47 dma_mark_declared_memory_occupied(struct device *dev,
48 dma_addr_t device_addr, size_t size)
50 return ERR_PTR(-EBUSY);
52 #endif
54 #endif