Lines Matching defs:pwp
3307 struct watched_page *pwp;
3318 pwp = avl_first(&as->a_wpage);
3321 while ((pwp = avl_destroy_nodes(&as->a_wpage, &cookie)) != NULL) {
3323 if ((prot = pwp->wp_oprot) != 0) {
3324 caddr_t addr = pwp->wp_vaddr;
3328 if ((pwp->wp_prot != prot ||
3329 (pwp->wp_flags & WP_NOWATCH)) &&
3339 kmem_free(pwp, sizeof (struct watched_page));
3359 struct watched_page *pwp, *newpwp;
3374 pwp = kmem_zalloc(sizeof (struct watched_page), KM_SLEEP);
3375 pwp->wp_list = newpwp;
3376 newpwp = pwp;
3396 pwp = newpwp->wp_list;
3398 newpwp = pwp;
3404 if ((pwp = avl_find(pwp_tree, &tpw, &where)) == NULL) {
3405 pwp = newpwp;
3407 pwp->wp_list = NULL;
3408 pwp->wp_vaddr = (caddr_t)((uintptr_t)vaddr &
3410 avl_insert(pwp_tree, pwp, where);
3413 ASSERT(vaddr >= pwp->wp_vaddr && vaddr < pwp->wp_vaddr + PAGESIZE);
3416 pwp->wp_read--;
3418 pwp->wp_write--;
3420 pwp->wp_exec--;
3422 ASSERT(pwp->wp_read >= 0);
3423 ASSERT(pwp->wp_write >= 0);
3424 ASSERT(pwp->wp_exec >= 0);
3427 pwp->wp_read++;
3429 pwp->wp_write++;
3431 pwp->wp_exec++;
3434 vaddr = pwp->wp_vaddr;
3435 if (pwp->wp_oprot == 0 &&
3438 pwp->wp_oprot = (uchar_t)prot;
3439 pwp->wp_prot = (uchar_t)prot;
3441 if (pwp->wp_oprot != 0) {
3442 prot = pwp->wp_oprot;
3443 if (pwp->wp_read)
3445 if (pwp->wp_write)
3447 if (pwp->wp_exec)
3449 if (!(pwp->wp_flags & WP_NOWATCH) &&
3450 pwp->wp_prot != prot &&
3451 (pwp->wp_flags & WP_SETPROT) == 0) {
3452 pwp->wp_flags |= WP_SETPROT;
3453 pwp->wp_list = p->p_wprot;
3454 p->p_wprot = pwp;
3456 pwp->wp_prot = (uchar_t)prot;
3464 if ((vaddr = pwp->wp_vaddr + PAGESIZE) < eaddr)
3473 pwp = newpwp->wp_list;
3475 newpwp = pwp;
3489 struct watched_page *pwp;
3503 pwp = avl_find(tree, &tpw, &where);
3504 if (pwp == NULL)
3505 pwp = avl_nearest(tree, where, AVL_AFTER);
3507 while (pwp != NULL && pwp->wp_vaddr < eaddr) {
3508 ASSERT(vaddr <= pwp->wp_vaddr);
3511 pwp->wp_read--;
3513 pwp->wp_write--;
3515 pwp->wp_exec--;
3517 if (pwp->wp_read + pwp->wp_write + pwp->wp_exec != 0) {
3521 if (pwp->wp_oprot != 0) {
3522 uint_t prot = pwp->wp_oprot;
3524 if (pwp->wp_read)
3527 if (pwp->wp_write)
3529 if (pwp->wp_exec)
3532 if (!(pwp->wp_flags & WP_NOWATCH) &&
3533 pwp->wp_prot != prot &&
3534 (pwp->wp_flags & WP_SETPROT) == 0) {
3535 pwp->wp_flags |= WP_SETPROT;
3536 pwp->wp_list = p->p_wprot;
3537 p->p_wprot = pwp;
3539 pwp->wp_prot = (uchar_t)prot;
3546 if (pwp->wp_oprot != 0) {
3547 pwp->wp_prot = pwp->wp_oprot;
3548 if ((pwp->wp_flags & WP_SETPROT) == 0) {
3549 pwp->wp_flags |= WP_SETPROT;
3550 pwp->wp_list = p->p_wprot;
3551 p->p_wprot = pwp;
3556 pwp = AVL_NEXT(tree, pwp);
3568 struct watched_page *pwp;
3574 if ((pwp = avl_find(&as->a_wpage, &tpw, NULL)) != NULL)
3575 *prot = pwp->wp_oprot;