summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-05-30 19:44:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-05-30 19:44:27 +0000
commitb4a6a28e25d9d9fcc4496e61b70f314570ba6676 (patch)
tree20a972319c3c9060f09b699c165be83b6a1a8799 /sys/arch
parentc30a63720cb16fe9c38a4ec436c5e424fef84d46 (diff)
Q: How did _dmamap_sync() work before?
A: It didn't.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mips64/mips64/busdma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/mips64/mips64/busdma.c b/sys/arch/mips64/mips64/busdma.c
index 06efa131e61..426130d7884 100644
--- a/sys/arch/mips64/mips64/busdma.c
+++ b/sys/arch/mips64/mips64/busdma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: busdma.c,v 1.12 2007/03/21 05:26:37 miod Exp $ */
+/* $OpenBSD: busdma.c,v 1.13 2007/05/30 19:44:26 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -368,12 +368,13 @@ _dmamap_sync(t, map, addr, size, op)
vaddr = map->dm_segs[curseg].ds_vaddr;
if (addr > 0) {
- if (addr > ssize) {
+ if (addr >= ssize) {
addr -= ssize;
ssize = 0;
} else {
vaddr += addr;
ssize -= addr;
+ addr = 0;
}
}
if (ssize > size) {
@@ -381,7 +382,6 @@ _dmamap_sync(t, map, addr, size, op)
}
if (ssize) {
-// #define DEBUG_BUSDMASYNC_FRAG
#ifdef DEBUG_BUSDMASYNC_FRAG
printf(" syncing %p:%p ", vaddr, ssize);
if (op & BUS_DMASYNC_PREWRITE) printf("PRW ");
@@ -636,4 +636,3 @@ _dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
return (0);
}
-