From 7b1ee3518987d4e142a948887f7a3691df0495f0 Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Tue, 29 Jul 2014 02:35:44 +0000 Subject: [PATCH] Correct the comparison logic when looking for intersections between exclusion zones and phsyical memory. The phys_avail[i] entries are the address of the first byte of ram in the region, and phys_avail[i+1] entries are the address of the first byte of ram in the next region (i.e., they're not included in the region that starts at phys_avail[i]). Reviewed by: cognet --- sys/arm/arm/busdma_machdep-v6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 94d02a999587..a7a594768bc2 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -252,9 +252,9 @@ exclusion_bounce_check(vm_offset_t lowaddr, vm_offset_t highaddr) return (0); for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { - if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) + if ((lowaddr >= phys_avail[i] && lowaddr < phys_avail[i + 1]) || (lowaddr < phys_avail[i] && - highaddr > phys_avail[i])) + highaddr >= phys_avail[i])) return (1); } return (0);