Date: Mon, 31 Dec 2012 01:13:42 +0000 (UTC) From: Jeff Roberson <jeff@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r244877 - projects/physbio/sys/kern Message-ID: <201212310113.qBV1DgGL026167@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jeff Date: Mon Dec 31 01:13:41 2012 New Revision: 244877 URL: http://svnweb.freebsd.org/changeset/base/244877 Log: - Correct the bus_dmamap_load_uio function so it correctly specifies the pmap in all cases. Sponsored by: EMC / Isilon Storage Division Modified: projects/physbio/sys/kern/subr_busdma.c Modified: projects/physbio/sys/kern/subr_busdma.c ============================================================================== --- projects/physbio/sys/kern/subr_busdma.c Mon Dec 31 00:52:16 2012 (r244876) +++ projects/physbio/sys/kern/subr_busdma.c Mon Dec 31 01:13:41 2012 (r244877) @@ -202,14 +202,21 @@ _bus_dmamap_load_ccb(bus_dma_tag_t dmat, */ static int _bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, - pmap_t pmap, int *nsegs, int flags) + int *nsegs, int flags) { bus_size_t resid; bus_size_t minlen; struct iovec *iov; + pmap_t pmap; caddr_t addr; int error, i; + if (uio->uio_segflg == UIO_USERSPACE) { + KASSERT(uio->uio_td != NULL, + ("bus_dmamap_load_uio: USERSPACE but no proc")); + pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); + } else + pmap = kernel_pmap; resid = uio->uio_resid; iov = uio->uio_iov; error = 0; @@ -318,18 +325,10 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, { bus_dma_segment_t *segs; int nsegs, error; - pmap_t pmap; flags |= BUS_DMA_NOWAIT; - if (uio->uio_segflg == UIO_USERSPACE) { - KASSERT(uio->uio_td != NULL, - ("bus_dmamap_load_uio: USERSPACE but no proc")); - pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); - } else - pmap = kernel_pmap; - nsegs = -1; - error = _bus_dmamap_load_uio(dmat, map, uio, pmap, &nsegs, flags); + error = _bus_dmamap_load_uio(dmat, map, uio, &nsegs, flags); nsegs++; segs = _bus_dmamap_complete(dmat, map, NULL, nsegs, error); @@ -419,7 +418,7 @@ bus_dmamap_load_mem(bus_dma_tag_t dmat, break; case BUS_DMAMEM_UIO: error = _bus_dmamap_load_uio(dmat, map, mem->u.dm_uio, - /*XXX*/kernel_pmap, &nsegs, flags); + &nsegs, flags); break; case BUS_DMAMEM_MBUF: error = _bus_dmamap_load_mbuf_sg(dmat, map, mem->u.dm_mbuf,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212310113.qBV1DgGL026167>