git: 094bcfa4e15b - stable/13 - mips_busdma: fix mips errors after merge

From: Doug Moore <dougm_at_FreeBSD.org>
Date: Tue, 12 Jul 2022 17:35:39 UTC
The branch stable/13 has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=094bcfa4e15bf2c21e6bd8e9c0bbdb0389beddef

commit 094bcfa4e15bf2c21e6bd8e9c0bbdb0389beddef
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2022-07-12 17:33:20 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2022-07-12 17:33:20 +0000

    mips_busdma: fix mips errors after merge
    
    The change "vm_extern: use standard address checkers everywhere"
    introduced bugs, as well as features, into head. After it was
    introduced, but before those bugs were addressed, mips support was
    dropped from head, so those mips bugs were never fixed in head. Now,
    that change and those fixes have been merged into stable/13. This
    change fixes two of those bugs that were fixed everywhere else but
    never in mips.
    
    Reviewed by:    alc
    Differential Revision:  https://reviews.freebsd.org/D35793
---
 sys/mips/mips/busdma_machdep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/mips/mips/busdma_machdep.c b/sys/mips/mips/busdma_machdep.c
index 348c1d98c328..f38142e6eecd 100644
--- a/sys/mips/mips/busdma_machdep.c
+++ b/sys/mips/mips/busdma_machdep.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/vm_kern.h>
 #include <vm/vm_page.h>
 #include <vm/vm_phys.h>
+#include <vm/vm_extern.h>
 #include <vm/vm_map.h>
 
 #include <machine/atomic.h>
@@ -888,8 +889,8 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t curaddr,
 	if (seg >= 0 &&
 	    curaddr == segs[seg].ds_addr + segs[seg].ds_len &&
 	    (segs[seg].ds_len + sgsize) <= dmat->maxsegsz &&
-	    vm_addr_bound_ok(segs[seg].ds_addr, segs[seg].ds_len,
-	    dmat->boundary))
+	    vm_addr_bound_ok(segs[seg].ds_addr,
+	    segs[seg].ds_len + sgsize, dmat->boundary))
 		segs[seg].ds_len += sgsize;
 	} else {
 		if (++seg >= dmat->nsegments)