summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-12-31 17:04:00 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-12-31 17:04:00 +0000
commitc46895d8d7573ae0e7da97af7986b5630e355e97 (patch)
treea1d8b33fce7dde7876de33efded4aa608564f579
parenta77104479538bd5b4f0275cd44fa48804ecd8693 (diff)
Fix a glitch in _dmamap_load_buffer introduced in the last commit.
jason@ ok
-rw-r--r--sys/arch/macppc/macppc/dma.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/macppc/macppc/dma.c b/sys/arch/macppc/macppc/dma.c
index 5c27994b736..1ffa91984d8 100644
--- a/sys/arch/macppc/macppc/dma.c
+++ b/sys/arch/macppc/macppc/dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.c,v 1.9 2001/12/12 19:18:23 jason Exp $ */
+/* $OpenBSD: dma.c,v 1.10 2001/12/31 17:03:59 miod Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -140,20 +140,22 @@ _dmamap_load_buffer(t, map, buf, buflen, p, flags, lastaddrp, segp, first)
bus_size_t sgsize;
bus_addr_t curaddr, lastaddr, baddr, bmask;
vaddr_t vaddr = (vaddr_t)buf;
+ pmap_t pmap;
int seg;
lastaddr = *lastaddrp;
bmask = ~(map->_dm_boundary - 1);
+ if (p != NULL)
+ pmap = p->p_vmspace->vm_map.pmap;
+ else
+ pmap = pmap_kernel();
+
for (seg = *segp; buflen > 0; ) {
/*
* Get the physical address for this segment.
*/
- if (p != NULL)
- (void) pmap_extract(p->p_vmspace->vm_map.pmap,
- vaddr, (paddr_t *)&curaddr);
- else
- curaddr = vtophys(vaddr);
+ (void) pmap_extract(pmap, vaddr, (paddr_t *)&curaddr);
/*
* Compute the segment size, and adjust counts.