Print this page
patch lower-case-segops


6044                  * unload any current translations that might exist).
6045                  */
6046                 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD);
6047         } else {
6048                 /*
6049                  * A shared mapping or a private mapping in which write
6050                  * protection is going to be denied - just change all the
6051                  * protections over the range of addresses in question.
6052                  * segvn does not support any other attributes other
6053                  * than prot so we can use hat_chgattr.
6054                  */
6055                 hat_chgattr(seg->s_as->a_hat, addr, len, prot);
6056         }
6057 
6058         SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
6059 
6060         return (0);
6061 }
6062 
6063 /*
6064  * segvn_setpagesize is called via SEGOP_SETPAGESIZE from as_setpagesize,
6065  * to determine if the seg is capable of mapping the requested szc.
6066  */
6067 static int
6068 segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc)
6069 {
6070         struct segvn_data *svd = (struct segvn_data *)seg->s_data;
6071         struct segvn_data *nsvd;
6072         struct anon_map *amp = svd->amp;
6073         struct seg *nseg;
6074         caddr_t eaddr = addr + len, a;
6075         size_t pgsz = page_get_pagesize(szc);
6076         pgcnt_t pgcnt = page_get_pagecnt(szc);
6077         int err;
6078         u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
6079 
6080         ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
6081         ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
6082 
6083         if (seg->s_szc == szc || segvn_lpg_disable != 0) {
6084                 return (0);




6044                  * unload any current translations that might exist).
6045                  */
6046                 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD);
6047         } else {
6048                 /*
6049                  * A shared mapping or a private mapping in which write
6050                  * protection is going to be denied - just change all the
6051                  * protections over the range of addresses in question.
6052                  * segvn does not support any other attributes other
6053                  * than prot so we can use hat_chgattr.
6054                  */
6055                 hat_chgattr(seg->s_as->a_hat, addr, len, prot);
6056         }
6057 
6058         SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
6059 
6060         return (0);
6061 }
6062 
6063 /*
6064  * segvn_setpagesize is called via segop_setpagesize from as_setpagesize,
6065  * to determine if the seg is capable of mapping the requested szc.
6066  */
6067 static int
6068 segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc)
6069 {
6070         struct segvn_data *svd = (struct segvn_data *)seg->s_data;
6071         struct segvn_data *nsvd;
6072         struct anon_map *amp = svd->amp;
6073         struct seg *nseg;
6074         caddr_t eaddr = addr + len, a;
6075         size_t pgsz = page_get_pagesize(szc);
6076         pgcnt_t pgcnt = page_get_pagecnt(szc);
6077         int err;
6078         u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
6079 
6080         ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
6081         ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
6082 
6083         if (seg->s_szc == szc || segvn_lpg_disable != 0) {
6084                 return (0);