aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dma-mapping.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r--include/linux/dma-mapping.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 347fdc32177a..e13117cbd2f7 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_DMA_MAPPING_H 1#ifndef _LINUX_DMA_MAPPING_H
2#define _LINUX_DMA_MAPPING_H 2#define _LINUX_DMA_MAPPING_H
3 3
4#include <linux/string.h>
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/err.h> 6#include <linux/err.h>
6#include <linux/dma-attrs.h> 7#include <linux/dma-attrs.h>
@@ -41,6 +42,9 @@ struct dma_map_ops {
41 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr); 42 int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
42 int (*dma_supported)(struct device *dev, u64 mask); 43 int (*dma_supported)(struct device *dev, u64 mask);
43 int (*set_dma_mask)(struct device *dev, u64 mask); 44 int (*set_dma_mask)(struct device *dev, u64 mask);
45#ifdef ARCH_HAS_DMA_GET_REQUIRED_MASK
46 u64 (*get_required_mask)(struct device *dev);
47#endif
44 int is_phys; 48 int is_phys;
45}; 49};
46 50
@@ -117,6 +121,15 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
117 return -EIO; 121 return -EIO;
118} 122}
119 123
124static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
125 dma_addr_t *dma_handle, gfp_t flag)
126{
127 void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
128 if (ret)
129 memset(ret, 0, size);
130 return ret;
131}
132
120#ifdef CONFIG_HAS_DMA 133#ifdef CONFIG_HAS_DMA
121static inline int dma_get_cache_alignment(void) 134static inline int dma_get_cache_alignment(void)
122{ 135{