--- old/usr/src/cmd/mdb/common/modules/genunix/genunix.c	2014-07-28 07:43:43.508681176 -0400
+++ new/usr/src/cmd/mdb/common/modules/genunix/genunix.c	2014-07-28 07:43:43.514604319 -0400
@@ -3607,8 +3607,8 @@
 
 	/*
 	 * If eq_ptail is set, it may point to a subset of the errors on the
-	 * pending list in the event a casptr() failed; if ptail's data is
-	 * already in our stack, NULL out eq_ptail and ignore it.
+	 * pending list in the event a atomic_cas_ptr() failed; if ptail's
+	 * data is already in our stack, NULL out eq_ptail and ignore it.
 	 */
 	if (eq.eq_ptail != NULL) {
 		for (i = 0; i < eqdp->eqd_qpos; i++) {
--- old/usr/src/uts/common/disp/fss.c	2014-07-28 07:43:43.819729307 -0400
+++ new/usr/src/uts/common/disp/fss.c	2014-07-28 07:43:43.825329040 -0400
@@ -1445,7 +1445,7 @@
 	 * (but check with an ordinary load first since most of the time
 	 * this will already be done).
 	 */
-	if (fssexists == 0 && cas32(&fssexists, 0, 1) == 0)
+	if (fssexists == 0 && atomic_cas_32(&fssexists, 0, 1) == 0)
 		(void) timeout(fss_update, NULL, hz);
 
 	return (0);
--- old/usr/src/uts/common/disp/ts.c	2014-07-28 07:43:44.088255197 -0400
+++ new/usr/src/uts/common/disp/ts.c	2014-07-28 07:43:44.094234153 -0400
@@ -650,7 +650,7 @@
 	 * faster than a mutex (but check with an ordinary load first
 	 * since most of the time this will already be done).
 	 */
-	if (tspexists == 0 && cas32(&tspexists, 0, 1) == 0)
+	if (tspexists == 0 && atomic_cas_32(&tspexists, 0, 1) == 0)
 		(void) timeout(ts_update, NULL, hz);
 
 	return (0);
--- old/usr/src/uts/common/dtrace/systrace.c	2014-07-28 07:43:44.330965929 -0400
+++ new/usr/src/uts/common/dtrace/systrace.c	2014-07-28 07:43:44.336491787 -0400
@@ -164,11 +164,11 @@
 		return (0);
 	}
 
-	(void) casptr(&sysent[sysnum].sy_callc,
+	(void) atomic_cas_ptr(&sysent[sysnum].sy_callc,
 	    (void *)systrace_sysent[sysnum].stsy_underlying,
 	    (void *)dtrace_systrace_syscall);
 #ifdef _SYSCALL32_IMPL
-	(void) casptr(&sysent32[sysnum].sy_callc,
+	(void) atomic_cas_ptr(&sysent32[sysnum].sy_callc,
 	    (void *)systrace_sysent32[sysnum].stsy_underlying,
 	    (void *)dtrace_systrace_syscall32);
 #endif
@@ -184,12 +184,12 @@
 	    systrace_sysent[sysnum].stsy_return == DTRACE_IDNONE);
 
 	if (disable) {
-		(void) casptr(&sysent[sysnum].sy_callc,
+		(void) atomic_cas_ptr(&sysent[sysnum].sy_callc,
 		    (void *)dtrace_systrace_syscall,
 		    (void *)systrace_sysent[sysnum].stsy_underlying);
 
 #ifdef _SYSCALL32_IMPL
-		(void) casptr(&sysent32[sysnum].sy_callc,
+		(void) atomic_cas_ptr(&sysent32[sysnum].sy_callc,
 		    (void *)dtrace_systrace_syscall32,
 		    (void *)systrace_sysent32[sysnum].stsy_underlying);
 #endif
--- old/usr/src/uts/common/fs/fem.c	2014-07-28 07:43:44.499855377 -0400
+++ new/usr/src/uts/common/fs/fem.c	2014-07-28 07:43:44.505463709 -0400
@@ -2872,7 +2872,7 @@
 	head = kmem_alloc(sizeof (*head), KM_SLEEP);
 	mutex_init(&head->femh_lock, NULL, MUTEX_DEFAULT, NULL);
 	head->femh_list = NULL;
-	if (casptr(hp, NULL, head) != NULL) {
+	if (atomic_cas_ptr(hp, NULL, head) != NULL) {
 		kmem_free(head, sizeof (*head));
 		head = *hp;
 	}
@@ -3365,7 +3365,7 @@
 			}
 			fem_unlock(v->v_femhead);
 		}
-	} while (casptr(&v->v_op, r, newops) != r);
+	} while (atomic_cas_ptr(&v->v_op, r, newops) != r);
 }
 
 vnodeops_t *
@@ -3508,7 +3508,7 @@
 			}
 			fem_unlock(v->vfs_femhead);
 		}
-	} while (casptr(&v->vfs_op, r, newops) != r);
+	} while (atomic_cas_ptr(&v->vfs_op, r, newops) != r);
 }
 
 vfsops_t *
--- old/usr/src/uts/common/fs/portfs/port_fop.c	2014-07-28 07:43:44.769505884 -0400
+++ new/usr/src/uts/common/fs/portfs/port_fop.c	2014-07-28 07:43:44.775002058 -0400
@@ -293,7 +293,7 @@
 	    (fem_t **)&femp)) {
 		return (NULL);
 	}
-	if (casptr(&fop_femop, NULL, femp) != NULL) {
+	if (atomic_cas_ptr(&fop_femop, NULL, femp) != NULL) {
 		/*
 		 * some other thread beat us to it.
 		 */
@@ -311,7 +311,7 @@
 	if (fsem_create("portfop_fsem", port_vfssrc_template, &fsemp)) {
 		return (NULL);
 	}
-	if (casptr(&fop_fsemop, NULL, fsemp) != NULL) {
+	if (atomic_cas_ptr(&fop_fsemop, NULL, fsemp) != NULL) {
 		/*
 		 * some other thread beat us to it.
 		 */
@@ -1087,7 +1087,7 @@
 	/*
 	 * If v_fopdata is not null, some other thread beat us to it.
 	 */
-	if (casptr(&vp->v_fopdata, NULL, npvp) != NULL) {
+	if (atomic_cas_ptr(&vp->v_fopdata, NULL, npvp) != NULL) {
 		mutex_destroy(&npvp->pvp_mutex);
 		list_destroy(&npvp->pvp_pfoplist);
 		kmem_free(npvp, sizeof (*npvp));
--- old/usr/src/uts/common/fs/vfs.c	2014-07-28 07:43:45.009240993 -0400
+++ new/usr/src/uts/common/fs/vfs.c	2014-07-28 07:43:45.015849246 -0400
@@ -467,7 +467,7 @@
 	op = vfsp->vfs_op;
 	membar_consumer();
 	if (vfsp->vfs_femhead == NULL &&
-	    casptr(&vfsp->vfs_op, op, vfsops) == op) {
+	    atomic_cas_ptr(&vfsp->vfs_op, op, vfsops) == op) {
 		return;
 	}
 	fsem_setvfsops(vfsp, vfsops);
@@ -2969,7 +2969,7 @@
 		oldhrt = hrt;
 		if (newhrt <= hrt)
 			newhrt = hrt + 1;
-		if (cas64((uint64_t *)&hrt, oldhrt, newhrt) == oldhrt)
+		if (atomic_cas_64((uint64_t *)&hrt, oldhrt, newhrt) == oldhrt)
 			break;
 	}
 	hrt2ts(newhrt, ts);
--- old/usr/src/uts/common/fs/vnode.c	2014-07-28 07:43:45.325989300 -0400
+++ new/usr/src/uts/common/fs/vnode.c	2014-07-28 07:43:45.331587870 -0400
@@ -2837,11 +2837,12 @@
 	op = vp->v_op;
 	membar_consumer();
 	/*
-	 * If vp->v_femhead == NULL, then we'll call casptr() to do the
-	 * compare-and-swap on vp->v_op.  If either fails, then FEM is
+	 * If vp->v_femhead == NULL, then we'll call atomic_cas_ptr() to do
+	 * the compare-and-swap on vp->v_op.  If either fails, then FEM is
 	 * in effect on the vnode and we need to have FEM deal with it.
 	 */
-	if (vp->v_femhead != NULL || casptr(&vp->v_op, op, vnodeops) != op) {
+	if (vp->v_femhead != NULL || atomic_cas_ptr(&vp->v_op, op, vnodeops) !=
+	    op) {
 		fem_setvnops(vp, vnodeops);
 	}
 }
--- old/usr/src/uts/common/inet/ip/sadb.c	2014-07-28 07:43:45.636432446 -0400
+++ new/usr/src/uts/common/inet/ip/sadb.c	2014-07-28 07:43:45.642354411 -0400
@@ -1731,7 +1731,7 @@
 	 * messages.
 	 */
 
-	oldq = casptr((void **)pfkey_qp, NULL, OTHERQ(q));
+	oldq = atomic_cas_ptr((void **)pfkey_qp, NULL, OTHERQ(q));
 	if (oldq != NULL) {
 		ASSERT(oldq != q);
 		cmn_err(CE_WARN, "Danger!  Multiple keysocks on top of %s.\n",
@@ -1746,8 +1746,8 @@
 	kha->ks_hello_satype = (uint8_t)satype;
 
 	/*
-	 * If we made it past the casptr, then we have "exclusive" access
-	 * to the timeout handle.  Fire it off after the default ager
+	 * If we made it past the atomic_cas_ptr, then we have "exclusive"
+	 * access to the timeout handle.  Fire it off after the default ager
 	 * interval.
 	 */
 	*top = qtimeout(*pfkey_qp, ager, agerarg,
--- old/usr/src/uts/common/inet/ipsecah.h	2014-07-28 07:43:46.071174674 -0400
+++ new/usr/src/uts/common/inet/ipsecah.h	2014-07-28 07:43:46.076711849 -0400
@@ -105,8 +105,8 @@
 
 	/*
 	 * Keysock instance of AH.  There can be only one per stack instance.
-	 * Use casptr() on this because I don't set it until KEYSOCK_HELLO
-	 * comes down.
+	 * Use atomic_cas_ptr() on this because I don't set it until
+	 * KEYSOCK_HELLO comes down.
 	 * Paired up with the ah_pfkey_q is the ah_event, which will age SAs.
 	 */
 	queue_t			*ah_pfkey_q;
--- old/usr/src/uts/common/inet/ipsecesp.h	2014-07-28 07:43:46.231737597 -0400
+++ new/usr/src/uts/common/inet/ipsecesp.h	2014-07-28 07:43:46.237805818 -0400
@@ -61,8 +61,8 @@
 
 	/*
 	 * Keysock instance of ESP.  There can be only one per stack instance.
-	 * Use casptr() on this because I don't set it until KEYSOCK_HELLO
-	 * comes down.
+	 * Use atomic_cas_ptr() on this because I don't set it until
+	 * KEYSOCK_HELLO comes down.
 	 * Paired up with the esp_pfkey_q is the esp_event, which will age SAs.
 	 */
 	queue_t			*esp_pfkey_q;
--- old/usr/src/uts/common/inet/keysock.h	2014-07-28 07:43:46.393291339 -0400
+++ new/usr/src/uts/common/inet/keysock.h	2014-07-28 07:43:46.399003463 -0400
@@ -74,7 +74,7 @@
 
 	/*
 	 * State for flush/dump.  This would normally be a boolean_t, but
-	 * cas32() works best for a known 32-bit quantity.
+	 * atomic_cas_32() works best for a known 32-bit quantity.
 	 */
 	uint32_t		keystack_flushdump;
 	int			keystack_flushdump_errno;
--- old/usr/src/uts/common/inet/nca/nca.h	2014-07-28 07:43:46.557243332 -0400
+++ new/usr/src/uts/common/inet/nca/nca.h	2014-07-28 07:43:46.562915044 -0400
@@ -695,7 +695,7 @@
 		_p = node_tp;						\
 		if ((_np = _p + 1) == &node_tv[NODE_TV_SZ])		\
 			_np = node_tv;					\
-	} while (casptr(&node_tp, _p, _np) != _p);			\
+	} while (atomic_cas_ptr(&node_tp, _p, _np) != _p);		\
 	_p->node = (p);							\
 	_p->action = (a);						\
 	_p->ref = (p) ? (p)->ref : 0;					\
@@ -785,7 +785,7 @@
 		_p = door_tp;						\
 		if ((_np = _p + 1) == &door_tv[DOOR_TV_SZ])		\
 			_np = door_tv;					\
-	} while (casptr(&door_tp, _p, _np) != _p);			\
+	} while (atomic_cas_ptr(&door_tp, _p, _np) != _p);		\
 	_p->cp = _cp;							\
 	_p->np = _req_np;						\
 	_p->action = (a);						\
@@ -987,7 +987,7 @@
 				continue;				\
 			}						\
 			new = old | DCB_COUNT_USELOCK;			\
-			while (cas32(rp, old, new) != old) {		\
+			while (atomic_cas_32(rp, old, new) != old) {	\
 				old = *rp;				\
 				new = old | DCB_COUNT_USELOCK;		\
 			}						\
@@ -1010,7 +1010,7 @@
 		int old = *rp;						\
 									\
 		new = old & ~DCB_COUNT_USELOCK;				\
-		while (cas32(rp, old, new) != old) {			\
+		while (atomic_cas_32(rp, old, new) != old) {		\
 			old = *rp;					\
 			new = old & ~DCB_COUNT_USELOCK;			\
 		}							\
@@ -1543,7 +1543,7 @@
 		_p = conn_tp;					\
 		if ((_np = _p + 1) == &con_tv[CON_TV_SZ])	\
 			_np = con_tv;				\
-	} while (casptr(&conn_tp, _p, _np) != _p);			\
+	} while (atomic_cas_ptr(&conn_tp, _p, _np) != _p);		\
 	_p->conn = (p);							\
 	_p->action = (a);						\
 	_p->ref = (p)->ref;						\
@@ -1765,7 +1765,7 @@
 		_ntp = _otp + 1;					\
 		if (_ntp == &nca_counter_tv[NCA_COUNTER_TRACE_SZ])	\
 			_ntp = nca_counter_tv;				\
-	} while (casptr((void *)&nca_counter_tp, (void *)_otp,		\
+	} while (atomic_cas_ptr((void *)&nca_counter_tp, (void *)_otp,	\
 	    (void *)_ntp) != (void *)_otp);				\
 	_ntp->t = gethrtime();						\
 	_ntp->p = p;							\
--- old/usr/src/uts/common/inet/tcp/tcp_input.c	2014-07-28 07:43:46.793612364 -0400
+++ new/usr/src/uts/common/inet/tcp/tcp_input.c	2014-07-28 07:43:46.799395548 -0400
@@ -1939,7 +1939,8 @@
 		}
 		if (connp->conn_sqp != new_sqp) {
 			while (connp->conn_sqp != new_sqp)
-				(void) casptr(&connp->conn_sqp, sqp, new_sqp);
+				(void) atomic_cas_ptr(&connp->conn_sqp, sqp,
+				    new_sqp);
 			/* No special MT issues for outbound ixa_sqp hint */
 			connp->conn_ixa->ixa_sqp = new_sqp;
 		}
@@ -1947,8 +1948,8 @@
 		do {
 			conn_flags = connp->conn_flags;
 			conn_flags |= IPCL_FULLY_BOUND;
-			(void) cas32(&connp->conn_flags, connp->conn_flags,
-			    conn_flags);
+			(void) atomic_cas_32(&connp->conn_flags,
+			    connp->conn_flags, conn_flags);
 		} while (!(connp->conn_flags & IPCL_FULLY_BOUND));
 
 		mutex_exit(&connp->conn_fanout->connf_lock);
--- old/usr/src/uts/common/io/bge/bge_atomic.c	2014-07-28 07:43:47.158457851 -0400
+++ new/usr/src/uts/common/io/bge/bge_atomic.c	2014-07-28 07:43:47.164042905 -0400
@@ -24,8 +24,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include "bge_impl.h"
 
 /*
@@ -49,7 +47,7 @@
 		newval = oldval - n;
 		if (oldval <= n)
 			return (0);		/* no resources left	*/
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 
 	return (newval);
 }
@@ -67,7 +65,7 @@
 	do {
 		oldval = *count_p;
 		newval = oldval + n;
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 }
 
 /*
@@ -83,7 +81,7 @@
 	do {
 		oldval = *count_p;
 		newval = NEXT(oldval, limit);
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 
 	return (oldval);
 }
@@ -102,7 +100,7 @@
 	do {
 		oldval = *sp;
 		newval = NEXT(oldval, limit);
-	} while (cas64(sp, oldval, newval) != oldval);
+	} while (atomic_cas_64(sp, oldval, newval) != oldval);
 
 	return (oldval);
 }
@@ -120,7 +118,7 @@
 	do {
 		oldval = *count_p;
 		newval = oldval - n;
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 }
 
 /*
@@ -137,7 +135,7 @@
 	do {
 		oldval = *sp;
 		newval = oldval & ~bits;
-	} while (cas64(sp, oldval, newval) != oldval);
+	} while (atomic_cas_64(sp, oldval, newval) != oldval);
 
 	return (oldval);
 }
@@ -156,7 +154,7 @@
 	do {
 		oldval = *sp;
 		newval = oldval << count;
-	} while (cas32(sp, oldval, newval) != oldval);
+	} while (atomic_cas_32(sp, oldval, newval) != oldval);
 
 	return (oldval);
 }
--- old/usr/src/uts/common/io/hxge/hxge_send.c	2014-07-28 07:43:47.325377002 -0400
+++ new/usr/src/uts/common/io/hxge/hxge_send.c	2014-07-28 07:43:47.331396161 -0400
@@ -219,7 +219,7 @@
 		    "TX Descriptor ring is full: channel %d", tx_ring_p->tdc));
 		HXGE_DEBUG_MSG((hxgep, TX_CTL,
 		    "TX Descriptor ring is full: channel %d", tx_ring_p->tdc));
-		(void) cas32((uint32_t *)&tx_ring_p->queueing, 0, 1);
+		(void) atomic_cas_32((uint32_t *)&tx_ring_p->queueing, 0, 1);
 		tdc_stats->tx_no_desc++;
 		MUTEX_EXIT(&tx_ring_p->lock);
 		status = 1;
--- old/usr/src/uts/common/io/hxge/hxge_txdma.c	2014-07-28 07:43:47.516831215 -0400
+++ new/usr/src/uts/common/io/hxge/hxge_txdma.c	2014-07-28 07:43:47.522809981 -0400
@@ -787,7 +787,8 @@
 		status = (nmblks <= ((int)tx_ring_p->tx_ring_size -
 		    (int)tx_ring_p->descs_pending - TX_FULL_MARK));
 		if (status) {
-			(void) cas32((uint32_t *)&tx_ring_p->queueing, 1, 0);
+			(void) atomic_cas_32((uint32_t *)&tx_ring_p->queueing,
+			    1, 0);
 		}
 	} else {
 		status = (nmblks <= ((int)tx_ring_p->tx_ring_size -
--- old/usr/src/uts/common/io/ksyms.c	2014-07-28 07:43:47.779205258 -0400
+++ new/usr/src/uts/common/io/ksyms.c	2014-07-28 07:43:47.784822041 -0400
@@ -247,7 +247,8 @@
 	 * since that's the "real" minor number.
 	 */
 	for (clone = 1; clone < nksyms_clones; clone++) {
-		if (casptr(&ksyms_clones[clone].ksyms_base, 0, addr) == 0) {
+		if (atomic_cas_ptr(&ksyms_clones[clone].ksyms_base, 0, addr) ==
+		    0) {
 			ksyms_clones[clone].ksyms_size = realsize;
 			*devp = makedevice(getemajor(*devp), clone);
 			(void) ddi_prop_update_int(*devp, ksyms_devi,
--- old/usr/src/uts/common/io/multidata.c	2014-07-28 07:43:47.951522327 -0400
+++ new/usr/src/uts/common/io/multidata.c	2014-07-28 07:43:47.957516722 -0400
@@ -24,8 +24,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * Multidata, as described in the following papers:
  *
@@ -1294,7 +1292,7 @@
 			return (NULL);
 
 		/* if someone got there first, use his table instead */
-		if ((o_tbl = casptr(tbl_p, NULL, tbl)) != NULL) {
+		if ((o_tbl = atomic_cas_ptr(tbl_p, NULL, tbl)) != NULL) {
 			kmem_cache_free(pattbl_cache, tbl);
 			tbl = o_tbl;
 		}
--- old/usr/src/uts/common/io/nge/nge_atomic.c	2014-07-28 07:43:48.167820672 -0400
+++ new/usr/src/uts/common/io/nge/nge_atomic.c	2014-07-28 07:43:48.173490233 -0400
@@ -24,8 +24,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include "nge.h"
 
 /*
@@ -44,7 +42,7 @@
 		newval = oldval - n;
 		if (oldval < n)
 			return (B_FALSE);
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 
 	return (B_TRUE);
 }
@@ -62,7 +60,7 @@
 	do {
 		oldval = *count_p;
 		newval = oldval + n;
-	} while (cas64(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_64(count_p, oldval, newval) != oldval);
 }
 
 
@@ -80,7 +78,7 @@
 	do {
 		oldval = *sp;
 		newval = oldval << count;
-	} while (cas32(sp, oldval, newval) != oldval);
+	} while (atomic_cas_32(sp, oldval, newval) != oldval);
 
 	return (oldval);
 }
--- old/usr/src/uts/common/io/nxge/nxge_send.c	2014-07-28 07:43:48.329728843 -0400
+++ new/usr/src/uts/common/io/nxge/nxge_send.c	2014-07-28 07:43:48.335596437 -0400
@@ -373,8 +373,8 @@
 				    tx_ring_p->tdc));
 				goto nxge_start_fail_lso;
 			} else {
-				(void) cas32((uint32_t *)&tx_ring_p->queueing,
-				    0, 1);
+				(void) atomic_cas_32(
+				    (uint32_t *)&tx_ring_p->queueing, 0, 1);
 				tdc_stats->tx_no_desc++;
 
 				if (isLDOMservice(nxgep)) {
--- old/usr/src/uts/common/io/nxge/nxge_txdma.c	2014-07-28 07:43:48.552868022 -0400
+++ new/usr/src/uts/common/io/nxge/nxge_txdma.c	2014-07-28 07:43:48.558502315 -0400
@@ -1083,7 +1083,8 @@
 		status = (nmblks <= ((int)tx_ring_p->tx_ring_size -
 		    (int)tx_ring_p->descs_pending - TX_FULL_MARK));
 		if (status) {
-			(void) cas32((uint32_t *)&tx_ring_p->queueing, 1, 0);
+			(void) atomic_cas_32((uint32_t *)&tx_ring_p->queueing,
+			    1, 0);
 		}
 	} else {
 		status = (nmblks <= ((int)tx_ring_p->tx_ring_size -
--- old/usr/src/uts/common/io/rge/rge_chip.c	2014-07-28 07:43:48.833953951 -0400
+++ new/usr/src/uts/common/io/rge/rge_chip.c	2014-07-28 07:43:48.839532943 -0400
@@ -285,7 +285,7 @@
 	do {
 		oldval = *sp;
 		newval = oldval << count;
-	} while (cas32(sp, oldval, newval) != oldval);
+	} while (atomic_cas_32(sp, oldval, newval) != oldval);
 
 	return (oldval);
 }
--- old/usr/src/uts/common/io/rge/rge_rxtx.c	2014-07-28 07:43:49.076886951 -0400
+++ new/usr/src/uts/common/io/rge/rge_rxtx.c	2014-07-28 07:43:49.082773895 -0400
@@ -49,7 +49,7 @@
 		newval = oldval - n;
 		if (oldval <= n)
 			return (0);		/* no resources left	*/
-	} while (cas32(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_32(count_p, oldval, newval) != oldval);
 
 	return (newval);
 }
@@ -70,7 +70,7 @@
 	do {
 		oldval = *count_p;
 		newval = oldval + n;
-	} while (cas32(count_p, oldval, newval) != oldval);
+	} while (atomic_cas_32(count_p, oldval, newval) != oldval);
 }
 
 /*
--- old/usr/src/uts/common/io/smbios.c	2014-07-28 07:43:49.259264326 -0400
+++ new/usr/src/uts/common/io/smbios.c	2014-07-28 07:43:49.265126553 -0400
@@ -78,7 +78,7 @@
 	 * the real minor number, and we assign a new minor to each clone.
 	 */
 	for (c = 1; c < smb_nclones; c++) {
-		if (casptr(&smb_clones[c].c_hdl, NULL, ksmbios) == NULL)
+		if (atomic_cas_ptr(&smb_clones[c].c_hdl, NULL, ksmbios) == NULL)
 			break;
 	}
 
--- old/usr/src/uts/common/io/stream.c	2014-07-28 07:43:49.428035108 -0400
+++ new/usr/src/uts/common/io/stream.c	2014-07-28 07:43:49.433656330 -0400
@@ -798,7 +798,8 @@
 			new_mp = NULL;
 			goto out;
 		}
-	} while (cas32(&DBLK_RTFU_WORD(dbp), oldrtfu, newrtfu) != oldrtfu);
+	} while (atomic_cas_32(&DBLK_RTFU_WORD(dbp), oldrtfu, newrtfu) !=
+	    oldrtfu);
 
 out:
 	FTRACE_1("dupb(): new_mp=0x%lx", (uintptr_t)new_mp);
@@ -4250,7 +4251,7 @@
 			 * the value is there for it.
 			 */
 			membar_producer();
-			if (casptr(&hp->tail, bp, nbp) == bp) {
+			if (atomic_cas_ptr(&hp->tail, bp, nbp) == bp) {
 				/* CAS was successful */
 				bp->nxt = nbp;
 				membar_producer();
@@ -4264,7 +4265,7 @@
 			}
 		}
 		nix = ix + 1;
-		if (cas32((uint32_t *)&bp->ix, ix, nix) == ix) {
+		if (atomic_cas_32((uint32_t *)&bp->ix, ix, nix) == ix) {
 		cas_good:
 			if (curthread != hp->thread) {
 				hp->thread = curthread;
--- old/usr/src/uts/common/io/xge/drv/xge_osdep.h	2014-07-28 07:43:49.733793976 -0400
+++ new/usr/src/uts/common/io/xge/drv/xge_osdep.h	2014-07-28 07:43:49.739345223 -0400
@@ -188,8 +188,8 @@
 
 #define	xge_os_cmpxchg(targetp, cmp, newval)		\
 	sizeof (*(targetp)) == 4 ?			\
-	cas32((uint32_t *)targetp, cmp, newval) :	\
-	cas64((uint64_t *)targetp, cmp, newval)
+	atomic_cas_32((uint32_t *)targetp, cmp, newval) :	\
+	atomic_cas_64((uint64_t *)targetp, cmp, newval)
 
 /* ------------------------- misc primitives ------------------------------- */
 
--- old/usr/src/uts/common/os/clock.c	2014-07-28 07:43:49.904345915 -0400
+++ new/usr/src/uts/common/os/clock.c	2014-07-28 07:43:49.910362025 -0400
@@ -1645,7 +1645,7 @@
 
 	do {
 		ticks = lwp->lwp_oweupc;
-	} while (cas32(&lwp->lwp_oweupc, ticks, 0) != ticks);
+	} while (atomic_cas_32(&lwp->lwp_oweupc, ticks, 0) != ticks);
 
 	mutex_enter(&p->p_pflock);
 	if (pr->pr_scale >= 2 && upc >= pr->pr_off) {
--- old/usr/src/uts/common/os/clock_highres.c	2014-07-28 07:43:50.150593441 -0400
+++ new/usr/src/uts/common/os/clock_highres.c	2014-07-28 07:43:50.156110217 -0400
@@ -93,7 +93,7 @@
 
 	do {
 		old = *addr;
-	} while (cas64((uint64_t *)addr, old, new) != old);
+	} while (atomic_cas_64((uint64_t *)addr, old, new) != old);
 
 	timer_fire(it);
 }
@@ -235,10 +235,10 @@
 	hrtime_t last;
 
 	/*
-	 * We're using cas64() here only to assure that we slurp the entire
-	 * timestamp atomically.
+	 * We're using atomic_cas_64() here only to assure that we slurp the
+	 * entire timestamp atomically.
 	 */
-	last = cas64((uint64_t *)addr, 0, 0);
+	last = atomic_cas_64((uint64_t *)addr, 0, 0);
 
 	*when = it->it_itime;
 
--- old/usr/src/uts/common/os/cyclic.c	2014-07-28 07:43:50.323557485 -0400
+++ new/usr/src/uts/common/os/cyclic.c	2014-07-28 07:43:50.329394026 -0400
@@ -658,7 +658,8 @@
 			break;
 
 		if (cyc_coverage[ndx].cyv_why != NULL ||
-		    casptr(&cyc_coverage[ndx].cyv_why, NULL, why) != NULL) {
+		    atomic_cas_ptr(&cyc_coverage[ndx].cyv_why, NULL, why) !=
+		    NULL) {
 
 			if (++ndx == CY_NCOVERAGE)
 				ndx = 0;
@@ -1219,9 +1220,10 @@
 			}
 
 			if ((opend =
-			    cas32(&cyclic->cy_pend, pend, npend)) != pend) {
+			    atomic_cas_32(&cyclic->cy_pend, pend, npend)) !=
+			    pend) {
 				/*
-				 * Our cas32 can fail for one of several
+				 * Our atomic_cas_32 can fail for one of several
 				 * reasons:
 				 *
 				 *  (a)	An intervening high level bumped up the
@@ -1311,7 +1313,8 @@
 		do {
 			lev = cpu->cyp_modify_levels;
 			nlev = lev + 1;
-		} while (cas32(&cpu->cyp_modify_levels, lev, nlev) != lev);
+		} while (atomic_cas_32(&cpu->cyp_modify_levels, lev, nlev) !=
+		    lev);
 
 		/*
 		 * If we are the last soft level to see the modification,
--- old/usr/src/uts/common/os/dtrace_subr.c	2014-07-28 07:43:50.609287908 -0400
+++ new/usr/src/uts/common/os/dtrace_subr.c	2014-07-28 07:43:50.614870979 -0400
@@ -203,7 +203,7 @@
 			/*NOTREACHED*/
 		}
 
-	} while	(cas32((uint32_t *)&dtrace_vtime_active,
+	} while	(atomic_cas_32((uint32_t *)&dtrace_vtime_active,
 	    state, nstate) != state);
 }
 
@@ -230,7 +230,7 @@
 			/*NOTREACHED*/
 		}
 
-	} while	(cas32((uint32_t *)&dtrace_vtime_active,
+	} while	(atomic_cas_32((uint32_t *)&dtrace_vtime_active,
 	    state, nstate) != state);
 }
 
@@ -257,7 +257,7 @@
 			/*NOTREACHED*/
 		}
 
-	} while	(cas32((uint32_t *)&dtrace_vtime_active,
+	} while	(atomic_cas_32((uint32_t *)&dtrace_vtime_active,
 	    state, nstate) != state);
 }
 
@@ -284,7 +284,7 @@
 			/*NOTREACHED*/
 		}
 
-	} while	(cas32((uint32_t *)&dtrace_vtime_active,
+	} while	(atomic_cas_32((uint32_t *)&dtrace_vtime_active,
 	    state, nstate) != state);
 }
 
--- old/usr/src/uts/common/os/errorq.c	2014-07-28 07:43:50.777135711 -0400
+++ new/usr/src/uts/common/os/errorq.c	2014-07-28 07:43:50.782782217 -0400
@@ -555,7 +555,7 @@
 		eep->eqe_prev = old;
 		membar_producer();
 
-		if (casptr(&eqp->eq_pend, old, eep) == old)
+		if (atomic_cas_ptr(&eqp->eq_pend, old, eep) == old)
 			break;
 	}
 
@@ -596,15 +596,16 @@
 	 * make sure that eq_ptail will be visible to errorq_panic() below
 	 * before the pending list is NULLed out.  This section is labeled
 	 * case (1) for errorq_panic, below.  If eq_ptail is not yet set (1A)
-	 * eq_pend has all the pending errors.  If casptr fails or has not
-	 * been called yet (1B), eq_pend still has all the pending errors.
-	 * If casptr succeeds (1C), eq_ptail has all the pending errors.
+	 * eq_pend has all the pending errors.  If atomic_cas_ptr fails or
+	 * has not been called yet (1B), eq_pend still has all the pending
+	 * errors.  If atomic_cas_ptr succeeds (1C), eq_ptail has all the
+	 * pending errors.
 	 */
 	while ((eep = eqp->eq_pend) != NULL) {
 		eqp->eq_ptail = eep;
 		membar_producer();
 
-		if (casptr(&eqp->eq_pend, eep, NULL) == eep)
+		if (atomic_cas_ptr(&eqp->eq_pend, eep, NULL) == eep)
 			break;
 	}
 
@@ -750,13 +751,14 @@
 		loggedtmp = eqp->eq_kstat.eqk_logged.value.ui64;
 
 		/*
-		 * In case (1B) above, eq_ptail may be set but the casptr may
-		 * not have been executed yet or may have failed.  Either way,
-		 * we must log errors in chronological order.  So we search
-		 * the pending list for the error pointed to by eq_ptail.  If
-		 * it is found, we know that all subsequent errors are also
-		 * still on the pending list, so just NULL out eq_ptail and let
-		 * errorq_drain(), below, take care of the logging.
+		 * In case (1B) above, eq_ptail may be set but the
+		 * atomic_cas_ptr may not have been executed yet or may have
+		 * failed.  Either way, we must log errors in chronological
+		 * order.  So we search the pending list for the error
+		 * pointed to by eq_ptail.  If it is found, we know that all
+		 * subsequent errors are also still on the pending list, so
+		 * just NULL out eq_ptail and let errorq_drain(), below,
+		 * take care of the logging.
 		 */
 		for (eep = eqp->eq_pend; eep != NULL; eep = eep->eqe_prev) {
 			if (eep == eqp->eq_ptail) {
@@ -790,8 +792,9 @@
 		 *
 		 * Unlike errorq_drain(), we don't need to worry about updating
 		 * eq_phead because errorq_panic() will be called at most once.
-		 * However, we must use casptr to update the freelist in case
-		 * errors are still being enqueued during panic.
+		 * However, we must use atomic_cas_ptr to update the
+		 * freelist in case errors are still being enqueued during
+		 * panic.
 		 */
 		for (eep = eqp->eq_phead; eep != NULL; eep = nep) {
 			eqp->eq_func(eqp->eq_private, eep->eqe_data, eep);
@@ -914,7 +917,7 @@
 		eqep->eqe_prev = old;
 		membar_producer();
 
-		if (casptr(&eqp->eq_pend, old, eqep) == old)
+		if (atomic_cas_ptr(&eqp->eq_pend, old, eqep) == old)
 			break;
 	}
 
--- old/usr/src/uts/common/os/fm.c	2014-07-28 07:43:50.972106330 -0400
+++ new/usr/src/uts/common/os/fm.c	2014-07-28 07:43:50.977716466 -0400
@@ -374,7 +374,7 @@
 {
 	va_list ap;
 
-	(void) casptr((void *)&fm_panicstr, NULL, (void *)format);
+	(void) atomic_cas_ptr((void *)&fm_panicstr, NULL, (void *)format);
 #if defined(__i386) || defined(__amd64)
 	fastreboot_disable_highpil();
 #endif /* __i386 || __amd64 */
--- old/usr/src/uts/common/os/kdi.c	2014-07-28 07:43:51.174663049 -0400
+++ new/usr/src/uts/common/os/kdi.c	2014-07-28 07:43:51.180406707 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/cpuvar.h>
 #include <sys/kdi_impl.h>
 #include <sys/reboot.h>
@@ -151,7 +149,7 @@
 		default:
 			return (EINVAL);
 		}
-	} while (cas32((uint_t *)&kdi_dtrace_state, cur, new) != cur);
+	} while (atomic_cas_32((uint_t *)&kdi_dtrace_state, cur, new) != cur);
 
 	return (0);
 }
--- old/usr/src/uts/common/os/kmem.c	2014-07-28 07:43:51.339752599 -0400
+++ new/usr/src/uts/common/os/kmem.c	2014-07-28 07:43:51.345970333 -0400
@@ -3166,7 +3166,7 @@
 	uint32_t *flag = (uint32_t *)flag_arg;
 
 	if (MUTEX_HELD(&kmem_cache_lock) || kmem_taskq == NULL ||
-	    cas32(flag, 0, 1) != 0)
+	    atomic_cas_32(flag, 0, 1) != 0)
 		return;
 
 	/*
--- old/usr/src/uts/common/os/lgrp.c	2014-07-28 07:43:51.691029601 -0400
+++ new/usr/src/uts/common/os/lgrp.c	2014-07-28 07:43:51.696662766 -0400
@@ -2773,8 +2773,8 @@
 					new = LGRP_LOADAVG_MAX;
 				else if (new < 0)
 					new = 0;
-			} while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old,
-			    new) != old);
+			} while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg,
+			    old, new) != old);
 		} else {
 			/*
 			 * We're supposed to update the load, but not age it.
@@ -2792,8 +2792,8 @@
 				 */
 				if (new < old)
 					new = LGRP_LOADAVG_MAX;
-			} while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old,
-			    new) != old);
+			} while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg,
+			    old, new) != old);
 		}
 
 		/*
@@ -3354,7 +3354,7 @@
 						 */
 						new = 0;
 					}
-				} while (cas32(
+				} while (atomic_cas_32(
 				    (lgrp_load_t *)&lpl->lpl_loadavg, old,
 				    new) != old);
 
@@ -3423,8 +3423,8 @@
 				 */
 				if (new < old)
 					new = UINT32_MAX;
-			} while (cas32((lgrp_load_t *)&lpl->lpl_loadavg, old,
-			    new) != old);
+			} while (atomic_cas_32((lgrp_load_t *)&lpl->lpl_loadavg,
+			    old, new) != old);
 
 			lpl = lpl->lpl_parent;
 			if (lpl == NULL)
--- old/usr/src/uts/common/os/msacct.c	2014-07-28 07:43:51.999459622 -0400
+++ new/usr/src/uts/common/os/msacct.c	2014-07-28 07:43:52.005378072 -0400
@@ -589,7 +589,7 @@
 			pctcpu = t->t_pctcpu;
 			npctcpu = cpu_decay(pctcpu, delta);
 		}
-	} while (cas32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu);
+	} while (atomic_cas_32(&t->t_pctcpu, pctcpu, npctcpu) != pctcpu);
 
 	return (npctcpu);
 }
@@ -657,7 +657,8 @@
 		newtime += oldtime;
 		t->t_mstate = new_state;
 		ms->ms_state_start = curtime;
-	} while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime);
+	} while (atomic_cas_64((uint64_t *)mstimep, oldtime, newtime) !=
+	    oldtime);
 
 	/*
 	 * When the system boots the initial startup thread will have a
@@ -781,7 +782,8 @@
 		}
 		oldtime = *mstimep;
 		newtime += oldtime;
-	} while (cas64((uint64_t *)mstimep, oldtime, newtime) != oldtime);
+	} while (atomic_cas_64((uint64_t *)mstimep, oldtime, newtime) !=
+	    oldtime);
 
 	/*
 	 * Update the WAIT_CPU timer and per-cpu waitrq total.
--- old/usr/src/uts/common/os/mutex.c	2014-07-28 07:43:52.185332170 -0400
+++ new/usr/src/uts/common/os/mutex.c	2014-07-28 07:43:52.191248387 -0400
@@ -243,7 +243,7 @@
 	if (panicstr)
 		return;
 
-	if (casptr(&panic_mutex_addr, NULL, lp) == NULL)
+	if (atomic_cas_ptr(&panic_mutex_addr, NULL, lp) == NULL)
 		panic_mutex = *lp;
 
 	panic("%s, lp=%p owner=%p thread=%p",
--- old/usr/src/uts/common/os/printf.c	2014-07-28 07:43:52.366921763 -0400
+++ new/usr/src/uts/common/os/printf.c	2014-07-28 07:43:52.372875063 -0400
@@ -167,7 +167,7 @@
 			new = old + len;
 			if (new >= PANICBUFSIZE)
 				new = panicbuf_log + len;
-		} while (cas32(&panicbuf_index, old, new) != old);
+		} while (atomic_cas_32(&panicbuf_index, old, new) != old);
 		bcopy(body, &panicbuf[new - len], len);
 	}
 	if (bufp != buf)
--- old/usr/src/uts/common/os/rwlock.c	2014-07-28 07:43:52.536404969 -0400
+++ new/usr/src/uts/common/os/rwlock.c	2014-07-28 07:43:52.542394456 -0400
@@ -217,7 +217,7 @@
 	if (panicstr)
 		return;
 
-	if (casptr(&panic_rwlock_addr, NULL, lp) == NULL)
+	if (atomic_cas_ptr(&panic_rwlock_addr, NULL, lp) == NULL)
 		panic_rwlock = *lp;
 
 	panic("%s, lp=%p wwwh=%lx thread=%p",
--- old/usr/src/uts/common/sys/bitmap.h	2014-07-28 07:43:52.716408428 -0400
+++ new/usr/src/uts/common/sys/bitmap.h	2014-07-28 07:43:52.721904056 -0400
@@ -171,9 +171,9 @@
  * to 0 otherwise.
  */
 #define	BT_ATOMIC_SET(bitmap, bitindex) \
-	{ atomic_or_long(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); }
+	{ atomic_or_ulong(&(BT_WIM(bitmap, bitindex)), BT_BIW(bitindex)); }
 #define	BT_ATOMIC_CLEAR(bitmap, bitindex) \
-	{ atomic_and_long(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); }
+	{ atomic_and_ulong(&(BT_WIM(bitmap, bitindex)), ~BT_BIW(bitindex)); }
 
 #define	BT_ATOMIC_SET_EXCL(bitmap, bitindex, result) \
 	{ result = atomic_set_long_excl(&(BT_WIM(bitmap, bitindex)),	\
--- old/usr/src/uts/common/sys/cpuvar.h	2014-07-28 07:43:52.881345066 -0400
+++ new/usr/src/uts/common/sys/cpuvar.h	2014-07-28 07:43:52.886974497 -0400
@@ -528,8 +528,8 @@
 	largest = (uint_t)(highbit(set) - 1);		\
 }
 
-#define	CPUSET_ATOMIC_DEL(set, cpu)	atomic_and_long(&(set), ~CPUSET(cpu))
-#define	CPUSET_ATOMIC_ADD(set, cpu)	atomic_or_long(&(set), CPUSET(cpu))
+#define	CPUSET_ATOMIC_DEL(set, cpu)	atomic_and_ulong(&(set), ~CPUSET(cpu))
+#define	CPUSET_ATOMIC_ADD(set, cpu)	atomic_or_ulong(&(set), CPUSET(cpu))
 
 #define	CPUSET_ATOMIC_XADD(set, cpu, result) \
 	{ result = atomic_set_long_excl(&(set), (cpu)); }
--- old/usr/src/uts/common/vm/seg_kp.c	2014-07-28 07:43:53.069586033 -0400
+++ new/usr/src/uts/common/vm/seg_kp.c	2014-07-28 07:43:53.075288355 -0400
@@ -840,7 +840,7 @@
 
 		atomic_add_32(&red_nmapped, 1);
 		while (fp - (uintptr_t)curthread->t_stkbase < red_closest) {
-			(void) cas32(&red_closest, red_closest,
+			(void) atomic_cas_32(&red_closest, red_closest,
 			    (uint32_t)(fp - (uintptr_t)curthread->t_stkbase));
 		}
 		return (1);
--- old/usr/src/uts/common/vm/seg_vn.c	2014-07-28 07:43:53.274583974 -0400
+++ new/usr/src/uts/common/vm/seg_vn.c	2014-07-28 07:43:53.280491553 -0400
@@ -9711,17 +9711,18 @@
 	 * replication and T1 new home is different from lgrp used for text
 	 * replication. When this happens asyncronous segvn thread rechecks if
 	 * segments should change lgrps used for text replication.  If we fail
-	 * to set p_tr_lgrpid with cas32 then set it to NLGRPS_MAX without cas
-	 * if it's not already NLGRPS_MAX and not equal lgrp_id we want to
-	 * use.  We don't need to use cas in this case because another thread
-	 * that races in between our non atomic check and set may only change
-	 * p_tr_lgrpid to NLGRPS_MAX at this point.
+	 * to set p_tr_lgrpid with atomic_cas_32 then set it to NLGRPS_MAX
+	 * without cas if it's not already NLGRPS_MAX and not equal lgrp_id
+	 * we want to use.  We don't need to use cas in this case because
+	 * another thread that races in between our non atomic check and set
+	 * may only change p_tr_lgrpid to NLGRPS_MAX at this point.
 	 */
 	ASSERT(lgrp_id != LGRP_NONE && lgrp_id < NLGRPS_MAX);
 	olid = p->p_tr_lgrpid;
 	if (lgrp_id != olid && olid != NLGRPS_MAX) {
 		lgrp_id_t nlid = (olid == LGRP_NONE) ? lgrp_id : NLGRPS_MAX;
-		if (cas32((uint32_t *)&p->p_tr_lgrpid, olid, nlid) != olid) {
+		if (atomic_cas_32((uint32_t *)&p->p_tr_lgrpid, olid, nlid) !=
+		    olid) {
 			olid = p->p_tr_lgrpid;
 			ASSERT(olid != LGRP_NONE);
 			if (olid != lgrp_id && olid != NLGRPS_MAX) {
--- old/usr/src/uts/i86pc/os/intr.c	2014-07-28 07:43:53.798672166 -0400
+++ new/usr/src/uts/i86pc/os/intr.c	2014-07-28 07:43:53.804341343 -0400
@@ -1218,15 +1218,16 @@
 	 * PIL and zeroed its timestamp. Since there was no pinned thread to
 	 * return to, swtch() gets called and we end up here.
 	 *
-	 * Note that we use atomic ops below (cas64 and atomic_add_64), which
-	 * we don't use in the functions above, because we're not called
-	 * with interrupts blocked, but the epilog/prolog functions are.
+	 * Note that we use atomic ops below (atomic_cas_64 and
+	 * atomic_add_64), which we don't use in the functions above,
+	 * because we're not called with interrupts blocked, but the
+	 * epilog/prolog functions are.
 	 */
 	if (t->t_intr_start) {
 		do {
 			start = t->t_intr_start;
 			interval = tsc_read() - start;
-		} while (cas64(&t->t_intr_start, start, 0) != start);
+		} while (atomic_cas_64(&t->t_intr_start, start, 0) != start);
 		cpu = CPU;
 		cpu->cpu_m.intrstat[t->t_pil][0] += interval;
 
@@ -1250,7 +1251,7 @@
 
 	do {
 		ts = t->t_intr_start;
-	} while (cas64(&t->t_intr_start, ts, tsc_read()) != ts);
+	} while (atomic_cas_64(&t->t_intr_start, ts, tsc_read()) != ts);
 }
 
 /*
--- old/usr/src/uts/i86pc/os/memnode.c	2014-07-28 07:43:54.015821147 -0400
+++ new/usr/src/uts/i86pc/os/memnode.c	2014-07-28 07:43:54.025122481 -0400
@@ -86,7 +86,7 @@
 	mnode = PFN_2_MEM_NODE(start);
 	ASSERT(mnode >= 0 && mnode < max_mem_nodes);
 
-	if (cas32((uint32_t *)&mem_node_config[mnode].exists, 0, 1)) {
+	if (atomic_cas_32((uint32_t *)&mem_node_config[mnode].exists, 0, 1)) {
 		/*
 		 * Add slice to existing node.
 		 */
@@ -101,7 +101,8 @@
 		do {
 			oldmask = memnodes_mask;
 			newmask = memnodes_mask | (1ull << mnode);
-		} while (cas64(&memnodes_mask, oldmask, newmask) != oldmask);
+		} while (atomic_cas_64(&memnodes_mask, oldmask, newmask) !=
+		    oldmask);
 	}
 
 	/*
@@ -161,7 +162,7 @@
 		do {
 			omask = memnodes_mask;
 			nmask = omask & ~(1ull << mnode);
-		} while (cas64(&memnodes_mask, omask, nmask) != omask);
+		} while (atomic_cas_64(&memnodes_mask, omask, nmask) != omask);
 		atomic_add_16(&num_memnodes, -1);
 		mem_node_config[mnode].exists = 0;
 	}
@@ -229,7 +230,7 @@
 	 * a first time memnode creation race.
 	 */
 	for (mnode = 0; mnode < max_mem_nodes; mnode++)
-		if (cas32((uint32_t *)&mem_node_config[mnode].exists,
+		if (atomic_cas_32((uint32_t *)&mem_node_config[mnode].exists,
 		    0, 1) == 0)
 			break;
 
@@ -242,7 +243,7 @@
 	do {
 		oldmask = memnodes_mask;
 		newmask = memnodes_mask | (1ull << mnode);
-	} while (cas64(&memnodes_mask, oldmask, newmask) != oldmask);
+	} while (atomic_cas_64(&memnodes_mask, oldmask, newmask) != oldmask);
 
 	return (mnode);
 }
--- old/usr/src/uts/i86pc/os/x_call.c	2014-07-28 07:43:54.199184078 -0400
+++ new/usr/src/uts/i86pc/os/x_call.c	2014-07-28 07:43:54.204851091 -0400
@@ -51,9 +51,9 @@
  *
  * This implementation uses a message passing architecture to allow multiple
  * concurrent cross calls to be in flight at any given time. We use the cmpxchg
- * instruction, aka casptr(), to implement simple efficient work queues for
- * message passing between CPUs with almost no need for regular locking.
- * See xc_extract() and xc_insert() below.
+ * instruction, aka atomic_cas_ptr(), to implement simple efficient work
+ * queues for message passing between CPUs with almost no need for regular
+ * locking.  See xc_extract() and xc_insert() below.
  *
  * The general idea is that initiating a cross call means putting a message
  * on a target(s) CPU's work queue. Any synchronization is handled by passing
@@ -64,8 +64,9 @@
  * with every message that finishes all processing.
  *
  * The code needs no mfence or other membar_*() calls. The uses of
- * casptr(), cas32() and atomic_dec_32() for the message passing are
- * implemented with LOCK prefix instructions which are equivalent to mfence.
+ * atomic_cas_ptr(), atomic_cas_32() and atomic_dec_32() for the message
+ * passing are implemented with LOCK prefix instructions which are
+ * equivalent to mfence.
  *
  * One interesting aspect of this implmentation is that it allows 2 or more
  * CPUs to initiate cross calls to intersecting sets of CPUs at the same time.
@@ -144,7 +145,7 @@
 	int old;
 	do {
 		old = mcpu->xc_work_cnt;
-	} while (cas32((uint32_t *)&mcpu->xc_work_cnt, old, old + 1) != old);
+	} while (atomic_cas_32(&mcpu->xc_work_cnt, old, old + 1) != old);
 	return (old);
 }
 
@@ -168,7 +169,7 @@
 	do {
 		old_head = (xc_msg_t *)*(volatile xc_msg_t **)queue;
 		msg->xc_next = old_head;
-	} while (casptr(queue, old_head, msg) != old_head);
+	} while (atomic_cas_ptr(queue, old_head, msg) != old_head);
 }
 
 /*
@@ -185,7 +186,8 @@
 		old_head = (xc_msg_t *)*(volatile xc_msg_t **)queue;
 		if (old_head == NULL)
 			return (old_head);
-	} while (casptr(queue, old_head, old_head->xc_next) != old_head);
+	} while (atomic_cas_ptr(queue, old_head, old_head->xc_next) !=
+	    old_head);
 	old_head->xc_next = NULL;
 	return (old_head);
 }
@@ -608,7 +610,7 @@
 		XC_BT_SET(xc_priority_set, c);
 		send_dirint(c, XC_HI_PIL);
 		for (i = 0; i < 10; ++i) {
-			(void) casptr(&cpup->cpu_m.xc_msgbox,
+			(void) atomic_cas_ptr(&cpup->cpu_m.xc_msgbox,
 			    cpup->cpu_m.xc_msgbox, cpup->cpu_m.xc_msgbox);
 		}
 	}
--- old/usr/src/uts/i86pc/vm/hat_i86.c	2014-07-28 07:43:54.386627618 -0400
+++ new/usr/src/uts/i86pc/vm/hat_i86.c	2014-07-28 07:43:54.392255471 -0400
@@ -944,7 +944,7 @@
 
 /*
  * On 32 bit PAE mode, PTE's are 64 bits, but ordinary atomic memory references
- * are 32 bit, so for safety we must use cas64() to install these.
+ * are 32 bit, so for safety we must use atomic_cas_64() to install these.
  */
 #ifdef __i386
 static void
@@ -967,7 +967,7 @@
 			pte = dest[i];
 			if (pte == src[i])
 				break;
-			if (cas64(dest + i, pte, src[i]) != src[i])
+			if (atomic_cas_64(dest + i, pte, src[i]) != src[i])
 				break;
 		}
 	}
@@ -1988,7 +1988,7 @@
 #define	TLB_CPU_HALTED	(01ul)
 #define	TLB_INVAL_ALL	(02ul)
 #define	CAS_TLB_INFO(cpu, old, new)	\
-	caslong((ulong_t *)&(cpu)->cpu_m.mcpu_tlb_info, (old), (new))
+	atomic_cas_ulong((ulong_t *)&(cpu)->cpu_m.mcpu_tlb_info, (old), (new))
 
 /*
  * Record that a CPU is going idle
@@ -1996,7 +1996,7 @@
 void
 tlb_going_idle(void)
 {
-	atomic_or_long((ulong_t *)&CPU->cpu_m.mcpu_tlb_info, TLB_CPU_HALTED);
+	atomic_or_ulong((ulong_t *)&CPU->cpu_m.mcpu_tlb_info, TLB_CPU_HALTED);
 }
 
 /*
--- old/usr/src/uts/i86pc/vm/hat_pte.h	2014-07-28 07:43:54.696432828 -0400
+++ new/usr/src/uts/i86pc/vm/hat_pte.h	2014-07-28 07:43:54.702014784 -0400
@@ -26,8 +26,6 @@
 #ifndef	_VM_HAT_PTE_H
 #define	_VM_HAT_PTE_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -235,7 +233,8 @@
  * The concept of a VA hole exists in AMD64. This might need to be made
  * model specific eventually.
  *
- * In the 64 bit kernel PTE loads are atomic, but need cas64 on 32 bit kernel.
+ * In the 64 bit kernel PTE loads are atomic, but need atomic_cas_64 on 32
+ * bit kernel.
  */
 #if defined(__amd64)
 
@@ -248,7 +247,7 @@
 #define	FMT_PTE "0x%lx"
 #define	GET_PTE(ptr)		(*(x86pte_t *)(ptr))
 #define	SET_PTE(ptr, pte)	(*(x86pte_t *)(ptr) = pte)
-#define	CAS_PTE(ptr, x, y)	cas64(ptr, x, y)
+#define	CAS_PTE(ptr, x, y)	atomic_cas_64(ptr, x, y)
 
 #elif defined(__i386)
 
@@ -263,8 +262,8 @@
 	((mmu.pae_hat ? ((x86pte32_t *)(ptr))[1] = (pte >> 32) : 0),	\
 	*(x86pte32_t *)(ptr) = pte)
 #define	CAS_PTE(ptr, x, y)			\
-	(mmu.pae_hat ? cas64(ptr, x, y) :	\
-	cas32((uint32_t *)(ptr), (uint32_t)(x), (uint32_t)(y)))
+	(mmu.pae_hat ? atomic_cas_64(ptr, x, y) :	\
+	atomic_cas_32((uint32_t *)(ptr), (uint32_t)(x), (uint32_t)(y)))
 
 #endif	/* __i386 */
 
--- old/usr/src/uts/intel/asm/atomic.h	2014-07-28 07:43:54.867969353 -0400
+++ new/usr/src/uts/intel/asm/atomic.h	2014-07-28 07:43:54.873825625 -0400
@@ -38,59 +38,8 @@
 
 #if defined(__amd64)
 
-extern __GNU_INLINE void
-atomic_or_long(ulong_t *target, ulong_t bits)
-{
-	__asm__ __volatile__(
-	    "lock; orq %1, (%0)"
-	    : /* no output */
-	    : "r" (target), "r" (bits));
-}
-
-extern __GNU_INLINE void
-atomic_and_long(ulong_t *target, ulong_t bits)
-{
-	__asm__ __volatile__(
-	    "lock; andq %1, (%0)"
-	    : /* no output */
-	    : "r" (target), "r" (bits));
-}
-
-#ifdef notdef
-extern __GNU_INLINE uint64_t
-cas64(uint64_t *target, uint64_t cmp,
-	uint64_t newval)
-{
-	uint64_t retval;
-
-	__asm__ __volatile__(
-	    "movq %2, %%rax; lock; cmpxchgq %3, (%1)"
-	    : "=a" (retval)
-	    : "r" (target), "r" (cmp), "r" (newval));
-	return (retval);
-}
-#endif
-
 #elif defined(__i386)
 
-extern __GNU_INLINE void
-atomic_or_long(ulong_t *target, ulong_t bits)
-{
-	__asm__ __volatile__(
-	    "lock; orl %1, (%0)"
-	    : /* no output */
-	    : "r" (target), "r" (bits));
-}
-
-extern __GNU_INLINE void
-atomic_and_long(ulong_t *target, ulong_t bits)
-{
-	__asm__ __volatile__(
-	    "lock; andl %1, (%0)"
-	    : /* no output */
-	    : "r" (target), "r" (bits));
-}
-
 #else
 #error	"port me"
 #endif
--- old/usr/src/uts/intel/sys/synch32.h	2014-07-28 07:43:55.030400185 -0400
+++ new/usr/src/uts/intel/sys/synch32.h	2014-07-28 07:43:55.036410182 -0400
@@ -27,8 +27,6 @@
 #ifndef _SYS_SYNCH32_H
 #define	_SYS_SYNCH32_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -42,7 +40,7 @@
 #define	mutex_owner		data
 /* used to atomically operate on whole word via cas or swap instruction */
 #define	mutex_lockword		lock.lock32.lockword
-/* this requires cas64 */
+/* this requires atomic_cas_64 */
 #define	mutex_lockword64	lock.owner64
 /* these are bytes */
 #define	mutex_lockw		lock.lock64.pad[7]
--- old/usr/src/uts/sfmmu/vm/hat_sfmmu.c	2014-07-28 07:43:55.196049337 -0400
+++ new/usr/src/uts/sfmmu/vm/hat_sfmmu.c	2014-07-28 07:43:55.202238900 -0400
@@ -3678,7 +3678,7 @@
 	do {
 		shw_mask = hmeblkp->hblk_shw_mask;
 		newshw_mask = shw_mask | (1 << vshift);
-		newshw_mask = cas32(&hmeblkp->hblk_shw_mask, shw_mask,
+		newshw_mask = atomic_cas_32(&hmeblkp->hblk_shw_mask, shw_mask,
 		    newshw_mask);
 	} while (newshw_mask != shw_mask);
 
@@ -11678,7 +11678,7 @@
 			shw_mask = shw_hblkp->hblk_shw_mask;
 			ASSERT(shw_mask & (1 << vshift));
 			newshw_mask = shw_mask & ~(1 << vshift);
-			newshw_mask = cas32(&shw_hblkp->hblk_shw_mask,
+			newshw_mask = atomic_cas_32(&shw_hblkp->hblk_shw_mask,
 			    shw_mask, newshw_mask);
 		} while (newshw_mask != shw_mask);
 		hmeblkp->hblk_shadow = NULL;
@@ -15757,7 +15757,7 @@
 			shw_mask = shw_hblkp->hblk_shw_mask;
 			ASSERT(shw_mask & (1 << vshift));
 			newshw_mask = shw_mask & ~(1 << vshift);
-			newshw_mask = cas32(&shw_hblkp->hblk_shw_mask,
+			newshw_mask = atomic_cas_32(&shw_hblkp->hblk_shw_mask,
 			    shw_mask, newshw_mask);
 		} while (newshw_mask != shw_mask);
 		hmeblkp->hblk_shadow = NULL;
--- old/usr/src/uts/sparc/sys/synch32.h	2014-07-28 07:43:55.898732381 -0400
+++ new/usr/src/uts/sparc/sys/synch32.h	2014-07-28 07:43:55.904225156 -0400
@@ -27,8 +27,6 @@
 #ifndef _SYS_SYNCH32_H
 #define	_SYS_SYNCH32_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -42,7 +40,7 @@
 #define	mutex_owner		data
 /* used to atomically operate on whole word via cas or swap instruction */
 #define	mutex_lockword		lock.lock32.lockword
-/* this requires cas64 */
+/* this requires atomic_cas_64 */
 #define	mutex_lockword64	lock.owner64
 /* these are bytes */
 #define	mutex_lockw		lock.lock64.pad[4]
--- old/usr/src/uts/sparc/v9/syscall/install_utrap.c	2014-07-28 07:43:56.059603583 -0400
+++ new/usr/src/uts/sparc/v9/syscall/install_utrap.c	2014-07-28 07:43:56.065265452 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/errno.h>
 #include <sys/systm.h>
@@ -81,13 +79,13 @@
 	}
 	/*
 	 * Allocate proc space for saving the addresses to these user
-	 * trap handlers, which must later be freed. Use casptr to
+	 * trap handlers, which must later be freed. Use atomic_cas_ptr to
 	 * do this atomically.
 	 */
 	if (p->p_utraps == NULL) {
 		pv = sv = kmem_zalloc((UT_PRECISE_MAXTRAPS+1) *
 		    sizeof (utrap_handler_t *), KM_SLEEP);
-		tmp = casptr(&p->p_utraps, NULL, sv);
+		tmp = atomic_cas_ptr(&p->p_utraps, NULL, sv);
 		if (tmp != NULL) {
 			kmem_free(pv, (UT_PRECISE_MAXTRAPS+1) *
 			    sizeof (utrap_handler_t *));
@@ -96,12 +94,12 @@
 	ASSERT(p->p_utraps != NULL);
 
 	/*
-	 * Use casptr to atomically install the handler.
+	 * Use atomic_cas_ptr to atomically install the handler.
 	 */
 	ov = p->p_utraps[idx];
 	if (new_handler != (utrap_handler_t)UTRAP_UTH_NOCHANGE) {
 		for (;;) {
-			tmp = casptr(&p->p_utraps[idx], ov, nv);
+			tmp = atomic_cas_ptr(&p->p_utraps[idx], ov, nv);
 			if (ov == tmp)
 				break;
 			ov = tmp;
@@ -225,13 +223,13 @@
 
 	/*
 	 * Allocate proc space for saving the addresses to these user
-	 * trap handlers, which must later be freed. Use casptr to
+	 * trap handlers, which must later be freed. Use atomic_cas_ptr to
 	 * do this atomically.
 	 */
 	if (p->p_utraps == NULL) {
 		pv = sv = kmem_zalloc((UT_PRECISE_MAXTRAPS+1) *
 		    sizeof (utrap_handler_t *), KM_SLEEP);
-		tmp = casptr(&p->p_utraps, NULL, sv);
+		tmp = atomic_cas_ptr(&p->p_utraps, NULL, sv);
 		if (tmp != NULL) {
 			kmem_free(pv, (UT_PRECISE_MAXTRAPS+1) *
 			    sizeof (utrap_handler_t *));
@@ -240,12 +238,12 @@
 	ASSERT(p->p_utraps != NULL);
 
 	/*
-	 * Use casptr to atomically install the handlers.
+	 * Use atomic_cas_ptr to atomically install the handlers.
 	 */
 	ov = p->p_utraps[idx];
 	if (new_precise != (utrap_handler_t)UTH_NOCHANGE) {
 		for (;;) {
-			tmp = casptr(&p->p_utraps[idx], ov, nvp);
+			tmp = atomic_cas_ptr(&p->p_utraps[idx], ov, nvp);
 			if (ov == tmp)
 				break;
 			ov = tmp;
--- old/usr/src/uts/sun4/os/machdep.c	2014-07-28 07:43:56.227744864 -0400
+++ new/usr/src/uts/sun4/os/machdep.c	2014-07-28 07:43:56.233634512 -0400
@@ -550,7 +550,7 @@
 		do {
 			start = t->t_intr_start;
 			interval = CLOCK_TICK_COUNTER() - start;
-		} while (cas64(&t->t_intr_start, start, 0) != start);
+		} while (atomic_cas_64(&t->t_intr_start, start, 0) != start);
 		cpu = CPU;
 		if (cpu->cpu_m.divisor > 1)
 			interval *= cpu->cpu_m.divisor;
@@ -577,7 +577,8 @@
 
 	do {
 		ts = t->t_intr_start;
-	} while (cas64(&t->t_intr_start, ts, CLOCK_TICK_COUNTER()) != ts);
+	} while (atomic_cas_64(&t->t_intr_start, ts, CLOCK_TICK_COUNTER()) !=
+	    ts);
 }
 
 
--- old/usr/src/uts/sun4/os/memnode.c	2014-07-28 07:43:56.415641349 -0400
+++ new/usr/src/uts/sun4/os/memnode.c	2014-07-28 07:43:56.422381350 -0400
@@ -83,7 +83,7 @@
 	mnode = PFN_2_MEM_NODE(start);
 	ASSERT(mnode < max_mem_nodes);
 
-	if (cas32((uint32_t *)&mem_node_config[mnode].exists, 0, 1)) {
+	if (atomic_cas_32((uint32_t *)&mem_node_config[mnode].exists, 0, 1)) {
 		/*
 		 * Add slice to existing node.
 		 */
@@ -98,7 +98,8 @@
 		do {
 			oldmask = memnodes_mask;
 			newmask = memnodes_mask | (1ull << mnode);
-		} while (cas64(&memnodes_mask, oldmask, newmask) != oldmask);
+		} while (atomic_cas_64(&memnodes_mask, oldmask, newmask) !=
+			 oldmask);
 	}
 	/*
 	 * Let the common lgrp framework know about the new memory
@@ -158,7 +159,7 @@
 		do {
 			omask = memnodes_mask;
 			nmask = omask & ~(1ull << mnode);
-		} while (cas64(&memnodes_mask, omask, nmask) != omask);
+		} while (atomic_cas_64(&memnodes_mask, omask, nmask) != omask);
 		atomic_add_16(&num_memnodes, -1);
 		mem_node_config[mnode].exists = 0;
 	}
@@ -220,7 +221,7 @@
 	 * a first time memnode creation race.
 	 */
 	for (mnode = 0; mnode < max_mem_nodes; mnode++)
-		if (cas32((uint32_t *)&mem_node_config[mnode].exists,
+		if (atomic_cas_32((uint32_t *)&mem_node_config[mnode].exists,
 		    0, 1) == 0)
 			break;
 
@@ -233,7 +234,7 @@
 	do {
 		oldmask = memnodes_mask;
 		newmask = memnodes_mask | (1ull << mnode);
-	} while (cas64(&memnodes_mask, oldmask, newmask) != oldmask);
+	} while (atomic_cas_64(&memnodes_mask, oldmask, newmask) != oldmask);
 
 	return (mnode);
 }
--- old/usr/src/uts/sun4/os/prom_subr.c	2014-07-28 07:43:56.589011882 -0400
+++ new/usr/src/uts/sun4/os/prom_subr.c	2014-07-28 07:43:56.594656776 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/cmn_err.h>
@@ -273,7 +271,7 @@
 			 * previous kpreempt_disable() before returning since
 			 * preemption was disabled by an earlier kern_preprom.
 			 */
-			prcp = casptr((void *)&prom_cpu, NULL, cp);
+			prcp = atomic_cas_ptr((void *)&prom_cpu, NULL, cp);
 			if (prcp == NULL ||
 			    (prcp == cp && prom_thread == curthread)) {
 				if (prcp == cp)
@@ -310,7 +308,7 @@
 			 * the lock.  If we get it or already hold it, break.
 			 */
 			ASSERT(getpil() == PIL_MAX);
-			prcp = casptr((void *)&prom_cpu, NULL, cp);
+			prcp = atomic_cas_ptr((void *)&prom_cpu, NULL, cp);
 			if (prcp == NULL || prcp == cp)
 				break;
 		}
--- old/usr/src/uts/sun4/vm/vm_dep.c	2014-07-28 07:43:56.769396686 -0400
+++ new/usr/src/uts/sun4/vm/vm_dep.c	2014-07-28 07:43:56.774952108 -0400
@@ -898,7 +898,7 @@
 	do {
 		old = color_start_current;
 		new = old + (color_start_stride << (vac_shift - MMU_PAGESHIFT));
-	} while (cas32(&color_start_current, old, new) != old);
+	} while (atomic_cas_32(&color_start_current, old, new) != old);
 
 	return ((uint_t)(new));
 }
--- old/usr/src/uts/sun4u/cpu/spitfire.c	2014-07-28 07:43:56.961648383 -0400
+++ new/usr/src/uts/sun4u/cpu/spitfire.c	2014-07-28 07:43:56.967400654 -0400
@@ -4324,7 +4324,7 @@
 	/*
 	 * Initialize the leaky_bucket timeout
 	 */
-	if (casptr(&leaky_bucket_timeout_id,
+	if (atomic_cas_ptr(&leaky_bucket_timeout_id,
 	    TIMEOUT_NONE, TIMEOUT_SET) == TIMEOUT_NONE)
 		add_leaky_bucket_timeout();
 
--- old/usr/src/uts/sun4u/cpu/us3_common.c	2014-07-28 07:43:57.269216186 -0400
+++ new/usr/src/uts/sun4u/cpu/us3_common.c	2014-07-28 07:43:57.275010226 -0400
@@ -898,7 +898,7 @@
 	cheetah_livelock_entry_t *histp;
 	uint64_t idsr;
 
-	if (cas32(&sendmondo_in_recover, 0, 1) != 0) {
+	if (atomic_cas_32(&sendmondo_in_recover, 0, 1) != 0) {
 		/*
 		 * Wait while recovery takes place
 		 */
@@ -984,7 +984,7 @@
 	CHEETAH_LIVELOCK_ENTRY_SET(histp, recovery_time, \
 	    (end_hrt -  begin_hrt));
 
-	while (cas32(&sendmondo_in_recover, 1, 0) != 1)
+	while (atomic_cas_32(&sendmondo_in_recover, 1, 0) != 1)
 		;
 
 	return (retval);
@@ -6300,7 +6300,7 @@
 		return (0);
 
 	clop = CPU_PRIVATE_PTR(CPU, chpr_cecc_logout);
-	if (cas64(&clop->clo_data.chd_afar, LOGOUT_INVALID, afar) !=
+	if (atomic_cas_64(&clop->clo_data.chd_afar, LOGOUT_INVALID, afar) !=
 	    LOGOUT_INVALID)
 		return (0);
 
--- old/usr/src/uts/sun4u/io/zuluvm.c	2014-07-28 07:43:57.678761742 -0400
+++ new/usr/src/uts/sun4u/io/zuluvm.c	2014-07-28 07:43:57.684358294 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * zuluvm module
  *
@@ -78,7 +76,7 @@
 #define	ZULUVM_UNLOCK mutex_exit(&(zdev->dev_lck))
 
 #define	ZULUVM_SET_STATE(_z, b, c) \
-	cas32((uint32_t *)&((_z)->zvm.state), c, b)
+	atomic_cas_32((uint32_t *)&((_z)->zvm.state), c, b)
 #define	ZULUVM_GET_STATE(_z) \
 	(_z)->zvm.state
 #define	ZULUVM_SET_IDLE(_z) \
--- old/usr/src/uts/sun4u/os/ppage.c	2014-07-28 07:43:57.887604985 -0400
+++ new/usr/src/uts/sun4u/os/ppage.c	2014-07-28 07:43:57.893161078 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/systm.h>
 #include <sys/archsystm.h>
@@ -189,7 +187,7 @@
 #ifdef PPDEBUG
 				align_hits[color]++;
 #endif /* PPDEBUG */
-				if (casptr(&ppmap_vaddrs[index],
+				if (atomic_cas_ptr(&ppmap_vaddrs[index],
 				    va, NULL) == va) {
 					hat_memload(kas.a_hat, va, pp,
 					    vprot | HAT_NOSYNC,
@@ -319,7 +317,7 @@
 
 	for (i = start; i < pp_slots; i += stride) {
 		if (*myslot == NULL) {
-			if (casptr(myslot, NULL, va) == NULL)
+			if (atomic_cas_ptr(myslot, NULL, va) == NULL)
 				break;
 		}
 		myslot += stride;
--- old/usr/src/uts/sun4u/vm/zulu_hat.c	2014-07-28 07:43:58.067197290 -0400
+++ new/usr/src/uts/sun4u/vm/zulu_hat.c	2014-07-28 07:43:58.073149138 -0400
@@ -278,7 +278,7 @@
 
 			new_lck = lck | ZULU_CTX_LOCK;
 
-			old_lck = cas64(plck, lck, new_lck);
+			old_lck = atomic_cas_64(plck, lck, new_lck);
 
 			if (old_lck == lck) {
 				/*
--- old/usr/src/uts/sun4v/os/ppage.c	2014-07-28 07:43:58.276938813 -0400
+++ new/usr/src/uts/sun4v/os/ppage.c	2014-07-28 07:43:58.282485064 -0400
@@ -23,8 +23,6 @@
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/systm.h>
 #include <sys/archsystm.h>
@@ -161,7 +159,8 @@
 #ifdef PPDEBUG
 			align_hits++;
 #endif /* PPDEBUG */
-			if (casptr(&ppmap_vaddrs[nset], va, NULL) == va) {
+			if (atomic_cas_ptr(&ppmap_vaddrs[nset], va, NULL) ==
+			    va) {
 				hat_memload(kas.a_hat, va, pp,
 				    vprot | HAT_NOSYNC,
 				    HAT_LOAD_LOCK);
