aboutsummaryrefslogtreecommitdiffstats
path: root/tools/virtio/linux/dma-mapping.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-16 15:51:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-16 15:51:57 -0700
commit3ec60b92d3bae719cf3a8b6e522af07ad3d1cc5b (patch)
tree194b96f2d90235f8511a125dfe29d8d3d9eed55c /tools/virtio/linux/dma-mapping.h
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (diff)
parenttools/virtio: add dma stubs (diff)
downloadlinux-dev-3ec60b92d3bae719cf3a8b6e522af07ad3d1cc5b.tar.xz
linux-dev-3ec60b92d3bae719cf3a8b6e522af07ad3d1cc5b.zip
Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio/vhost fixes from Michael Tsirkin: - test fixes - a vsock fix * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: tools/virtio: add dma stubs vhost/test: fix after swiotlb changes vhost/vsock: drop space available check for TX vq ringtest: test build fix
Diffstat (limited to 'tools/virtio/linux/dma-mapping.h')
-rw-r--r--tools/virtio/linux/dma-mapping.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h
index 4f93af89ae16..18601f6689b9 100644
--- a/tools/virtio/linux/dma-mapping.h
+++ b/tools/virtio/linux/dma-mapping.h
@@ -14,4 +14,20 @@ enum dma_data_direction {
DMA_NONE = 3,
};
+#define dma_alloc_coherent(d, s, hp, f) ({ \
+ void *__dma_alloc_coherent_p = kmalloc((s), (f)); \
+ *(hp) = (unsigned long)__dma_alloc_coherent_p; \
+ __dma_alloc_coherent_p; \
+})
+
+#define dma_free_coherent(d, s, p, h) kfree(p)
+
+#define dma_map_page(d, p, o, s, dir) (page_to_phys(p) + (o))
+
+#define dma_map_single(d, p, s, dir) (virt_to_phys(p))
+#define dma_mapping_error(...) (0)
+
+#define dma_unmap_single(...) do { } while (0)
+#define dma_unmap_page(...) do { } while (0)
+
#endif