Lines Matching refs:end

130 	KASSERT(a->start <= a->end, ("inverted entry %p (%jx, %jx)",  in iommu_gas_cmp_entries()
131 a, (uintmax_t)a->start, (uintmax_t)a->end)); in iommu_gas_cmp_entries()
132 KASSERT(b->start <= b->end, ("inverted entry %p (%jx, %jx)", in iommu_gas_cmp_entries()
133 b, (uintmax_t)b->start, (uintmax_t)b->end)); in iommu_gas_cmp_entries()
135 a->end <= b->start || b->end <= a->start || in iommu_gas_cmp_entries()
136 a->end == a->start || b->end == b->start, in iommu_gas_cmp_entries()
139 a, (uintmax_t)a->start, (uintmax_t)a->end, a->flags, in iommu_gas_cmp_entries()
140 b, (uintmax_t)b->start, (uintmax_t)b->end, b->flags, in iommu_gas_cmp_entries()
143 if (a->end < b->end) in iommu_gas_cmp_entries()
145 else if (b->end < a->end) in iommu_gas_cmp_entries()
168 bound = entry->end; in iommu_gas_augment_entry()
210 v = MAX(v, r->first - entry->end); in iommu_gas_check_free()
223 if (entry->end <= domain->start_gap->end) { in iommu_gas_rb_remove()
245 struct iommu_map_entry *begin, *end; in iommu_gas_init_domain() local
248 end = iommu_gas_alloc_entry(domain, IOMMU_PGF_WAITOK); in iommu_gas_init_domain()
255 end->start = domain->end; in iommu_gas_init_domain()
256 end->end = domain->end; in iommu_gas_init_domain()
257 end->flags = IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_UNMAPPED; in iommu_gas_init_domain()
258 RB_INSERT(iommu_gas_entries_tree, &domain->rb_root, end); in iommu_gas_init_domain()
261 begin->end = 0; in iommu_gas_init_domain()
263 RB_INSERT_PREV(iommu_gas_entries_tree, &domain->rb_root, end, begin); in iommu_gas_init_domain()
264 iommu_gas_augment_entry(end); in iommu_gas_init_domain()
269 domain->last_place = end; in iommu_gas_init_domain()
285 KASSERT(entry->end == IOMMU_PAGE_SIZE, ("start entry end %p", domain)); in iommu_gas_fini_domain()
293 KASSERT(entry->start == domain->end, ("end entry start %p", domain)); in iommu_gas_fini_domain()
294 KASSERT(entry->end == domain->end, ("end entry end %p", domain)); in iommu_gas_fini_domain()
318 iommu_gaddr_t end, iommu_gaddr_t lbound, iommu_gaddr_t ubound) in iommu_gas_match_one() argument
335 if (end < IOMMU_PAGE_SIZE + 1) in iommu_gas_match_one()
337 end = MIN(end - IOMMU_PAGE_SIZE - 1, ubound); in iommu_gas_match_one()
340 if (start + offset + size - 1 > end) in iommu_gas_match_one()
354 if (start + offset + size - 1 > end || in iommu_gas_match_one()
375 entry->end = start + roundup2(size + offset, IOMMU_PAGE_SIZE); in iommu_gas_match_one()
437 curr->end + min_free <= first->first) in iommu_gas_find_space()
468 if (curr->end >= addr) { in iommu_gas_find_space()
473 iommu_gas_match_one(a, curr->end, first->first, in iommu_gas_find_space()
491 if (addr < curr->end) in iommu_gas_find_space()
507 addr + 1, domain->end - 1)) { in iommu_gas_find_space()
513 iommu_gas_match_one(a, curr->end, first->first, in iommu_gas_find_space()
514 addr + 1, domain->end - 1)) { in iommu_gas_find_space()
533 (entry->end & IOMMU_PAGE_MASK) != 0) in iommu_gas_alloc_region()
535 if (entry->start >= entry->end) in iommu_gas_alloc_region()
537 if (entry->end >= domain->end) in iommu_gas_alloc_region()
556 if (prev != NULL && prev->end > entry->start && in iommu_gas_alloc_region()
561 entry->start = prev->end; in iommu_gas_alloc_region()
563 if (next->start < entry->end && in iommu_gas_alloc_region()
568 entry->end = next->start; in iommu_gas_alloc_region()
570 if (entry->end == entry->start) in iommu_gas_alloc_region()
573 if (prev != NULL && prev->end > entry->start) { in iommu_gas_alloc_region()
580 if (next->start < entry->end) { in iommu_gas_alloc_region()
594 entry, entry->start, entry->end, prev, in iommu_gas_alloc_region()
595 prev == NULL ? 0 : prev->start, prev == NULL ? 0 : prev->end, in iommu_gas_alloc_region()
596 ip, ip == NULL ? 0 : ip->start, ip == NULL ? 0 : ip->end)); in iommu_gas_alloc_region()
599 entry, entry->start, entry->end, next, in iommu_gas_alloc_region()
600 next == NULL ? 0 : next->start, next == NULL ? 0 : next->end, in iommu_gas_alloc_region()
601 in, in == NULL ? 0 : in->start, in == NULL ? 0 : in->end)); in iommu_gas_alloc_region()
647 iommu_gaddr_t end, struct iommu_map_entry **r) in iommu_gas_remove_clip_left() argument
652 MPASS(start <= end); in iommu_gas_remove_clip_left()
653 MPASS(end <= domain->end); in iommu_gas_remove_clip_left()
663 fentry.end = start + 1; in iommu_gas_remove_clip_left()
674 res->start = entry->end = start; in iommu_gas_remove_clip_left()
683 iommu_gaddr_t end, struct iommu_map_entry *entry, in iommu_gas_remove_clip_right() argument
686 if (entry->start >= end || (entry->flags & IOMMU_MAP_ENTRY_RMRR) != 0) in iommu_gas_remove_clip_right()
690 r->end = entry->start = end; in iommu_gas_remove_clip_right()
719 iommu_gaddr_t end; in iommu_gas_remove_locked() local
723 end = start + size; in iommu_gas_remove_locked()
725 nentry = iommu_gas_remove_clip_left(domain, start, end, r1); in iommu_gas_remove_locked()
727 if (entry->start >= end) in iommu_gas_remove_locked()
731 entry->start, entry->end, start)); in iommu_gas_remove_locked()
734 if (iommu_gas_remove_clip_right(domain, end, entry, *r2)) { in iommu_gas_remove_locked()
744 KASSERT(entry->end <= start || entry->start >= end, in iommu_gas_remove_locked()
747 entry->start, entry->end, start, end)); in iommu_gas_remove_locked()
832 KASSERT(entry->end < domain->end, ("allocated GPA %jx, max GPA %jx", in iommu_gas_map()
833 (uintmax_t)entry->end, (uintmax_t)domain->end)); in iommu_gas_map()
875 if (entry->end == entry->start) in iommu_gas_map_region()
894 iommu_gaddr_t start, iommu_gaddr_t end, struct iommu_map_entry *entry) in iommu_gas_reserve_region_locked() argument
901 entry->end = end; in iommu_gas_reserve_region_locked()
910 iommu_gaddr_t end, struct iommu_map_entry **entry0) in iommu_gas_reserve_region() argument
917 error = iommu_gas_reserve_region_locked(domain, start, end, entry); in iommu_gas_reserve_region()
932 iommu_gaddr_t start, iommu_gaddr_t end) in iommu_gas_reserve_region_extend() argument
940 end = ummin(end, domain->end); in iommu_gas_reserve_region_extend()
941 while (start < end) { in iommu_gas_reserve_region_extend()
947 key.start = key.end = start; in iommu_gas_reserve_region_extend()
951 "after %#jx", domain, (uintmax_t)domain->end, in iommu_gas_reserve_region_extend()
953 entry_end = ummin(end, next->start); in iommu_gas_reserve_region_extend()
956 entry_start = ummax(start, prev->end); in iommu_gas_reserve_region_extend()
959 start = next->end; in iommu_gas_reserve_region_extend()
1058 KASSERT(*addr + sizeof(*addr) <= domain->msi_entry->end, in iommu_translate_msi()
1060 __func__, (uintmax_t)*addr, (uintmax_t)domain->msi_entry->end)); in iommu_translate_msi()
1087 entry, (uintmax_t)entry->start, (uintmax_t)entry->end, in iommu_debug_dump_gas()