Lines Matching refs:mapp

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