summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-01-26 15:31:03 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-01-26 15:31:03 +0000
commit4863df7cd3688799de3c274f9e23b864803968f4 (patch)
tree06e61bca082221cf20788428c53e2b8e0e722868 /sys/dev/pv
parent3eaed73131565d4b1feb79238497144cb14792f7 (diff)
Implement a rather conservative bus_dmamap_sync API
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/xen.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c
index e78ba640f93..4c19687e5c6 100644
--- a/sys/dev/pv/xen.c
+++ b/sys/dev/pv/xen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xen.c,v 1.36 2016/01/26 15:23:11 mikeb Exp $ */
+/* $OpenBSD: xen.c,v 1.37 2016/01/26 15:31:02 mikeb Exp $ */
/*
* Copyright (c) 2015 Mike Belopuhov
@@ -78,6 +78,8 @@ int xen_bus_dmamap_load(bus_dma_tag_t, bus_dmamap_t, void *, bus_size_t,
int xen_bus_dmamap_load_mbuf(bus_dma_tag_t, bus_dmamap_t, struct mbuf *,
int);
void xen_bus_dmamap_unload(bus_dma_tag_t, bus_dmamap_t);
+void xen_bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_addr_t,
+ bus_size_t, int);
int xs_attach(struct xen_softc *);
@@ -98,7 +100,7 @@ struct bus_dma_tag xen_bus_dma_tag = {
NULL,
NULL,
xen_bus_dmamap_unload,
- _bus_dmamap_sync,
+ xen_bus_dmamap_sync,
_bus_dmamem_alloc,
NULL,
_bus_dmamem_free,
@@ -1091,6 +1093,15 @@ xen_bus_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map)
_bus_dmamap_unload(t, map);
}
+void
+xen_bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t addr,
+ bus_size_t size, int op)
+{
+ if ((op == (BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE)) ||
+ (op == (BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE)))
+ virtio_membar_sync();
+}
+
static int
xen_attach_print(void *aux, const char *name)
{