Print this page
patch lower-case-segops

*** 3144,3154 **** mutex_exit(&p->p_lock); AS_LOCK_ENTER(as, &as->a_lock, RW_READER); seg = as_segat(as, va); if (seg != NULL && seg->s_ops == &segvn_ops && ! SEGOP_GETVP(seg, va, &xvp) == 0 && xvp != NULL && xvp->v_type == VREG) { VN_HOLD(xvp); } else { error = EINVAL; --- 3144,3154 ---- mutex_exit(&p->p_lock); AS_LOCK_ENTER(as, &as->a_lock, RW_READER); seg = as_segat(as, va); if (seg != NULL && seg->s_ops == &segvn_ops && ! segop_getvp(seg, va, &xvp) == 0 && xvp != NULL && xvp->v_type == VREG) { VN_HOLD(xvp); } else { error = EINVAL;
*** 3549,3567 **** mp = pr_iol_newbuf(iolhead, sizeof (*mp)); mp->pr_vaddr = saddr; mp->pr_size = naddr - saddr; ! mp->pr_off = SEGOP_GETOFFSET(seg, saddr); mp->pr_mflags = 0; if (prot & PROT_READ) mp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) mp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) mp->pr_mflags |= MA_EXEC; ! if (SEGOP_GETTYPE(seg, saddr) & MAP_SHARED) mp->pr_mflags |= MA_SHARED; if (seg == brkseg) mp->pr_mflags |= MA_BREAK; else if (seg == stkseg) mp->pr_mflags |= MA_STACK; --- 3549,3567 ---- mp = pr_iol_newbuf(iolhead, sizeof (*mp)); mp->pr_vaddr = saddr; mp->pr_size = naddr - saddr; ! mp->pr_off = segop_getoffset(seg, saddr); mp->pr_mflags = 0; if (prot & PROT_READ) mp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) mp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) mp->pr_mflags |= MA_EXEC; ! if (segop_gettype(seg, saddr) & MAP_SHARED) mp->pr_mflags |= MA_SHARED; if (seg == brkseg) mp->pr_mflags |= MA_BREAK; else if (seg == stkseg) mp->pr_mflags |= MA_STACK;
*** 3609,3627 **** mp = pr_iol_newbuf(iolhead, sizeof (*mp)); mp->pr_vaddr = (caddr32_t)(uintptr_t)saddr; mp->pr_size = (size32_t)(naddr - saddr); ! mp->pr_off = (off32_t)SEGOP_GETOFFSET(seg, saddr); mp->pr_mflags = 0; if (prot & PROT_READ) mp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) mp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) mp->pr_mflags |= MA_EXEC; ! if (SEGOP_GETTYPE(seg, saddr) & MAP_SHARED) mp->pr_mflags |= MA_SHARED; if (seg == brkseg) mp->pr_mflags |= MA_BREAK; else if (seg == stkseg) mp->pr_mflags |= MA_STACK; --- 3609,3627 ---- mp = pr_iol_newbuf(iolhead, sizeof (*mp)); mp->pr_vaddr = (caddr32_t)(uintptr_t)saddr; mp->pr_size = (size32_t)(naddr - saddr); ! mp->pr_off = (off32_t)segop_getoffset(seg, saddr); mp->pr_mflags = 0; if (prot & PROT_READ) mp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) mp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) mp->pr_mflags |= MA_EXEC; ! if (segop_gettype(seg, saddr) & MAP_SHARED) mp->pr_mflags |= MA_SHARED; if (seg == brkseg) mp->pr_mflags |= MA_BREAK; else if (seg == stkseg) mp->pr_mflags |= MA_STACK;
*** 3751,3761 **** * subtlely even though we're holding as->a_lock * due to the nondeterminism of page_exists() in * the presence of asychronously flushed pages or * mapped files whose sizes are changing. * page_exists() may be called indirectly from ! * pr_getprot() by a SEGOP_INCORE() routine. * If this happens we need to make sure we don't * overrun the buffer whose size we computed based * on the initial iteration through the segments. * Once we've detected an overflow, we need to clean * up the temporary memory allocated in pr_getprot() --- 3751,3761 ---- * subtlely even though we're holding as->a_lock * due to the nondeterminism of page_exists() in * the presence of asychronously flushed pages or * mapped files whose sizes are changing. * page_exists() may be called indirectly from ! * pr_getprot() by a segop_incore() routine. * If this happens we need to make sure we don't * overrun the buffer whose size we computed based * on the initial iteration through the segments. * Once we've detected an overflow, we need to clean * up the temporary memory allocated in pr_getprot()
*** 3777,3795 **** php->pr_nmap++; php->pr_npage += npage; pmp->pr_vaddr = saddr; pmp->pr_npage = npage; ! pmp->pr_off = SEGOP_GETOFFSET(seg, saddr); pmp->pr_mflags = 0; if (prot & PROT_READ) pmp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) pmp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) pmp->pr_mflags |= MA_EXEC; ! if (SEGOP_GETTYPE(seg, saddr) & MAP_SHARED) pmp->pr_mflags |= MA_SHARED; pmp->pr_pagesize = PAGESIZE; hat_getstat(as, saddr, len, hatid, (char *)(pmp + 1), HAT_SYNC_ZERORM); pmp = (prasmap_t *)next; --- 3777,3795 ---- php->pr_nmap++; php->pr_npage += npage; pmp->pr_vaddr = saddr; pmp->pr_npage = npage; ! pmp->pr_off = segop_getoffset(seg, saddr); pmp->pr_mflags = 0; if (prot & PROT_READ) pmp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) pmp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) pmp->pr_mflags |= MA_EXEC; ! if (segop_gettype(seg, saddr) & MAP_SHARED) pmp->pr_mflags |= MA_SHARED; pmp->pr_pagesize = PAGESIZE; hat_getstat(as, saddr, len, hatid, (char *)(pmp + 1), HAT_SYNC_ZERORM); pmp = (prasmap_t *)next;
*** 3858,3868 **** * subtlely even though we're holding as->a_lock * due to the nondeterminism of page_exists() in * the presence of asychronously flushed pages or * mapped files whose sizes are changing. * page_exists() may be called indirectly from ! * pr_getprot() by a SEGOP_INCORE() routine. * If this happens we need to make sure we don't * overrun the buffer whose size we computed based * on the initial iteration through the segments. * Once we've detected an overflow, we need to clean * up the temporary memory allocated in pr_getprot() --- 3858,3868 ---- * subtlely even though we're holding as->a_lock * due to the nondeterminism of page_exists() in * the presence of asychronously flushed pages or * mapped files whose sizes are changing. * page_exists() may be called indirectly from ! * pr_getprot() by a segop_incore() routine. * If this happens we need to make sure we don't * overrun the buffer whose size we computed based * on the initial iteration through the segments. * Once we've detected an overflow, we need to clean * up the temporary memory allocated in pr_getprot()
*** 3884,3902 **** php->pr_nmap++; php->pr_npage += npage; pmp->pr_vaddr = (uint32_t)(uintptr_t)saddr; pmp->pr_npage = (uint32_t)npage; ! pmp->pr_off = (int32_t)SEGOP_GETOFFSET(seg, saddr); pmp->pr_mflags = 0; if (prot & PROT_READ) pmp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) pmp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) pmp->pr_mflags |= MA_EXEC; ! if (SEGOP_GETTYPE(seg, saddr) & MAP_SHARED) pmp->pr_mflags |= MA_SHARED; pmp->pr_pagesize = PAGESIZE; hat_getstat(as, saddr, len, hatid, (char *)(pmp + 1), HAT_SYNC_ZERORM); pmp = (ioc_prasmap32_t *)next; --- 3884,3902 ---- php->pr_nmap++; php->pr_npage += npage; pmp->pr_vaddr = (uint32_t)(uintptr_t)saddr; pmp->pr_npage = (uint32_t)npage; ! pmp->pr_off = (int32_t)segop_getoffset(seg, saddr); pmp->pr_mflags = 0; if (prot & PROT_READ) pmp->pr_mflags |= MA_READ; if (prot & PROT_WRITE) pmp->pr_mflags |= MA_WRITE; if (prot & PROT_EXEC) pmp->pr_mflags |= MA_EXEC; ! if (segop_gettype(seg, saddr) & MAP_SHARED) pmp->pr_mflags |= MA_SHARED; pmp->pr_pagesize = PAGESIZE; hat_getstat(as, saddr, len, hatid, (char *)(pmp + 1), HAT_SYNC_ZERORM); pmp = (ioc_prasmap32_t *)next;