summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2007-05-30 19:44:26 +0000
committermiod <miod@openbsd.org>2007-05-30 19:44:26 +0000
commite86fbc3701dab5d63bdea139c4f190835dafb7f1 (patch)
tree158a84b2d5c710cc0bd13dc97731052905821b33
parentMake sure that if there are staggered syncs that they complete successfully (diff)
downloadwireguard-openbsd-e86fbc3701dab5d63bdea139c4f190835dafb7f1.tar.xz
wireguard-openbsd-e86fbc3701dab5d63bdea139c4f190835dafb7f1.zip
Q: How did _dmamap_sync() work before?
A: It didn't.
-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);
}
-