--- old/usr/src/uts/common/exec/elf/elf.c	2015-11-25 13:59:35.516829104 -0500
+++ new/usr/src/uts/common/exec/elf/elf.c	2015-11-25 13:59:35.524877805 -0500
@@ -1752,7 +1752,7 @@
 	ASSERT(p == ttoproc(curthread));
 	prstop(0, 0);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	nphdrs = prnsegs(as, 0) + 2;		/* two CORE note sections */
 
 	/*
@@ -1763,7 +1763,7 @@
 		(void) process_scns(content, p, credp, NULL, NULL, NULL, 0,
 		    NULL, &nshdrs);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT(nshdrs == 0 || nshdrs > 1);
 
@@ -1879,7 +1879,7 @@
 
 	mutex_exit(&p->p_lock);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	i = 2;
 	for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) {
 		caddr_t eaddr = seg->s_base + pr_getsegsize(seg, 0);
@@ -1979,7 +1979,7 @@
 		}
 		ASSERT(tmp == NULL);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	if (overflow || i != nphdrs) {
 		if (ntries++ == 0) {
@@ -2128,14 +2128,14 @@
 			bigwad->shdr[0].sh_info = nphdrs;
 
 		if (nshdrs > 1) {
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			if ((error = process_scns(content, p, credp, vp,
 			    &bigwad->shdr[0], nshdrs, rlimit, &doffset,
 			    NULL)) != 0) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				goto done;
 			}
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		}
 
 		if ((error = core_write(vp, UIO_SYSSPACE, soffset,
--- old/usr/src/uts/common/fs/doorfs/door_sys.c	2015-11-25 13:59:35.682932142 -0500
+++ new/usr/src/uts/common/fs/doorfs/door_sys.c	2015-11-25 13:59:35.686693799 -0500
@@ -3020,9 +3020,9 @@
 		pfn_t	pfnum;
 
 		/* MMU mapping is already locked down */
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		pfnum = hat_getpfnum(as->a_hat, rdest);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 
 		/*
 		 * TODO: The pfn step should not be necessary - need
--- old/usr/src/uts/common/fs/proc/prcontrol.c	2015-11-25 13:59:35.866017104 -0500
+++ new/usr/src/uts/common/fs/proc/prcontrol.c	2015-11-25 13:59:35.869790498 -0500
@@ -2513,7 +2513,7 @@
 			tree = &as->a_wpage;
 
 		mutex_exit(&p->p_lock);
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 
 		for (pwp = avl_first(tree); pwp != NULL;
 		    pwp = AVL_NEXT(tree, pwp)) {
@@ -2528,7 +2528,7 @@
 			}
 		}
 
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		mutex_enter(&p->p_lock);
 	}
 
--- old/usr/src/uts/common/fs/proc/prioctl.c	2015-11-25 13:59:36.128079245 -0500
+++ new/usr/src/uts/common/fs/proc/prioctl.c	2015-11-25 13:59:36.131797300 -0500
@@ -962,9 +962,9 @@
 			n = 0;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			n = prnsegs(as, 0);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		prunlock(pnp);
@@ -983,9 +983,9 @@
 			prunlock(pnp);
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			error = oprgetmap(p, &iolhead);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 			prunlock(pnp);
 
@@ -1657,11 +1657,11 @@
 			psp->pr_pctmem = 0;
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			psp->pr_size = (size32_t)btopr(as->a_resvsize);
 			psp->pr_rssize = (size32_t)rm_asrss(as);
 			psp->pr_pctmem = rm_pctmemory(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 	}
@@ -2589,9 +2589,9 @@
 			n = 0;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			n = prnsegs(as, 0);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		prunlock(pnp);
@@ -2613,9 +2613,9 @@
 			prunlock(pnp);
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			error = oprgetmap32(p, &iolhead);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 			prunlock(pnp);
 
@@ -3142,7 +3142,7 @@
 		 * change because it is marked P_PR_LOCK.
 		 */
 		mutex_exit(&p->p_lock);
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		seg = as_segat(as, va);
 		if (seg != NULL &&
 		    seg->s_ops == &segvn_ops &&
@@ -3153,7 +3153,7 @@
 		} else {
 			error = EINVAL;
 		}
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		mutex_enter(&p->p_lock);
 	} else if ((xvp = p->p_exec) == NULL) {
 		error = EINVAL;
@@ -3496,11 +3496,11 @@
 			psp->pr_pctmem = 0;
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			psp->pr_size = btopr(as->a_resvsize);
 			psp->pr_rssize = rm_asrss(as);
 			psp->pr_pctmem = rm_pctmemory(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 	}
@@ -3523,7 +3523,7 @@
 	struct seg *brkseg, *stkseg;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
@@ -3583,7 +3583,7 @@
 	struct seg *brkseg, *stkseg;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
@@ -3643,7 +3643,7 @@
 	struct seg *seg;
 	size_t size;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	if ((seg = AS_SEGFIRST(as)) == NULL)
 		return (0);
@@ -3673,7 +3673,7 @@
 	struct seg *seg;
 	size_t size;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	if ((seg = AS_SEGFIRST(as)) == NULL)
 		return (0);
@@ -3711,15 +3711,15 @@
 	int error;
 
 again:
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if ((seg = AS_SEGFIRST(as)) == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (0);
 	}
 	size = oprpdsize(as);
 	if (uiop->uio_resid < size) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (E2BIG);
 	}
 
@@ -3765,7 +3765,7 @@
 			 */
 			if (next > (uintptr_t)buf + size) {
 				pr_getprot_done(&tmp);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 
 				kmem_free(buf, size);
 
@@ -3797,7 +3797,7 @@
 		ASSERT(tmp == NULL);
 	} while ((seg = AS_SEGNEXT(as, seg)) != NULL);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT((uintptr_t)pmp <= (uintptr_t)buf + size);
 	error = uiomove(buf, (caddr_t)pmp - buf, UIO_READ, uiop);
@@ -3818,15 +3818,15 @@
 	int error;
 
 again:
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if ((seg = AS_SEGFIRST(as)) == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (0);
 	}
 	size = oprpdsize32(as);
 	if (uiop->uio_resid < size) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (E2BIG);
 	}
 
@@ -3872,7 +3872,7 @@
 			 */
 			if (next > (uintptr_t)buf + size) {
 				pr_getprot_done(&tmp);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 
 				kmem_free(buf, size);
 
@@ -3904,7 +3904,7 @@
 		ASSERT(tmp == NULL);
 	} while ((seg = AS_SEGNEXT(as, seg)) != NULL);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT((uintptr_t)pmp == (uintptr_t)buf + size);
 	error = uiomove(buf, (caddr_t)pmp - buf, UIO_READ, uiop);
--- old/usr/src/uts/common/fs/proc/prsubr.c	2015-11-25 13:59:36.334662663 -0500
+++ new/usr/src/uts/common/fs/proc/prsubr.c	2015-11-25 13:59:36.338451163 -0500
@@ -1376,7 +1376,7 @@
 	int n = 0;
 	struct seg *seg;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) {
 		caddr_t eaddr = seg->s_base + pr_getsegsize(seg, reserved);
@@ -1619,7 +1619,7 @@
 	struct vattr vattr;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
@@ -1730,7 +1730,7 @@
 	struct vattr vattr;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
@@ -1840,7 +1840,7 @@
 	struct seg *seg;
 	size_t size;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	if ((seg = AS_SEGFIRST(as)) == NULL)
 		return (0);
@@ -1870,7 +1870,7 @@
 	struct seg *seg;
 	size_t size;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	if ((seg = AS_SEGFIRST(as)) == NULL)
 		return (0);
@@ -1909,15 +1909,15 @@
 	int error;
 
 again:
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if ((seg = AS_SEGFIRST(as)) == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (0);
 	}
 	size = prpdsize(as);
 	if (uiop->uio_resid < size) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (E2BIG);
 	}
 
@@ -1965,7 +1965,7 @@
 			 */
 			if (next > (uintptr_t)buf + size) {
 				pr_getprot_done(&tmp);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 
 				kmem_free(buf, size);
 
@@ -2034,7 +2034,7 @@
 		ASSERT(tmp == NULL);
 	} while ((seg = AS_SEGNEXT(as, seg)) != NULL);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT((uintptr_t)pmp <= (uintptr_t)buf + size);
 	error = uiomove(buf, (caddr_t)pmp - buf, UIO_READ, uiop);
@@ -2056,15 +2056,15 @@
 	int error;
 
 again:
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if ((seg = AS_SEGFIRST(as)) == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (0);
 	}
 	size = prpdsize32(as);
 	if (uiop->uio_resid < size) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (E2BIG);
 	}
 
@@ -2112,7 +2112,7 @@
 			 */
 			if (next > (uintptr_t)buf + size) {
 				pr_getprot_done(&tmp);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 
 				kmem_free(buf, size);
 
@@ -2181,7 +2181,7 @@
 		ASSERT(tmp == NULL);
 	} while ((seg = AS_SEGNEXT(as, seg)) != NULL);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT((uintptr_t)pmp <= (uintptr_t)buf + size);
 	error = uiomove(buf, (caddr_t)pmp - buf, UIO_READ, uiop);
@@ -2336,12 +2336,12 @@
 			psp->pr_rssize = 0;
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			psp->pr_size = btopr(as->a_resvsize) *
 			    (PAGESIZE / 1024);
 			psp->pr_rssize = rm_asrss(as) * (PAGESIZE / 1024);
 			psp->pr_pctmem = rm_pctmemory(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 	}
@@ -2469,13 +2469,13 @@
 			psp->pr_rssize = 0;
 		} else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			psp->pr_size = (size32_t)
 			    (btopr(as->a_resvsize) * (PAGESIZE / 1024));
 			psp->pr_rssize = (size32_t)
 			    (rm_asrss(as) * (PAGESIZE / 1024));
 			psp->pr_pctmem = rm_pctmemory(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 	}
@@ -3313,7 +3313,7 @@
 		return;
 
 	ASSERT(MUTEX_NOT_HELD(&curproc->p_lock));
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	pwp = avl_first(&as->a_wpage);
 
@@ -3342,7 +3342,7 @@
 	avl_destroy(&as->a_wpage);
 	p->p_wprot = NULL;
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 }
 
 /*
@@ -3376,7 +3376,7 @@
 		newpwp = pwp;
 	}
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	/*
 	 * Search for an existing watched page to contain the watched area.
@@ -3391,7 +3391,7 @@
 
 again:
 	if (avl_numnodes(pwp_tree) > prnwatch) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		while (newpwp != NULL) {
 			pwp = newpwp->wp_list;
 			kmem_free(newpwp, sizeof (struct watched_page));
@@ -3464,7 +3464,7 @@
 	if ((vaddr = pwp->wp_vaddr + PAGESIZE) < eaddr)
 		goto again;
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	/*
 	 * Free any pages we may have over-allocated
@@ -3491,7 +3491,7 @@
 	avl_tree_t *tree;
 	avl_index_t where;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if (p->p_flag & SVFWAIT)
 		tree = &p->p_wpage;
@@ -3556,7 +3556,7 @@
 		pwp = AVL_NEXT(tree, pwp);
 	}
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 }
 
 /*
@@ -3568,7 +3568,7 @@
 	struct watched_page *pwp;
 	struct watched_page tpw;
 
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 
 	tpw.wp_vaddr = (caddr_t)((uintptr_t)addr & (uintptr_t)PAGEMASK);
 	if ((pwp = avl_find(&as->a_wpage, &tpw, NULL)) != NULL)
@@ -3855,7 +3855,7 @@
 
 	s.data = seg->s_data;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	ASSERT(saddr >= seg->s_base && saddr < eaddr);
 	ASSERT(eaddr <= seg->s_base + seg->s_size);
 
@@ -3969,7 +3969,7 @@
 {
 	ssize_t pagesize, hatsize;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg->s_as));
 	ASSERT(IS_P2ALIGNED(saddr, PAGESIZE));
 	ASSERT(IS_P2ALIGNED(eaddr, PAGESIZE));
 	ASSERT(saddr < eaddr);
@@ -4009,7 +4009,7 @@
 	struct vattr vattr;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
@@ -4193,7 +4193,7 @@
 	struct vattr vattr;
 	uint_t prot;
 
-	ASSERT(as != &kas && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as != &kas && AS_WRITE_HELD(as));
 
 	/*
 	 * Request an initial buffer size that doesn't waste memory
--- old/usr/src/uts/common/fs/proc/prvnops.c	2015-11-25 13:59:36.551642683 -0500
+++ new/usr/src/uts/common/fs/proc/prvnops.c	2015-11-25 13:59:36.555566444 -0500
@@ -889,7 +889,7 @@
 		return (0);
 	}
 
-	if (!AS_LOCK_TRYENTER(as, &as->a_lock, RW_WRITER)) {
+	if (!AS_LOCK_TRYENTER(as, RW_WRITER)) {
 		prunlock(pnp);
 		delay(1);
 		goto readmap_common;
@@ -908,7 +908,7 @@
 		break;
 	}
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	mutex_enter(&p->p_lock);
 	prunlock(pnp);
 
@@ -2005,7 +2005,7 @@
 		return (EOVERFLOW);
 	}
 
-	if (!AS_LOCK_TRYENTER(as, &as->a_lock, RW_WRITER)) {
+	if (!AS_LOCK_TRYENTER(as, RW_WRITER)) {
 		prunlock(pnp);
 		delay(1);
 		goto readmap32_common;
@@ -2023,7 +2023,7 @@
 		error = prgetmap32(p, 0, &iolhead);
 		break;
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	mutex_enter(&p->p_lock);
 	prunlock(pnp);
 
@@ -2930,11 +2930,11 @@
 			vap->va_size = 2 * PRSDSIZE;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			if (as->a_updatedir)
 				rebuild_objdir(as);
 			vap->va_size = (as->a_sizedir + 2) * PRSDSIZE;
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		vap->va_nlink = 2;
@@ -2944,12 +2944,12 @@
 			vap->va_size = (P_FINFO(p)->fi_nfiles + 4) * PRSDSIZE;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			if (as->a_updatedir)
 				rebuild_objdir(as);
 			vap->va_size = (as->a_sizedir + 4 +
 			    P_FINFO(p)->fi_nfiles) * PRSDSIZE;
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		vap->va_nlink = 2;
@@ -3015,7 +3015,7 @@
 			vap->va_size = 0;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			if (type == PR_MAP)
 				vap->va_mtime = as->a_updatetime;
 			if (type == PR_XMAP)
@@ -3024,7 +3024,7 @@
 			else
 				vap->va_size = prnsegs(as, type == PR_RMAP) *
 				    PR_OBJSIZE(prmap32_t, prmap_t);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		break;
@@ -3073,14 +3073,14 @@
 			 * change while the process is marked P_PR_LOCK.
 			 */
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 #ifdef _LP64
 			vap->va_size = iam32bit?
 			    prpdsize32(as) : prpdsize(as);
 #else
 			vap->va_size = prpdsize(as);
 #endif
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		break;
@@ -3089,14 +3089,14 @@
 			vap->va_size = 0;
 		else {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 #ifdef _LP64
 			vap->va_size = iam32bit?
 			    oprpdsize32(as) : oprpdsize(as);
 #else
 			vap->va_size = oprpdsize(as);
 #endif
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		break;
@@ -3693,7 +3693,7 @@
 	 * will not change because it is marked P_PR_LOCK.
 	 */
 	mutex_exit(&p->p_lock);
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	if ((seg = AS_SEGFIRST(as)) == NULL) {
 		vp = NULL;
 		goto out;
@@ -3726,7 +3726,7 @@
 	if (vp != NULL) {
 		VN_HOLD(vp);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	mutex_enter(&p->p_lock);
 	prunlock(dpnp);
 
@@ -4150,7 +4150,7 @@
 				type = NAME_OBJECT;
 			}
 		} else {
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			if ((seg = AS_SEGFIRST(as)) != NULL) {
 				do {
 					/*
@@ -4184,7 +4184,7 @@
 				type = NAME_OBJECT;
 			}
 
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		}
 	}
 
@@ -4838,7 +4838,7 @@
 	int i, j;
 	ulong_t nold, nnew;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	if (as->a_updatedir == 0 && as->a_objectdir != NULL)
 		return;
@@ -4943,7 +4943,7 @@
 static vnode_t *
 obj_entry(struct as *as, int slot)
 {
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 	if (as->a_objectdir == NULL)
 		return (NULL);
 	ASSERT(slot < as->a_sizedir);
@@ -5007,7 +5007,7 @@
 		 * space via mmap/munmap calls.
 		 */
 		if (as != NULL) {
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			if (as->a_updatedir)
 				rebuild_objdir(as);
 			objdirsize = as->a_sizedir;
@@ -5025,7 +5025,7 @@
 		}
 
 		if (as != NULL)
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 
 		/*
 		 * Stop when all objects have been reported.
@@ -5299,11 +5299,11 @@
 		as = NULL;
 		objdirsize = 0;
 	} else {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 		if (as->a_updatedir)
 			rebuild_objdir(as);
 		objdirsize = as->a_sizedir;
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		as = NULL;
 	}
 
@@ -5363,7 +5363,7 @@
 			 */
 			if (as == NULL) {
 				as = p->p_as;
-				AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+				AS_LOCK_ENTER(as, RW_WRITER);
 			}
 
 			if (as->a_updatedir) {
@@ -5401,11 +5401,11 @@
 		 * Drop the address space lock to do the uiomove().
 		 */
 		if (as != NULL)
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 
 		error = uiomove((caddr_t)dirent, reclen, UIO_READ, uiop);
 		if (as != NULL)
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 
 		if (error)
 			break;
@@ -5417,7 +5417,7 @@
 	if (fip != NULL)
 		mutex_exit(&fip->fi_lock);
 	if (as != NULL)
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	mutex_enter(&p->p_lock);
 	prunlock(pnp);
 	return (error);
--- old/usr/src/uts/common/fs/ufs/ufs_vnops.c	2015-11-25 13:59:36.804847315 -0500
+++ new/usr/src/uts/common/fs/ufs/ufs_vnops.c	2015-11-25 13:59:36.808960310 -0500
@@ -5653,7 +5653,7 @@
 	 * deadlock between ufs_read/ufs_map/pagefault when a quiesce is
 	 * pending.
 	 */
-	while (!AS_LOCK_TRYENTER(as, &as->a_lock, RW_WRITER)) {
+	while (!AS_LOCK_TRYENTER(as, RW_WRITER)) {
 		ufs_map_alock_retry_cnt++;
 		delay(RETRY_LOCK_DELAY);
 	}
@@ -5669,7 +5669,7 @@
 		 * as->a_lock and wait for ulp->ul_fs_lock status to change.
 		 */
 		ufs_map_lockfs_retry_cnt++;
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		as_rangeunlock(as);
 		if (error == EIO)
 			goto out;
--- old/usr/src/uts/common/io/mem.c	2015-11-25 13:59:37.055110910 -0500
+++ new/usr/src/uts/common/io/mem.c	2015-11-25 13:59:37.058982504 -0500
@@ -288,10 +288,10 @@
 	struct seg *seg;
 	int i;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	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, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	return (i);
 }
@@ -496,7 +496,7 @@
 		as = p->p_as;
 		if (as == mem_vtop.m_as) {
 			mutex_exit(&p->p_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			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 -
@@ -504,7 +504,7 @@
 					break;
 			if (seg != NULL)
 				pfn = hat_getpfnum(as->a_hat, mem_vtop.m_va);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			mutex_enter(&p->p_lock);
 		}
 		sprunlock(p);
--- old/usr/src/uts/common/io/physmem.c	2015-11-25 13:59:37.185583941 -0500
+++ new/usr/src/uts/common/io/physmem.c	2015-11-25 13:59:37.189414156 -0500
@@ -647,7 +647,7 @@
 	page_t *pp;
 
 	ASSERT(len == PAGESIZE);
-	ASSERT(AS_READ_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_READ_HELD(seg->s_as));
 
 	/*
 	 * If the page is in the hash, then we successfully claimed this
--- old/usr/src/uts/common/os/dumpsubr.c	2015-11-25 13:59:37.314734989 -0500
+++ new/usr/src/uts/common/os/dumpsubr.c	2015-11-25 13:59:37.318537867 -0500
@@ -1407,7 +1407,7 @@
 {
 	struct seg *seg;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	for (seg = AS_SEGFIRST(as); seg; seg = AS_SEGNEXT(as, seg)) {
 		if (seg->s_as != as)
 			break;
@@ -1415,7 +1415,7 @@
 			continue;
 		SEGOP_DUMP(seg);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	if (seg != NULL)
 		cmn_err(CE_WARN, "invalid segment %p in address space %p",
--- old/usr/src/uts/common/os/exec.c	2015-11-25 13:59:37.491567097 -0500
+++ new/usr/src/uts/common/os/exec.c	2015-11-25 13:59:37.495466664 -0500
@@ -1273,12 +1273,12 @@
 			 * other return values from as_setprot.
 			 */
 
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			seg = as_segat(curproc->p_as, (caddr_t)end);
 			if (seg != NULL)
 				SEGOP_GETPROT(seg, (caddr_t)end, zfoddiff - 1,
 				    &zprot);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 
 			if (seg != NULL && (zprot & PROT_WRITE) == 0) {
 				if (as_setprot(as, (caddr_t)end, zfoddiff - 1,
--- old/usr/src/uts/common/os/fork.c	2015-11-25 13:59:37.646239006 -0500
+++ new/usr/src/uts/common/os/fork.c	2015-11-25 13:59:37.650254306 -0500
@@ -231,13 +231,13 @@
 		 */
 		as = p->p_as;
 		if (avl_numnodes(&as->a_wpage) != 0) {
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			as_clearwatch(as);
 			p->p_wpage = as->a_wpage;
 			avl_create(&as->a_wpage, wp_compare,
 			    sizeof (struct watched_page),
 			    offsetof(struct watched_page, wp_link));
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		}
 		cp->p_as = as;
 		cp->p_flag |= SVFORK;
@@ -592,13 +592,13 @@
 		if (avl_numnodes(&p->p_wpage) != 0) {
 			/* restore watchpoints to parent */
 			as = p->p_as;
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 			as->a_wpage = p->p_wpage;
 			avl_create(&p->p_wpage, wp_compare,
 			    sizeof (struct watched_page),
 			    offsetof(struct watched_page, wp_link));
 			as_setwatch(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		}
 	} else {
 		if (cp->p_segacct)
@@ -1450,9 +1450,9 @@
 	/* restore watchpoints to parent */
 	if (pr_watch_active(pp)) {
 		struct as *as = pp->p_as;
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 		as_setwatch(as);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 
 	mutex_enter(&pp->p_lock);
--- old/usr/src/uts/common/os/mmapobj.c	2015-11-25 13:59:37.790613326 -0500
+++ new/usr/src/uts/common/os/mmapobj.c	2015-11-25 13:59:37.794228714 -0500
@@ -1484,7 +1484,7 @@
 			 * segdev and the type is neither MAP_SHARED
 			 * nor MAP_PRIVATE.
 			 */
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			seg = as_findseg(as, myaddr, 0);
 			MOBJ_STAT_ADD(exec_addr_mapped);
 			if (seg && seg->s_ops == &segdev_ops &&
@@ -1494,7 +1494,7 @@
 			    myaddr + mylen <=
 			    seg->s_base + seg->s_size) {
 				MOBJ_STAT_ADD(exec_addr_devnull);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				(void) as_unmap(as, myaddr, mylen);
 				ret = as_map(as, myaddr, mylen, segvn_create,
 				    &crargs);
@@ -1507,7 +1507,7 @@
 					return (ret);
 				}
 			} else {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				as_rangeunlock(as);
 				mmapobj_unmap_exec(mrp, i, start_addr);
 				MOBJ_STAT_ADD(exec_addr_in_use);
--- old/usr/src/uts/common/os/move.c	2015-11-25 13:59:37.954624794 -0500
+++ new/usr/src/uts/common/os/move.c	2015-11-25 13:59:37.958573133 -0500
@@ -662,12 +662,12 @@
 			}
 			locked->uioa_ppp = (void **)pfnp;
 			locked->uioa_pfncnt = pcnt;
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			while (pcnt-- > 0) {
 				*pfnp++ = hat_getpfnum(as->a_hat, addr);
 				addr += PAGESIZE;
 			}
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		} else {
 			/* Have a page_t list, save it */
 			locked->uioa_ppp = (void **)pages;
--- old/usr/src/uts/common/os/sunddi.c	2015-11-25 13:59:38.083980614 -0500
+++ new/usr/src/uts/common/os/sunddi.c	2015-11-25 13:59:38.088118918 -0500
@@ -8370,7 +8370,7 @@
 	if (flags & DDI_UMEMLOCK_LONGTERM) {
 		extern  struct seg_ops segspt_shmops;
 		extern	struct seg_ops segdev_ops;
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		for (seg = as_segat(as, addr); ; seg = AS_SEGNEXT(as, seg)) {
 			if (seg == NULL || seg->s_base > addr + len)
 				break;
@@ -8383,14 +8383,14 @@
 			    (SEGOP_GETTYPE(seg, addr) & MAP_SHARED))) {
 				as_pageunlock(as, p->pparray,
 				    addr, len, p->s_flags);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				umem_decr_devlockmem(p);
 				kmem_free(p, sizeof (struct ddi_umem_cookie));
 				*cookie = (ddi_umem_cookie_t)NULL;
 				return (EFAULT);
 			}
 		}
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 
 
--- old/usr/src/uts/common/os/urw.c	2015-11-25 13:59:38.411735460 -0500
+++ new/usr/src/uts/common/os/urw.c	2015-11-25 13:59:38.415378667 -0500
@@ -202,11 +202,11 @@
 	 */
 	page = (caddr_t)(uintptr_t)((uintptr_t)addr & PAGEMASK);
 	retrycnt = 0;
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 retry:
 	if ((seg = as_segat(as, page)) == NULL ||
 	    !page_valid(seg, page)) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENXIO);
 	}
 	SEGOP_GETPROT(seg, page, 0, &prot);
@@ -224,7 +224,7 @@
 		}
 
 		if (err != 0) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (ENXIO);
 		}
 	}
@@ -247,7 +247,7 @@
 	if (SEGOP_FAULT(as->a_hat, seg, page, PAGESIZE, F_SOFTLOCK, rw)) {
 		if (protchanged)
 			(void) SEGOP_SETPROT(seg, page, PAGESIZE, prot);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENXIO);
 	}
 	CPU_STATS_ADD_K(vm, softlock, 1);
@@ -308,7 +308,7 @@
 	if (protchanged)
 		(void) SEGOP_SETPROT(seg, page, PAGESIZE, prot);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	return (error);
 }
--- old/usr/src/uts/common/os/vm_subr.c	2015-11-25 13:59:38.526868129 -0500
+++ new/usr/src/uts/common/os/vm_subr.c	2015-11-25 13:59:38.530468406 -0500
@@ -364,11 +364,11 @@
 
 	*lenp = 0;
 	if (cow) {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 		seg = as_findseg(as, uaddr, 0);
 		if ((seg == NULL) || ((base = seg->s_base) > uaddr) ||
 		    (uaddr + total) > base + seg->s_size) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (EINVAL);
 		}
 		/*
@@ -376,10 +376,10 @@
 		 * But to be safe, we check against segvn.
 		 */
 		if (seg->s_ops != &segvn_ops) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (ENOTSUP);
 		} else if ((SEGOP_GETTYPE(seg, uaddr) & MAP_PRIVATE) == 0) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (ENOTSUP);
 		}
 	}
@@ -484,7 +484,7 @@
 		++i;
 	}
 	if (cow) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 	if (first && res == FC_NOMAP) {
 		/*
@@ -502,7 +502,7 @@
 		size = total;
 		res = as_fault(as->a_hat, as, uaddr, size, F_INVAL, S_READ);
 		if (cow)
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 		goto tryagain;
 	}
 	switch (res) {
--- old/usr/src/uts/common/os/watchpoint.c	2015-11-25 13:59:38.649341870 -0500
+++ new/usr/src/uts/common/os/watchpoint.c	2015-11-25 13:59:38.653351191 -0500
@@ -196,7 +196,7 @@
 	 */
 
 	mutex_enter(&p->p_maplock);
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 
 	tpw.wp_vaddr = (caddr_t)((uintptr_t)addr & (uintptr_t)PAGEMASK);
 	if ((pwp = avl_find(&as->a_wpage, &tpw, &where)) == NULL)
@@ -235,7 +235,7 @@
 				 * Release as lock while in holdwatch()
 				 * in case other threads need to grab it.
 				 */
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				mutex_exit(&p->p_maplock);
 				if (holdwatch() != 0) {
 					/*
@@ -246,7 +246,7 @@
 					goto startover;
 				}
 				mutex_enter(&p->p_maplock);
-				AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+				AS_LOCK_ENTER(as, RW_READER);
 			}
 			p->p_mapcnt++;
 		}
@@ -306,8 +306,8 @@
 			uint_t oprot;
 			int err, retrycnt = 0;
 
-			AS_LOCK_EXIT(as, &as->a_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_EXIT(as);
+			AS_LOCK_ENTER(as, RW_WRITER);
 		retry:
 			seg = as_segat(as, addr);
 			ASSERT(seg != NULL);
@@ -320,9 +320,9 @@
 					goto retry;
 				}
 			}
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		} else
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 
 		/*
 		 * When all pages are mapped back to their normal state,
@@ -340,10 +340,10 @@
 			}
 		}
 
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 	}
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	mutex_exit(&p->p_maplock);
 
 	return (rv);
@@ -394,7 +394,7 @@
 
 	ASSERT(MUTEX_NOT_HELD(&curproc->p_lock));
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	pwp = p->p_wprot;
 	while (pwp != NULL) {
@@ -431,7 +431,7 @@
 	}
 	p->p_wprot = NULL;
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 }
 
 
@@ -505,9 +505,9 @@
 		return (0);
 
 	/* Grab the lock because of XHAT (see comment in pr_mappage()) */
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	rv = pr_is_watchpage_as(addr, rw, as);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	return (rv);
 }
--- old/usr/src/uts/common/os/zone.c	2015-11-25 13:59:38.805412256 -0500
+++ new/usr/src/uts/common/os/zone.c	2015-11-25 13:59:38.809577847 -0500
@@ -5609,7 +5609,7 @@
 	int allow = 1;
 
 	ASSERT(pp->p_as != &kas);
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) {
 
 		/*
@@ -5632,7 +5632,7 @@
 			break;
 		}
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (allow);
 }
 
@@ -5648,7 +5648,7 @@
 	size_t swap = 0;
 
 	ASSERT(pp->p_as != &kas);
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg))
 		swap += seg_swresv(seg);
 
@@ -5853,7 +5853,7 @@
 	 * memory and reserve swap via MCL_FUTURE and MAP_NORESERVE
 	 * segments respectively.
 	 */
-	AS_LOCK_ENTER(pp->as, &pp->p_as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(pp->p_as, RW_WRITER);
 	swap = as_swresv();
 	mutex_enter(&pp->p_lock);
 	zone_proj0 = zone->zone_zsched->p_task->tk_proj;
@@ -5900,7 +5900,7 @@
 	pp->p_flag |= SZONETOP;
 	pp->p_zone = zone;
 	mutex_exit(&pp->p_lock);
-	AS_LOCK_EXIT(pp->p_as, &pp->p_as->a_lock);
+	AS_LOCK_EXIT(pp->p_as);
 
 	/*
 	 * Joining the zone cannot fail from now on.
--- old/usr/src/uts/common/syscall/lgrpsys.c	2015-11-25 13:59:39.065085081 -0500
+++ new/usr/src/uts/common/syscall/lgrpsys.c	2015-11-25 13:59:39.068932797 -0500
@@ -190,7 +190,7 @@
 		/* get the corresponding memory info for each virtual address */
 		as = curproc->p_as;
 
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		hat = as->a_hat;
 		for (i = out_idx = 0; i < addr_count; i++, out_idx +=
 		    info_count) {
@@ -286,7 +286,7 @@
 				}
 			}
 		}
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 
 	/* copy out the results and validity bits and free the buffers */
--- old/usr/src/uts/common/syscall/rlimit.c	2015-11-25 13:59:39.218754520 -0500
+++ new/usr/src/uts/common/syscall/rlimit.c	2015-11-25 13:59:39.222429455 -0500
@@ -141,7 +141,7 @@
 		 */
 		retval = (long)brkend;
 
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		for (seg = as_findseg(as, brkend, 0); seg != NULL;
 		    seg = AS_SEGNEXT(as, seg)) {
 			if (seg->s_base >= brkend) {
@@ -212,7 +212,7 @@
 				    (size_t)(brkendpg + size));
 		}
 
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 
 		/* truncate to same boundary as sbrk */
 
--- old/usr/src/uts/common/syscall/utssys.c	2015-11-25 13:59:39.337422959 -0500
+++ new/usr/src/uts/common/syscall/utssys.c	2015-11-25 13:59:39.341046382 -0500
@@ -534,7 +534,7 @@
 			struct seg	*seg;
 			struct as	*as = prp->p_as;
 
-			AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+			AS_LOCK_ENTER(as, RW_READER);
 			for (seg = AS_SEGFIRST(as); seg;
 			    seg = AS_SEGNEXT(as, seg)) {
 				/*
@@ -598,7 +598,7 @@
 					break;
 				}
 			}
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 		}
 
 		if (use_flag) {
--- old/usr/src/uts/common/vm/as.h	2015-11-25 13:59:39.466177303 -0500
+++ new/usr/src/uts/common/vm/as.h	2015-11-25 13:59:39.469855176 -0500
@@ -240,19 +240,19 @@
  * in rwlock.c for more information on the semantics of and motivation behind
  * RW_READER_STARVEWRITER.)
  */
-#define	AS_LOCK_ENTER(as, lock, type)		rw_enter((lock), \
+#define	AS_LOCK_ENTER(as, type)		rw_enter(&(as)->a_lock, \
 	(type) == RW_READER ? RW_READER_STARVEWRITER : (type))
-#define	AS_LOCK_EXIT(as, lock)			rw_exit((lock))
-#define	AS_LOCK_DESTROY(as, lock)		rw_destroy((lock))
-#define	AS_LOCK_TRYENTER(as, lock, type)	rw_tryenter((lock), \
+#define	AS_LOCK_EXIT(as)		rw_exit(&(as)->a_lock)
+#define	AS_LOCK_DESTROY(as)		rw_destroy(&(as)->a_lock)
+#define	AS_LOCK_TRYENTER(as, type)	rw_tryenter(&(as)->a_lock, \
 	(type) == RW_READER ? RW_READER_STARVEWRITER : (type))
 
 /*
  * Macros to test lock states.
  */
-#define	AS_LOCK_HELD(as, lock)		RW_LOCK_HELD((lock))
-#define	AS_READ_HELD(as, lock)		RW_READ_HELD((lock))
-#define	AS_WRITE_HELD(as, lock)		RW_WRITE_HELD((lock))
+#define	AS_LOCK_HELD(as)		RW_LOCK_HELD(&(as)->a_lock)
+#define	AS_READ_HELD(as)		RW_READ_HELD(&(as)->a_lock)
+#define	AS_WRITE_HELD(as)		RW_WRITE_HELD(&(as)->a_lock)
 
 /*
  * macros to walk thru segment lists
--- old/usr/src/uts/common/vm/seg_dev.c	2015-11-25 13:59:39.583635888 -0500
+++ new/usr/src/uts/common/vm/seg_dev.c	2015-11-25 13:59:39.587652537 -0500
@@ -368,7 +368,7 @@
 	 * Since the address space is "write" locked, we
 	 * don't need the segment lock to protect "segdev" data.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	hat_map(seg->s_as->a_hat, seg->s_base, seg->s_size, HAT_MAP);
 
@@ -474,7 +474,7 @@
 	 * Since the address space is "write" locked, we
 	 * don't need the segment lock to protect "segdev" data.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	newsdp = sdp_alloc();
 
@@ -646,7 +646,7 @@
 	 * Since the address space is "write" locked, we
 	 * don't need the segment lock to protect "segdev" data.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	if ((sz = sdp->softlockcnt) > 0) {
 		/*
@@ -1135,7 +1135,7 @@
 	 * Since the address space is "write" locked, we
 	 * don't need the segment lock to protect "segdev" data.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	while (dhp != NULL)
 		dhp = devmap_handle_unmap(dhp);
@@ -1617,7 +1617,7 @@
 	    "addr %p len %lx type %x\n",
 	    (void *)dhp_head, (void *)seg, (void *)addr, len, type));
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/* Handle non-devmap case */
 	if (dhp_head == NULL)
@@ -2057,7 +2057,7 @@
 {
 	TRACE_2(TR_FAC_DEVMAP, TR_DEVMAP_FAULTA,
 	    "segdev_faulta: seg=%p addr=%p", (void *)seg, (void *)addr);
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (0);
 }
@@ -2075,7 +2075,7 @@
 	TRACE_4(TR_FAC_DEVMAP, TR_DEVMAP_SETPROT,
 	    "segdev_setprot:start seg=%p addr=%p len=%lx prot=%x",
 	    (void *)seg, (void *)addr, len, prot);
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if ((sz = sdp->softlockcnt) > 0 && dhp_head != NULL) {
 		/*
@@ -2198,7 +2198,7 @@
 	TRACE_4(TR_FAC_DEVMAP, TR_DEVMAP_CHECKPROT,
 	    "segdev_checkprot:start seg=%p addr=%p len=%lx prot=%x",
 	    (void *)seg, (void *)addr, len, prot);
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * If segment protection can be used, simply check against them
@@ -2235,7 +2235,7 @@
 	TRACE_4(TR_FAC_DEVMAP, TR_DEVMAP_GETPROT,
 	    "segdev_getprot:start seg=%p addr=%p len=%lx protv=%p",
 	    (void *)seg, (void *)addr, len, (void *)protv);
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1;
 	if (pgno != 0) {
@@ -2266,7 +2266,7 @@
 	TRACE_2(TR_FAC_DEVMAP, TR_DEVMAP_GETOFFSET,
 	    "segdev_getoffset:start seg=%p addr=%p", (void *)seg, (void *)addr);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return ((u_offset_t)sdp->offset + (addr - seg->s_base));
 }
@@ -2280,7 +2280,7 @@
 	TRACE_2(TR_FAC_DEVMAP, TR_DEVMAP_GETTYPE,
 	    "segdev_gettype:start seg=%p addr=%p", (void *)seg, (void *)addr);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (sdp->type);
 }
@@ -2295,7 +2295,7 @@
 	TRACE_2(TR_FAC_DEVMAP, TR_DEVMAP_GETVP,
 	    "segdev_getvp:start seg=%p addr=%p", (void *)seg, (void *)addr);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * Note that this vp is the common_vp of the device, where the
@@ -2325,7 +2325,7 @@
 {
 	TRACE_0(TR_FAC_DEVMAP, TR_DEVMAP_SYNC, "segdev_sync:start");
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (0);
 }
@@ -2341,7 +2341,7 @@
 
 	TRACE_0(TR_FAC_DEVMAP, TR_DEVMAP_INCORE, "segdev_incore:start");
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	for (len = (len + PAGEOFFSET) & PAGEMASK; len; len -= PAGESIZE,
 	    v += PAGESIZE)
@@ -2360,7 +2360,7 @@
 {
 	TRACE_0(TR_FAC_DEVMAP, TR_DEVMAP_LOCKOP, "segdev_lockop:start");
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (0);
 }
@@ -2375,7 +2375,7 @@
 {
 	TRACE_0(TR_FAC_DEVMAP, TR_DEVMAP_ADVISE, "segdev_advise:start");
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (0);
 }
@@ -3080,7 +3080,7 @@
 	 *	the as lock is held. Verify here and return error if drivers
 	 *	inadvertently call devmap_load on a wrong devmap handle.
 	 */
-	if ((asp != &kas) && !AS_LOCK_HELD(asp, &asp->a_lock))
+	if ((asp != &kas) && !AS_LOCK_HELD(asp))
 		return (FC_MAKE_ERR(EINVAL));
 
 	soff = (ssize_t)(offset - dhp->dh_uoff);
--- old/usr/src/uts/common/vm/seg_kpm.c	2015-11-25 13:59:39.790470338 -0500
+++ new/usr/src/uts/common/vm/seg_kpm.c	2015-11-25 13:59:39.794310968 -0500
@@ -210,7 +210,7 @@
 segkpm_fault(struct hat *hat, struct seg *seg, caddr_t addr, size_t len,
 	enum fault_type type, enum seg_rw rw)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	switch (type) {
 	case F_INVAL:
--- old/usr/src/uts/common/vm/seg_map.c	2015-11-25 13:59:39.906456200 -0500
+++ new/usr/src/uts/common/vm/seg_map.c	2015-11-25 13:59:39.919408767 -0500
@@ -853,7 +853,7 @@
 	struct segmap_data *smd = (struct segmap_data *)seg->s_data;
 	size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if (pgno != 0) {
 		do {
--- old/usr/src/uts/common/vm/seg_spt.c	2015-11-25 13:59:40.107871931 -0500
+++ new/usr/src/uts/common/vm/seg_spt.c	2015-11-25 13:59:40.111766347 -0500
@@ -241,7 +241,7 @@
 {
 	struct spt_data *sptd = (struct spt_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	if (sptd != NULL) {
 		if (sptd->spt_realsize)
@@ -263,7 +263,7 @@
 segspt_shmsync(struct seg *seg, caddr_t addr, size_t len, int attr,
 	uint_t flags)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (0);
 }
@@ -278,7 +278,7 @@
 	struct seg	*sptseg;
 	struct spt_data *sptd;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 #ifdef lint
 	seg = seg;
 #endif
@@ -342,7 +342,7 @@
 {
 	size_t share_size;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	/*
 	 * seg.s_size may have been rounded up to the largest page size
@@ -393,7 +393,7 @@
 	 * We are holding the a_lock on the underlying dummy as,
 	 * so we can make calls to the HAT layer.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(sp != NULL);
 
 #ifdef DEBUG
@@ -629,7 +629,7 @@
 	kproject_t	*proj;
 	kshmid_t	*sp;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	len = P2ROUNDUP(len, PAGESIZE);
 
@@ -838,7 +838,7 @@
 	pgcnt_t claim_availrmem = 0;
 	uint_t	szc;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(type == L_PAGELOCK || type == L_PAGEUNLOCK);
 
 	/*
@@ -1193,7 +1193,7 @@
 	struct vnode *vp;
 	u_offset_t off;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(type == L_PAGELOCK || type == L_PAGEUNLOCK);
 
 
@@ -1451,7 +1451,7 @@
 	ASSERT(sptd->spt_pcachecnt != 0);
 	ASSERT(sptd->spt_ppa == pplist);
 	ASSERT(npages == btopr(sptd->spt_amp->size));
-	ASSERT(async || AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(async || AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * Acquire the lock on the dummy seg and destroy the
@@ -1585,7 +1585,7 @@
 	struct anon *ap = NULL;
 	pgcnt_t npages;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	sptseg = shmd->shm_sptseg;
 	sptd = sptseg->s_data;
@@ -1609,9 +1609,9 @@
 	 * underlying dummy as. This is mostly to satisfy the
 	 * underlying HAT layer.
 	 */
-	AS_LOCK_ENTER(sptseg->s_as, &sptseg->s_as->a_lock, RW_READER);
+	AS_LOCK_ENTER(sptseg->s_as, RW_READER);
 	hat_unlock(sptseg->s_as->a_hat, sptseg_addr, len);
-	AS_LOCK_EXIT(sptseg->s_as, &sptseg->s_as->a_lock);
+	AS_LOCK_EXIT(sptseg->s_as);
 
 	amp = sptd->spt_amp;
 	ASSERT(amp != NULL);
@@ -1676,7 +1676,7 @@
 	struct spt_data *sptd;
 	int error = 0;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	shmd = kmem_zalloc((sizeof (*shmd)), KM_NOSLEEP);
 	if (shmd == NULL)
@@ -1735,7 +1735,7 @@
 	struct shm_data *shmd = (struct shm_data *)seg->s_data;
 	int reclaim = 1;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 retry:
 	if (shmd->shm_softlockcnt > 0) {
 		if (reclaim == 1) {
@@ -1769,7 +1769,7 @@
 	struct shm_data *shmd = (struct shm_data *)seg->s_data;
 	struct anon_map *shm_amp = shmd->shm_amp;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	(void) segspt_shmlockop(seg, seg->s_base, shm_amp->size, 0,
 	    MC_UNLOCK, NULL, 0);
@@ -1802,7 +1802,7 @@
 int
 segspt_shmsetprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * Shared page table is more than shared mapping.
@@ -1840,7 +1840,7 @@
 #ifdef lint
 	hat = hat;
 #endif
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * Because of the way spt is implemented
@@ -1909,7 +1909,7 @@
 			}
 			goto dism_err;
 		}
-		AS_LOCK_ENTER(sptseg->s_as, &sptseg->s_as->a_lock, RW_READER);
+		AS_LOCK_ENTER(sptseg->s_as, RW_READER);
 		a = segspt_addr;
 		pidx = 0;
 		if (type == F_SOFTLOCK) {
@@ -1970,7 +1970,7 @@
 				}
 			}
 		}
-		AS_LOCK_EXIT(sptseg->s_as, &sptseg->s_as->a_lock);
+		AS_LOCK_EXIT(sptseg->s_as);
 dism_err:
 		kmem_free(ppa, npages * sizeof (page_t *));
 		return (err);
@@ -2037,7 +2037,7 @@
 	hat = hat;
 #endif
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if (sptd->spt_flags & SHM_PAGEABLE) {
 		return (segspt_dismfault(hat, seg, addr, len, type, rw));
@@ -2169,7 +2169,7 @@
 		 * underlying dummy as. This is mostly to satisfy the
 		 * underlying HAT layer.
 		 */
-		AS_LOCK_ENTER(sptseg->s_as, &sptseg->s_as->a_lock, RW_READER);
+		AS_LOCK_ENTER(sptseg->s_as, RW_READER);
 		a = sptseg_addr;
 		pidx = 0;
 		if (type == F_SOFTLOCK) {
@@ -2214,7 +2214,7 @@
 			for (i = 0; i < npages; i++)
 				page_unlock(ppa[i]);
 		}
-		AS_LOCK_EXIT(sptseg->s_as, &sptseg->s_as->a_lock);
+		AS_LOCK_EXIT(sptseg->s_as);
 
 		kmem_free(ppa, sizeof (page_t *) * npages);
 		return (0);
@@ -2284,7 +2284,7 @@
 	struct spt_data		*sptd = spt_seg->s_data;
 	int			error = 0;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	shmd_new = kmem_zalloc((sizeof (*shmd_new)), KM_SLEEP);
 	newseg->s_data = (void *)shmd_new;
@@ -2326,7 +2326,7 @@
 	struct shm_data *shmd = (struct shm_data *)seg->s_data;
 	struct spt_data *sptd = (struct spt_data *)shmd->shm_sptseg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * ISM segment is always rw.
@@ -2677,7 +2677,7 @@
 	struct proc	*p = curproc;
 	kproject_t	*proj;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(sp != NULL);
 
 	if ((sptd->spt_flags & SHM_PAGEABLE) == 0) {
@@ -2807,7 +2807,7 @@
 	struct spt_data *sptd = (struct spt_data *)shmd->shm_sptseg->s_data;
 	spgcnt_t pgno = seg_page(seg, addr+len) - seg_page(seg, addr) + 1;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * ISM segment is always rw.
@@ -2821,7 +2821,7 @@
 u_offset_t
 segspt_shmgetoffset(struct seg *seg, caddr_t addr)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/* Offset does not matter in ISM memory */
 
@@ -2835,7 +2835,7 @@
 	struct shm_data *shmd = (struct shm_data *)seg->s_data;
 	struct spt_data *sptd = (struct spt_data *)shmd->shm_sptseg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * The shared memory mapping is always MAP_SHARED, SWAP is only
@@ -2852,7 +2852,7 @@
 	struct shm_data *shmd = (struct shm_data *)seg->s_data;
 	struct spt_data *sptd = (struct spt_data *)shmd->shm_sptseg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	*vpp = sptd->spt_vp;
 	return (0);
@@ -2878,7 +2878,7 @@
 	int writer;
 	page_t **ppa;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if (behav == MADV_FREE) {
 		if ((sptd->spt_flags & SHM_PAGEABLE) == 0)
@@ -2912,9 +2912,9 @@
 		 * kicked out of the seg_pcache.  We bump the shm_softlockcnt
 		 * to keep this segment resident.
 		 */
-		writer = AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock);
+		writer = AS_WRITE_HELD(seg->s_as);
 		atomic_inc_ulong((ulong_t *)(&(shmd->shm_softlockcnt)));
-		AS_LOCK_EXIT(seg->s_as, &seg->s_as->a_lock);
+		AS_LOCK_EXIT(seg->s_as);
 
 		mutex_enter(&sptd->spt_lock);
 
@@ -2935,8 +2935,7 @@
 		mutex_exit(&sptd->spt_lock);
 
 		/* Regrab the AS_LOCK and release our hold on the segment */
-		AS_LOCK_ENTER(seg->s_as, &seg->s_as->a_lock,
-		    writer ? RW_WRITER : RW_READER);
+		AS_LOCK_ENTER(seg->s_as, writer ? RW_WRITER : RW_READER);
 		atomic_dec_ulong((ulong_t *)(&(shmd->shm_softlockcnt)));
 		if (shmd->shm_softlockcnt <= 0) {
 			if (AS_ISUNMAPWAIT(seg->s_as)) {
--- old/usr/src/uts/common/vm/seg_vn.c	2015-11-25 13:59:40.418199109 -0500
+++ new/usr/src/uts/common/vm/seg_vn.c	2015-11-25 13:59:40.422569973 -0500
@@ -551,7 +551,7 @@
 	int use_rgn = 0;
 	int trok = 0;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	if (a->type != MAP_PRIVATE && a->type != MAP_SHARED) {
 		panic("segvn_create type");
@@ -1022,7 +1022,7 @@
 	pgcnt_t npages1, npages2;
 
 	ASSERT(seg1->s_as && seg2->s_as && seg1->s_as == seg2->s_as);
-	ASSERT(AS_WRITE_HELD(seg1->s_as, &seg1->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg1->s_as));
 	ASSERT(seg1->s_ops == seg2->s_ops);
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd1->rcookie) ||
@@ -1267,7 +1267,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg1->s_as && AS_WRITE_HELD(seg1->s_as, &seg1->s_as->a_lock));
+	ASSERT(seg1->s_as && AS_WRITE_HELD(seg1->s_as));
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd1->rcookie)) {
 		return (-1);
@@ -1388,7 +1388,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg2->s_as && AS_WRITE_HELD(seg2->s_as, &seg2->s_as->a_lock));
+	ASSERT(seg2->s_as && AS_WRITE_HELD(seg2->s_as));
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd2->rcookie)) {
 		return (-1);
@@ -1575,7 +1575,7 @@
 	size_t len;
 	struct anon_map *amp;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(newseg->s_as->a_proc->p_parent == curproc);
 
 	/*
@@ -1872,7 +1872,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	/*
 	 * Fail the unmap if pages are SOFTLOCKed through this mapping.
@@ -2422,7 +2422,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 
 	ASSERT(svd->rcookie == HAT_INVALID_REGION_COOKIE);
@@ -2572,7 +2572,7 @@
 	struct anon_map *amp;
 	struct anon *ap = NULL;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock));
 
 	if ((amp = svd->amp) != NULL)
@@ -4961,7 +4961,7 @@
 	anon_sync_obj_t cookie;
 	int brkcow = BREAK_COW_SHARE(rw, type, svd->type);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(svd->amp == NULL || svd->rcookie == HAT_INVALID_REGION_COOKIE);
 
 	/*
@@ -4970,7 +4970,7 @@
 	if (type == F_SOFTUNLOCK) {
 		if (rw == S_READ_NOCOW) {
 			rw = S_READ;
-			ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+			ASSERT(AS_WRITE_HELD(seg->s_as));
 		}
 		SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 		pgsz = (seg->s_szc == 0) ? PAGESIZE :
@@ -5115,7 +5115,7 @@
 			}
 		}
 
-		ASSERT(demote || AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+		ASSERT(demote || AS_WRITE_HELD(seg->s_as));
 
 		if (demote) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
@@ -5169,7 +5169,7 @@
 	 */
 	if (rw == S_READ_NOCOW) {
 		ASSERT(type == F_SOFTLOCK);
-		ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+		ASSERT(AS_WRITE_HELD(seg->s_as));
 		rw = S_READ;
 	}
 
@@ -5640,7 +5640,7 @@
 	struct anon_map *amp;
 	vnode_t *vp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	if ((amp = svd->amp) != NULL) {
@@ -5697,7 +5697,7 @@
 	anon_sync_obj_t cookie;
 	int unload_done = 0;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if ((svd->maxprot & prot) != prot)
 		return (EACCES);			/* violated maxprot */
@@ -5774,7 +5774,7 @@
 			 * we need to return IE_RETRY and let the as
 			 * layer drop and re-acquire the lock as a writer.
 			 */
-			if (AS_READ_HELD(seg->s_as, &seg->s_as->a_lock))
+			if (AS_READ_HELD(seg->s_as))
 				return (IE_RETRY);
 			VM_STAT_ADD(segvnvmstats.demoterange[1]);
 			if (svd->type == MAP_PRIVATE || svd->vp != NULL) {
@@ -6100,7 +6100,7 @@
 	int err;
 	u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
 
 	if (seg->s_szc == szc || segvn_lpg_disable != 0) {
@@ -6388,7 +6388,7 @@
 	uint_t prot = svd->prot, vpprot;
 	int pageflag = 0;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(svd->softlockcnt == 0);
 
@@ -6600,7 +6600,7 @@
 	size_t nsize;
 	struct segvn_data *nsvd;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 
 	ASSERT(addr >= seg->s_base);
@@ -6755,7 +6755,7 @@
 	uint_t szc = seg->s_szc;
 	uint_t tszcvec;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 	ASSERT(szc != 0);
 	pgsz = page_get_pagesize(szc);
@@ -6884,7 +6884,7 @@
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 	struct vpage *vp, *evp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	/*
@@ -6918,7 +6918,7 @@
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 	size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if (pgno != 0) {
 		SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
@@ -6944,7 +6944,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (svd->offset + (uintptr_t)(addr - seg->s_base));
 }
@@ -6955,7 +6955,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (svd->type | (svd->flags & (MAP_NORESERVE | MAP_TEXT |
 	    MAP_INITDATA)));
@@ -6967,7 +6967,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	*vpp = svd->vp;
 	return (0);
@@ -6994,8 +6994,8 @@
 	u_offset_t off1, off2;
 	struct anon_map *amp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_LOCK_HELD(seg->s_as, &svd->lock));
 
 	if (addr + delta < seg->s_base ||
@@ -7100,7 +7100,7 @@
 	pgcnt_t page;
 	ulong_t anon_index;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	/*
@@ -7279,7 +7279,7 @@
 	struct anon *ap;
 	anon_sync_obj_t cookie;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 
@@ -7501,7 +7501,7 @@
 	uint_t attr;
 	anon_sync_obj_t cookie;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	if (svd->amp == NULL && svd->vp == NULL) {
@@ -7677,7 +7677,7 @@
 	 * Hold write lock on address space because may split or concatenate
 	 * segments
 	 */
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * If this is a shm, use shm's project and zone, else use
@@ -8093,7 +8093,7 @@
 	struct seg *prev;
 	struct vnode *vp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * In case of MADV_FREE, we won't be modifying any segment private
@@ -8221,8 +8221,7 @@
 				 * address space because the segment may be
 				 * split or concatenated when changing policy
 				 */
-				if (AS_READ_HELD(seg->s_as,
-				    &seg->s_as->a_lock)) {
+				if (AS_READ_HELD(seg->s_as)) {
 					SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
 					return (IE_RETRY);
 				}
@@ -8372,7 +8371,7 @@
 			 * split or concatenated when changing policy
 			 */
 			if (svd->type == MAP_PRIVATE &&
-			    AS_READ_HELD(seg->s_as, &seg->s_as->a_lock)) {
+			    AS_READ_HELD(seg->s_as)) {
 				SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
 				return (IE_RETRY);
 			}
@@ -8558,7 +8557,7 @@
 	size_t page;
 	int ret = 0;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/* Can't support something we don't know about */
 	if (behav != SEGP_INH_ZERO)
@@ -8827,7 +8826,7 @@
 	TRACE_2(TR_FAC_PHYSIO, TR_PHYSIO_SEGVN_START,
 	    "segvn_pagelock: start seg %p addr %p", seg, addr);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(type == L_PAGELOCK || type == L_PAGEUNLOCK);
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
@@ -9449,7 +9448,7 @@
 
 	ASSERT(svd->vp == NULL && svd->amp != NULL);
 	ASSERT(svd->softlockcnt >= npages);
-	ASSERT(async || AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(async || AS_LOCK_HELD(seg->s_as));
 
 	pl = pplist;
 
@@ -9727,7 +9726,7 @@
 	int			first;
 	struct anon_map		*amp;
 
-	ASSERT(AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_LOCK_HELD(seg->s_as));
 	ASSERT(SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(p != NULL);
 	ASSERT(svd->tr_state == SEGVN_TR_INIT);
@@ -10008,8 +10007,8 @@
 	lgrp_id_t		lgrp_id = svd->tr_policy_info.mem_lgrpid;
 	lgrp_id_t		i;
 
-	ASSERT(AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(AS_LOCK_HELD(seg->s_as));
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(svd->tr_state == SEGVN_TR_ON);
 	ASSERT(!HAT_IS_REGION_COOKIE_VALID(svd->rcookie));
@@ -10234,7 +10233,7 @@
 	 * Use tryenter locking since we are locking as/seg and svntr hash
 	 * lock in reverse from syncrounous thread order.
 	 */
-	if (!AS_LOCK_TRYENTER(as, &as->a_lock, RW_READER)) {
+	if (!AS_LOCK_TRYENTER(as, RW_READER)) {
 		SEGVN_TR_ADDSTAT(nolock);
 		if (segvn_lgrp_trthr_migrs_snpsht) {
 			segvn_lgrp_trthr_migrs_snpsht = 0;
@@ -10242,7 +10241,7 @@
 		return;
 	}
 	if (!SEGVN_LOCK_TRYENTER(seg->s_as, &svd->lock, RW_WRITER)) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		SEGVN_TR_ADDSTAT(nolock);
 		if (segvn_lgrp_trthr_migrs_snpsht) {
 			segvn_lgrp_trthr_migrs_snpsht = 0;
@@ -10254,14 +10253,14 @@
 		size_t trmem = atomic_add_long_nv(&segvn_textrepl_bytes, size);
 		if (trmem > segvn_textrepl_max_bytes) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			SEGVN_TR_ADDSTAT(normem);
 			return;
 		}
 		if (anon_try_resv_zone(size, NULL) == 0) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			SEGVN_TR_ADDSTAT(noanon);
 			return;
@@ -10269,7 +10268,7 @@
 		amp = anonmap_alloc(size, size, KM_NOSLEEP);
 		if (amp == NULL) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			anon_unresv_zone(size, NULL);
 			SEGVN_TR_ADDSTAT(nokmem);
@@ -10301,7 +10300,7 @@
 	svd->amp = svntrp->tr_amp[lgrp_id];
 	p->p_tr_lgrpid = NLGRPS_MAX;
 	SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT(svntrp->tr_refcnt != 0);
 	ASSERT(svd->vp == svntrp->tr_vp);
--- old/usr/src/uts/common/vm/vm_as.c	2015-11-25 13:59:40.792696806 -0500
+++ new/usr/src/uts/common/vm/vm_as.c	2015-11-25 13:59:40.796547792 -0500
@@ -360,7 +360,7 @@
 	struct seg *seg = as->a_seglast;
 	avl_index_t where;
 
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 
 	if (seg != NULL &&
 	    seg->s_base <= addr &&
@@ -422,7 +422,7 @@
 	caddr_t eaddr;
 	avl_index_t where;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	as->a_updatedir = 1;	/* inform /proc */
 	gethrestime(&as->a_updatetime);
@@ -504,7 +504,7 @@
 {
 	avl_tree_t *t;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	as->a_updatedir = 1;	/* inform /proc */
 	gethrestime(&as->a_updatetime);
@@ -544,7 +544,7 @@
 {
 	struct seg *seg = as->a_seglast;
 
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 
 	if (seg != NULL && seg->s_base <= addr &&
 	    addr < seg->s_base + seg->s_size)
@@ -667,9 +667,9 @@
 	as->a_lastgaphl		= NULL;
 	as->a_callbacks		= NULL;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	as->a_hat = hat_alloc(as);	/* create hat for default system mmu */
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	as->a_xhat = NULL;
 
@@ -703,7 +703,7 @@
 	if (!called)
 		AS_SETBUSY(as);
 	mutex_exit(&as->a_contents);
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	if (!called) {
 		called = 1;
@@ -720,7 +720,7 @@
 		if (err == EAGAIN) {
 			mutex_enter(&as->a_contents);
 			if (as->a_callbacks) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 			} else if (!AS_ISNOUNMAPWAIT(as)) {
 				/*
 				 * Memory is currently locked. Wait for a
@@ -730,7 +730,7 @@
 				if (AS_ISUNMAPWAIT(as) == 0)
 					cv_broadcast(&as->a_cv);
 				AS_SETUNMAPWAIT(as);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				while (AS_ISUNMAPWAIT(as))
 					cv_wait(&as->a_cv, &as->a_contents);
 			} else {
@@ -761,7 +761,7 @@
 	hat_free_end(hat);
 	if (as->a_xhat != NULL)
 		xhat_free_end_all(as);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	/* /proc stuff */
 	ASSERT(avl_numnodes(&as->a_wpage) == 0);
@@ -786,13 +786,13 @@
 	size_t	purgesize = 0;
 	int error;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	as_clearwatch(as);
 	newas = as_alloc();
 	newas->a_userlimit = as->a_userlimit;
 	newas->a_proc = forkedproc;
 
-	AS_LOCK_ENTER(newas, &newas->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(newas, RW_WRITER);
 
 	/* This will prevent new XHATs from attaching */
 	mutex_enter(&as->a_contents);
@@ -813,12 +813,12 @@
 
 		newseg = seg_alloc(newas, seg->s_base, seg->s_size);
 		if (newseg == NULL) {
-			AS_LOCK_EXIT(newas, &newas->a_lock);
+			AS_LOCK_EXIT(newas);
 			as_setwatch(as);
 			mutex_enter(&as->a_contents);
 			AS_CLRBUSY(as);
 			mutex_exit(&as->a_contents);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			as_free(newas);
 			return (-1);
 		}
@@ -832,9 +832,9 @@
 			mutex_enter(&as->a_contents);
 			AS_CLRBUSY(as);
 			mutex_exit(&as->a_contents);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			seg_free(newseg);
-			AS_LOCK_EXIT(newas, &newas->a_lock);
+			AS_LOCK_EXIT(newas);
 			as_free(newas);
 			return (error);
 		}
@@ -849,13 +849,13 @@
 	mutex_enter(&newas->a_contents);
 	AS_CLRBUSY(newas);
 	mutex_exit(&newas->a_contents);
-	AS_LOCK_EXIT(newas, &newas->a_lock);
+	AS_LOCK_EXIT(newas);
 
 	as_setwatch(as);
 	mutex_enter(&as->a_contents);
 	AS_CLRBUSY(as);
 	mutex_exit(&as->a_contents);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	if (error != 0) {
 		as_free(newas);
 		return (error);
@@ -959,7 +959,7 @@
 		seg = segkmap;
 		as_lock_held = 0;
 	} else {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		if (is_xhat && avl_numnodes(&as->a_wpage) != 0) {
 			/*
 			 * Grab and hold the writers' lock on the as
@@ -973,13 +973,13 @@
 			 * is within a watched page and only then grab
 			 * the writer lock, but this is simpler.
 			 */
-			AS_LOCK_EXIT(as, &as->a_lock);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_EXIT(as);
+			AS_LOCK_ENTER(as, RW_WRITER);
 		}
 
 		seg = as_segat(as, raddr);
 		if (seg == NULL) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			if ((lwp != NULL) && (!is_xhat))
 				lwp->lwp_nostop--;
 			return (FC_NOMAP);
@@ -1060,7 +1060,7 @@
 		}
 	}
 	if (as_lock_held)
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	if ((lwp != NULL) && (!is_xhat))
 		lwp->lwp_nostop--;
 
@@ -1108,10 +1108,10 @@
 	rsize = (((size_t)(addr + size) + PAGEOFFSET) & PAGEMASK) -
 	    (size_t)raddr;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		if (lwp != NULL)
 			lwp->lwp_nostop--;
 		return (FC_NOMAP);
@@ -1129,7 +1129,7 @@
 		if (res != 0)
 			break;
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	if (lwp != NULL)
 		lwp->lwp_nostop--;
 	/*
@@ -1189,16 +1189,16 @@
 	 * want to only lock as a writer when necessary.
 	 */
 	if (writer || avl_numnodes(&as->a_wpage) != 0) {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 	} else {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 	}
 
 	as_clearwatchprot(as, raddr, rsize);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
 		as_setwatch(as);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -1223,7 +1223,7 @@
 		}
 
 		if (error == IE_RETRY) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			writer = 1;
 			goto setprot_top;
 		}
@@ -1233,7 +1233,7 @@
 			 * Make sure we have a_lock as writer.
 			 */
 			if (writer == 0) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				writer = 1;
 				goto setprot_top;
 			}
@@ -1274,13 +1274,13 @@
 			if (as->a_callbacks &&
 			    (cb = as_find_callback(as, AS_SETPROT_EVENT,
 			    seg->s_base, seg->s_size))) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				as_execute_callback(as, cb, AS_SETPROT_EVENT);
 			} else if (!AS_ISNOUNMAPWAIT(as)) {
 				if (AS_ISUNMAPWAIT(as) == 0)
 					cv_broadcast(&as->a_cv);
 				AS_SETUNMAPWAIT(as);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				while (AS_ISUNMAPWAIT(as))
 					cv_wait(&as->a_cv, &as->a_contents);
 			} else {
@@ -1308,7 +1308,7 @@
 	} else {
 		as_setwatchprot(as, saveraddr, saversize, prot);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (error);
 }
 
@@ -1342,14 +1342,14 @@
 	 * the benefit of as_clearwatchprot() and as_setwatchprot().
 	 */
 	if (avl_numnodes(&as->a_wpage) != 0)
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 	else
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 	as_clearwatchprot(as, raddr, rsize);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
 		as_setwatch(as);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -1371,7 +1371,7 @@
 			break;
 	}
 	as_setwatch(as);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (error);
 }
 
@@ -1389,7 +1389,7 @@
 	eaddr = (caddr_t)(((uintptr_t)(addr + size) + PAGEOFFSET) &
 	    (uintptr_t)PAGEMASK);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 
 	as->a_updatedir = 1;	/* inform /proc */
 	gethrestime(&as->a_updatetime);
@@ -1470,13 +1470,13 @@
 			if (as->a_callbacks &&
 			    (cb = as_find_callback(as, AS_UNMAP_EVENT,
 			    seg->s_base, seg->s_size))) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				as_execute_callback(as, cb, AS_UNMAP_EVENT);
 			} else if (!AS_ISNOUNMAPWAIT(as)) {
 				if (AS_ISUNMAPWAIT(as) == 0)
 					cv_broadcast(&as->a_cv);
 				AS_SETUNMAPWAIT(as);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				while (AS_ISUNMAPWAIT(as))
 					cv_wait(&as->a_cv, &as->a_contents);
 			} else {
@@ -1497,11 +1497,11 @@
 			mutex_exit(&as->a_contents);
 			goto top;
 		} else if (err == IE_RETRY) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			goto top;
 		} else if (err) {
 			as_setwatch(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (-1);
 		}
 
@@ -1510,7 +1510,7 @@
 			as->a_resvsize -= rsize;
 		raddr += ssize;
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (0);
 }
 
@@ -1529,7 +1529,7 @@
 	int do_off = (vn_a->vp != NULL || vn_a->amp != NULL);
 	uint_t save_szcvec;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	ASSERT(IS_P2ALIGNED(addr, PAGESIZE));
 	ASSERT(IS_P2ALIGNED(size, PAGESIZE));
 	ASSERT(vn_a->vp == NULL || vn_a->amp == NULL);
@@ -1643,7 +1643,7 @@
 	size_t save_size = 0;
 	extern size_t textrepl_size_thresh;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	ASSERT(IS_P2ALIGNED(addr, PAGESIZE));
 	ASSERT(IS_P2ALIGNED(size, PAGESIZE));
 	ASSERT(vn_a->vp != NULL);
@@ -1732,7 +1732,7 @@
 	szcvec = map_pgszcvec(addr, size, vn_a->amp == NULL ?
 	    (uintptr_t)addr : (uintptr_t)P2ROUNDUP(vn_a->offset, PAGESIZE),
 	    (vn_a->flags & MAP_TEXT), type, 0);
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	ASSERT(IS_P2ALIGNED(addr, PAGESIZE));
 	ASSERT(IS_P2ALIGNED(size, PAGESIZE));
 	ASSERT(vn_a->vp == NULL);
@@ -1744,7 +1744,7 @@
 int
 as_map(struct as *as, caddr_t addr, size_t size, int (*crfp)(), void *argsp)
 {
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	return (as_map_locked(as, addr, size, crfp, argsp));
 }
 
@@ -1768,7 +1768,7 @@
 	 * check for wrap around
 	 */
 	if ((raddr + rsize < raddr) || (as->a_size > (ULONG_MAX - size))) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -1776,7 +1776,7 @@
 	gethrestime(&as->a_updatetime);
 
 	if (as != &kas && as->a_size + rsize > (size_t)p->p_vmem_ctl) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 
 		(void) rctl_action(rctlproc_legacy[RLIMIT_VMEM], p->p_rctls, p,
 		    RCA_UNSAFE_ALL);
@@ -1788,7 +1788,7 @@
 		crargs = *(struct segvn_crargs *)argsp;
 		error = as_map_vnsegs(as, raddr, rsize, crfp, &crargs, &unmap);
 		if (error != 0) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			if (unmap) {
 				(void) as_unmap(as, addr, size);
 			}
@@ -1798,7 +1798,7 @@
 		crargs = *(struct segvn_crargs *)argsp;
 		error = as_map_ansegs(as, raddr, rsize, crfp, &crargs, &unmap);
 		if (error != 0) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			if (unmap) {
 				(void) as_unmap(as, addr, size);
 			}
@@ -1807,14 +1807,14 @@
 	} else {
 		seg = seg_alloc(as, addr, size);
 		if (seg == NULL) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (ENOMEM);
 		}
 
 		error = (*crfp)(seg, argsp);
 		if (error != 0) {
 			seg_free(seg);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (error);
 		}
 		/*
@@ -1833,13 +1833,13 @@
 	mutex_enter(&as->a_contents);
 	if (AS_ISPGLCK(as)) {
 		mutex_exit(&as->a_contents);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		error = as_ctl(as, addr, size, MC_LOCK, 0, 0, NULL, 0);
 		if (error != 0)
 			(void) as_unmap(as, addr, size);
 	} else {
 		mutex_exit(&as->a_contents);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 	return (error);
 }
@@ -1864,7 +1864,7 @@
 	if ((as->a_flags & AS_NEEDSPURGE) == 0)
 		return;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	next_seg = NULL;
 	seg = AS_SEGFIRST(as);
 	while (seg != NULL) {
@@ -1873,7 +1873,7 @@
 			SEGOP_UNMAP(seg, seg->s_base, seg->s_size);
 		seg = next_seg;
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	mutex_enter(&as->a_contents);
 	as->a_flags &= ~AS_NEEDSPURGE;
@@ -1936,14 +1936,14 @@
 	minlen += 2 * redzone;
 	redzone = 0;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	if (AS_SEGFIRST(as) == NULL) {
 		if (valid_va_range_aligned(basep, lenp, minlen, flags & AH_DIR,
 		    align, redzone, off)) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (0);
 		} else {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			*basep = save_base;
 			*lenp = save_len;
 			return (-1);
@@ -2024,7 +2024,7 @@
 				as->a_lastgaphl = hseg;
 			else
 				as->a_lastgaphl = lseg;
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (0);
 		}
 	cont:
@@ -2051,7 +2051,7 @@
 	}
 	*basep = save_base;
 	*lenp = save_len;
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (-1);
 }
 
@@ -2093,7 +2093,7 @@
 	caddr_t addr, eaddr;
 	caddr_t segend;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 
 	addr = *basep;
 	eaddr = addr + *lenp;
@@ -2104,7 +2104,7 @@
 
 	for (;;) {
 		if (seg == NULL || addr >= eaddr || eaddr <= seg->s_base) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (EINVAL);
 		}
 
@@ -2136,7 +2136,7 @@
 	else
 		*lenp = segend - addr;
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (0);
 }
 
@@ -2164,7 +2164,7 @@
 	if (as == NULL)
 		return (0);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 
 	/* Prevent XHATs from attaching */
 	mutex_enter(&as->a_contents);
@@ -2203,7 +2203,7 @@
 		if ((ov != NULL) && (ov->swapout != NULL))
 			swpcnt += SEGOP_SWAPOUT(seg);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (swpcnt);
 }
 
@@ -2230,10 +2230,10 @@
 	if (raddr + rsize < raddr)		/* check for wraparound */
 		return (ENOMEM);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (-1);
 	}
 
@@ -2256,7 +2256,7 @@
 		}
 		vec += btopr(ssize);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (error);
 }
 
@@ -2326,9 +2326,9 @@
 				/* pages. */
 retry:
 	if (error == IE_RETRY)
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 	else
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 
 	/*
 	 * If these are address space lock/unlock operations, loop over
@@ -2346,13 +2346,13 @@
 			mutex_exit(&as->a_contents);
 		}
 		if ((arg & MCL_CURRENT) == 0) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (0);
 		}
 
 		seg = AS_SEGFIRST(as);
 		if (seg == NULL) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			return (0);
 		}
 
@@ -2366,7 +2366,7 @@
 		mlock_size = BT_BITOUL(btopr(rlen));
 		if ((mlock_map = (ulong_t *)kmem_zalloc(mlock_size *
 		    sizeof (ulong_t), KM_NOSLEEP)) == NULL) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (EAGAIN);
 		}
 
@@ -2392,7 +2392,7 @@
 		}
 
 		kmem_free(mlock_map, mlock_size * sizeof (ulong_t));
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		goto lockerr;
 	} else if (func == MC_UNLOCKAS) {
 		mutex_enter(&as->a_contents);
@@ -2406,7 +2406,7 @@
 				break;
 		}
 
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		goto lockerr;
 	}
 
@@ -2418,7 +2418,7 @@
 	    (size_t)raddr;
 
 	if (raddr + rsize < raddr) {		/* check for wraparound */
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -2426,7 +2426,7 @@
 	 * Get initial segment.
 	 */
 	if ((seg = as_segat(as, raddr)) == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -2434,7 +2434,7 @@
 		mlock_size = BT_BITOUL(btopr(rsize));
 		if ((mlock_map = (ulong_t *)kmem_zalloc(mlock_size *
 		    sizeof (ulong_t), KM_NOSLEEP)) == NULL) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (EAGAIN);
 		}
 	}
@@ -2459,7 +2459,7 @@
 					kmem_free(mlock_map,
 					    mlock_size * sizeof (ulong_t));
 				}
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (ENOMEM);
 			}
 		}
@@ -2480,7 +2480,7 @@
 		case MC_SYNC:
 			if (error = SEGOP_SYNC(seg, raddr, ssize,
 			    attr, (uint_t)arg)) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (error);
 			}
 			break;
@@ -2495,7 +2495,7 @@
 				    initrsize - rsize + ssize);
 				kmem_free(mlock_map, mlock_size *
 				    sizeof (ulong_t));
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				goto lockerr;
 			}
 			break;
@@ -2524,7 +2524,7 @@
 					 * have to drop readers lock and start
 					 * all over again
 					 */
-					AS_LOCK_EXIT(as, &as->a_lock);
+					AS_LOCK_EXIT(as);
 					goto retry;
 				} else if (error == IE_REATTACH) {
 					/*
@@ -2534,14 +2534,14 @@
 					 */
 					seg = as_segat(as, raddr);
 					if (seg == NULL) {
-						AS_LOCK_EXIT(as, &as->a_lock);
+						AS_LOCK_EXIT(as);
 						return (ENOMEM);
 					}
 				} else {
 					/*
 					 * Regular error
 					 */
-					AS_LOCK_EXIT(as, &as->a_lock);
+					AS_LOCK_EXIT(as);
 					return (error);
 				}
 			}
@@ -2555,7 +2555,7 @@
 				    SEGP_INH_ZERO);
 			}
 			if (error != 0) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (error);
 			}
 			break;
@@ -2574,7 +2574,7 @@
 
 	if (func == MC_LOCK)
 		kmem_free(mlock_map, mlock_size * sizeof (ulong_t));
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (0);
 lockerr:
 
@@ -2639,7 +2639,7 @@
 	pgcnt_t pl_off;
 	extern struct seg_ops segspt_shmops;
 
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 	ASSERT(seg != NULL);
 	ASSERT(addr >= seg->s_base && addr < seg->s_base + seg->s_size);
 	ASSERT(addr + size > seg->s_base + seg->s_size);
@@ -2656,7 +2656,7 @@
 
 			seg = AS_SEGNEXT(as, seg);
 			if (seg == NULL || addr != seg->s_base) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				return (EFAULT);
 			}
 			/*
@@ -2668,11 +2668,11 @@
 
 				if (SEGOP_GETVP(seg, addr, &vp) != 0 ||
 				    vp != NULL) {
-					AS_LOCK_EXIT(as, &as->a_lock);
+					AS_LOCK_EXIT(as);
 					goto slow;
 				}
 			} else if (seg->s_ops != &segspt_shmops) {
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				goto slow;
 			}
 			segcnt++;
@@ -2717,7 +2717,7 @@
 	}
 
 	if (size == 0) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		ASSERT(cnt == segcnt - 1);
 		*ppp = plist;
 		return (0);
@@ -2751,7 +2751,7 @@
 		    L_PAGEUNLOCK, rw);
 	}
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	kmem_free(plist, (npages + segcnt) * sizeof (page_t *));
 
@@ -2800,11 +2800,11 @@
 	 * if the request crosses two segments let
 	 * as_fault handle it.
 	 */
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (EFAULT);
 	}
 	ASSERT(raddr >= seg->s_base && raddr < seg->s_base + seg->s_size);
@@ -2812,7 +2812,7 @@
 		return (as_pagelock_segs(as, seg, ppp, raddr, rsize, rw));
 	}
 	if (raddr + rsize <= raddr) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (EFAULT);
 	}
 
@@ -2826,7 +2826,7 @@
 
 	TRACE_0(TR_FAC_PHYSIO, TR_PHYSIO_SEG_LOCK_END, "seg_lock_1_end");
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	if (err == 0 || (err != ENOTSUP && err != EFAULT)) {
 		return (err);
@@ -2864,7 +2864,7 @@
 	size_t ssize;
 	page_t **pl;
 
-	ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	ASSERT(AS_LOCK_HELD(as));
 	ASSERT(seg != NULL);
 	ASSERT(addr >= seg->s_base && addr < seg->s_base + seg->s_size);
 	ASSERT(addr + size > seg->s_base + seg->s_size);
@@ -2889,7 +2889,7 @@
 		    L_PAGEUNLOCK, rw);
 	}
 	ASSERT(cnt > 0);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	cnt++;
 	kmem_free(plist, (npages + cnt) * sizeof (page_t *));
@@ -2922,7 +2922,7 @@
 	rsize = (((size_t)(addr + size) + PAGEOFFSET) & PAGEMASK) -
 	    (size_t)raddr;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	seg = as_segat(as, raddr);
 	ASSERT(seg != NULL);
 
@@ -2936,7 +2936,7 @@
 		as_pageunlock_segs(as, seg, raddr, rsize, pp, rw);
 		return;
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	TRACE_0(TR_FAC_PHYSIO, TR_PHYSIO_AS_UNLOCK_END, "as_pageunlock_end");
 }
 
@@ -2962,12 +2962,12 @@
 	if (raddr + rsize < raddr)		/* check for wraparound */
 		return (ENOMEM);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 	as_clearwatchprot(as, raddr, rsize);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
 		as_setwatch(as);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 
@@ -2994,7 +2994,7 @@
 		}
 
 		if (error == IE_RETRY) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			goto setpgsz_top;
 		}
 
@@ -3034,7 +3034,7 @@
 					cv_broadcast(&as->a_cv);
 				}
 				AS_SETUNMAPWAIT(as);
-				AS_LOCK_EXIT(as, &as->a_lock);
+				AS_LOCK_EXIT(as);
 				while (AS_ISUNMAPWAIT(as)) {
 					cv_wait(&as->a_cv, &as->a_contents);
 				}
@@ -3060,7 +3060,7 @@
 		}
 	}
 	as_setwatch(as);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (error);
 }
 
@@ -3076,7 +3076,7 @@
 	size_t ssize;
 	int error;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
@@ -3133,7 +3133,7 @@
 	int error;
 	int retry;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	for (;;) {
 		error = as_iset3_default_lpsize(as, addr, size, szc, &retry);
@@ -3165,7 +3165,7 @@
 	int set;
 	int error;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
@@ -3233,7 +3233,7 @@
 	size_t pgsz;
 	uint_t save_szcvec;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	ASSERT(IS_P2ALIGNED(addr, PAGESIZE));
 	ASSERT(IS_P2ALIGNED(size, PAGESIZE));
 
@@ -3325,7 +3325,7 @@
 	if (size == 0)
 		return (0);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+	AS_LOCK_ENTER(as, RW_WRITER);
 again:
 	error = 0;
 
@@ -3334,14 +3334,14 @@
 	    (size_t)raddr;
 
 	if (raddr + rsize < raddr) {		/* check for wraparound */
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 	as_clearwatchprot(as, raddr, rsize);
 	seg = as_segat(as, raddr);
 	if (seg == NULL) {
 		as_setwatch(as);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENOMEM);
 	}
 	if (seg->s_ops == &segvn_ops) {
@@ -3426,12 +3426,12 @@
 				cv_broadcast(&as->a_cv);
 			}
 			AS_SETUNMAPWAIT(as);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			while (AS_ISUNMAPWAIT(as)) {
 				cv_wait(&as->a_cv, &as->a_contents);
 			}
 			mutex_exit(&as->a_contents);
-			AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+			AS_LOCK_ENTER(as, RW_WRITER);
 		} else {
 			/*
 			 * We may have raced with
@@ -3449,7 +3449,7 @@
 	}
 
 	as_setwatch(as);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (error);
 }
 
@@ -3468,7 +3468,7 @@
 	if (avl_numnodes(&as->a_wpage) == 0)
 		return;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	for (pwp = avl_first(&as->a_wpage); pwp != NULL;
 	    pwp = AVL_NEXT(&as->a_wpage, pwp)) {
@@ -3515,7 +3515,7 @@
 	if (avl_numnodes(&as->a_wpage) == 0)
 		return;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	for (pwp = avl_first(&as->a_wpage); pwp != NULL;
 	    pwp = AVL_NEXT(&as->a_wpage, pwp)) {
@@ -3557,7 +3557,7 @@
 	if (avl_numnodes(&as->a_wpage) == 0)
 		return;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	tpw.wp_vaddr = (caddr_t)((uintptr_t)addr & (uintptr_t)PAGEMASK);
 	if ((pwp = avl_find(&as->a_wpage, &tpw, &where)) == NULL)
@@ -3616,7 +3616,7 @@
 	if ((pwp = avl_find(&as->a_wpage, &tpw, &where)) == NULL)
 		pwp = avl_nearest(&as->a_wpage, where, AVL_AFTER);
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 
 	while (pwp != NULL && pwp->wp_vaddr < eaddr) {
 
@@ -3671,22 +3671,22 @@
 	struct seg	*seg;
 	int		sts;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	seg = as_segat(as, addr);
 	if (seg == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (EFAULT);
 	}
 	/*
 	 * catch old drivers which may not support getmemid
 	 */
 	if (seg->s_ops->getmemid == NULL) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (ENODEV);
 	}
 
 	sts = SEGOP_GETMEMID(seg, addr, memidp);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	return (sts);
 }
--- old/usr/src/uts/common/vm/vm_page.c	2015-11-25 13:59:41.032381118 -0500
+++ new/usr/src/uts/common/vm/vm_page.c	2015-11-25 13:59:41.036300696 -0500
@@ -5381,7 +5381,7 @@
 	ulong_t		an_idx;
 	anon_sync_obj_t	cookie;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * Don't do anything if don't need to do lgroup optimizations
@@ -5559,7 +5559,7 @@
 	spgcnt_t	i;
 	uint_t		pszc;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	while (npages > 0) {
 		pp = *ppa;
--- old/usr/src/uts/common/vm/vm_seg.c	2015-11-25 13:59:41.299065930 -0500
+++ new/usr/src/uts/common/vm/vm_seg.c	2015-11-25 13:59:41.302697717 -0500
@@ -1649,7 +1649,7 @@
 	int ret;
 #endif /* DEBUG */
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	/* Shouldn't have called seg_unmap if mapping isn't yet established */
 	ASSERT(seg->s_data != NULL);
--- old/usr/src/uts/common/vm/vm_usage.c	2015-11-25 13:59:41.475110879 -0500
+++ new/usr/src/uts/common/vm/vm_usage.c	2015-11-25 13:59:41.488191615 -0500
@@ -1533,12 +1533,12 @@
 	ASSERT(entities != NULL);
 	/* process all segs in process's address space */
 	as = p->p_as;
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	for (seg = AS_SEGFIRST(as); seg != NULL;
 	    seg = AS_SEGNEXT(as, seg)) {
 		vmu_calculate_seg(entities, seg);
 	}
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 }
 
 /*
--- old/usr/src/uts/common/xen/io/xpvtap.c	2015-11-25 13:59:41.653831786 -0500
+++ new/usr/src/uts/common/xen/io/xpvtap.c	2015-11-25 13:59:41.657691082 -0500
@@ -789,12 +789,12 @@
 		return (DDI_FAILURE);
 	}
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 
 	seg = as_findseg(as, state->bt_map.um_guest_pages, 0);
 	if ((seg == NULL) || ((uaddr + state->bt_map.um_guest_size) >
 	    (seg->s_base + seg->s_size))) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (DDI_FAILURE);
 	}
 
@@ -815,7 +815,7 @@
 
 	state->bt_map.um_registered = B_TRUE;
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	return (DDI_SUCCESS);
 }
@@ -850,11 +850,11 @@
 
 	/* Unlock the gref pages */
 	for (i = 0; i < pgcnt; i++) {
-		AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+		AS_LOCK_ENTER(as, RW_WRITER);
 		hat_prepare_mapping(as->a_hat, uaddr, NULL);
 		hat_unload(as->a_hat, uaddr, PAGESIZE, HAT_UNLOAD_UNLOCK);
 		hat_release_mapping(as->a_hat, uaddr);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		uaddr += PAGESIZE;
 	}
 
@@ -1228,11 +1228,11 @@
 	/* get the apps gref address */
 	uaddr = XPVTAP_GREF_REQADDR(state->bt_map.um_guest_pages, *uid);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	seg = as_findseg(as, state->bt_map.um_guest_pages, 0);
 	if ((seg == NULL) || ((uaddr + mmu_ptob(req->nr_segments)) >
 	    (seg->s_base + seg->s_size))) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (DDI_FAILURE);
 	}
 
@@ -1249,7 +1249,7 @@
 	(void) segmf_add_grefs(seg, uaddr, flags, gref, req->nr_segments,
 	    domid);
 
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	return (DDI_SUCCESS);
 }
@@ -1314,11 +1314,11 @@
 	    (req->operation != BLKIF_OP_FLUSH_DISKCACHE) &&
 	    (req->nr_segments != 0)) {
 		uaddr = XPVTAP_GREF_REQADDR(state->bt_map.um_guest_pages, uid);
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		seg = as_findseg(as, state->bt_map.um_guest_pages, 0);
 		if ((seg == NULL) || ((uaddr + mmu_ptob(req->nr_segments)) >
 		    (seg->s_base + seg->s_size))) {
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			xpvtap_rs_free(state->bt_map.um_rs, uid);
 			return;
 		}
@@ -1328,7 +1328,7 @@
 			cmn_err(CE_WARN, "unable to release grefs");
 		}
 
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 	}
 
 	/* free up the user ring id */
--- old/usr/src/uts/i86pc/io/rootnex.c	2015-11-25 13:59:41.800646874 -0500
+++ new/usr/src/uts/i86pc/io/rootnex.c	2015-11-25 13:59:41.804496784 -0500
@@ -1007,7 +1007,7 @@
 			 * the hat of the system MMU.  At alternative
 			 * would be to panic .. this might well be better ..
 			 */
-			ASSERT(AS_READ_HELD(seg->s_as, &seg->s_as->a_lock));
+			ASSERT(AS_READ_HELD(seg->s_as));
 			hat = seg->s_as->a_hat;
 			cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
 		}
--- old/usr/src/uts/i86pc/vm/hat_i86.c	2015-11-25 13:59:42.023347595 -0500
+++ new/usr/src/uts/i86pc/vm/hat_i86.c	2015-11-25 13:59:42.027112668 -0500
@@ -260,7 +260,7 @@
 	if (can_steal_post_boot == 0)
 		can_steal_post_boot = 1;
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	hat = kmem_cache_alloc(hat_cache, KM_SLEEP);
 	hat->hat_as = as;
 	mutex_init(&hat->hat_mutex, NULL, MUTEX_DEFAULT, NULL);
@@ -393,7 +393,7 @@
 void
 hat_free_start(hat_t *hat)
 {
-	ASSERT(AS_WRITE_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(AS_WRITE_HELD(hat->hat_as));
 
 	/*
 	 * If the hat is currently a stealing victim, wait for the stealing
@@ -726,12 +726,12 @@
 	/*
 	 * Set up the kernel's hat
 	 */
-	AS_LOCK_ENTER(&kas, &kas.a_lock, RW_WRITER);
+	AS_LOCK_ENTER(&kas, RW_WRITER);
 	kas.a_hat = kmem_cache_alloc(hat_cache, KM_NOSLEEP);
 	mutex_init(&kas.a_hat->hat_mutex, NULL, MUTEX_DEFAULT, NULL);
 	kas.a_hat->hat_as = &kas;
 	kas.a_hat->hat_flags = 0;
-	AS_LOCK_EXIT(&kas, &kas.a_lock);
+	AS_LOCK_EXIT(&kas);
 
 	CPUSET_ZERO(khat_cpuset);
 	CPUSET_ADD(khat_cpuset, CPU->cpu_id);
@@ -1157,7 +1157,7 @@
 	 */
 	ASSERT(IS_PAGEALIGNED(vaddr));
 	ASSERT(IS_PAGEALIGNED(eaddr));
-	ASSERT(AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(AS_LOCK_HELD(hat->hat_as));
 	if ((uintptr_t)hat->hat_as->a_userlimit < eaddr)
 		eaddr = (uintptr_t)hat->hat_as->a_userlimit;
 
@@ -1438,8 +1438,7 @@
 	++curthread->t_hatdepth;
 	ASSERT(curthread->t_hatdepth < 16);
 
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 
 	if (flags & HAT_LOAD_SHARE)
 		hat->hat_flags |= HAT_SHARED;
@@ -1587,8 +1586,7 @@
 	XPV_DISALLOW_MIGRATE();
 	ASSERT(IS_PAGEALIGNED(va));
 	ASSERT(hat == kas.a_hat || va < _userlimit);
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 	ASSERT((flags & supported_memload_flags) == flags);
 
 	ASSERT(!IN_VA_HOLE(va));
@@ -1645,8 +1643,7 @@
 	XPV_DISALLOW_MIGRATE();
 	ASSERT(IS_PAGEALIGNED(va));
 	ASSERT(hat == kas.a_hat || va + len <= _userlimit);
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 	ASSERT((flags & supported_memload_flags) == flags);
 
 	/*
@@ -1781,8 +1778,7 @@
 	XPV_DISALLOW_MIGRATE();
 	ASSERT(IS_PAGEALIGNED(va));
 	ASSERT(hat == kas.a_hat || eva <= _userlimit);
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 	ASSERT((flags & supported_devload_flags) == flags);
 
 	/*
@@ -1890,7 +1886,7 @@
 		panic("hat_unlock() address out of range - above _userlimit");
 
 	XPV_DISALLOW_MIGRATE();
-	ASSERT(AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(AS_LOCK_HELD(hat->hat_as));
 	while (vaddr < eaddr) {
 		(void) htable_walk(hat, &ht, &vaddr, eaddr);
 		if (ht == NULL)
@@ -2645,8 +2641,7 @@
 	XPV_DISALLOW_MIGRATE();
 	ASSERT(IS_PAGEALIGNED(vaddr));
 	ASSERT(IS_PAGEALIGNED(eaddr));
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 	for (; vaddr < eaddr; vaddr += LEVEL_SIZE(ht->ht_level)) {
 try_again:
 		oldpte = htable_walk(hat, &ht, &vaddr, eaddr);
@@ -2856,8 +2851,7 @@
 	pgcnt_t		pg_off;
 
 	ASSERT(hat == kas.a_hat || vaddr <= _userlimit);
-	ASSERT(hat == kas.a_hat ||
-	    AS_LOCK_HELD(hat->hat_as, &hat->hat_as->a_lock));
+	ASSERT(hat == kas.a_hat || AS_LOCK_HELD(hat->hat_as));
 	if (IN_VA_HOLE(vaddr))
 		return (0);
 
--- old/usr/src/uts/i86xpv/io/privcmd.c	2015-11-25 13:59:42.233591454 -0500
+++ new/usr/src/uts/i86xpv/io/privcmd.c	2015-11-25 13:59:42.237201153 -0500
@@ -169,14 +169,14 @@
 		 * Find the segment we want to mess with, then add
 		 * the mfn range to the segment.
 		 */
-		AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+		AS_LOCK_ENTER(as, RW_READER);
 		if ((seg = as_findseg(as, addr, 0)) == NULL ||
 		    addr + mmu_ptob(mme->npages) > seg->s_base + seg->s_size)
 			error = EINVAL;
 		else
 			error = segmf_add_mfns(seg, addr,
 			    mme->mfn, mme->npages, mmc->dom);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 
 		if (error != 0)
 			break;
@@ -219,7 +219,7 @@
 	    caddr_t, mmb->addr);
 
 	addr = (caddr_t)mmb->addr;
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	if ((seg = as_findseg(as, addr, 0)) == NULL ||
 	    addr + ptob(mmb->num) > seg->s_base + seg->s_size) {
 		error = EINVAL;
@@ -260,7 +260,7 @@
 	}
 
 done:
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	DTRACE_XPV3(mmapbatch__end, int, error, struct seg *, seg, caddr_t,
 	    mmb->addr);
--- old/usr/src/uts/sfmmu/vm/hat_sfmmu.c	2015-11-25 13:59:42.355478443 -0500
+++ new/usr/src/uts/sfmmu/vm/hat_sfmmu.c	2015-11-25 13:59:42.359778407 -0500
@@ -1318,9 +1318,9 @@
 	/*
 	 * We grab the first hat for the kernel,
 	 */
-	AS_LOCK_ENTER(&kas, &kas.a_lock, RW_WRITER);
+	AS_LOCK_ENTER(&kas, RW_WRITER);
 	kas.a_hat = hat_alloc(&kas);
-	AS_LOCK_EXIT(&kas, &kas.a_lock);
+	AS_LOCK_EXIT(&kas);
 
 	/*
 	 * Initialize hblk_reserve.
@@ -1463,7 +1463,7 @@
 	uint64_t cnum;
 	extern uint_t get_color_start(struct as *);
 
-	ASSERT(AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(AS_WRITE_HELD(as));
 	sfmmup = kmem_cache_alloc(sfmmuid_cache, KM_SLEEP);
 	sfmmup->sfmmu_as = as;
 	sfmmup->sfmmu_flags = 0;
@@ -1917,7 +1917,7 @@
 void
 hat_free_start(struct hat *sfmmup)
 {
-	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as));
 	ASSERT(sfmmup != ksfmmup);
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
 
@@ -2247,8 +2247,7 @@
 		return;
 	}
 
-	ASSERT((hat == ksfmmup) ||
-	    AS_LOCK_HELD(hat->sfmmu_as, &hat->sfmmu_as->a_lock));
+	ASSERT((hat == ksfmmup) || AS_LOCK_HELD(hat->sfmmu_as));
 
 	if (flags & ~SFMMU_LOAD_ALLFLAG)
 		cmn_err(CE_NOTE, "hat_memload: unsupported flags %d",
@@ -2303,8 +2302,7 @@
 
 	ASSERT(!(flags & ~SFMMU_LOAD_ALLFLAG));
 	ASSERT(!(attr & ~SFMMU_LOAD_ALLATTR));
-	ASSERT((hat == ksfmmup) ||
-	    AS_LOCK_HELD(hat->sfmmu_as, &hat->sfmmu_as->a_lock));
+	ASSERT((hat == ksfmmup) || AS_LOCK_HELD(hat->sfmmu_as));
 	if (len == 0)
 		panic("hat_devload: zero len");
 	if (flags & ~SFMMU_LOAD_ALLFLAG)
@@ -3973,8 +3971,7 @@
 	ASSERT(sfmmup != NULL);
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
 
-	ASSERT((sfmmup == ksfmmup) ||
-	    AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT((sfmmup == ksfmmup) || AS_LOCK_HELD(sfmmup->sfmmu_as));
 	ASSERT((len & MMU_PAGEOFFSET) == 0);
 	endaddr = addr + len;
 	hblktag.htag_id = sfmmup;
@@ -4770,8 +4767,7 @@
 	ASSERT(sfmmup != NULL);
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
 
-	ASSERT((sfmmup == ksfmmup) ||
-	    AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT((sfmmup == ksfmmup) || AS_LOCK_HELD(sfmmup->sfmmu_as));
 
 	if (sfmmup == ksfmmup) {
 		while ((pfn = sfmmu_vatopfn(addr, sfmmup, &tte))
@@ -4920,8 +4916,7 @@
 
 	CPUSET_ZERO(cpuset);
 
-	ASSERT((sfmmup == ksfmmup) ||
-	    AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT((sfmmup == ksfmmup) || AS_LOCK_HELD(sfmmup->sfmmu_as));
 	ASSERT((len & MMU_PAGEOFFSET) == 0);
 	ASSERT(((uintptr_t)addr & MMU_PAGEOFFSET) == 0);
 
@@ -5714,7 +5709,7 @@
 	}
 
 	ASSERT((sfmmup == ksfmmup) || (flags & HAT_UNLOAD_OTHER) || \
-	    AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	    AS_LOCK_HELD(sfmmup->sfmmu_as));
 
 	ASSERT(sfmmup != NULL);
 	ASSERT((len & MMU_PAGEOFFSET) == 0);
@@ -6332,8 +6327,7 @@
 	cpuset_t cpuset;
 
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
-	ASSERT((sfmmup == ksfmmup) ||
-	    AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT((sfmmup == ksfmmup) || AS_LOCK_HELD(sfmmup->sfmmu_as));
 	ASSERT((len & MMU_PAGEOFFSET) == 0);
 	ASSERT((clearflag == HAT_SYNC_DONTZERO) ||
 	    (clearflag == HAT_SYNC_ZERORM));
@@ -7976,7 +7970,7 @@
 
 	/*
 	 * We would like to
-	 * ASSERT(AS_LOCK_HELD(as, &as->a_lock));
+	 * ASSERT(AS_LOCK_HELD(as));
 	 * but we can't because the iommu driver will call this
 	 * routine at interrupt time and it can't grab the as lock
 	 * or it will deadlock: A thread could have the as lock
@@ -14031,7 +14025,7 @@
 
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
 	ASSERT(sfmmup != ksfmmup);
-	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as));
 	ASSERT(srdp->srd_refcnt > 0);
 	ASSERT(!(flags & ~HAT_REGION_TYPE_MASK));
 	ASSERT(flags == HAT_REGION_TEXT || flags == HAT_REGION_ISM);
@@ -14334,7 +14328,7 @@
 	ASSERT(rgnp->rgn_id == rid);
 	ASSERT((rgnp->rgn_flags & SFMMU_REGION_TYPE_MASK) == r_type);
 	ASSERT(!(rgnp->rgn_flags & SFMMU_REGION_FREE));
-	ASSERT(AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_LOCK_HELD(sfmmup->sfmmu_as));
 
 	ASSERT(sfmmup->sfmmu_xhat_provider == NULL);
 	if (r_type == SFMMU_REGION_HME && sfmmup->sfmmu_as->a_xhat != NULL) {
@@ -15130,7 +15124,7 @@
 	ASSERT(srdp != NULL);
 	ASSERT(scdp != NULL);
 	ASSERT(scdp->scd_refcnt > 0);
-	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as));
 
 	if ((old_scdp = sfmmup->sfmmu_scdp) != NULL) {
 		ASSERT(old_scdp != scdp);
@@ -15242,7 +15236,7 @@
 	int ret;
 
 	ASSERT(srdp != NULL);
-	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_WRITE_HELD(sfmmup->sfmmu_as));
 
 	mutex_enter(&srdp->srd_scd_mutex);
 	for (scdp = srdp->srd_scdp; scdp != NULL;
@@ -15348,7 +15342,7 @@
 	ASSERT(scdp->scd_refcnt);
 	ASSERT(!sfmmup->sfmmu_free);
 	ASSERT(sfmmu_hat_lock_held(sfmmup));
-	ASSERT(AS_LOCK_HELD(sfmmup->sfmmu_as, &sfmmup->sfmmu_as->a_lock));
+	ASSERT(AS_LOCK_HELD(sfmmup->sfmmu_as));
 
 	/*
 	 * Wait for ISM maps to be updated.
--- old/usr/src/uts/sparc/v9/os/simulator.c	2015-11-25 13:59:42.838979614 -0500
+++ new/usr/src/uts/sparc/v9/os/simulator.c	2015-11-25 13:59:42.842918341 -0500
@@ -1087,7 +1087,7 @@
 
 	as = p->p_as;
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	mapseg = as_findseg(as, (caddr_t)rp->r_pc, 0);
 	ASSERT(mapseg != NULL);
 	svd = (struct segvn_data *)mapseg->s_data;
@@ -1098,11 +1098,11 @@
 	SEGVN_LOCK_ENTER(as, &svd->lock, RW_READER);
 	if ((svd->type & MAP_TYPE) & MAP_SHARED) {
 		SEGVN_LOCK_EXIT(as, &svd->lock);
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		return (SIMU_ILLEGAL);
 	}
 	SEGVN_LOCK_EXIT(as, &svd->lock);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	/*
 	 * A "flush" instruction using the user PC's vaddr will not work
@@ -1114,9 +1114,9 @@
 	    F_SOFTLOCK, S_READ))
 		return (SIMU_FAULT);
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	pfnum = hat_getpfnum(as->a_hat, (caddr_t)rp->r_pc);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 	if (pf_is_memory(pfnum)) {
 		pp = page_numtopp_nolock(pfnum);
 		ASSERT(pp == NULL || PAGE_LOCKED(pp));
@@ -1126,12 +1126,12 @@
 		return (SIMU_FAULT);
 	}
 
-	AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+	AS_LOCK_ENTER(as, RW_READER);
 	ka = ppmapin(pp, PROT_READ|PROT_WRITE, (caddr_t)rp->r_pc);
 	*(uint_t *)(ka + (uintptr_t)(rp->r_pc % PAGESIZE)) = inst;
 	doflush(ka + (uintptr_t)(rp->r_pc % PAGESIZE));
 	ppmapout(ka);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	(void) as_fault(as->a_hat, as, (caddr_t)(rp->r_pc & PAGEMASK),
 	    PAGESIZE, F_SOFTUNLOCK, S_READ);
--- old/usr/src/uts/sparc/v9/vm/seg_nf.c	2015-11-25 13:59:42.983436381 -0500
+++ new/usr/src/uts/sparc/v9/vm/seg_nf.c	2015-11-25 13:59:42.987002674 -0500
@@ -188,7 +188,7 @@
 	size_t size;
 	struct as *as = seg->s_as;
 
-	ASSERT(as && AS_WRITE_HELD(as, &as->a_lock));
+	ASSERT(as && AS_WRITE_HELD(as));
 
 	/*
 	 * Need a page per virtual color or just 1 if no vac.
@@ -306,7 +306,7 @@
 static int
 segnf_unmap(struct seg *seg, caddr_t addr, size_t len)
 {
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	/*
 	 * Check for bad sizes.
@@ -375,7 +375,7 @@
 static void
 segnf_free(struct seg *seg)
 {
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 }
 
 /*
@@ -391,7 +391,7 @@
 static int
 segnf_setprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	return (EACCES);
 }
 
@@ -400,7 +400,7 @@
 segnf_checkprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot)
 {
 	uint_t sprot;
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	sprot = seg->s_as == &kas ?  PROT_READ : PROT_READ|PROT_USER;
 	return ((prot & sprot) == prot ? 0 : EACCES);
@@ -424,7 +424,7 @@
 {
 	size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1;
 	size_t p;
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	for (p = 0; p < pgno; ++p)
 		protv[p] = PROT_READ;
@@ -435,7 +435,7 @@
 static u_offset_t
 segnf_getoffset(struct seg *seg, caddr_t addr)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return ((u_offset_t)0);
 }
@@ -444,7 +444,7 @@
 static int
 segnf_gettype(struct seg *seg, caddr_t addr)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (MAP_SHARED);
 }
@@ -453,7 +453,7 @@
 static int
 segnf_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp)
 {
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	*vpp = &nfvp;
 	return (0);
--- old/usr/src/uts/sun4/io/rootnex.c	2015-11-25 13:59:43.105759034 -0500
+++ new/usr/src/uts/sun4/io/rootnex.c	2015-11-25 13:59:43.109484477 -0500
@@ -746,7 +746,7 @@
 			 * the hat of the system MMU.  At alternative
 			 * would be to panic .. this might well be better ..
 			 */
-			ASSERT(AS_READ_HELD(seg->s_as, &seg->s_as->a_lock));
+			ASSERT(AS_READ_HELD(seg->s_as));
 			hat = seg->s_as->a_hat;
 			cmn_err(CE_NOTE, "rootnex_map_fault: nil hat");
 		}
