summaryrefslogtreecommitdiffstats
path: root/include/linux/dma-mapping.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-08-03 13:31:25 +0300
committerChristoph Hellwig <hch@lst.de>2019-09-04 11:13:18 +0200
commite29ccc188f3dae1cb66f59e10e01e0f150642a54 (patch)
tree50aefa076cec185f9ccc50c2696fb80d38ceb165 /include/linux/dma-mapping.h
parentf9f3232a7d0ab73a33d11f4056c5823010f03d55 (diff)
downloadblackbird-op-linux-e29ccc188f3dae1cb66f59e10e01e0f150642a54.tar.gz
blackbird-op-linux-e29ccc188f3dae1cb66f59e10e01e0f150642a54.zip
dma-mapping: add a dma_can_mmap helper
Add a helper to check if DMA allocations for a specific device can be mapped to userspace using dma_mmap_*. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r--include/linux/dma-mapping.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index de41a4f0b9f6..10dc9ac3cccb 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -463,6 +463,7 @@ int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt,
int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
void *cpu_addr, dma_addr_t dma_addr, size_t size,
unsigned long attrs);
+bool dma_can_mmap(struct device *dev);
int dma_supported(struct device *dev, u64 mask);
int dma_set_mask(struct device *dev, u64 mask);
int dma_set_coherent_mask(struct device *dev, u64 mask);
@@ -554,6 +555,10 @@ static inline int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
{
return -ENXIO;
}
+static inline bool dma_can_mmap(struct device *dev)
+{
+ return false;
+}
static inline int dma_supported(struct device *dev, u64 mask)
{
return 0;
OpenPOWER on IntegriCloud