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
This commit is contained in:
Ian Lepore 2014-07-29 02:35:44 +00:00
parent 7c54a52475
commit 7b1ee35189

View File

@ -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);