From 6b02d9debbf5cdcf0b1d4835ba26a6229330bf28 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sun, 3 Jun 2007 13:02:24 +0000 Subject: [PATCH] Correct conditional to correctly treat segments which end on a boundary. --- sys/platform/pc32/i386/busdma_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/platform/pc32/i386/busdma_machdep.c b/sys/platform/pc32/i386/busdma_machdep.c index baadaf8920..5bc5e1b916 100644 --- a/sys/platform/pc32/i386/busdma_machdep.c +++ b/sys/platform/pc32/i386/busdma_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.16.2.2 2003/01/23 00:55:27 scottl Exp $ - * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.19 2007/06/03 11:47:10 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.20 2007/06/03 13:02:24 corecode Exp $ */ #include @@ -525,7 +525,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, /* * Limit to the boundary and maximum segment size */ - if ((nextpaddr ^ sg->ds_addr) & bmask) { + if (((nextpaddr - 1) ^ sg->ds_addr) & bmask) { tmpsize = dmat->boundary - (sg->ds_addr & ~bmask); if (tmpsize > dmat->maxsegsz) -- 2.41.0