Lines Matching refs:curr

382 iommu_gas_next(struct iommu_map_entry *curr, iommu_gaddr_t min_free)  in iommu_gas_next()  argument
386 if ((next = RB_RIGHT(curr, rb_entry)) != NULL && in iommu_gas_next()
390 curr = next; in iommu_gas_next()
391 while ((next = RB_LEFT(curr, rb_entry)) != NULL && in iommu_gas_next()
395 while ((next = RB_PARENT(curr, rb_entry)) != NULL && in iommu_gas_next()
396 curr == RB_RIGHT(next, rb_entry)) in iommu_gas_next()
397 curr = next; in iommu_gas_next()
398 curr = next; in iommu_gas_next()
400 return (curr); in iommu_gas_next()
415 struct iommu_map_entry *curr, *first; in iommu_gas_find_space() local
431 for (curr = first; curr != NULL; in iommu_gas_find_space()
432 curr = iommu_gas_next(curr, min_free)) { in iommu_gas_find_space()
433 if ((first = RB_LEFT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
434 first->last + min_free <= curr->start) in iommu_gas_find_space()
436 if ((first = RB_RIGHT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
437 curr->end + min_free <= first->first) in iommu_gas_find_space()
440 domain->start_gap = curr; in iommu_gas_find_space()
450 first = curr; in iommu_gas_find_space()
459 for (curr = first; curr != NULL; in iommu_gas_find_space()
460 curr = iommu_gas_next(curr, min_free)) { in iommu_gas_find_space()
461 if ((first = RB_LEFT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
462 iommu_gas_match_one(a, first->last, curr->start, in iommu_gas_find_space()
465 &domain->rb_root, curr, a->entry); in iommu_gas_find_space()
468 if (curr->end >= addr) { in iommu_gas_find_space()
472 if ((first = RB_RIGHT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
473 iommu_gas_match_one(a, curr->end, first->first, in iommu_gas_find_space()
476 &domain->rb_root, curr, a->entry); in iommu_gas_find_space()
487 while (curr != NULL && curr->last < addr) in iommu_gas_find_space()
488 curr = RB_PARENT(curr, rb_entry); in iommu_gas_find_space()
490 while (curr != NULL && curr->free_down >= min_free) { in iommu_gas_find_space()
491 if (addr < curr->end) in iommu_gas_find_space()
492 curr = RB_LEFT(curr, rb_entry); in iommu_gas_find_space()
494 first = curr; in iommu_gas_find_space()
495 curr = RB_RIGHT(curr, rb_entry); in iommu_gas_find_space()
503 for (curr = first; curr != NULL; in iommu_gas_find_space()
504 curr = iommu_gas_next(curr, min_free)) { in iommu_gas_find_space()
505 if ((first = RB_LEFT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
506 iommu_gas_match_one(a, first->last, curr->start, in iommu_gas_find_space()
509 &domain->rb_root, curr, a->entry); in iommu_gas_find_space()
512 if ((first = RB_RIGHT(curr, rb_entry)) != NULL && in iommu_gas_find_space()
513 iommu_gas_match_one(a, curr->end, first->first, in iommu_gas_find_space()
516 &domain->rb_root, curr, a->entry); in iommu_gas_find_space()