summaryrefslogtreecommitdiff
path: root/tools/virtio/linux/dma-mapping.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2016-08-15 04:50:55 +0300
committerMichael S. Tsirkin <mst@redhat.com>2016-08-15 05:05:51 +0300
commit6be3ffaa0e15c64f560904b025f5c50bef5886f9 (patch)
tree73aab67c5d66b71b6e6ca0a9f38dd37e031b0049 /tools/virtio/linux/dma-mapping.h
parent446374d7c7f89603d8151b56824e2cac85ed8e0d (diff)
tools/virtio: add dma stubs
Fixes build after recent IOMMU-related changes, mustly by adding more stubs. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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