Print this page
patch as-lock-macro-simplification

*** 286,299 **** mmpagelock(struct as *as, caddr_t va) { struct seg *seg; int i; ! AS_LOCK_ENTER(as, &as->a_lock, RW_READER); seg = as_segat(as, va); i = (seg != NULL)? SEGOP_CAPABLE(seg, S_CAPABILITY_NOMINFLT) : 0; ! AS_LOCK_EXIT(as, &as->a_lock); return (i); } #ifdef __sparc --- 286,299 ---- mmpagelock(struct as *as, caddr_t va) { struct seg *seg; int i; ! AS_LOCK_ENTER(as, RW_READER); seg = as_segat(as, va); i = (seg != NULL)? SEGOP_CAPABLE(seg, S_CAPABILITY_NOMINFLT) : 0; ! AS_LOCK_EXIT(as); return (i); } #ifdef __sparc
*** 494,512 **** if (p == NULL) return (EIO); as = p->p_as; if (as == mem_vtop.m_as) { mutex_exit(&p->p_lock); ! AS_LOCK_ENTER(as, &as->a_lock, RW_READER); for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) if ((uintptr_t)mem_vtop.m_va - (uintptr_t)seg->s_base < seg->s_size) break; if (seg != NULL) pfn = hat_getpfnum(as->a_hat, mem_vtop.m_va); ! AS_LOCK_EXIT(as, &as->a_lock); mutex_enter(&p->p_lock); } sprunlock(p); } mem_vtop.m_pfn = pfn; --- 494,512 ---- if (p == NULL) return (EIO); as = p->p_as; if (as == mem_vtop.m_as) { mutex_exit(&p->p_lock); ! AS_LOCK_ENTER(as, RW_READER); for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) if ((uintptr_t)mem_vtop.m_va - (uintptr_t)seg->s_base < seg->s_size) break; if (seg != NULL) pfn = hat_getpfnum(as->a_hat, mem_vtop.m_va); ! AS_LOCK_EXIT(as); mutex_enter(&p->p_lock); } sprunlock(p); } mem_vtop.m_pfn = pfn;