diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-07-21 20:00:48 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-07-21 20:00:48 +0000 |
commit | 257f82699f4ecb60460e5b33bb8af5ab5171bf58 (patch) | |
tree | feac6e43ea3a2b80d724da6d78d576a36094a73e | |
parent | f98f61125420d61f8d045ad4c72a16e71d7171f5 (diff) |
Replace MD _bus_dmamap_* function calls with MI ones
-rw-r--r-- | sys/dev/pv/xen.c | 17 | ||||
-rw-r--r-- | sys/dev/pv/xenvar.h | 4 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c index 19f16dca860..cfb709471a4 100644 --- a/sys/dev/pv/xen.c +++ b/sys/dev/pv/xen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xen.c,v 1.88 2017/07/19 16:48:22 mikeb Exp $ */ +/* $OpenBSD: xen.c,v 1.89 2017/07/21 20:00:47 mikeb Exp $ */ /* * Copyright (c) 2015, 2016, 2017 Mike Belopuhov @@ -152,6 +152,7 @@ xen_attach(struct device *parent, struct device *self, void *aux) struct xen_softc *sc = (struct xen_softc *)self; sc->sc_base = hv->hv_base; + sc->sc_dmat = pva->pva_dmat; if (xen_init_hypercall(sc)) return; @@ -1243,15 +1244,15 @@ xen_bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, return (EINVAL); /* Allocate a dma map structure */ - error = _bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, - flags, dmamp); + error = bus_dmamap_create(sc->sc_dmat, size, nsegments, maxsegsz, + boundary, flags, dmamp); if (error) return (error); /* Allocate an array of grant table pa<->ref maps */ gm = mallocarray(nsegments, sizeof(struct xen_gntmap), M_DEVBUF, M_ZERO | ((flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)); if (gm == NULL) { - _bus_dmamap_destroy(t, *dmamp); + bus_dmamap_destroy(sc->sc_dmat, *dmamp); *dmamp = NULL; return (ENOMEM); } @@ -1282,7 +1283,7 @@ xen_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) xen_grant_table_free(sc, gm[i].gm_ref); } free(gm, M_DEVBUF, map->_dm_segcnt * sizeof(struct xen_gntmap)); - _bus_dmamap_destroy(t, map); + bus_dmamap_destroy(sc->sc_dmat, map); } int @@ -1295,7 +1296,7 @@ xen_bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf, domain = flags >> 16; flags &= 0xffff; - error = _bus_dmamap_load(t, map, buf, buflen, p, flags); + error = bus_dmamap_load(sc->sc_dmat, map, buf, buflen, p, flags); if (error) return (error); for (i = 0; i < map->dm_nsegs; i++) { @@ -1317,7 +1318,7 @@ xen_bus_dmamap_load_mbuf(bus_dma_tag_t t, bus_dmamap_t map, struct mbuf *m0, domain = flags >> 16; flags &= 0xffff; - error = _bus_dmamap_load_mbuf(t, map, m0, flags); + error = bus_dmamap_load_mbuf(sc->sc_dmat, map, m0, flags); if (error) return (error); for (i = 0; i < map->dm_nsegs; i++) { @@ -1343,7 +1344,7 @@ xen_bus_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map) map->dm_segs[i].ds_addr = gm[i].gm_paddr; gm[i].gm_paddr = 0; } - _bus_dmamap_unload(t, map); + bus_dmamap_unload(sc->sc_dmat, map); } void diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h index dc43698f0cf..c79f0b8499d 100644 --- a/sys/dev/pv/xenvar.h +++ b/sys/dev/pv/xenvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xenvar.h,v 1.50 2017/07/14 19:09:52 mikeb Exp $ */ +/* $OpenBSD: xenvar.h,v 1.51 2017/07/21 20:00:47 mikeb Exp $ */ /* * Copyright (c) 2015 Mike Belopuhov @@ -90,6 +90,8 @@ struct xen_softc { uint32_t sc_features; #define XENFEAT_CBVEC (1<<8) + bus_dma_tag_t sc_dmat; /* parent dma tag */ + struct shared_info *sc_ipg; /* HYPERVISOR_shared_info */ uint32_t sc_flags; |