Print this page
patch lower-case-segops


6067                  * unload any current translations that might exist).
6068                  */
6069                 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD);
6070         } else {
6071                 /*
6072                  * A shared mapping or a private mapping in which write
6073                  * protection is going to be denied - just change all the
6074                  * protections over the range of addresses in question.
6075                  * segvn does not support any other attributes other
6076                  * than prot so we can use hat_chgattr.
6077                  */
6078                 hat_chgattr(seg->s_as->a_hat, addr, len, prot);
6079         }
6080 
6081         SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
6082 
6083         return (0);
6084 }
6085 
6086 /*
6087  * segvn_setpagesize is called via SEGOP_SETPAGESIZE from as_setpagesize,
6088  * to determine if the seg is capable of mapping the requested szc.
6089  */
6090 static int
6091 segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc)
6092 {
6093         struct segvn_data *svd = (struct segvn_data *)seg->s_data;
6094         struct segvn_data *nsvd;
6095         struct anon_map *amp = svd->amp;
6096         struct seg *nseg;
6097         caddr_t eaddr = addr + len, a;
6098         size_t pgsz = page_get_pagesize(szc);
6099         pgcnt_t pgcnt = page_get_pagecnt(szc);
6100         int err;
6101         u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
6102 
6103         ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
6104         ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
6105 
6106         if (seg->s_szc == szc || segvn_lpg_disable != 0) {
6107                 return (0);




6067                  * unload any current translations that might exist).
6068                  */
6069                 hat_unload(seg->s_as->a_hat, addr, len, HAT_UNLOAD);
6070         } else {
6071                 /*
6072                  * A shared mapping or a private mapping in which write
6073                  * protection is going to be denied - just change all the
6074                  * protections over the range of addresses in question.
6075                  * segvn does not support any other attributes other
6076                  * than prot so we can use hat_chgattr.
6077                  */
6078                 hat_chgattr(seg->s_as->a_hat, addr, len, prot);
6079         }
6080 
6081         SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
6082 
6083         return (0);
6084 }
6085 
6086 /*
6087  * segvn_setpagesize is called via segop_setpagesize from as_setpagesize,
6088  * to determine if the seg is capable of mapping the requested szc.
6089  */
6090 static int
6091 segvn_setpagesize(struct seg *seg, caddr_t addr, size_t len, uint_t szc)
6092 {
6093         struct segvn_data *svd = (struct segvn_data *)seg->s_data;
6094         struct segvn_data *nsvd;
6095         struct anon_map *amp = svd->amp;
6096         struct seg *nseg;
6097         caddr_t eaddr = addr + len, a;
6098         size_t pgsz = page_get_pagesize(szc);
6099         pgcnt_t pgcnt = page_get_pagecnt(szc);
6100         int err;
6101         u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
6102 
6103         ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
6104         ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
6105 
6106         if (seg->s_szc == szc || segvn_lpg_disable != 0) {
6107                 return (0);