Remove the psycho and sbus iommu function stubs, and put the pointer

to the iommu_state structure directly into dt_cookie. The stubs have
not been needed for a long time now.
This commit is contained in:
Thomas Moestl 2003-06-11 20:30:52 +00:00
parent 987c23d4ff
commit ad9d5b934b
4 changed files with 81 additions and 308 deletions

View File

@ -81,23 +81,18 @@ void iommu_enter(struct iommu_state *, vm_offset_t, vm_paddr_t, int);
void iommu_remove(struct iommu_state *, vm_offset_t, size_t);
void iommu_decode_fault(struct iommu_state *, vm_offset_t);
int iommu_dvmamap_create(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
int, bus_dmamap_t *);
int iommu_dvmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t);
int iommu_dvmamap_load(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t, void *, bus_size_t, bus_dmamap_callback_t *, void *, int);
int iommu_dvmamap_load_mbuf(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t, struct mbuf *, bus_dmamap_callback2_t *, void *, int);
int iommu_dvmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t, struct uio *, bus_dmamap_callback2_t *, void *, int);
void iommu_dvmamap_unload(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t);
void iommu_dvmamap_sync(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
bus_dmamap_t, int);
int iommu_dvmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
void **, int, bus_dmamap_t *);
void iommu_dvmamem_free(bus_dma_tag_t, bus_dma_tag_t, struct iommu_state *,
void *, bus_dmamap_t);
int iommu_dvmamap_create(bus_dma_tag_t, bus_dma_tag_t, int, bus_dmamap_t *);
int iommu_dvmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
int iommu_dvmamap_load(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, void *,
bus_size_t, bus_dmamap_callback_t *, void *, int);
int iommu_dvmamap_load_mbuf(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct mbuf *, bus_dmamap_callback2_t *, void *, int);
int iommu_dvmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct uio *, bus_dmamap_callback2_t *, void *, int);
void iommu_dvmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
void iommu_dvmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, int);
int iommu_dvmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
bus_dmamap_t *);
void iommu_dvmamem_free(bus_dma_tag_t, bus_dma_tag_t, void *, bus_dmamap_t);
#endif /* !_MACHINE_IOMMUVAR_H_ */

View File

@ -97,27 +97,6 @@ static void psycho_wakeup(void *);
static void psycho_iommu_init(struct psycho_softc *, int);
static ofw_pci_binit_t psycho_binit;
/*
* bus space and bus dma support for UltraSPARC `psycho'. note that most
* of the bus dma support is provided by the iommu dvma controller.
*/
static int psycho_dmamap_create(bus_dma_tag_t, bus_dma_tag_t, int,
bus_dmamap_t *);
static int psycho_dmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
static int psycho_dmamap_load(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
void *, bus_size_t, bus_dmamap_callback_t *, void *, int);
static int psycho_dmamap_load_mbuf(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct mbuf *, bus_dmamap_callback2_t *, void *, int);
static int psycho_dmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct uio *, bus_dmamap_callback2_t *, void *, int);
static void psycho_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
static void psycho_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
bus_dmasync_op_t);
static int psycho_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
bus_dmamap_t *);
static void psycho_dmamem_free(bus_dma_tag_t, bus_dma_tag_t, void *,
bus_dmamap_t);
/*
* autoconfiguration
*/
@ -492,33 +471,12 @@ psycho_attach(device_t dev)
panic("psycho_attach: range %d missing", n);
}
/* allocate our tags */
sc->sc_memt = psycho_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE);
sc->sc_iot = psycho_alloc_bus_tag(sc, PCI_IO_BUS_SPACE);
sc->sc_cfgt = psycho_alloc_bus_tag(sc, PCI_CONFIG_BUS_SPACE);
if (bus_dma_tag_create(sc->sc_dmatag, 8, 1, 0, 0x3ffffffff, NULL, NULL,
0x3ffffffff, 0xff, 0xffffffff, 0, &sc->sc_dmat) != 0)
panic("psycho_attach: bus_dma_tag_create failed");
/* Customize the tag */
sc->sc_dmat->dt_cookie = sc;
sc->sc_dmat->dt_dmamap_create = psycho_dmamap_create;
sc->sc_dmat->dt_dmamap_destroy = psycho_dmamap_destroy;
sc->sc_dmat->dt_dmamap_load = psycho_dmamap_load;
sc->sc_dmat->dt_dmamap_load_mbuf = psycho_dmamap_load_mbuf;
sc->sc_dmat->dt_dmamap_load_uio = psycho_dmamap_load_uio;
sc->sc_dmat->dt_dmamap_unload = psycho_dmamap_unload;
sc->sc_dmat->dt_dmamap_sync = psycho_dmamap_sync;
sc->sc_dmat->dt_dmamem_alloc = psycho_dmamem_alloc;
sc->sc_dmat->dt_dmamem_free = psycho_dmamem_free;
/* XXX: register as root dma tag (kluge). */
sparc64_root_dma_tag = sc->sc_dmat;
/* Register the softc, this is needed for paired psychos. */
SLIST_INSERT_HEAD(&psycho_softcs, sc, sc_link);
/*
* And finally, if we're a sabre or the first of a pair of psycho's to
* arrive here, start up the IOMMU and get a config space tag.
* If we're a sabre or the first of a pair of psycho's to arrive here,
* start up the IOMMU.
*/
if (osc == NULL) {
/*
@ -585,6 +543,27 @@ psycho_attach(device_t dev)
iommu_reset(sc->sc_is);
}
/* Allocate our tags. */
sc->sc_memt = psycho_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE);
sc->sc_iot = psycho_alloc_bus_tag(sc, PCI_IO_BUS_SPACE);
sc->sc_cfgt = psycho_alloc_bus_tag(sc, PCI_CONFIG_BUS_SPACE);
if (bus_dma_tag_create(sc->sc_dmatag, 8, 1, 0, 0x3ffffffff, NULL, NULL,
0x3ffffffff, 0xff, 0xffffffff, 0, &sc->sc_dmat) != 0)
panic("psycho_attach: bus_dma_tag_create failed");
/* Customize the tag. */
sc->sc_dmat->dt_cookie = sc->sc_is;
sc->sc_dmat->dt_dmamap_create = iommu_dvmamap_create;
sc->sc_dmat->dt_dmamap_destroy = iommu_dvmamap_destroy;
sc->sc_dmat->dt_dmamap_load = iommu_dvmamap_load;
sc->sc_dmat->dt_dmamap_load_mbuf = iommu_dvmamap_load_mbuf;
sc->sc_dmat->dt_dmamap_load_uio = iommu_dvmamap_load_uio;
sc->sc_dmat->dt_dmamap_unload = iommu_dvmamap_unload;
sc->sc_dmat->dt_dmamap_sync = iommu_dvmamap_sync;
sc->sc_dmat->dt_dmamem_alloc = iommu_dvmamem_alloc;
sc->sc_dmat->dt_dmamem_free = iommu_dvmamem_free;
/* XXX: register as root dma tag (kludge). */
sparc64_root_dma_tag = sc->sc_dmat;
/*
* Enable all interrupts, clear all interrupt states, and install an
* interrupt handler for OBIO interrupts, which can be ISA ones
@ -1345,103 +1324,3 @@ psycho_alloc_bus_tag(struct psycho_softc *sc, int type)
bt->bst_type = type;
return (bt);
}
/*
* hooks into the iommu dvma calls.
*/
static int
psycho_dmamem_alloc(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void **vaddr,
int flags, bus_dmamap_t *mapp)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamem_alloc(pdmat, ddmat, sc->sc_is, vaddr, flags,
mapp));
}
static void
psycho_dmamem_free(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void *vaddr,
bus_dmamap_t map)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
iommu_dvmamem_free(pdmat, ddmat, sc->sc_is, vaddr, map);
}
static int
psycho_dmamap_create(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, int flags,
bus_dmamap_t *mapp)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_create(pdmat, ddmat, sc->sc_is, flags, mapp));
}
static int
psycho_dmamap_destroy(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat,
bus_dmamap_t map)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_destroy(pdmat, ddmat, sc->sc_is, map));
}
static int
psycho_dmamap_load(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
void *buf, bus_size_t buflen, bus_dmamap_callback_t *callback,
void *callback_arg, int flags)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load(pdmat, ddmat, sc->sc_is, map, buf, buflen,
callback, callback_arg, flags));
}
static int
psycho_dmamap_load_mbuf(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat,
bus_dmamap_t map, struct mbuf *m, bus_dmamap_callback2_t *callback,
void *callback_arg, int flags)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load_mbuf(pdmat, ddmat, sc->sc_is, map, m,
callback, callback_arg, flags));
}
static int
psycho_dmamap_load_uio(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat,
bus_dmamap_t map, struct uio *uio, bus_dmamap_callback2_t *callback,
void *callback_arg, int flags)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load_uio(pdmat, ddmat, sc->sc_is, map, uio,
callback, callback_arg, flags));
}
static void
psycho_dmamap_unload(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
iommu_dvmamap_unload(pdmat, ddmat, sc->sc_is, map);
}
static void
psycho_dmamap_sync(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
bus_dmasync_op_t op)
{
struct psycho_softc *sc;
sc = (struct psycho_softc *)pdmat->dt_cookie;
iommu_dvmamap_sync(pdmat, ddmat, sc->sc_is, map, op);
}

View File

@ -229,26 +229,6 @@ static bus_space_tag_t sbus_alloc_bustag(struct sbus_softc *);
static void sbus_overtemp(void *);
static void sbus_pwrfail(void *);
/*
* DVMA routines
*/
static int sbus_dmamap_create(bus_dma_tag_t, bus_dma_tag_t, int,
bus_dmamap_t *);
static int sbus_dmamap_destroy(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
static int sbus_dmamap_load(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, void *,
bus_size_t, bus_dmamap_callback_t *, void *, int);
static int sbus_dmamap_load_mbuf(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct mbuf *, bus_dmamap_callback2_t *, void *, int);
static int sbus_dmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
struct uio *, bus_dmamap_callback2_t *, void *, int);
static void sbus_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
static void sbus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
bus_dmasync_op_t);
static int sbus_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
bus_dmamap_t *);
static void sbus_dmamem_free(bus_dma_tag_t, bus_dma_tag_t, void *,
bus_dmamap_t);
static device_method_t sbus_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, sbus_probe),
@ -336,24 +316,6 @@ sbus_probe(device_t dev)
clock /= 1000;
device_printf(dev, "clock %d.%03d MHz\n", clock / 1000, clock % 1000);
sc->sc_dmatag = nexus_get_dmatag(dev);
if (bus_dma_tag_create(sc->sc_dmatag, 8, 1, 0, 0x3ffffffff, NULL, NULL,
0x3ffffffff, 0xff, 0xffffffff, 0, &sc->sc_cdmatag) != 0)
panic("bus_dma_tag_create failed");
/* Customize the tag */
sc->sc_cdmatag->dt_cookie = sc;
sc->sc_cdmatag->dt_dmamap_create = sbus_dmamap_create;
sc->sc_cdmatag->dt_dmamap_destroy = sbus_dmamap_destroy;
sc->sc_cdmatag->dt_dmamap_load = sbus_dmamap_load;
sc->sc_cdmatag->dt_dmamap_load_mbuf = sbus_dmamap_load_mbuf;
sc->sc_cdmatag->dt_dmamap_load_uio = sbus_dmamap_load_uio;
sc->sc_cdmatag->dt_dmamap_unload = sbus_dmamap_unload;
sc->sc_cdmatag->dt_dmamap_sync = sbus_dmamap_sync;
sc->sc_cdmatag->dt_dmamem_alloc = sbus_dmamem_alloc;
sc->sc_cdmatag->dt_dmamem_free = sbus_dmamem_free;
/* XXX: register as root dma tag (kluge). */
sparc64_root_dma_tag = sc->sc_cdmatag;
/*
* Collect address translations from the OBP.
*/
@ -427,6 +389,25 @@ sbus_probe(device_t dev)
*/
iommu_init(name, &sc->sc_is, 3, -1, 1);
/* Create the DMA tag. */
sc->sc_dmatag = nexus_get_dmatag(dev);
if (bus_dma_tag_create(sc->sc_dmatag, 8, 1, 0, 0x3ffffffff, NULL, NULL,
0x3ffffffff, 0xff, 0xffffffff, 0, &sc->sc_cdmatag) != 0)
panic("bus_dma_tag_create failed");
/* Customize the tag. */
sc->sc_cdmatag->dt_cookie = &sc->sc_is;
sc->sc_cdmatag->dt_dmamap_create = iommu_dvmamap_create;
sc->sc_cdmatag->dt_dmamap_destroy = iommu_dvmamap_destroy;
sc->sc_cdmatag->dt_dmamap_load = iommu_dvmamap_load;
sc->sc_cdmatag->dt_dmamap_load_mbuf = iommu_dvmamap_load_mbuf;
sc->sc_cdmatag->dt_dmamap_load_uio = iommu_dvmamap_load_uio;
sc->sc_cdmatag->dt_dmamap_unload = iommu_dvmamap_unload;
sc->sc_cdmatag->dt_dmamap_sync = iommu_dvmamap_sync;
sc->sc_cdmatag->dt_dmamem_alloc = iommu_dvmamem_alloc;
sc->sc_cdmatag->dt_dmamem_free = iommu_dvmamem_free;
/* XXX: register as root dma tag (kludge). */
sparc64_root_dma_tag = sc->sc_cdmatag;
/* Enable the over-temperature and power-fail intrrupts. */
rid = 0;
mr = SYSIO_READ8(sc, SBR_THERM_INT_MAP);
@ -918,90 +899,3 @@ sbus_alloc_bustag(struct sbus_softc *sc)
sbt->bst_type = SBUS_BUS_SPACE;
return (sbt);
}
static int
sbus_dmamap_create(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, int flags,
bus_dmamap_t *mapp)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_create(pdmat, ddmat, &sc->sc_is, flags, mapp));
}
static int
sbus_dmamap_destroy(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_destroy(pdmat, ddmat, &sc->sc_is, map));
}
static int
sbus_dmamap_load(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
void *buf, bus_size_t buflen, bus_dmamap_callback_t *callback,
void *callback_arg, int flags)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load(pdmat, ddmat, &sc->sc_is, map, buf, buflen,
callback, callback_arg, flags));
}
static int
sbus_dmamap_load_mbuf(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat,
bus_dmamap_t map, struct mbuf *m, bus_dmamap_callback2_t *callback,
void *callback_arg, int flags)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load_mbuf(pdmat, ddmat, &sc->sc_is, map, m,
callback, callback_arg, flags));
}
static int
sbus_dmamap_load_uio(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat,
bus_dmamap_t map, struct uio *uio, bus_dmamap_callback2_t *callback,
void *callback_arg, int flags)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamap_load_uio(pdmat, ddmat, &sc->sc_is, map, uio,
callback, callback_arg, flags));
}
static void
sbus_dmamap_unload(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
iommu_dvmamap_unload(pdmat, ddmat, &sc->sc_is, map);
}
static void
sbus_dmamap_sync(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
bus_dmasync_op_t op)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
iommu_dvmamap_sync(pdmat, ddmat, &sc->sc_is, map, op);
}
static int
sbus_dmamem_alloc(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void **vaddr,
int flags, bus_dmamap_t *mapp)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
return (iommu_dvmamem_alloc(pdmat, ddmat, &sc->sc_is, vaddr, flags,
mapp));
}
static void
sbus_dmamem_free(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void *vaddr,
bus_dmamap_t map)
{
struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
iommu_dvmamem_free(pdmat, ddmat, &sc->sc_is, vaddr, map);
}

View File

@ -668,9 +668,10 @@ iommu_dvma_vallocseg(bus_dma_tag_t dt, struct iommu_state *is, bus_dmamap_t map,
}
int
iommu_dvmamem_alloc(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
void **vaddr, int flags, bus_dmamap_t *mapp)
iommu_dvmamem_alloc(bus_dma_tag_t pt, bus_dma_tag_t dt, void **vaddr,
int flags, bus_dmamap_t *mapp)
{
struct iommu_state *is = pt->dt_cookie;
int error;
/*
@ -695,9 +696,10 @@ iommu_dvmamem_alloc(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
}
void
iommu_dvmamem_free(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
void *vaddr, bus_dmamap_t map)
iommu_dvmamem_free(bus_dma_tag_t pt, bus_dma_tag_t dt, void *vaddr,
bus_dmamap_t map)
{
struct iommu_state *is = pt->dt_cookie;
iommu_dvma_vfree(is, map);
sparc64_dmamem_free_map(dt, map);
@ -705,9 +707,10 @@ iommu_dvmamem_free(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
}
int
iommu_dvmamap_create(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
int flags, bus_dmamap_t *mapp)
iommu_dvmamap_create(bus_dma_tag_t pt, bus_dma_tag_t dt, int flags,
bus_dmamap_t *mapp)
{
struct iommu_state *is = pt->dt_cookie;
bus_size_t totsz, presz, currsz;
int error, i, maxpre;
@ -749,9 +752,9 @@ iommu_dvmamap_create(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
}
int
iommu_dvmamap_destroy(bus_dma_tag_t pt, bus_dma_tag_t dt,
struct iommu_state *is, bus_dmamap_t map)
iommu_dvmamap_destroy(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map)
{
struct iommu_state *is = pt->dt_cookie;
iommu_dvma_vfree(is, map);
return (sparc64_dmamap_destroy(pt->dt_parent, dt, map));
@ -840,10 +843,11 @@ iommu_dvmamap_load_buffer(bus_dma_tag_t dt, struct iommu_state *is,
}
int
iommu_dvmamap_load(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
bus_dmamap_t map, void *buf, bus_size_t buflen, bus_dmamap_callback_t *cb,
void *cba, int flags)
iommu_dvmamap_load(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map,
void *buf, bus_size_t buflen, bus_dmamap_callback_t *cb, void *cba,
int flags)
{
struct iommu_state *is = pt->dt_cookie;
#ifdef __GNUC__
bus_dma_segment_t sgs[dt->dt_nsegments];
#else
@ -875,10 +879,10 @@ iommu_dvmamap_load(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
}
int
iommu_dvmamap_load_mbuf(bus_dma_tag_t pt, bus_dma_tag_t dt,
struct iommu_state *is, bus_dmamap_t map, struct mbuf *m0,
bus_dmamap_callback2_t *cb, void *cba, int flags)
iommu_dvmamap_load_mbuf(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map,
struct mbuf *m0, bus_dmamap_callback2_t *cb, void *cba, int flags)
{
struct iommu_state *is = pt->dt_cookie;
#ifdef __GNUC__
bus_dma_segment_t sgs[dt->dt_nsegments];
#else
@ -920,10 +924,10 @@ iommu_dvmamap_load_mbuf(bus_dma_tag_t pt, bus_dma_tag_t dt,
}
int
iommu_dvmamap_load_uio(bus_dma_tag_t pt, bus_dma_tag_t dt,
struct iommu_state *is, bus_dmamap_t map, struct uio *uio,
bus_dmamap_callback2_t *cb, void *cba, int flags)
iommu_dvmamap_load_uio(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map,
struct uio *uio, bus_dmamap_callback2_t *cb, void *cba, int flags)
{
struct iommu_state *is = pt->dt_cookie;
#ifdef __GNUC__
bus_dma_segment_t sgs[dt->dt_nsegments];
#else
@ -979,9 +983,9 @@ iommu_dvmamap_load_uio(bus_dma_tag_t pt, bus_dma_tag_t dt,
}
void
iommu_dvmamap_unload(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
bus_dmamap_t map)
iommu_dvmamap_unload(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map)
{
struct iommu_state *is = pt->dt_cookie;
if (map->dm_loaded == 0)
return;
@ -991,9 +995,10 @@ iommu_dvmamap_unload(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
}
void
iommu_dvmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
bus_dmamap_t map, bus_dmasync_op_t op)
iommu_dvmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t map,
bus_dmasync_op_t op)
{
struct iommu_state *is = pt->dt_cookie;
struct bus_dmamap_res *r;
vm_offset_t va;
vm_size_t len;