summaryrefslogtreecommitdiffstats
path: root/sys/x86/iommu
diff options
context:
space:
mode:
Diffstat (limited to 'sys/x86/iommu')
-rw-r--r--sys/x86/iommu/intel_gas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/x86/iommu/intel_gas.c b/sys/x86/iommu/intel_gas.c
index 8b18b4c..ffc8b70 100644
--- a/sys/x86/iommu/intel_gas.c
+++ b/sys/x86/iommu/intel_gas.c
@@ -327,8 +327,8 @@ dmar_gas_match_one(struct dmar_gas_match_args *a, struct dmar_map_entry *prev,
* the boundary. Check if there is enough space after the
* next boundary after the prev->end.
*/
- bs = (a->entry->start + a->offset + a->common->boundary) &
- ~(a->common->boundary - 1);
+ bs = rounddown2(a->entry->start + a->offset + a->common->boundary,
+ a->common->boundary);
start = roundup2(bs, a->common->alignment);
/* DMAR_PAGE_SIZE to create gap after new entry. */
if (start + a->offset + a->size + DMAR_PAGE_SIZE <=
OpenPOWER on IntegriCloud