diff options
author | marius <marius@FreeBSD.org> | 2011-03-19 20:36:05 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-03-19 20:36:05 +0000 |
commit | 7c3982eb1db23f686c22e3a500eb0a1b5aca64ca (patch) | |
tree | e5b82c488fc9b57da5205171e54b3fde46afb6b8 | |
parent | b3fb44555374e44743991fa506daf14d46cd1b7d (diff) | |
download | FreeBSD-src-7c3982eb1db23f686c22e3a500eb0a1b5aca64ca.zip FreeBSD-src-7c3982eb1db23f686c22e3a500eb0a1b5aca64ca.tar.gz |
- Make a panic message better reflect the actual problem.
- A closer inspection of the OpenSolaris code indicates the block store
workaround is only necessary in case of BUS_DMASYNC_POSTREAD.
- Mark some unused parameters as such.
-rw-r--r-- | sys/sparc64/pci/fire.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sys/sparc64/pci/fire.c b/sys/sparc64/pci/fire.c index 70fc13e..855a72a 100644 --- a/sys/sparc64/pci/fire.c +++ b/sys/sparc64/pci/fire.c @@ -337,7 +337,7 @@ fire_attach(device_t dev) if (OF_getprop(node, "portid", &sc->sc_ign, sizeof(sc->sc_ign)) == -1) panic("%s: could not determine IGN", __func__); if (OF_getprop(node, "module-revision#", &prop, sizeof(prop)) == -1) - panic("%s: could not determine revision", __func__); + panic("%s: could not determine module-revision", __func__); device_printf(dev, "%s, module-revision %d, IGN %#x\n", desc->fd_name, prop, sc->sc_ign); @@ -1510,18 +1510,20 @@ fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, static u_char buf[VIS_BLOCKSIZE] __aligned(VIS_BLOCKSIZE); register_t reg, s; - if ((map->dm_flags & DMF_LOADED) == 0 || - (op & ~BUS_DMASYNC_POSTWRITE) == 0) + if ((map->dm_flags & DMF_LOADED) == 0) return; - s = intr_disable(); - reg = rd(fprs); - wr(fprs, reg | FPRS_FEF, 0); - __asm __volatile("stda %%f0, [%0] %1" - : : "r" (buf), "n" (ASI_BLK_COMMIT_S)); - membar(Sync); - wr(fprs, reg, 0); - intr_restore(s); + if ((op & BUS_DMASYNC_POSTREAD) != 0) { + s = intr_disable(); + reg = rd(fprs); + wr(fprs, reg | FPRS_FEF, 0); + __asm __volatile("stda %%f0, [%0] %1" + : : "r" (buf), "n" (ASI_BLK_COMMIT_S)); + membar(Sync); + wr(fprs, reg, 0); + intr_restore(s); + } else if ((op & BUS_DMASYNC_PREWRITE) != 0) + membar(Sync); } static void @@ -2128,7 +2130,7 @@ fire_release_resource(device_t bus, device_t child, int type, int rid, } static bus_dma_tag_t -fire_get_dma_tag(device_t bus, device_t child) +fire_get_dma_tag(device_t bus, device_t child __unused) { struct fire_softc *sc; @@ -2137,7 +2139,7 @@ fire_get_dma_tag(device_t bus, device_t child) } static phandle_t -fire_get_node(device_t bus, device_t dev) +fire_get_node(device_t bus, device_t child __unused) { struct fire_softc *sc; |