diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-12-08 12:35:05 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2012-12-08 12:35:05 +0000 |
commit | 94de1f1d8040cc16b22b094dd387f0168821a237 (patch) | |
tree | bcf9d0b2b70f5c39e873abf8fa1bb86403c49599 /sys | |
parent | 4a287a6b29ce5855ff8b614faa3aa9e9b8a52400 (diff) |
Descriptor rings can be larger than a single page, so add the offset instead
of or-ing it in.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/vdsp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c index 9fedc903111..009b8b8b4b9 100644 --- a/sys/arch/sparc64/dev/vdsp.c +++ b/sys/arch/sparc64/dev/vdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsp.c,v 1.16 2012/12/03 19:57:04 kettenis Exp $ */ +/* $OpenBSD: vdsp.c,v 1.17 2012/12/08 12:35:04 kettenis Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -719,16 +719,16 @@ vdsp_rx_vio_dring_data(struct vdsp_softc *sc, struct vio_msg_tag *tag) pmap_extract(pmap_kernel(), va, &pa); nbytes = min(size, PAGE_SIZE - (off & PAGE_MASK)); err = hv_ldc_copy(sc->sc_lc.lc_id, LDC_COPY_IN, - sc->sc_dring_cookie.addr | off, pa, + sc->sc_dring_cookie.addr + off, pa, nbytes, &nbytes); + if (err != H_EOK) { + printf("%s: hv_ldc_copy %d\n", __func__, err); + return; + } va += nbytes; size -= nbytes; off += nbytes; } - if (err != H_EOK) { - printf("%s: hv_ldc_copy %d\n", __func__, err); - return; - } DPRINTF(("%s: start_idx %d, end_idx %d, operation %x\n", sc->sc_dv.dv_xname, dm->start_idx, dm->end_idx, @@ -1575,15 +1575,15 @@ vdsp_ack_desc(struct vdsp_softc *sc, struct vd_desc *vd) pmap_extract(pmap_kernel(), va, &pa); nbytes = min(size, PAGE_SIZE - (off & PAGE_MASK)); err = hv_ldc_copy(sc->sc_lc.lc_id, LDC_COPY_OUT, - sc->sc_dring_cookie.addr | off, pa, nbytes, &nbytes); + sc->sc_dring_cookie.addr + off, pa, nbytes, &nbytes); + if (err != H_EOK) { + printf("%s: hv_ldc_copy %d\n", __func__, err); + return; + } va += nbytes; size -= nbytes; off += nbytes; } - if (err != H_EOK) { - printf("%s: hv_ldc_copy %d\n", __func__, err); - return; - } /* ACK the descriptor. */ bzero(&dm, sizeof(dm)); |