Lines Matching refs:lp
291 struct kcage_glist *lp = kcage_current_glist; in kcage_current_pfn() local
295 ASSERT(lp != NULL); in kcage_current_pfn()
297 *pfncur = lp->curr; in kcage_current_pfn()
299 return (lp->decr); in kcage_current_pfn()
320 struct kcage_glist *lp; in kcage_next_range() local
334 for (lp = incage ? kcage_glist : kcage_current_glist; in kcage_next_range()
335 lp != NULL; lp = lp->next) { in kcage_next_range()
340 if ((incage && lp->decr) || (!incage && !lp->decr)) { in kcage_next_range()
341 klo = lp->curr; in kcage_next_range()
342 khi = lp->lim; in kcage_next_range()
344 klo = lp->base; in kcage_next_range()
345 khi = lp->curr; in kcage_next_range()
357 if (incage && lp == kcage_current_glist) { in kcage_next_range()
482 struct kcage_glist *lp; in kcage_range_delete_internal() local
502 for (lp = kcage_glist; lp != NULL; lp = lp->next) { in kcage_range_delete_internal()
507 if ((lp->decr == 0 && lp->curr == lp->base) || in kcage_range_delete_internal()
508 (lp->decr != 0 && lp->curr == lp->lim)) in kcage_range_delete_internal()
513 if (base >= lp->lim || lim <= lp->base) in kcage_range_delete_internal()
519 if (lp->decr == 0 && base < lp->curr && lim >= lp->base) { in kcage_range_delete_internal()
522 if (lp->decr != 0 && base < lp->lim && lim >= lp->curr) { in kcage_range_delete_internal()
605 kcage_glist_free(struct kcage_glist *lp) in kcage_glist_free() argument
607 lp->next = kcage_glist_freelist; in kcage_glist_free()
608 kcage_glist_freelist = lp; in kcage_glist_free()
614 struct kcage_glist *lp, *prev = *lpp; in kcage_glist_delete() local
616 while ((lp = *lpp) != NULL) { in kcage_glist_delete()
617 if (lim > lp->base && base < lp->lim) { in kcage_glist_delete()
619 if (base <= lp->base && lim >= lp->lim) { in kcage_glist_delete()
621 *lpp = lp->next; in kcage_glist_delete()
622 if (lp == kcage_current_glist) { in kcage_glist_delete()
627 kcage_glist_free(lp); in kcage_glist_delete()
632 if (base > lp->base && lim < lp->lim) { in kcage_glist_delete()
649 new->decr = lp->decr; in kcage_glist_delete()
651 new->base = lp->base; in kcage_glist_delete()
655 lp->base = lim; in kcage_glist_delete()
658 new->lim = lp->lim; in kcage_glist_delete()
661 lp->lim = base; in kcage_glist_delete()
665 new->next = lp->next; in kcage_glist_delete()
666 lp->next = new; in kcage_glist_delete()
667 lpp = &lp->next; in kcage_glist_delete()
670 if (base > lp->base) { in kcage_glist_delete()
671 ASSERT(lim >= lp->lim); in kcage_glist_delete()
672 ASSERT(base < lp->lim); in kcage_glist_delete()
673 if (lp->decr != 0 && in kcage_glist_delete()
674 lp->curr == lp->lim) in kcage_glist_delete()
675 lp->curr = base; in kcage_glist_delete()
676 lp->lim = base; in kcage_glist_delete()
678 ASSERT(base <= lp->base); in kcage_glist_delete()
679 ASSERT(lim > lp->base); in kcage_glist_delete()
680 if (lp->decr == 0 && in kcage_glist_delete()
681 lp->curr == lp->base) in kcage_glist_delete()
682 lp->curr = lim; in kcage_glist_delete()
683 lp->base = lim; in kcage_glist_delete()
703 struct kcage_glist *lp; in kcage_get_pfn() local
709 lp = kcage_current_glist; in kcage_get_pfn()
710 while (lp != NULL) { in kcage_get_pfn()
711 if (lp->decr != 0) { in kcage_get_pfn()
712 if (lp->curr != lp->base) { in kcage_get_pfn()
713 pfn = --lp->curr; in kcage_get_pfn()
717 if (lp->curr != lp->lim) { in kcage_get_pfn()
718 pfn = lp->curr++; in kcage_get_pfn()
723 lp = lp->next; in kcage_get_pfn()
724 if (lp) in kcage_get_pfn()
725 kcage_current_glist = lp; in kcage_get_pfn()
761 static struct kcage_glist *lp = NULL; in kcage_walk_cage() local
765 lp = NULL; in kcage_walk_cage()
766 if (lp == NULL) { in kcage_walk_cage()
767 lp = kcage_glist; in kcage_walk_cage()
772 if (lp == NULL) in kcage_walk_cage()
775 if (lp->decr != 0) { in kcage_walk_cage()
783 pfn = lp->curr; in kcage_walk_cage()
792 pfn = lp->base; in kcage_walk_cage()
796 if (lp->decr != 0) { /* decrementing pfn */ in kcage_walk_cage()
797 if (pfn == lp->lim) { in kcage_walk_cage()
799 if (lp == kcage_current_glist) in kcage_walk_cage()
800 lp = NULL; in kcage_walk_cage()
802 lp = lp->next; in kcage_walk_cage()
807 ASSERT(pfn >= lp->curr && pfn < lp->lim); in kcage_walk_cage()
809 if (pfn == lp->curr) { in kcage_walk_cage()
811 if (lp == kcage_current_glist) in kcage_walk_cage()
812 lp = NULL; in kcage_walk_cage()
814 lp = lp->next; in kcage_walk_cage()
819 ASSERT(pfn >= lp->base && pfn < lp->curr); in kcage_walk_cage()
1031 struct kcage_glist *lp; in kcage_kstat_update() local
1039 for (lp = kcage_glist; lp != NULL; lp = lp->next) { in kcage_kstat_update()
1040 if (lp->decr) { in kcage_kstat_update()
1041 if (lp->curr != lp->lim) { in kcage_kstat_update()
1045 if (lp->curr != lp->base) { in kcage_kstat_update()
1061 struct kcage_glist *lp; in kcage_kstat_snapshot() local
1074 for (lp = kcage_glist; lp != NULL; lp = lp->next, kspmem++) { in kcage_kstat_snapshot()
1078 if (lp->decr) { in kcage_kstat_snapshot()
1079 if (lp->curr != lp->lim) { in kcage_kstat_snapshot()
1080 kspmem->address = ptob(lp->curr); in kcage_kstat_snapshot()
1081 kspmem->size = ptob(lp->lim - lp->curr); in kcage_kstat_snapshot()
1084 if (lp->curr != lp->base) { in kcage_kstat_snapshot()
1085 kspmem->address = ptob(lp->base); in kcage_kstat_snapshot()
1086 kspmem->size = ptob(lp->curr - lp->base); in kcage_kstat_snapshot()