Lines Matching refs:mapp
364 struct ra_resource *mapp, **backp; in ndi_ra_free() local
381 mapp = dipmap->ra_rangeset; in ndi_ra_free()
386 for (; mapp != NULL; backp = &(mapp->ra_next), mapp = mapp->ra_next) { in ndi_ra_free()
387 mapend = mapp->ra_base + mapp->ra_len; in ndi_ra_free()
390 if ((base <= mapp->ra_base && newend > mapp->ra_base) || in ndi_ra_free()
391 (base > mapp->ra_base && base < mapend)) { in ndi_ra_free()
393 overlapmap = mapp; in ndi_ra_free()
395 } else if ((base == mapend && mapp->ra_next) && in ndi_ra_free()
396 (newend > mapp->ra_next->ra_base)) { in ndi_ra_free()
398 overlapmap = mapp->ra_next; in ndi_ra_free()
402 if (newend == mapp->ra_base) { in ndi_ra_free()
404 mapp->ra_base = base; in ndi_ra_free()
405 mapp->ra_len += len; in ndi_ra_free()
413 mapp->ra_len += len; in ndi_ra_free()
414 if (mapp->ra_next && in ndi_ra_free()
415 (newend == mapp->ra_next->ra_base)) { in ndi_ra_free()
417 oldmap = mapp->ra_next; in ndi_ra_free()
418 mapp->ra_len += oldmap->ra_len; in ndi_ra_free()
419 RA_REMOVE(&mapp->ra_next, oldmap); in ndi_ra_free()
423 } else if (base < mapp->ra_base) { in ndi_ra_free()
433 if (mapp == NULL) { in ndi_ra_free()
490 adjust_link(struct ra_resource **backp, struct ra_resource *mapp, in adjust_link() argument
496 if (base != mapp->ra_base) { in adjust_link()
498 newlen = base - mapp->ra_base; in adjust_link()
499 if ((mapp->ra_len - newlen) == len) { in adjust_link()
501 mapp->ra_len = newlen; in adjust_link()
507 newmap->ra_len = mapp->ra_len - (len + newlen); in adjust_link()
508 mapp->ra_len = newlen; in adjust_link()
509 RA_INSERT(&(mapp->ra_next), newmap); in adjust_link()
513 mapp->ra_base += len; in adjust_link()
514 mapp->ra_len -= len; in adjust_link()
515 if (mapp->ra_len == 0) { in adjust_link()
517 RA_REMOVE(backp, mapp); in adjust_link()
518 kmem_free((caddr_t)mapp, sizeof (*mapp)); in adjust_link()
528 struct ra_resource *mapp, **backp, **backlargestp; in ndi_ra_alloc() local
555 if ((dipmap == NULL) || ((mapp = dipmap->ra_rangeset) == NULL)) { in ndi_ra_alloc()
562 PRIx64 "\n", (void *)mapp, len, mask); in ndi_ra_alloc()
580 "\n", mapp->ra_len, len, mapp->ra_base, mask); in ndi_ra_alloc()
581 for (; mapp != NULL && (mapp->ra_base + mapp->ra_len) < lower; in ndi_ra_alloc()
582 backp = &(mapp->ra_next), mapp = mapp->ra_next) { in ndi_ra_alloc()
583 if (((mapp->ra_len + mapp->ra_base) == 0) || in ndi_ra_alloc()
584 ((mapp->ra_len + mapp->ra_base) < mapp->ra_len)) in ndi_ra_alloc()
593 PRIx64 "\n", mapp->ra_len, mapp->ra_base); in ndi_ra_alloc()
602 for (; mapp != NULL && mapp->ra_base <= upper; in ndi_ra_alloc()
603 backp = &(mapp->ra_next), mapp = mapp->ra_next) { in ndi_ra_alloc()
606 ", len = %" PRIx64 "", mapp->ra_len, len); in ndi_ra_alloc()
607 base = mapp->ra_base; in ndi_ra_alloc()
612 base, mapp->ra_base, mask); in ndi_ra_alloc()
630 if (base >= (oldbase + mapp->ra_len + 1)) { in ndi_ra_alloc()
636 if ((upper - mapp->ra_base) < mapp->ra_len) in ndi_ra_alloc()
639 remlen = mapp->ra_len - in ndi_ra_alloc()
640 (base - mapp->ra_base); in ndi_ra_alloc()
651 if (mapp->ra_len >= len) { in ndi_ra_alloc()
653 if ((len > (mapp->ra_len - in ndi_ra_alloc()
654 (base - mapp->ra_base))) || in ndi_ra_alloc()
663 adjust_link(backp, mapp, base, len); in ndi_ra_alloc()
673 for (; mapp != NULL && mapp->ra_base <= upper; in ndi_ra_alloc()
674 backp = &(mapp->ra_next), mapp = mapp->ra_next) { in ndi_ra_alloc()
675 if (base >= mapp->ra_base && in ndi_ra_alloc()
676 ((base - mapp->ra_base) < mapp->ra_len)) { in ndi_ra_alloc()
681 if ((len > mapp->ra_len) || in ndi_ra_alloc()
682 (base - mapp->ra_base > in ndi_ra_alloc()
683 mapp->ra_len - len)) { in ndi_ra_alloc()
687 if ((upper - mapp->ra_base) in ndi_ra_alloc()
688 < mapp->ra_len) in ndi_ra_alloc()
692 mapp->ra_len - in ndi_ra_alloc()
694 mapp->ra_base); in ndi_ra_alloc()
702 adjust_link(backp, mapp, base, len); in ndi_ra_alloc()