changeset 12719:bd9fb35d09c2

6924858 various OSNet components could be simplified with symbol capabilities
author Rod Evans <Rod.Evans@Sun.COM>
date Mon, 28 Jun 2010 15:32:48 -0700
parents 5d58bbec4ff6
children 3db6e0082404
files usr/src/Makefile.master.64 usr/src/cmd/svc/milestone/fs-root usr/src/cmd/trapstat/Makefile usr/src/cmd/trapstat/capabilities/Makefile usr/src/cmd/trapstat/capabilities/Makefile.com usr/src/cmd/trapstat/capabilities/Makefile.targ usr/src/cmd/trapstat/capabilities/sun4/gettrapent.c usr/src/cmd/trapstat/capabilities/sun4u/Makefile usr/src/cmd/trapstat/capabilities/sun4u/mapfile-cap usr/src/cmd/trapstat/capabilities/sun4v/Makefile usr/src/cmd/trapstat/capabilities/sun4v/mapfile-cap usr/src/cmd/trapstat/i386/Makefile usr/src/cmd/trapstat/sun4/Makefile usr/src/cmd/trapstat/sun4/_trapstat.h usr/src/cmd/trapstat/sun4/trapstat.c usr/src/cmd/trapstat/sun4u/Makefile usr/src/cmd/trapstat/sun4v/Makefile usr/src/common/bignum/bignumimpl.c usr/src/lib/Makefile usr/src/lib/Makefile.lib usr/src/lib/Makefile.targ usr/src/lib/libc/Makefile usr/src/lib/libc/amd64/Makefile usr/src/lib/libc/capabilities/Makefile usr/src/lib/libc/capabilities/Makefile.com usr/src/lib/libc/capabilities/Makefile.targ usr/src/lib/libc/capabilities/sun4u-opl/Makefile usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com usr/src/lib/libc/capabilities/sun4u-opl/common/mapfile-cap usr/src/lib/libc/capabilities/sun4u-opl/common/memcpy.s usr/src/lib/libc/capabilities/sun4u-opl/sparc/Makefile usr/src/lib/libc/capabilities/sun4u-opl/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/common/mapfile-cap usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparc/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/common/mapfile-cap usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparc/Makefile usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4u-us3/common/mapfile-cap usr/src/lib/libc/capabilities/sun4u-us3/common/memcmp.s usr/src/lib/libc/capabilities/sun4u-us3/common/memcpy.s usr/src/lib/libc/capabilities/sun4u-us3/common/memset.s usr/src/lib/libc/capabilities/sun4u/Makefile usr/src/lib/libc/capabilities/sun4u/Makefile.com usr/src/lib/libc/capabilities/sun4u/common/mapfile-cap usr/src/lib/libc/capabilities/sun4u/common/memcmp.s usr/src/lib/libc/capabilities/sun4u/common/memcpy.s usr/src/lib/libc/capabilities/sun4u/common/memset.s usr/src/lib/libc/capabilities/sun4u/sparc/Makefile usr/src/lib/libc/capabilities/sun4u/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com usr/src/lib/libc/capabilities/sun4v-hwcap1/common/mapfile-cap usr/src/lib/libc/capabilities/sun4v-hwcap1/sparc/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap1/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com usr/src/lib/libc/capabilities/sun4v-hwcap2/common/mapfile-cap usr/src/lib/libc/capabilities/sun4v-hwcap2/sparc/Makefile usr/src/lib/libc/capabilities/sun4v-hwcap2/sparcv9/Makefile usr/src/lib/libc/capabilities/sun4v/common/memcpy.s usr/src/lib/libc/capabilities/sun4v/common/memset.s usr/src/lib/libc/i386/Makefile.com usr/src/lib/libc/port/mapfile-vers usr/src/lib/libc/sparc/Makefile usr/src/lib/libc/sparc/Makefile.com usr/src/lib/libc/sparc/gen/memcpy.s usr/src/lib/libc/sparc/mapfile-vers-aux usr/src/lib/libc/sparc_hwcap1/sparc/Makefile usr/src/lib/libc/sparc_hwcap1/sparc/mapfile usr/src/lib/libc/sparc_hwcap1/sparc/mapfile-vers-aux usr/src/lib/libc/sparc_hwcap1/sparcv9/Makefile usr/src/lib/libc/sparc_hwcap1/sparcv9/mapfile usr/src/lib/libc/sparc_hwcap1/sparcv9/mapfile-vers-aux usr/src/lib/libc/sparcv9/Makefile usr/src/lib/libc/sparcv9/Makefile.com usr/src/lib/libc/sparcv9/mapfile-vers-aux usr/src/lib/libc_psr/Makefile usr/src/lib/libc_psr/Makefile.targ usr/src/lib/libc_psr/etc/Makefile usr/src/lib/libc_psr/etc/caplib.ksh usr/src/lib/libc_psr/sun4u-opl/Makefile usr/src/lib/libc_psr/sun4u-opl/Makefile.com usr/src/lib/libc_psr/sun4u-opl/common/memcpy.s usr/src/lib/libc_psr/sun4u-opl/sparc/Makefile usr/src/lib/libc_psr/sun4u-opl/sparcv9/Makefile usr/src/lib/libc_psr/sun4u-us3/Makefile usr/src/lib/libc_psr/sun4u-us3/common/memcmp.s usr/src/lib/libc_psr/sun4u-us3/common/memcpy.s usr/src/lib/libc_psr/sun4u-us3/common/memset.s usr/src/lib/libc_psr/sun4u/Makefile usr/src/lib/libc_psr/sun4u/Makefile.com usr/src/lib/libc_psr/sun4u/common/memcmp.s usr/src/lib/libc_psr/sun4u/common/memcpy.s usr/src/lib/libc_psr/sun4u/common/memset.s usr/src/lib/libc_psr/sun4u/sparc/Makefile usr/src/lib/libc_psr/sun4u/sparcv9/Makefile usr/src/lib/libc_psr/sun4u_hwcap1/Makefile usr/src/lib/libc_psr/sun4u_hwcap1/Makefile.com usr/src/lib/libc_psr/sun4u_hwcap1/sparc/Makefile usr/src/lib/libc_psr/sun4u_hwcap1/sparcv9/Makefile usr/src/lib/libc_psr/sun4u_hwcap2/Makefile usr/src/lib/libc_psr/sun4u_hwcap2/Makefile.com usr/src/lib/libc_psr/sun4u_hwcap2/mapfile usr/src/lib/libc_psr/sun4u_hwcap2/sparc/Makefile usr/src/lib/libc_psr/sun4u_hwcap2/sparcv9/Makefile usr/src/lib/libc_psr/sun4v/Makefile usr/src/lib/libc_psr/sun4v/common/memcpy.s usr/src/lib/libc_psr/sun4v/common/memset.s usr/src/lib/libc_psr/sun4v_hwcap1/Makefile usr/src/lib/libc_psr/sun4v_hwcap1/Makefile.com usr/src/lib/libc_psr/sun4v_hwcap1/sparc/Makefile usr/src/lib/libc_psr/sun4v_hwcap1/sparcv9/Makefile usr/src/lib/libc_psr/sun4v_hwcap2/Makefile usr/src/lib/libc_psr/sun4v_hwcap2/Makefile.com usr/src/lib/libc_psr/sun4v_hwcap2/sparc/Makefile usr/src/lib/libc_psr/sun4v_hwcap2/sparcv9/Makefile usr/src/lib/libmd/Makefile usr/src/lib/libmd/Makefile.com usr/src/lib/libmd/Makefile.targ usr/src/lib/libmd/amd64/Makefile usr/src/lib/libmd/capabilities/Makefile usr/src/lib/libmd/capabilities/Makefile.com usr/src/lib/libmd/capabilities/Makefile.targ usr/src/lib/libmd/capabilities/sun4u/Makefile usr/src/lib/libmd/capabilities/sun4u/Makefile.com usr/src/lib/libmd/capabilities/sun4u/Makefile.targ usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile usr/src/lib/libmd/capabilities/sun4v/Makefile usr/src/lib/libmd/capabilities/sun4v/Makefile.com usr/src/lib/libmd/capabilities/sun4v/Makefile.targ usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile usr/src/lib/libmd/i386/Makefile usr/src/lib/libmd/sparc/Makefile usr/src/lib/libmd/sparcv9/Makefile usr/src/lib/libmd/sun4u/Makefile usr/src/lib/libmd/sun4u/Makefile.com usr/src/lib/libmd/sun4u/Makefile.links usr/src/lib/libmd/sun4u/sparc/Makefile usr/src/lib/libmd/sun4u/sparcv9/Makefile usr/src/lib/libmd/sun4v/Makefile usr/src/lib/libmd/sun4v/Makefile.com usr/src/lib/libmd/sun4v/Makefile.links usr/src/lib/libmd/sun4v/sparc/Makefile usr/src/lib/libmd/sun4v/sparcv9/Makefile usr/src/lib/pkcs11/libsoftcrypto/Makefile usr/src/lib/pkcs11/libsoftcrypto/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/Makefile.targ usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile.targ usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/common/mapfile-cap usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/common/mapfile-cap usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparc/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparcv9/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.targ usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/common/mapfile-cap usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparc/Makefile usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparcv9/Makefile usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile usr/src/lib/pkcs11/libsoftcrypto/i386_hwcap1/Makefile usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile.links usr/src/lib/pkcs11/libsoftcrypto/sun4u/mapfile-vers usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparc/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparcv9/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile.com usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile.links usr/src/lib/pkcs11/libsoftcrypto/sun4v/mapfile-vers usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparc/Makefile usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparcv9/Makefile usr/src/pkg/manifests/SUNWcs.mf usr/src/pkg/manifests/system-library-platform.mf usr/src/pkg/manifests/system-library-processor.mf usr/src/pkg/manifests/system-library.mf usr/src/uts/sun4u/boston/Makefile usr/src/uts/sun4u/boston/Makefile.boston usr/src/uts/sun4u/boston/Makefile.targ usr/src/uts/sun4u/mpxu/Makefile usr/src/uts/sun4u/mpxu/Makefile.mpxu.shared usr/src/uts/sun4u/mpxu/Makefile.targ.shared usr/src/uts/sun4u/opl/Makefile usr/src/uts/sun4u/opl/Makefile.opl.shared usr/src/uts/sun4u/opl/Makefile.targ.shared usr/src/uts/sun4u/schumacher/Makefile usr/src/uts/sun4u/schumacher/Makefile.schumacher usr/src/uts/sun4u/schumacher/Makefile.targ usr/src/uts/sun4u/seattle/Makefile usr/src/uts/sun4u/seattle/Makefile.seattle usr/src/uts/sun4u/seattle/Makefile.targ usr/src/uts/sun4u/snowbird/Makefile usr/src/uts/sun4u/snowbird/Makefile.snowbird usr/src/uts/sun4u/snowbird/Makefile.targ usr/src/uts/sun4v/Makefile.monza usr/src/uts/sun4v/montoya/Makefile.montoya
diffstat 215 files changed, 12567 insertions(+), 13904 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/Makefile.master.64	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/Makefile.master.64	Mon Jun 28 15:32:48 2010 -0700
@@ -19,8 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 # rebind basic build macros to 64-bit versions
@@ -73,7 +72,7 @@
 REAL_CCC=	$(CW_CCC_CMD:sh)
 
 BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-		$(PICS) -L $(ROOTLIBDIR64) $(LDLIBS)
+		$(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
 
 #
 # ld(1) requires the -64 option to create a 64-bit filter solely from a mapfile
@@ -84,5 +83,6 @@
 $(__GNUC64)CCNEEDED =	-L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++	\
 			-lgcc_s_$(MACH64)
 
-BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(LDLIBS) $(CCNEEDED)
+BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
+		$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED)
 MAPFILE.NGB =	$(MAPFILE.NGB_$(MACH64))
--- a/usr/src/cmd/svc/milestone/fs-root	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/cmd/svc/milestone/fs-root	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#
+# Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 # Make sure that the libraries essential to this stage of booting can be found.
@@ -53,114 +50,6 @@
 	fi
 }
 
-# This mount function is sun4v only. It may be melded with the sun4u-us3
-# version later.
-sun4v_libc_psr_mount() {
-	LIBC_MOE_32=`/usr/bin/moe -32 /platform/$PLAT/lib/libc_psr/'$HWCAP'`
-	if [ -n "$LIBC_MOE_32" ]; then
-		/usr/sbin/mount |
-		    egrep -s "^/platform/[^/]*/lib/libc_psr.so.1 on "
-		if [ $? -ne 0 ]; then
-			/usr/sbin/mount -O -F lofs $LIBC_MOE_32 \
-			    /platform/$PLAT/lib/libc_psr.so.1
-		fi
-	fi
-
-	LIBC_MOE_64=`/usr/bin/moe -64 \
-	    /platform/$PLAT/lib/sparcv9/libc_psr/'$HWCAP'`
-	if [ -n "$LIBC_MOE_64" ]; then
-		/usr/sbin/mount |
-		    egrep -s "^/platform/[^/]*/lib/sparcv9/libc_psr.so.1 on "
-		if [ $? -ne 0 ]; then
-			/usr/sbin/mount -O -F lofs $LIBC_MOE_64 \
-			    /platform/$PLAT/lib/sparcv9/libc_psr.so.1
-		fi
-	fi
-}
-
-# This is specific to sun4u[-us3].
-# try to intelligently handle the various ways that a hwcap library can
-# be present for libc_psr for sun4u.
-sun4u_libc_psr_mount() {
-	# first look for $PLAT specific
-	# the string $HWCAP is not an env var but part of the argument to moe
-	LIBC_MOE_32=`/usr/bin/moe -32 /platform/$PLAT/lib/libc_psr/'$HWCAP'`
-	if [ -n "$LIBC_MOE_32" ]; then
-		/usr/sbin/mount |
-		    egrep -s "^/platform/$PLAT/lib/libc_psr.so.1 on "
-		if [ $? -ne 0 ]; then
-			/usr/sbin/mount -O -F lofs $LIBC_MOE_32 \
-			    /platform/$PLAT/lib/libc_psr.so.1
-		fi
-	else
-		# try the 'generic' one under $ARCH
-		LIBC_MOE_32=`/usr/bin/moe -32 \
-		    /platform/$ARCH/lib/libc_psr/'$HWCAP'`
-		if [ -n "$LIBC_MOE_32" ]; then
-			/usr/sbin/mount |
-			    egrep -s "^/platform/$ARCH/lib/libc_psr.so.1 on "
-			if [ $? -ne 0 ]; then
-				/usr/sbin/mount -O -F lofs $LIBC_MOE_32 \
-				    /platform/$ARCH/lib/libc_psr.so.1
-			fi
-		fi
-
-	fi
-
-	# now repeat for 64 bit.
-
-	LIBC_MOE_64=`/usr/bin/moe -64 \
-	    /platform/$PLAT/lib/sparcv9/libc_psr/'$HWCAP'`
-	if [ -n "$LIBC_MOE_64" ]; then
-		/usr/sbin/mount |
-		    egrep -s "^/platform/$PLAT/lib/sparcv9/libc_psr.so.1 on "
-		if [ $? -ne 0 ]; then
-			/usr/sbin/mount -O -F lofs $LIBC_MOE_64 \
-			    /platform/$PLAT/lib/sparcv9/libc_psr.so.1
-		fi
-	else
-		# now try $ARCH version
-		LIBC_MOE_64=`/usr/bin/moe -64 \
-		    /platform/$ARCH/lib/sparcv9/libc_psr/'$HWCAP'`
-		if [ -n "$LIBC_MOE_64" ]; then
-			/usr/sbin/mount |
-			    egrep -s \
-			    "^/platform/$ARCH/lib/sparcv9/libc_psr.so.1 on "
-			if [ $? -ne 0 ]; then
-				/usr/sbin/mount -O -F lofs $LIBC_MOE_64 \
-				    /platform/$ARCH/lib/sparcv9/libc_psr.so.1
-			fi
-		fi
-	fi
-}
-
-# 
-# Discover architecture and find and mount optimal libc_psr 
-#  
-libc_psr_mount() {
-	PLAT=`/usr/bin/uname -i` 
-	ARCH=`/usr/bin/uname -m` 
-	if [ "$ARCH" = "sun4v" ]; then 
-		# Check if we already loaded libc_hwcapX.so.1 thru libc_mount
-		# We can get rid of this check (and the libc_psr mount),
-		# if all the sun4v platforms start using libc_hwcap.
-		if [ ! -n "$LIBC_MOE_32" ]; then
-			sun4v_libc_psr_mount
-		fi
-	elif [ "$ARCH" = "sun4u" ]; then 
-		if [ -h /platform/$PLAT/lib/libc_psr.so.1 ]; then 
-			LINKSTO=`/usr/bin/ls -l \
-			    /platform/$PLAT/lib/libc_psr.so.1 | 
-			    /usr/bin/awk '{print $NF}'` 
-			if [ "$LINKSTO" = \
-			    "../../sun4u-us3/lib/libc_psr.so.1" ]; then 
-				ARCH=sun4u-us3 
-			fi
-		fi
-		sun4u_libc_psr_mount 
-	fi
-}
-
 . /lib/svc/share/smf_include.sh
 . /lib/svc/share/fs_include.sh
 
@@ -171,7 +60,6 @@
 #
 if smf_is_nonglobalzone; then
 	libc_mount
-	libc_psr_mount
 	exit $SMF_EXIT_OK
 fi
 
@@ -295,6 +183,5 @@
 /usr/sbin/devfsadm -I -P
 
 libc_mount
-libc_psr_mount
 
 exit $SMF_EXIT_OK
--- a/usr/src/cmd/trapstat/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/cmd/trapstat/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -2,9 +2,8 @@
 # CDDL HEADER START
 #
 # The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
 #
 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 # or http://www.opensolaris.org/os/licensing.
@@ -19,41 +18,40 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-PROG= trapstat
+include		$(SRC)/cmd/Makefile.cmd
 
-include ../Makefile.cmd
-
-sparc_SUBDIRS = sun4u sun4v
-i386_SUBDIRS = 
+sparc_CAPDIR =	capabilities
+i386_CAPDIR =	i386
+CAPDIR =	$($(MACH)_CAPDIR)
 
-SUBDIRS = $($(MACH)_SUBDIRS)
+sparc_SUBDIRS =	sun4
+i386_SUBDIRS =
+SUBDIRS =	$($(MACH)_SUBDIRS)
 
-all	:=	TARGET = all
-install	:=	TARGET = install
-clean	:=	TARGET = clean
-clobber	:=	TARGET = clobber
-lint	:=	TARGET = lint
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+lint :=		TARGET= lint
 
 .KEEP_STATE:
 
-all:	$(SUBDIRS)
+.PARALLEL:	$(SUBDIRS)
 
-clean clobber lint:	$(SUBDIRS)
+all clean clobber install lint: \
+		$(CAPDIR) .WAIT $(SUBDIRS)
 
-install:	$(SUBDIRS)
-	$(RM) $(ROOTUSRSBINPROG)
-	$(LN) $(PLATEXEC) $(ROOTUSRSBINPROG)
+install_h check:
 
+$(CAPDIR) \
 $(SUBDIRS):	FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
+		@cd $@; pwd; $(MAKE) $(TARGET)
 
 FRC:
 
-include ../Makefile.targ
+include		$(SRC)/cmd/Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+
+# Each target directory is responsible for making a symbol capabilities object.
+$(SPARC_BLD)SUBDIRS =	sun4u sun4v
+$(INTEL_BLD)SUBDIRS =
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,37 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+
+MAPFILE-CAP =	mapfile-cap
+MAPOPT-CAP =	$(MAPFILE-CAP:%=-M%)
+
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(SRC)/uts/sun4 -I../../sun4 -D$(PLATFORM)
+
+OBJCAP =	objcap.o
+SYMCAP =	symcap.o
+
+CLOBBERFILES +=	$(OBJCAP) $(SYMCAP)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,70 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# trapstat provides two families of trap tables for SPARC platforms, one for
+# sun4u, and one for sun4v.  Previous implementations provided these families by
+# invoking a platform specific binary (/usr/platform/$PLATFORM/sbin/trapstat).
+# trapstat itself was linked to /usr/lib/platexec, a shell script used to
+# discover the platform name, and exec the associated platform specific binary.
+#
+# The two trapstat trap tables are now encapsulated behind a symbol capabilities
+# routine get_trap_entry().  An instance of this routine is provided for sun4u,
+# and sun4v, and are identified with a machine hardware name via using
+# ../common/mapfile-cap.
+#
+# These object capabilities relocatable objects are then translated into symbol
+# capabilities relocatable objects, pics/symcap.o.
+# 
+# The sun4u and sun4v families of symbol capabilities object are eventually
+# included in the final build of trapstat.
+
+$(SYMCAP):	$(OBJCAP)
+$(OBJCAP):	$(OBJECTS)
+
+# Combine all pic objects into one relocatable object.  Assign any capabilities
+# to this object, and define the interface.
+
+objcap.o:	$(OBJECTS) $(MAPFILE-CAP)
+		$(LD) -r -o $@ $(MAPOPT-CAP) -Breduce $(OBJECTS)
+
+# Convert the combined object capabilities object into a symbol capabilities
+# object.
+
+symcap.o:	$(OBJCAP)
+		$(LD) -r -o $@ -z symbolcap $(OBJCAP)
+
+# Create original object.
+
+%.o:		../sun4/%.c
+		$(COMPILE.c) -o $@ $<
+		$(POST_PROCESS_O)
+
+clean:
+		$(RM) $(OBJECTS)
+
+lint:
+
+include		$(SRC)/cmd/Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/sun4/gettrapent.c	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,679 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+#include <sys/trapstat.h>
+#include "_trapstat.h"
+
+static tstat_ent_t g_traps[TSTAT_NENT] = {
+#ifndef	sun4v
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "power-on", 		"power on reset" },
+	{ "watchdog", 		"watchdog reset" },
+	{ "xir", 		"externally initiated reset" },
+	{ "sir", 		"software initiated reset" },
+	{ "red", 		"RED state exception" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "immu-xcp", 		"instruction access exception" },
+	{ "immu-miss", 		"instruction access MMU miss" },
+	{ "immu-err", 		"instruction access error" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "ill-inst", 		"illegal instruction" },
+	{ "priv-inst", 		"privileged opcode" },
+	{ "unimp-ldd", 		"unimplemented LDD" },
+	{ "unimp-std", 		"unimplemented STD" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "fp-disabled", 	"fp disabled" },
+	{ "fp-ieee754", 	"fp exception ieee754" },
+	{ "fp-xcp-other", 	"fp exception other" },
+	{ "tag-oflow", 		"tag overflow" },
+	{ "cleanwin", 		"clean window" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "div-zero", 		"division by zero" },
+	{ "internal-err", 	"internal processor error" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "dmmu-xcp", 		"data access exception" },
+	{ "dmmu-miss", 		"data access MMU miss" },
+	{ "dmmu-err", 		"data access error" },
+	{ "dmmu-prot", 		"data access protection" },
+	{ "unalign", 		"mem address not aligned" },
+	{ "lddf-unalign", 	"LDDF mem address not aligned" },
+	{ "stdf-unalign", 	"STDF mem address not aligned" },
+	{ "priv-act", 		"privileged action" },
+	{ "ldqf-unalign",	"LDQF mem address not aligned" },
+	{ "stqf-unalign", 	"STQF mem address not aligned" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "async-d-err", 	"async data error" },
+	{ "level-1", 		"interrupt level 1" },
+	{ "level-2", 		"interrupt level 2" },
+	{ "level-3", 		"interrupt level 3" },
+	{ "level-4", 		"interrupt level 4" },
+	{ "level-5", 		"interrupt level 5" },
+	{ "level-6", 		"interrupt level 6" },
+	{ "level-7", 		"interrupt level 7" },
+	{ "level-8", 		"interrupt level 8" },
+	{ "level-9", 		"interrupt level 9" },
+	{ "level-10", 		"interrupt level 10" },
+	{ "level-11", 		"interrupt level 11" },
+	{ "level-12", 		"interrupt level 12" },
+	{ "level-13", 		"interrupt level 13" },
+	{ "level-14", 		"interrupt level 14" },
+	{ "level-15", 		"interrupt level 15" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "int-vec", 		"interrupt vector" },
+	{ "pa-watch", 		"PA watchpoint" },
+	{ "va-watch", 		"VA watchpoint" },
+	{ "ecc-err", 		"corrected ECC error" },
+	{ "itlb-miss", 		"instruction access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "dtlb-miss", 		"data access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "dtlb-prot", 		"data access protection" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fast-ecc",		"fast ECC error" },
+	{ "dcache-parity",	"D-cache parity error" },
+	{ "icache-parity",	"I-cache parity error" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+#else /* sun4v */
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "watchdog", 		"watchdog reset" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "immu-xcp", 		"instruction access exception" },
+	{ "immu-miss", 		"instruction access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "ill-inst", 		"illegal instruction" },
+	{ "priv-inst", 		"privileged opcode" },
+	{ "unimp-ldd", 		"unimplemented LDD" },
+	{ "unimp-std", 		"unimplemented STD" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "fp-disabled", 	"fp disabled" },
+	{ "fp-ieee754", 	"fp exception ieee754" },
+	{ "fp-xcp-other", 	"fp exception other" },
+	{ "tag-oflow", 		"tag overflow" },
+	{ "cleanwin", 		"clean window" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "div-zero", 		"division by zero" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "dmmu-xcp", 		"data access exception" },
+	{ "dmmu-miss", 		"data access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "dmmu-prot", 		"data access protection" },
+	{ "unalign", 		"mem address not aligned" },
+	{ "lddf-unalign", 	"LDDF mem address not aligned" },
+	{ "stdf-unalign", 	"STDF mem address not aligned" },
+	{ "priv-act", 		"privileged action" },
+	{ "ldqf-unalign",	"LDQF mem address not aligned" },
+	{ "stqf-unalign", 	"STQF mem address not aligned" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "level-1", 		"interrupt level 1" },
+	{ "level-2", 		"interrupt level 2" },
+	{ "level-3", 		"interrupt level 3" },
+	{ "level-4", 		"interrupt level 4" },
+	{ "level-5", 		"interrupt level 5" },
+	{ "level-6", 		"interrupt level 6" },
+	{ "level-7", 		"interrupt level 7" },
+	{ "level-8", 		"interrupt level 8" },
+	{ "level-9", 		"interrupt level 9" },
+	{ "level-10", 		"interrupt level 10" },
+	{ "level-11", 		"interrupt level 11" },
+	{ "level-12", 		"interrupt level 12" },
+	{ "level-13", 		"interrupt level 13" },
+	{ "level-14", 		"interrupt level 14" },
+	{ "level-15", 		"interrupt level 15" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "pa-watch", 		"PA watchpoint" },
+	{ "va-watch", 		"VA watchpoint" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "itlb-miss", 		"instruction access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "dtlb-miss", 		"data access MMU miss" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "dtlb-prot", 		"data access protection" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "ctl-xfer",		"control transfer" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "instr-brkpt",	"instruction breakpoint" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ "hw-changed", 	"hardware changed" },
+	{ "cpu_mondo", 		"cpu mondo trap" },
+	{ "dev_mondo", 		"device mondo trap" },
+	{ "res-err", 		"resumable error" },
+	{ "nonres-err",		"non-resumable error" },
+#endif /* sun4v */
+	{ "spill-0-normal", 	"spill 0 normal" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-user-32", 	"spill user window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-user-64", 	"spill user window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-user-32-cln", 	"spill, clean user window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-user-64-cln", 	"spill, clean user window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-kern-32", 	"spill kernel window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-kern-64", 	"spill kernel window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-mixed", 	"spill window, mixed 32-bit/64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-0-other", 	"spill 0 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-asuser-32", 	"spill user window as kernel, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-asuser-64", 	"spill user window as kernel, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-asuser-32-cln", "spill, clean user window as kernel, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-asuser-64-cln", "spill, clean user window as kernel, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-5-other", 	"spill 5 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-6-other", 	"spill 6 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "spill-7-other", 	"spill 7 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-0-normal", 	"fill 0 normal" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-user-32", 	"fill user window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-user-64", 	"fill user window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-user-32-cln", 	"fill user window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-user-64-cln", 	"fill user window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-kern-32", 	"fill kernel window, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-kern-64", 	"fill kernel window, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-mixed", 	"fill window, mixed 32-bit/64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-0-other", 	"fill 0 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-asuser-32", 	"fill user window as kernel, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-asuser-64", 	"fill user window as kernel, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-asuser-32-cln", "fill user window as kernel, 32-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-asuser-64-cln",	"fill user window as kernel, 64-bit" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-5-other", 	"fill 5 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-6-other", 	"fill 6 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "fill-7-other", 	"fill 7 other" },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
+	{ "syscall-4x", 	"old system call" },
+	{ "usr-brkpt", 		"user breakpoint" },
+	{ "usr-div-zero", 	"user divide by zero" },
+	{ "flush-wins", 	"flush windows" },
+	{ "clean-wins", 	"clean windows" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "fix-align", 		"fix unaligned references" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "syscall-32", 	"ILP32 system call" },
+	{ "set-t0-addr", 	"set trap0 address" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "trap-inst-16", 	"trap instruction 16", },
+	{ "trap-inst-17", 	"trap instruction 17", },
+	{ "trap-inst-18", 	"trap instruction 18", },
+	{ "trap-inst-19", 	"trap instruction 19", },
+	{ "trap-inst-20", 	"trap instruction 20", },
+	{ "trap-inst-21", 	"trap instruction 21", },
+	{ "trap-inst-22", 	"trap instruction 22", },
+	{ "trap-inst-23", 	"trap instruction 23", },
+	{ "trap-inst-24", 	"trap instruction 24", },
+	{ "trap-inst-25", 	"trap instruction 25", },
+	{ "trap-inst-26", 	"trap instruction 26", },
+	{ "trap-inst-27", 	"trap instruction 27", },
+	{ "trap-inst-28", 	"trap instruction 28", },
+	{ "trap-inst-29", 	"trap instruction 29", },
+	{ "trap-inst-30", 	"trap instruction 30", },
+	{ "trap-inst-31", 	"trap instruction 31", },
+	{ "get-cc", 		"get condition codes" },
+	{ "set-cc", 		"set condition codes" },
+	{ "get-psr", 		"get psr" },
+	{ "set-psr", 		"set psr (some fields)" },
+	{ "getts", 		"get timestamp" },
+	{ "gethrvtime", 	"get lwp virtual time" },
+	{ "self-xcall", 	"self xcall" },
+	{ "gethrtime", 		"get hrestime" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "getlgrp",		"get lgrpid" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "dtrace-pid",		"DTrace pid provider" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "dtrace-return",	"DTrace pid provider return" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "syscall-64", 	"LP64 system call" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "tt-freeze", 		"freeze traptrace" },
+	{ "tt-unfreeze", 	"unfreeze traptrace" },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ NULL, NULL,		TSTAT_ENT_UNUSED },
+	{ "ptl1-panic", 	"test ptl1-panic" },
+	{ "kmdb-enter", 	"kmdb enter (L1-A)" },
+	{ "kmdb-brkpt", 	"kmdb breakpoint" },
+	{ "obp-brkpt", 		"obp breakpoint" },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED },
+	{ NULL, NULL,		TSTAT_ENT_RESERVED }
+};
+
+tstat_ent_t *
+get_trap_ent(int ndx)
+{
+	return (&g_traps[ndx]);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/sun4u/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =      sun4u
+
+include		../Makefile.com
+
+OBJECTS =       gettrapent.o
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/sun4u/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u {
+	MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+	global:
+		get_trap_ent;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/sun4v/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =      sun4v
+
+include		../Makefile.com
+
+OBJECTS =       gettrapent.o
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/capabilities/sun4v/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v {
+	MACHINE = sun4v;
+};
+
+SYMBOL_SCOPE {
+	global:
+		get_trap_ent;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/i386/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+
+PROG =		trapstat
+
+all:
+
+# Generate a link to platexec.  Nothing gets executed at runtime, other
+# than platexec which generates an error message that no i386 executable
+# is available.
+install:	$(ROOTUSRSBINPROG)
+
+$(ROOTUSRSBINPROG):
+		$(RM) $(ROOTUSRSBINPROG)
+	        $(LN) $(PLATEXEC) $(ROOTUSRSBINPROG)
+
+clean lint:
+
+include		$(SRC)/cmd/Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/sun4/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,53 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/cmd/Makefile.cmd
+
+PROG =		trapstat
+OBJS =		trapstat.o
+
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTOBJS =	../capabilities/sun4u/symcap.o \
+		../capabilities/sun4v/symcap.o
+
+CPPFLAGS +=	-I$(SRC)/uts/sun4 -I.
+LINTFLAGS +=	-erroff=E_SEC_PRINTF_VAR_FMT
+
+.KEEP_STATE:
+
+all:		$(PROG)
+
+install:	$(ROOTUSRSBINPROG)
+
+$(PROG):	$(OBJS) $(EXTOBJS)
+		$(LINK.c) -o $(PROG) $(OBJS) $(EXTOBJS) $(LDLIBS)
+	        $(POST_PROCESS)
+
+clean:
+		$(RM) $(OBJS) $(EXTOBJS)
+		
+lint:		lint_PROG
+
+include		$(SRC)/cmd/Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/cmd/trapstat/sun4/_trapstat.h	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,52 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+#ifndef	__TRAPSTAT_DOT_H
+#define	__TRAPSTAT_DOT_H
+
+#include <sys/trapstat.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#define	TSTAT_ENT_USED			0
+#define	TSTAT_ENT_RESERVED		1
+#define	TSTAT_ENT_UNUSED		2
+#define	TSTAT_ENT_CONTINUED		3
+
+typedef struct {
+	char	*tent_name;
+	char	*tent_descr;
+	int	tent_type;
+} tstat_ent_t;
+
+extern	tstat_ent_t *get_trap_ent(int);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif /* __TRAPSTAT_DOT_H */
--- a/usr/src/cmd/trapstat/sun4/trapstat.c	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/cmd/trapstat/sun4/trapstat.c	Mon Jun 28 15:32:48 2010 -0700
@@ -20,12 +20,9 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -42,6 +39,7 @@
 #include <sys/wait.h>
 #include <stddef.h>
 #include <termio.h>
+#include "_trapstat.h"
 
 #define	TSTAT_DEVICE	"/dev/trapstat"
 #define	TSTAT_COMMAND	"trapstat"
@@ -98,662 +96,17 @@
 	double		tsum_time;
 } tstat_sum_t;
 
-#define	TSTAT_ENT_USED			0
-#define	TSTAT_ENT_RESERVED		1
-#define	TSTAT_ENT_UNUSED		2
-#define	TSTAT_ENT_CONTINUED		3
-
-typedef struct tstat_ent {
-	char *tent_name;
-	char *tent_descr;
-	int tent_type;
-} tstat_ent_t;
-
-static tstat_ent_t g_traps[] = {
-#ifndef	sun4v
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "power-on", 		"power on reset" },
-	{ "watchdog", 		"watchdog reset" },
-	{ "xir", 		"externally initiated reset" },
-	{ "sir", 		"software initiated reset" },
-	{ "red", 		"RED state exception" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "immu-xcp", 		"instruction access exception" },
-	{ "immu-miss", 		"instruction access MMU miss" },
-	{ "immu-err", 		"instruction access error" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "ill-inst", 		"illegal instruction" },
-	{ "priv-inst", 		"privileged opcode" },
-	{ "unimp-ldd", 		"unimplemented LDD" },
-	{ "unimp-std", 		"unimplemented STD" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "fp-disabled", 	"fp disabled" },
-	{ "fp-ieee754", 	"fp exception ieee754" },
-	{ "fp-xcp-other", 	"fp exception other" },
-	{ "tag-oflow", 		"tag overflow" },
-	{ "cleanwin", 		"clean window" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "div-zero", 		"division by zero" },
-	{ "internal-err", 	"internal processor error" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "dmmu-xcp", 		"data access exception" },
-	{ "dmmu-miss", 		"data access MMU miss" },
-	{ "dmmu-err", 		"data access error" },
-	{ "dmmu-prot", 		"data access protection" },
-	{ "unalign", 		"mem address not aligned" },
-	{ "lddf-unalign", 	"LDDF mem address not aligned" },
-	{ "stdf-unalign", 	"STDF mem address not aligned" },
-	{ "priv-act", 		"privileged action" },
-	{ "ldqf-unalign",	"LDQF mem address not aligned" },
-	{ "stqf-unalign", 	"STQF mem address not aligned" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "async-d-err", 	"async data error" },
-	{ "level-1", 		"interrupt level 1" },
-	{ "level-2", 		"interrupt level 2" },
-	{ "level-3", 		"interrupt level 3" },
-	{ "level-4", 		"interrupt level 4" },
-	{ "level-5", 		"interrupt level 5" },
-	{ "level-6", 		"interrupt level 6" },
-	{ "level-7", 		"interrupt level 7" },
-	{ "level-8", 		"interrupt level 8" },
-	{ "level-9", 		"interrupt level 9" },
-	{ "level-10", 		"interrupt level 10" },
-	{ "level-11", 		"interrupt level 11" },
-	{ "level-12", 		"interrupt level 12" },
-	{ "level-13", 		"interrupt level 13" },
-	{ "level-14", 		"interrupt level 14" },
-	{ "level-15", 		"interrupt level 15" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "int-vec", 		"interrupt vector" },
-	{ "pa-watch", 		"PA watchpoint" },
-	{ "va-watch", 		"VA watchpoint" },
-	{ "ecc-err", 		"corrected ECC error" },
-	{ "itlb-miss", 		"instruction access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "dtlb-miss", 		"data access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "dtlb-prot", 		"data access protection" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fast-ecc",		"fast ECC error" },
-	{ "dcache-parity",	"D-cache parity error" },
-	{ "icache-parity",	"I-cache parity error" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-#else /* sun4v */
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "watchdog", 		"watchdog reset" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "immu-xcp", 		"instruction access exception" },
-	{ "immu-miss", 		"instruction access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "ill-inst", 		"illegal instruction" },
-	{ "priv-inst", 		"privileged opcode" },
-	{ "unimp-ldd", 		"unimplemented LDD" },
-	{ "unimp-std", 		"unimplemented STD" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "fp-disabled", 	"fp disabled" },
-	{ "fp-ieee754", 	"fp exception ieee754" },
-	{ "fp-xcp-other", 	"fp exception other" },
-	{ "tag-oflow", 		"tag overflow" },
-	{ "cleanwin", 		"clean window" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "div-zero", 		"division by zero" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "dmmu-xcp", 		"data access exception" },
-	{ "dmmu-miss", 		"data access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "dmmu-prot", 		"data access protection" },
-	{ "unalign", 		"mem address not aligned" },
-	{ "lddf-unalign", 	"LDDF mem address not aligned" },
-	{ "stdf-unalign", 	"STDF mem address not aligned" },
-	{ "priv-act", 		"privileged action" },
-	{ "ldqf-unalign",	"LDQF mem address not aligned" },
-	{ "stqf-unalign", 	"STQF mem address not aligned" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "level-1", 		"interrupt level 1" },
-	{ "level-2", 		"interrupt level 2" },
-	{ "level-3", 		"interrupt level 3" },
-	{ "level-4", 		"interrupt level 4" },
-	{ "level-5", 		"interrupt level 5" },
-	{ "level-6", 		"interrupt level 6" },
-	{ "level-7", 		"interrupt level 7" },
-	{ "level-8", 		"interrupt level 8" },
-	{ "level-9", 		"interrupt level 9" },
-	{ "level-10", 		"interrupt level 10" },
-	{ "level-11", 		"interrupt level 11" },
-	{ "level-12", 		"interrupt level 12" },
-	{ "level-13", 		"interrupt level 13" },
-	{ "level-14", 		"interrupt level 14" },
-	{ "level-15", 		"interrupt level 15" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "pa-watch", 		"PA watchpoint" },
-	{ "va-watch", 		"VA watchpoint" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "itlb-miss", 		"instruction access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "dtlb-miss", 		"data access MMU miss" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "dtlb-prot", 		"data access protection" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "ctl-xfer",		"control transfer" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "instr-brkpt",	"instruction breakpoint" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ "hw-changed", 	"hardware changed" },
-	{ "cpu_mondo", 		"cpu mondo trap" },
-	{ "dev_mondo", 		"device mondo trap" },
-	{ "res-err", 		"resumable error" },
-	{ "nonres-err",		"non-resumable error" },
-#endif /* sun4v */
-	{ "spill-0-normal", 	"spill 0 normal" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-user-32", 	"spill user window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-user-64", 	"spill user window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-user-32-cln", 	"spill, clean user window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-user-64-cln", 	"spill, clean user window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-kern-32", 	"spill kernel window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-kern-64", 	"spill kernel window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-mixed", 	"spill window, mixed 32-bit/64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-0-other", 	"spill 0 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-asuser-32", 	"spill user window as kernel, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-asuser-64", 	"spill user window as kernel, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-asuser-32-cln", "spill, clean user window as kernel, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-asuser-64-cln", "spill, clean user window as kernel, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-5-other", 	"spill 5 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-6-other", 	"spill 6 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "spill-7-other", 	"spill 7 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-0-normal", 	"fill 0 normal" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-user-32", 	"fill user window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-user-64", 	"fill user window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-user-32-cln", 	"fill user window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-user-64-cln", 	"fill user window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-kern-32", 	"fill kernel window, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-kern-64", 	"fill kernel window, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-mixed", 	"fill window, mixed 32-bit/64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-0-other", 	"fill 0 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-asuser-32", 	"fill user window as kernel, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-asuser-64", 	"fill user window as kernel, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-asuser-32-cln", "fill user window as kernel, 32-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-asuser-64-cln",	"fill user window as kernel, 64-bit" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-5-other", 	"fill 5 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-6-other", 	"fill 6 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "fill-7-other", 	"fill 7 other" },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ NULL, NULL,		TSTAT_ENT_CONTINUED },
-	{ "syscall-4x", 	"old system call" },
-	{ "usr-brkpt", 		"user breakpoint" },
-	{ "usr-div-zero", 	"user divide by zero" },
-	{ "flush-wins", 	"flush windows" },
-	{ "clean-wins", 	"clean windows" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "fix-align", 		"fix unaligned references" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "syscall-32", 	"ILP32 system call" },
-	{ "set-t0-addr", 	"set trap0 address" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "trap-inst-16", 	"trap instruction 16", },
-	{ "trap-inst-17", 	"trap instruction 17", },
-	{ "trap-inst-18", 	"trap instruction 18", },
-	{ "trap-inst-19", 	"trap instruction 19", },
-	{ "trap-inst-20", 	"trap instruction 20", },
-	{ "trap-inst-21", 	"trap instruction 21", },
-	{ "trap-inst-22", 	"trap instruction 22", },
-	{ "trap-inst-23", 	"trap instruction 23", },
-	{ "trap-inst-24", 	"trap instruction 24", },
-	{ "trap-inst-25", 	"trap instruction 25", },
-	{ "trap-inst-26", 	"trap instruction 26", },
-	{ "trap-inst-27", 	"trap instruction 27", },
-	{ "trap-inst-28", 	"trap instruction 28", },
-	{ "trap-inst-29", 	"trap instruction 29", },
-	{ "trap-inst-30", 	"trap instruction 30", },
-	{ "trap-inst-31", 	"trap instruction 31", },
-	{ "get-cc", 		"get condition codes" },
-	{ "set-cc", 		"set condition codes" },
-	{ "get-psr", 		"get psr" },
-	{ "set-psr", 		"set psr (some fields)" },
-	{ "getts", 		"get timestamp" },
-	{ "gethrvtime", 	"get lwp virtual time" },
-	{ "self-xcall", 	"self xcall" },
-	{ "gethrtime", 		"get hrestime" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "getlgrp",		"get lgrpid" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "dtrace-pid",		"DTrace pid provider" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "dtrace-return",	"DTrace pid provider return" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "syscall-64", 	"LP64 system call" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "tt-freeze", 		"freeze traptrace" },
-	{ "tt-unfreeze", 	"unfreeze traptrace" },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ NULL, NULL,		TSTAT_ENT_UNUSED },
-	{ "ptl1-panic", 	"test ptl1-panic" },
-	{ "kmdb-enter", 	"kmdb enter (L1-A)" },
-	{ "kmdb-brkpt", 	"kmdb breakpoint" },
-	{ "obp-brkpt", 		"obp breakpoint" },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED },
-	{ NULL, NULL,		TSTAT_ENT_RESERVED }
-};
+/*
+ * Define a dummy g_traps reader to establish a symbol capabilities lead.
+ * This routine should never be called, as the sun4u and sun4v variants
+ * will be used as appropriate.
+ */
+/* ARGSUSED0 */
+tstat_ent_t *
+get_trap_ent(int ndx)
+{
+	return (NULL);
+}
 
 static void
 usage(void)
@@ -861,11 +214,16 @@
 	int i;
 
 	for (i = 0; i < TSTAT_NENT; i++) {
-		if (g_traps[i].tent_type == TSTAT_ENT_RESERVED)
-			g_traps[i].tent_name = "reserved";
+		tstat_ent_t	*gtp;
+
+		if ((gtp = get_trap_ent(i)) == NULL)
+			continue;
 
-		if (g_traps[i].tent_type == TSTAT_ENT_UNUSED)
-			g_traps[i].tent_name = "unused";
+		if (gtp->tent_type == TSTAT_ENT_RESERVED)
+			gtp->tent_name = "reserved";
+
+		if (gtp->tent_type == TSTAT_ENT_UNUSED)
+			gtp->tent_name = "unused";
 	}
 
 	g_max_cpus = (processorid_t)sysconf(_SC_CPUID_MAX) + 1;
@@ -976,13 +334,18 @@
 	}
 
 	for (entno = 0; entno < TSTAT_NENT; entno++) {
-		if (g_traps[entno].tent_type != TSTAT_ENT_USED)
+		tstat_ent_t	*gtp;
+
+		if ((gtp = get_trap_ent(entno)) == NULL)
+			continue;
+
+		if (gtp->tent_type != TSTAT_ENT_USED)
 			continue;
 
 		(void) fprintf(stream, "0x%03x %3d %s%-20s %s%s\n",
 		    entno, entno,
-		    parsable ? "" : "| ", g_traps[entno].tent_name,
-		    parsable ? "" : "| ", g_traps[entno].tent_descr);
+		    parsable ? "" : "| ", gtp->tent_name,
+		    parsable ? "" : "| ", gtp->tent_descr);
 	}
 }
 
@@ -1003,10 +366,15 @@
 			goto bad_entry;
 	} else {
 		for (entno = 0; entno < TSTAT_NENT; entno++) {
-			if (g_traps[entno].tent_type != TSTAT_ENT_USED)
+			tstat_ent_t	*gtp;
+
+			if ((gtp = get_trap_ent(entno)) == NULL)
 				continue;
 
-			if (strcmp(entry, g_traps[entno].tent_name) == 0)
+			if (gtp->tent_type != TSTAT_ENT_USED)
+				continue;
+
+			if (strcmp(entry, gtp->tent_name) == 0)
 				break;
 		}
 
@@ -1560,10 +928,12 @@
 		(void) printf("\n");
 
 		for (j = 0; j < TSTAT_NENT; j++) {
-			if (!g_active[j])
+			tstat_ent_t	*gtp;
+
+			if ((!g_active[j]) || ((gtp = get_trap_ent(j)) == NULL))
 				continue;
 
-			(void) printf("%3x %-20s|", j, g_traps[j].tent_name);
+			(void) printf("%3x %-20s|", j, gtp->tent_name);
 			for (k = 0; k < i; k++) {
 				(void) printf(" %8lld", TSTAT_DELTA(&data[k],
 				    &odata[data - base + k], tdata_traps[j]));
@@ -1585,12 +955,15 @@
 			break;
 
 		for (i = 0; i < TSTAT_NENT; i++) {
-			if (!data->tdata_traps[i] && !g_active[i])
+			tstat_ent_t	*gtp;
+
+			if ((!data->tdata_traps[i] && !g_active[i]) ||
+			    ((gtp = get_trap_ent(i)) == NULL))
 				continue;
 
 			(void) printf("%lld %d %x %s ",
 			    data->tdata_snapts - g_start, data->tdata_cpuid, i,
-			    g_traps[i].tent_name);
+			    gtp->tent_name);
 
 			(void) printf("%lld\n", TSTAT_DELTA(data, odata,
 			    tdata_traps[i]));
--- a/usr/src/cmd/trapstat/sun4u/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PLATFORM = sun4u
-PLATLINKS =
-CLASS = 32
-SRCDIR=../sun4
-
-include ../../Makefile.cmd
-include ../../../Makefile.psm
-
-PROG= trapstat
-OBJS= trapstat.o
-SRCS= $(OBJS:%.o=$(SRCDIR)/%.c)
-
-CFLAGS += $(CCVERBOSE)
-IFLAGS = -I$(USR_PSM_INCL_DIR)
-CPPFLAGS += $(IFLAGS) $(ARCHOPTS)
-LINTFLAGS += $(LDLIBS) -u
-
-FILEMODE= 0555
-
-CLEANFILES += $(OBJS)
-
-%.o : $(SRCDIR)/%.c
-	$(COMPILE.c) $<
-
-.KEEP_STATE:
-
-all: $(PROG)
-
-install:	all $(USR_PSM_SBIN_PROG) $(USR_PSM_SBIN_PROG_LINKS)
-
-$(PROG):	$(OBJS)
-	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
-	$(POST_PROCESS)
-
-clean:
-	-$(RM) $(CLEANFILES)
-
-lint:	lint_SRCS
-
-include ../../Makefile.targ
-include ../../../Makefile.psm.targ
--- a/usr/src/cmd/trapstat/sun4v/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-PLATFORM = sun4v
-PLATLINKS =
-CLASS = 32
-SRCDIR=../sun4
-
-include ../../Makefile.cmd
-include ../../../Makefile.psm
-
-PROG= trapstat
-OBJS= trapstat.o
-SRCS= $(OBJS:%.o=$(SRCDIR)/%.c)
-
-CFLAGS += -v -Dsun4v
-IFLAGS = -I$(USR_PSM_INCL_DIR)
-CPPFLAGS += $(IFLAGS) $(ARCHOPTS) -Dsun4v
-LINTFLAGS += $(LDLIBS) -u
-
-FILEMODE= 0555
-
-CLEANFILES += $(OBJS)
-
-%.o : $(SRCDIR)/%.c
-	$(COMPILE.c) $<
-
-.KEEP_STATE:
-
-all: $(PROG)
-
-install:	all $(USR_PSM_SBIN_PROG) $(USR_PSM_SBIN_PROG_LINKS)
-
-$(PROG):	$(OBJS)
-	$(LINK.c) -o $(PROG) $(OBJS) $(LDLIBS)
-	$(POST_PROCESS)
-
-clean:
-	-$(RM) $(CLEANFILES)
-
-lint:	lint_SRCS
-
-include ../../Makefile.targ
-include ../../../Makefile.psm.targ
--- a/usr/src/common/bignum/bignumimpl.c	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/common/bignum/bignumimpl.c	Mon Jun 28 15:32:48 2010 -0700
@@ -2498,10 +2498,14 @@
 
 
 static BIG_CHUNK_TYPE onearr[1] = {(BIG_CHUNK_TYPE)1};
+#if	!defined(NO_BIG_ONE)
 BIGNUM big_One = {1, 1, 1, 0, onearr};
+#endif
 
 static BIG_CHUNK_TYPE twoarr[1] = {(BIG_CHUNK_TYPE)2};
+#if	!defined(NO_BIG_TWO)
 BIGNUM big_Two = {1, 1, 1, 0, twoarr};
+#endif
 
 static BIG_CHUNK_TYPE fourarr[1] = {(BIG_CHUNK_TYPE)4};
 static BIGNUM big_Four = {1, 1, 1, 0, fourarr};
--- a/usr/src/lib/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -273,7 +273,6 @@
 
 sparc_SUBDIRS= .WAIT	\
 	efcode		\
-	libc_psr	.WAIT	\
 	libds		\
 	libdscp		\
 	libprtdiag	.WAIT	\
--- a/usr/src/lib/Makefile.lib	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/Makefile.lib	Mon Jun 28 15:32:48 2010 -0700
@@ -155,8 +155,8 @@
 # default build of an archive and a shared object,
 # overridden locally when extra processing is needed
 BUILD.AR=	$(AR) $(ARFLAGS) $@ $(AROBJS)
-BUILD.SO=	$(CC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(LDLIBS)
-BUILDCCC.SO=	$(CCC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(LDLIBS)
+BUILD.SO=	$(CC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(EXTPICS) $(LDLIBS)
+BUILDCCC.SO=	$(CCC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(EXTPICS) $(LDLIBS)
 
 # default dynamic library symlink
 # IMPORTANT:: If you change INS.liblink OR INS.liblink64 here, then you 
--- a/usr/src/lib/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -19,10 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -93,11 +90,11 @@
 
 $(DYNLIB): $$(MAPFILES)
 
-$(DYNLIB): pics .WAIT $$(PICS) $$(ALTPICS)
+$(DYNLIB): pics .WAIT $$(PICS) $$(ALTPICS) $$(EXTPICS)
 	$(BUILD.SO)
 	$(POST_PROCESS_SO)
 
-$(DYNLIBCCC): pics .WAIT $$(PICS) $$(ALTPICS)
+$(DYNLIBCCC): pics .WAIT $$(PICS) $$(ALTPICS) $$(EXTPICS)
 	$(BUILDCCC.SO)
 	$(POST_PROCESS_SO)
 
--- a/usr/src/lib/libc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -19,8 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #
 
@@ -73,8 +72,13 @@
 VAR1_BLDDIR64 =	$(MACH)_$(VAR1)/$(VARBLD64)
 
 i386_VARIANTS=	$(VAR1) $(VAR2) $(VAR3)
-sparc_VARIANTS= $(VAR1)
-sparcv9_VARIANTS= $(VAR1)
+sparc_VARIANTS=
+sparcv9_VARIANTS=
+
+i386_COMP=
+sparc_COMP=	capabilities
+
+MACH_COMP=	$($(MACH)_COMP)
 
 i386_ETC=	$(MACH)/etc
 sparc_ETC=
@@ -85,7 +89,7 @@
 VARIANTS64=	$($(MACH64)_VARIANTS)
 VARIANT_SUBDIRS64	= $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
 
-SUBDIRS=	$(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
+SUBDIRS=	$(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
 $(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
 
 LIBS =		$(DYNLIB) $(LINTLIB)
@@ -140,7 +144,7 @@
 
 etc:	$($(MACH)_ETC)
 
-lib32:	$(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
+lib32:	$(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
 	mkdir -p $(MACH)/i18n_pics
 	cd $(MACH)/i18n_pics ; $(AR) -x $(ROOTFS_LIBDIR)/libc_i18n.a
 	@if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
@@ -149,7 +153,7 @@
 		exit 1; \
 	fi
 
-lib64:	$(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
+lib64:	$(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
 	mkdir -p $(MACH64)/i18n_pics
 	cd $(MACH64)/i18n_pics ; $(AR) -x $(ROOTFS_LIBDIR64)/libc_i18n.a
 	@if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
@@ -167,6 +171,9 @@
 $($(MACH)_ETC): FRC
 	@cd $(@); pwd; $(MAKE) $(TARGET)
 
+$($(MACH)_COMP): FRC
+	@cd $(@); pwd; $(MAKE) $(TARGET)
+
 install:	all			\
 		etc			\
 		inslib32		\
--- a/usr/src/lib/libc/amd64/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/amd64/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -23,12 +23,12 @@
 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-LIBCBASE=.
-
-LIBRARY= libc.a
-LIB_PIC= libc_pic.a
-VERS=	.1
-CPP=	/usr/lib/cpp
+LIBCBASE=	.
+LIBCDIR=	$(SRC)/lib/libc
+LIBRARY=	libc.a
+LIB_PIC=	libc_pic.a
+VERS=		.1
+CPP=		/usr/lib/cpp
 TARGET_ARCH=	amd64
 
 # objects are grouped by source directory
@@ -297,7 +297,7 @@
 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 PORTGEN64=
 
-# objects from source under ../port
+# objects from source under $(LIBCDIR)/port
 PORTFP=				\
 	__flt_decim.o		\
 	__flt_rounds.o		\
@@ -909,12 +909,12 @@
 ALTPICS= $(TRACEOBJS:%=pics/%)
 
 $(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
-$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
+$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
 
-MAPFILES =	../port/mapfile-vers
+MAPFILES =	$(LIBCDIR)/port/mapfile-vers
 
 CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
-		-I. -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) -I/usr/include
+		-I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
 ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
 		$(amd64_AS_XARCH)
 
@@ -948,8 +948,8 @@
 
 # extra files for the clean target
 CLEANFILES=			\
-	../port/gen/errlst.c	\
-	../port/gen/new_list.c	\
+	$(LIBCDIR)/port/gen/errlst.c	\
+	$(LIBCDIR)/port/gen/new_list.c	\
 	assym.h			\
 	genassym		\
 	crt/_rtld.s		\
@@ -964,22 +964,22 @@
 	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
 	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
 	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
-	$(PORTFP:%.o=../port/fp/%.c)			\
-	$(PORTGEN:%.o=../port/gen/%.c)			\
-	$(PORTI18N:%.o=../port/i18n/%.c)		\
-	$(PORTPRINT:%.o=../port/print/%.c)		\
-	$(PORTREGEX:%.o=../port/regex/%.c)		\
-	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
-	$(PORTSYS:%.o=../port/sys/%.c)			\
-	$(AIOOBJS:%.o=../port/aio/%.c)			\
-	$(RTOBJS:%.o=../port/rt/%.c)			\
-	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
-	$(THREADSOBJS:%.o=../port/threads/%.c)		\
+	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
+	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
+	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
+	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
+	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
+	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
+	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
+	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
+	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
+	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
+	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
 	$(THREADSMACHOBJS:%.o=threads/%.c)		\
 	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
 	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
 	$(FPOBJS:%.o=fp/%.c)				\
-	$(I386FPOBJS:%.o=../i386/fp/%.c)		\
+	$(I386FPOBJS:%.o=$(LIBCDIR)/i386/fp/%.c)		\
 	$(LIBCBASE)/gen/ecvt.c				\
 	$(LIBCBASE)/gen/makectxt.c			\
 	$(LIBCBASE)/gen/siginfolst.c			\
@@ -1070,7 +1070,7 @@
 
 all: $(LIBS) $(LIB_PIC)
 
-lint	:=	CPPFLAGS += -I../$(MACH)/fp
+lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
 lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
 lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 
@@ -1078,7 +1078,7 @@
 	@echo $(LINT.c) ... $(LDLIBS)
 	@$(LINT.c) $(SRCS) $(LDLIBS)
 
-$(LINTLIB):= SRCS=../port/llib-lc
+$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
 $(LINTLIB):= LINTFLAGS64=-nvx -m64
 
@@ -1119,19 +1119,19 @@
 	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
 
 genassym: $(GENASSYM_C)
-	$(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
+	$(NATIVECC) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
 
-OFFSETS = ../$(MACH)/offsets.in
+OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
 
 assym.h: $(OFFSETS) genassym
 	$(OFFSETS_CREATE) <$(OFFSETS) >$@
 	./genassym >>$@
 
 # derived C source and related explicit dependencies
-../port/gen/errlst.c + \
-../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
-	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
+$(LIBCDIR)/port/gen/errlst.c + \
+$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
+	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
 
-pics/errlst.o: ../port/gen/errlst.c
+pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
 
-pics/new_list.o: ../port/gen/new_list.c
+pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,55 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/Makefile.master
+
+# Each target directory is responsible for making a symbol capabilities object.
+$(SPARC_BLD)SUBDIRS = \
+		sun4u \
+		sun4u-opl \
+		sun4u-us3-hwcap1 \
+		sun4u-us3-hwcap2 \
+		sun4v-hwcap1 \
+		sun4v-hwcap2
+$(INTEL_BLD)SUBDIRS =
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+MAPFILE-CAP =	../common/mapfile-cap
+MAPOPT-CAP =	$(MAPFILE-CAP:%=-M%)
+
+OBJCAP =	pics/objcap.o
+SYMCAP =	pics/symcap.o
+
+CLOBBERFILES +=	$(OBJCAP) $(SYMCAP)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,53 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+$(SYMCAP):	$(OBJCAP)
+$(OBJCAP):	$(PICS)
+$(PICS):	pics
+
+# Assemble the original source file.
+
+pics/%.o:	../../$(TRG_PLATFORM)/common/%.s
+		$(COMPILE.s) $< -o $@
+		$(POST_PROCESS_O)
+
+pics/%.o:	../../$(ALT_PLATFORM)/common/%.s
+		$(COMPILE.s) $< -o $@
+		$(POST_PROCESS_O)
+
+# Combine all pic objects into one relocatable object.  Assign any capabilities
+# to this object, and define the interface.
+
+pics/objcap.o:	$(PICS) $(MAPFILE-CAP)
+		$(LD) -r -o $@ $(MAPOPT-CAP) -Breduce $(PICS)
+		$(POST_PROCESS_OBJCAP_O)
+
+# Convert the combined object capabilities object into a symbol capabilities
+# object.
+
+pics/symcap.o:	$(OBJCAP)
+		$(LD) -r -o $@ -z symbolcap $(OBJCAP)
+
+include		../../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,45 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,40 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4u-opl
+ALT_PLATFORM =	sun4u-us3
+GEN_PLATFORM =	sun4u
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o memset.o memcmp.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS)
+ASFLAGS =	-P -K pic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u-opl {
+	PLATFORM = "SUNW,SPARC-Enterprise";
+};
+
+SYMBOL_SCOPE {
+	global:
+		_memcmp;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcmp;
+		memcpy;
+		memmove;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/common/memcpy.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,1019 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcpy.s"
+
+/*
+ * memcpy(s1, s2, len)
+ *
+ * Copy s2 to s1, always copy n bytes.
+ * Note: this C code does not work for overlapped copies.
+ *       Memmove() and bcopy() do.
+ *
+ * Fast assembler language version of the following C-program for memcpy
+ * which represents the `standard' for the C-library.
+ *
+ *	void *
+ *	memcpy(void *s, const void *s0, size_t n)
+ *	{
+ *		if (n != 0) {
+ *	   	    char *s1 = s;
+ *		    const char *s2 = s0;
+ *		    do {
+ *			*s1++ = *s2++;
+ *		    } while (--n != 0);
+ *		}
+ *		return (s);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+#include <sys/trap.h>
+
+#define	ICACHE_LINE_SIZE	64
+#define	BLOCK_SIZE		64
+#define	FPRS_FEF		0x4
+
+#define	ALIGNED8_FPCOPY_THRESHOLD	1024
+#define	ALIGNED4_FPCOPY_THRESHOLD	1024
+#define	BST_THRESHOLD			65536
+
+#define	SHORTCOPY	3
+#define	SMALL_MAX	64
+#define	MEDIUM_MAX	255
+#define	MED_WMAX	256	/* max copy for medium word-aligned case */
+
+#define	N_READS_STRONG	20
+#define	N_WRITES_STRONG	22
+
+
+	ANSI_PRAGMA_WEAK(memmove,function)
+	ANSI_PRAGMA_WEAK(memcpy,function)
+
+	ENTRY(memmove)
+	prefetch [%o1], N_READS_STRONG
+	prefetch [%o0], N_WRITES_STRONG
+	cmp	%o1, %o0	! if from address is >= to use forward copy
+	bgeu	%ncc, .forcpy	! else use backward if ...
+	sub	%o0, %o1, %o4	! get difference of two addresses
+	cmp	%o2, %o4	! compare size and difference of addresses
+	bleu	%ncc, .forcpy	! if size is bigger, do overlapped copy
+	nop
+
+	!
+	! an overlapped copy that must be done "backwards"
+	!
+.ovbc:
+	mov	%o0, %g1		! save dest address for return val
+	add     %o1, %o2, %o1           ! get to end of source space
+	add     %o0, %o2, %o0           ! get to end of destination space
+
+	cmp	%o2, 64
+	bgeu,pn	%ncc, .dbalign
+	nop
+	cmp	%o2, 4
+	blt,pn	%ncc, .byte
+	sub	%o2, 3, %o2
+.byte4loop:
+	ldub	[%o1-1], %o3		! load last byte
+	stb	%o3, [%o0-1]		! store last byte
+	sub	%o1, 4, %o1
+	ldub	[%o1+2], %o3		! load 2nd from last byte
+	stb	%o3, [%o0-2]		! store 2nd from last byte
+	sub	%o0, 4, %o0
+	ldub	[%o1+1], %o3		! load 3rd from last byte
+	stb	%o3, [%o0+1]		! store 3rd from last byte
+	subcc	%o2, 4, %o2
+	ldub	[%o1], %o3		! load 4th from last byte
+	bgu,pt	%ncc, .byte4loop
+	stb	%o3, [%o0]		! store 4th from last byte
+.byte:
+	addcc	%o2, 3, %o2
+	bz,pt	%ncc, .exit
+.byteloop:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o2			! decrement count
+	bgu,pt	%ncc, .byteloop		! loop until done
+	stb	%o3, [%o0]		! write byte
+.exit:
+	retl
+	mov	%g1, %o0
+
+	.align	16
+.dbalign:
+	prefetch [%o1 - (4 * BLOCK_SIZE)], #one_read
+	prefetch [%o0 - (4 * BLOCK_SIZE)], #one_write
+	andcc   %o0, 7, %o5		! bytes till DST 8 byte aligned
+	bz,pt	%ncc, .dbmed
+	sub	%o2, %o5, %o2		! update count
+.dbalign1:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o5			! decrement count
+	bgu,pt	%ncc, .dbalign1		! loop until done
+	stb	%o3, [%o0]		! store a byte
+
+! check for src long word alignment
+.dbmed:
+	andcc	%o1, 7, %g0		! chk src long word alignment
+	bnz,pn	%ncc, .dbbck
+	nop
+!
+! Following code is for overlapping copies where src and dest
+! are long word aligned
+!
+!
+! For SPARC64-VI, prefetch is effective for both integer and fp register
+! operations. There are no benefits in using the fp registers for
+! aligned data copying.
+	
+.dbmedl32enter:
+	subcc	%o2, 31, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt  %ncc, .dbmedl31		! skip big loop if less than 32
+	nop
+.dbmedl32:
+	ldx	[%o1-8], %o4		! load
+	prefetch [%o1 - (8 * BLOCK_SIZE)], #one_read
+	subcc	%o2, 32, %o2		! decrement length count
+	stx	%o4, [%o0-8]		! and store
+	prefetch [%o0 - (8 * BLOCK_SIZE)], #one_write
+	ldx	[%o1-16], %o3		! a block of 32 bytes
+	sub	%o1, 32, %o1		! decrease src ptr by 32
+	stx	%o3, [%o0-16]
+	ldx	[%o1+8], %o4
+	sub	%o0, 32, %o0		! decrease dst ptr by 32
+	stx	%o4, [%o0+8]
+	ldx	[%o1], %o3
+	bgu,pt	%ncc, .dbmedl32		! repeat if at least 32 bytes left
+	stx	%o3, [%o0]
+.dbmedl31:
+	addcc	%o2, 16, %o2		! adjust remaining count
+	ble,pt	%ncc, .dbmedl15		! skip if 15 or fewer bytes left
+	nop				!
+	ldx	[%o1-8], %o4		! load and store 16 bytes
+	sub	%o1, 16, %o1		! decrease src ptr by 16
+	stx	%o4, [%o0-8]		!
+	sub	%o2, 16, %o2		! decrease count by 16
+	ldx	[%o1], %o3		!
+	sub	%o0, 16, %o0		! decrease dst ptr by 16
+	stx	%o3, [%o0]
+.dbmedl15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .dbexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .dbremain		! skip if 7 or fewer bytes left
+	nop
+	ldx	[%o1-8], %o4		! load 8 bytes
+	sub	%o1, 8, %o1		! decrease src ptr by 8
+	stx	%o4, [%o0-8]		! and store 8 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	bnz	%ncc, .dbremain		! exit if finished
+	sub	%o0, 8, %o0		! decrease dst ptr by 8
+	retl
+	mov	%g1, %o0
+
+!
+! Following code is for overlapping copies where src and dest
+! are not long word aligned
+!
+	.align	16
+.dbbck:
+	rd	%fprs, %o3		! o3 = fprs
+
+	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
+	! So set it anyway, without checking.
+	wr	%g0, 0x4, %fprs		! fprs.fef = 1
+
+	alignaddr %o1, %g0, %o5		! align src
+	ldd	[%o5], %d0		! get first 8 byte block
+	andn	%o2, 7, %o4		! prepare src ptr for finishup code
+	cmp	%o2, 32
+	blt,pn	%ncc, .dbmv8
+	sub	%o1, %o4, %o1		!
+	cmp	%o2, 4095		! check for short memmoves
+	blt,pn	%ncc, .dbmv32enter	! go to no prefetch code
+.dbmv64:
+	ldd	[%o5-8], %d2		! load 8 bytes
+	ldd	[%o5-16], %d4		! load 8 bytes
+	sub	%o5, 64, %o5		!
+	ldd	[%o5+40], %d6		! load 8 bytes
+	sub	%o0, 64, %o0		!
+	ldd	[%o5+32], %d8		! load 8 bytes
+	sub	%o2, 64, %o2		! 64 less bytes to copy
+	ldd	[%o5+24], %d18		! load 8 bytes
+	cmp	%o2, 64			! do we have < 64 bytes remaining
+	ldd	[%o5+16], %d28		! load 8 bytes
+	ldd	[%o5+8], %d30		! load 8 bytes
+	faligndata %d2, %d0, %d10	! extract 8 bytes out
+	prefetch [%o5 - (5 * BLOCK_SIZE)], #one_read
+	ldd	[%o5], %d0		! load 8 bytes
+	std	%d10, [%o0+56]		! store the current 8 bytes
+	faligndata %d4, %d2, %d12	! extract 8 bytes out
+	prefetch [%o0 - (5 * BLOCK_SIZE)], #one_write
+	std	%d12, [%o0+48]		! store the current 8 bytes
+	faligndata %d6, %d4, %d14	! extract 8 bytes out
+	std	%d14, [%o0+40]		! store the current 8 bytes
+	faligndata %d8, %d6, %d16	! extract 8 bytes out
+	std	%d16, [%o0+32]		! store the current 8 bytes
+	faligndata %d18, %d8, %d20	! extract 8 bytes out
+	std	%d20, [%o0+24]		! store the current 8 bytes
+	faligndata %d28, %d18, %d22	! extract 8 bytes out
+	std	%d22, [%o0+16]		! store the current 8 bytes
+	faligndata %d30, %d28, %d24	! extract 8 bytes out
+	std	%d24, [%o0+8]		! store the current 8 bytes
+	faligndata %d0, %d30, %d26	! extract 8 bytes out
+	bgeu,pt	%ncc, .dbmv64
+	std	%d26, [%o0]		! store the current 8 bytes
+
+	cmp	%o2, 32
+	blt,pn	%ncc, .dbmvx
+	nop
+.dbmv32:
+	ldd	[%o5-8], %d2		! load 8 bytes
+.dbmv32enter:
+	ldd	[%o5-16], %d4		! load 8 bytes
+	sub	%o5, 32, %o5		!
+	ldd	[%o5+8], %d6		! load 8 bytes
+	sub	%o0, 32, %o0		!
+	faligndata %d2, %d0, %d10	! extract 8 bytes out
+	ldd	[%o5], %d0		! load 8 bytes
+	sub	%o2,32, %o2		! 32 less bytes to copy
+	std	%d10, [%o0+24]		! store the current 8 bytes
+	cmp	%o2, 32			! do we have < 32 bytes remaining
+	faligndata %d4, %d2, %d12	! extract 8 bytes out
+	std	%d12, [%o0+16]		! store the current 8 bytes
+	faligndata %d6, %d4, %d14	! extract 8 bytes out
+	std	%d14, [%o0+8]		! store the current 8 bytes
+	faligndata %d0, %d6, %d16	! extract 8 bytes out
+	bgeu,pt	%ncc, .dbmv32
+	std	%d16, [%o0]		! store the current 8 bytes
+.dbmvx:
+	cmp	%o2, 8			! do we have < 8 bytes remaining
+	blt,pt	%ncc, .dbmvfinish	! if yes, skip to finish up code
+	nop
+.dbmv8:
+	ldd	[%o5-8], %d2
+	sub	%o0, 8, %o0		! since we are at the end
+					! when we first enter the loop
+	sub	%o2, 8, %o2		! 8 less bytes to copy
+	sub	%o5, 8, %o5
+	cmp	%o2, 8			! do we have < 8 bytes remaining
+	faligndata %d2, %d0, %d8	! extract 8 bytes out
+	std	%d8, [%o0]		! store the current 8 bytes
+	bgeu,pt	%ncc, .dbmv8
+	fmovd	%d2, %d0
+.dbmvfinish:
+	and	%o3, 0x4, %o3		! fprs.du = fprs.dl = 0
+	tst	%o2
+	bz,pt	%ncc, .dbexit
+	wr	%o3, %g0, %fprs		! fprs = o3   restore fprs
+
+.dbremain:
+	cmp	%o2, 4
+	blt,pn	%ncc, .dbbyte
+	nop
+	ldub	[%o1-1], %o3		! load last byte
+	stb	%o3, [%o0-1]		! store last byte
+	sub	%o1, 4, %o1
+	ldub	[%o1+2], %o3		! load 2nd from last byte
+	stb	%o3, [%o0-2]		! store 2nd from last byte
+	sub	%o0, 4, %o0
+	ldub	[%o1+1], %o3		! load 3rd from last byte
+	stb	%o3, [%o0+1]		! store 3rd from last byte
+	subcc	%o2, 4, %o2
+	ldub	[%o1], %o3		! load 4th from last byte
+	stb	%o3, [%o0]		! store 4th from last byte
+	bz,pt	%ncc, .dbexit
+.dbbyte:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o2			! decrement count
+	bgu,pt	%ncc, .dbbyte		! loop until done
+	stb	%o3, [%o0]		! write byte
+.dbexit:
+	retl
+	mov	%g1, %o0
+	SET_SIZE(memmove)
+
+
+	.align ICACHE_LINE_SIZE
+	ENTRY(memcpy)
+					! adjust instruction alignment
+	nop				! Do not remove, these nops affect
+	nop				! icache alignment and performance
+.forcpy:
+	prefetch [%o1], N_READS_STRONG
+	prefetch [%o0], N_WRITES_STRONG
+	cmp	%o2, SMALL_MAX		! check for not small case
+	bgu,pn	%ncc, .medium		! go to larger cases
+	mov	%o0, %g1		! save %o0
+	cmp	%o2, SHORTCOPY		! check for really short case
+	ble,pt	%ncc, .smallleft	!
+	or	%o0, %o1, %o3		! prepare alignment check
+	andcc	%o3, 0x3, %g0		! test for alignment
+	bz,pt	%ncc, .smallword	! branch to word aligned case
+	sub	%o2, 3, %o2		! adjust count to allow cc zero test
+.smallnotalign4:
+	ldub	[%o1], %o3		! read byte
+	subcc	%o2, 4, %o2		! reduce count by 4
+	stb	%o3, [%o0]		! write byte
+	ldub	[%o1+1], %o3		! repeat for a total of 4 bytes
+	add	%o1, 4, %o1		! advance SRC by 4
+	stb	%o3, [%o0+1]
+	ldub	[%o1-2], %o3
+	add	%o0, 4, %o0		! advance DST by 4
+	stb	%o3, [%o0-2]
+	ldub	[%o1-1], %o3
+	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
+	stb	%o3, [%o0-1]
+	add	%o2, 3, %o2		! restore count
+.smallleft:
+	tst	%o2
+	bz,pt	%ncc, .smallexit
+	nop
+.smallleft3:				! 1, 2, or 3 bytes remain
+	ldub	[%o1], %o3		! load one byte
+	deccc	%o2			! reduce count for cc test
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0]		! store one byte
+	ldub	[%o1+1], %o3		! load second byte
+	deccc	%o2
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+1]		! store second byte
+	ldub	[%o1+2], %o3		! load third byte
+	stb	%o3, [%o0+2]		! store third byte
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align	16
+	nop				! affects loop icache alignment
+.smallwords:
+	lduw	[%o1], %o3		! read word
+.smallwordx:
+	subcc	%o2, 8, %o2		! update count
+	stw	%o3, [%o0]		! write word
+	add	%o1, 8, %o1		! update SRC
+	lduw	[%o1-4], %o3		! read word
+	add	%o0, 8, %o0		! update DST
+	bgu,pt	%ncc, .smallwords	! loop until done
+	stw	%o3, [%o0-4]		! write word
+	addcc	%o2, 7, %o2		! restore count
+	bz,pt	%ncc, .smallexit	! check for completion
+	nop
+	cmp	%o2, 4			! check for 4 or more bytes left
+	blt	.smallleft3		! if not, go to finish up
+	nop
+	lduw	[%o1], %o3
+	add	%o1, 4, %o1
+	subcc	%o2, 4, %o2
+	stw	%o3, [%o0]
+	add	%o0, 4, %o0
+	bnz,pt	%ncc, .smallleft3
+	nop
+	retl
+	mov	%g1, %o0		! restore %o0
+
+.smallword:
+	subcc	%o2, 4, %o2		! update count
+	bgu,pt	%ncc, .smallwordx
+	lduw	[%o1], %o3		! read word
+	addcc	%o2, 3, %o2		! restore count
+	bz,pt	%ncc, .smallexit
+	stw	%o3, [%o0]		! write word
+	deccc	%o2			! reduce count for cc test
+	ldub	[%o1+4], %o3		! load one byte
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+4]		! store one byte
+	ldub	[%o1+5], %o3		! load second byte
+	deccc	%o2
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+5]		! store second byte
+	ldub	[%o1+6], %o3		! load third byte
+	stb	%o3, [%o0+6]		! store third byte
+.smallexit:
+	retl
+	mov	%g1, %o0		! restore %o0
+	.align 16
+.medium:
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_write
+	neg	%o0, %o5
+	neg	%o1, %o3
+	andcc	%o5, 7, %o5	! bytes till DST 8 byte aligned
+	and	%o3, 7, %o3	! bytes till SRC 8 byte aligned
+
+	bz	%ncc, 2f
+	sub	%o5, %o3, %o3	! -(bytes till SRC aligned after DST aligned)
+				! o3={-7, -6, ... 7}  o3>0 => SRC overaligned
+
+	sub	%o2, %o5, %o2	! update count
+
+1:
+	ldub	[%o1], %o4
+	deccc	%o5
+	inc	%o1
+	stb	%o4, [%o0]
+	bgu,pt	%ncc, 1b
+	inc	%o0
+
+	! Now DST is 8-byte aligned.  o0, o1, o2 are current.
+
+2:
+	andcc	%o1, 0x3, %g0		! test alignment
+	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
+	bnz,pt	%ncc, .mediumsetup	! branch to skip aligned cases
+					! if src, dst not aligned
+	prefetch [%o0 + (1 * BLOCK_SIZE)], #one_write
+
+/*
+ * Handle all cases where src and dest are aligned on word
+ * or long word boundaries.  Use unrolled loops for better
+ * performance.  This option wins over standard large data
+ * move when source and destination is in cache for medium
+ * to short data moves.
+ */
+	andcc	%o1, 0x7, %g0		! test word alignment
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+	bz,pt	%ncc, .medlword		! branch to long word aligned case
+	prefetch [%o0 + (2 * BLOCK_SIZE)], #one_write
+	cmp	%o2, ALIGNED4_FPCOPY_THRESHOLD	! limit to store buffer size
+	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+	subcc	%o2, 15, %o2		! adjust length to allow cc test
+	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_write
+					! for end of loop
+	ble,pt	%ncc, .medw15		! skip big loop if less than 16
+	  .empty
+.medw16:
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ld	[%o1], %o4		! load
+	subcc	%o2, 16, %o2		! decrement length count
+	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_write
+	stw	%o4, [%o0]		! and store
+	ld	[%o1+4], %o3		! a block of 16 bytes
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stw	%o3, [%o0+4]
+	ld	[%o1-8], %o4
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stw	%o4, [%o0-8]
+	ld	[%o1-4], %o3
+	bgu,pt	%ncc, .medw16		! repeat if at least 16 bytes left
+	stw	%o3, [%o0-4]
+.medw15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .medwexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	nop				!
+	ld	[%o1], %o4		! load 4 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	stw	%o4, [%o0]		! and store 4 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	ld	[%o1-4], %o3		! load 4 bytes
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	stw	%o3, [%o0-4]		! and store 4 bytes
+	bz	%ncc, .medwexit		! exit if finished
+	nop
+.medw7:					! count is ge 1, less than 8
+	cmp	%o2, 3			! check for 4 bytes left
+	ble,pt	%ncc, .medw3		! skip if 3 or fewer bytes left
+	nop				!
+	ld	[%o1], %o4		! load 4 bytes
+	sub	%o2, 4, %o2		! decrease count by 4
+	add	%o1, 4, %o1		! increase src ptr by 4
+	stw	%o4, [%o0]		! and store 4 bytes
+	add	%o0, 4, %o0		! increase dst ptr by 4
+	tst	%o2			! check for zero bytes left
+	bz	%ncc, .medwexit		! exit if finished
+	nop
+.medw3:					! count is known to be 1, 2, or 3
+	deccc	%o2			! reduce count by one
+	ldub	[%o1], %o3		! load one byte
+	bz,pt	%ncc, .medwexit		! exit if last byte
+	stb	%o3, [%o0]		! store one byte
+	ldub	[%o1+1], %o3		! load second byte
+	deccc	%o2			! reduce count by one
+	bz,pt	%ncc, .medwexit		! exit if last byte
+	stb	%o3, [%o0+1]		! store second byte
+	ldub	[%o1+2], %o3		! load third byte
+	stb	%o3, [%o0+2]		! store third byte
+.medwexit:
+	retl
+	mov	%g1, %o0		! restore %o0
+
+/*
+ * Special case for handling when src and dest are both long word aligned
+ * and total data to move is between SMALL_MAX and ALIGNED8_FPCOPY_THRESHOLD
+ * bytes.
+ */
+
+	.align 16
+	nop
+.medlword:				! long word aligned
+					! length > ALIGNED8_FPCOPY_THRESHOLD
+	cmp	%o2, ALIGNED8_FPCOPY_THRESHOLD
+	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_write
+	subcc	%o2, 31, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt	%ncc, .medl31		! skip big loop if less than 32
+	  .empty
+.medl32:
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ldx	[%o1], %o4		! load
+	subcc	%o2, 32, %o2		! decrement length count
+	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_read
+	stx	%o4, [%o0]		! and store
+	ldx	[%o1+8], %o3		! a block of 32 bytes
+	add	%o1, 32, %o1		! increase src ptr by 32
+	stx	%o3, [%o0+8]
+	ldx	[%o1-16], %o4
+	add	%o0, 32, %o0		! increase dst ptr by 32
+	stx	%o4, [%o0-16]
+	ldx	[%o1-8], %o3
+	bgu,pt	%ncc, .medl32		! repeat if at least 32 bytes left
+	stx	%o3, [%o0-8]
+.medl31:
+	addcc	%o2, 16, %o2		! adjust remaining count
+	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
+	nop				!
+	ldx	[%o1], %o4		! load and store 16 bytes
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stx	%o4, [%o0]		!
+	sub	%o2, 16, %o2		! decrease count by 16
+	ldx	[%o1-8], %o3		!
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stx	%o3, [%o0-8]
+.medl15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .medwexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	nop
+	ldx	[%o1], %o4		! load 8 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	stx	%o4, [%o0]		! and store 8 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	bz	%ncc, .medwexit		! exit if finished
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	ba	.medw7
+	nop
+
+	.align 16
+	nop
+	nop
+	nop
+.mediumsetup:
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+.mediumrejoin:
+	rd	%fprs, %o4		! check for unused FPU
+
+	add	%o1, 8, %o1		! prepare to round SRC upward
+
+	sethi	%hi(0x1234567f), %o5	! For GSR.MASK
+	or	%o5, 0x67f, %o5
+
+	andcc	%o4, FPRS_FEF, %o4	! test FEF, fprs.du = fprs.dl = 0
+	bz,a	%ncc, 3f
+	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
+3:
+	cmp	%o2, MEDIUM_MAX
+	bmask	%o5, %g0, %g0
+
+	! Compute o5 (number of bytes that need copying using the main loop).
+	! First, compute for the medium case.
+	! Then, if large case, o5 is replaced by count for block alignment.
+	! Be careful not to read past end of SRC
+	! Currently, o2 is the actual count remaining
+	!            o3 is how much sooner we'll cross the alignment boundary
+	!                in SRC compared to in DST
+	!
+	! Examples:  Let # denote bytes that should not be accessed
+	!            Let x denote a byte already copied to align DST
+	!            Let . and - denote bytes not yet copied
+	!            Let | denote double alignment boundaries
+	!
+	!            DST:  ######xx|........|--------|..######   o2 = 18
+	!                          o0
+	!
+	!  o3 = -3:  SRC:  ###xx...|.....---|-----..#|########   o5 = 8
+	!                          o1
+	!
+	!  o3 =  0:  SRC:  ######xx|........|--------|..######   o5 = 16-8 = 8
+	!                                   o1
+	!
+	!  o3 = +1:  SRC:  #######x|x.......|.-------|-..#####   o5 = 16-8 = 8
+	!                                   o1
+
+	or	%g0, -8, %o5
+	alignaddr %o1, %g0, %o1		! set GSR.ALIGN and align o1
+
+	movrlz	%o3, %g0, %o5		! subtract 8 from o2+o3 only if o3>=0
+	add	%o5, %o2, %o5
+	add	%o5, %o3, %o5
+
+	bleu	%ncc, 4f
+	andn	%o5, 7, %o5		! 8 byte aligned count
+	neg	%o0, %o5		! 'large' case
+	and	%o5, BLOCK_SIZE-1, %o5  ! bytes till DST block aligned
+4:
+	brgez,a	%o3, .beginmedloop
+	ldd	[%o1-8], %d0
+
+	add	%o1, %o3, %o1		! back up o1
+5:
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	andcc	%o1, 7, %g0
+	bnz	%ncc, 5b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+.beginmedloop:
+	tst	%o5
+	bz	%ncc, .endmedloop
+	sub	%o2, %o5, %o2		! update count for later
+
+	! Main loop to write out doubles.  Note: o5 & 7 == 0
+
+	ldd	[%o1], %d2
+	subcc	%o5, 8, %o5		! update local count
+	bz,pn	%ncc, 1f
+	add	%o1, 8, %o1		! update SRC
+
+.medloop:
+	faligndata %d0, %d2, %d4
+	ldd	[%o1], %d0
+	subcc	%o5, 8, %o5		! update local count
+	add	%o1, 16, %o1		! update SRC
+	std	%d4, [%o0]
+	bz,pn	%ncc, 2f
+	faligndata %d2, %d0, %d6
+	ldd	[%o1 - 8], %d2
+	subcc	%o5, 8, %o5		! update local count
+	std	%d6, [%o0 + 8]
+	bnz,pt	%ncc, .medloop
+	add	%o0, 16, %o0		! update DST
+
+1:
+	faligndata %d0, %d2, %d4
+	fmovd	%d2, %d0
+	std	%d4, [%o0]
+	ba	.endmedloop
+	add	%o0, 8, %o0
+
+2:
+	std	%d6, [%o0 + 8]
+	sub	%o1, 8, %o1
+	add	%o0, 16, %o0
+
+
+.endmedloop:
+	! Currently, o1 is pointing to the next double-aligned byte in SRC
+	! The 8 bytes starting at [o1-8] are available in d0
+	! At least one, and possibly all, of these need to be written.
+
+	cmp	%o2, BLOCK_SIZE
+	bgu	%ncc, .large		! otherwise, less than 16 bytes left
+
+#if 0
+
+	/* This code will use partial stores.  */
+
+	mov	%g0, %o5
+	and	%o3, 7, %o3		! Number of bytes needed to completely
+					! fill %d0 with good (unwritten) data.
+
+	subcc	%o2, 8, %o2		! update count (maybe too much)
+	movl	%ncc, %o2, %o5
+	addcc	%o3, %o5, %o5		! extra bytes we can stuff into %d0
+	sub	%o3, %o5, %o3		! update o3 (# bad bytes in %d0)
+
+	bz	%ncc, 2f
+	alignaddr %o3, %g0, %g0		! set GSR.ALIGN
+
+1:
+	deccc	%o5
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	bgu	%ncc, 1b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+2:
+	not	%o3
+	faligndata %d0, %d0, %d0	! shift bytes to the left
+	and	%o3, 7, %o3		! last byte to be stored in [%o0+%o3]
+	edge8n	%g0, %o3, %o5
+	stda	%d0, [%o0]%o5, ASI_PST8_P
+	brlez	%o2, .mediumexit
+	add	%o0, %o3, %o0		! update DST to last stored byte
+3:
+	inc	%o0
+	deccc	%o2
+	ldub	[%o1], %o3
+	stb	%o3, [%o0]
+	bgu	%ncc, 3b
+	inc	%o1
+
+#else
+
+	andcc	%o3, 7, %o5		! Number of bytes needed to completely
+					! fill %d0 with good (unwritten) data.
+	bz	%ncc, 2f
+	sub	%o5, 8, %o3		! -(number of good bytes in %d0)
+	cmp	%o2, 8
+	bl,a	%ncc, 3f		! Not enough bytes to fill %d0
+	add	%o1, %o3, %o1 		! Back up %o1
+
+1:
+	deccc	%o5
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	bgu	%ncc, 1b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+2:
+	subcc	%o2, 8, %o2
+	std	%d0, [%o0]
+	bz	%ncc, .mediumexit
+	add	%o0, 8, %o0
+3:
+	ldub	[%o1], %o3
+	deccc	%o2
+	inc	%o1
+	stb	%o3, [%o0]
+	bgu	%ncc, 3b
+	inc	%o0
+#endif
+
+.mediumexit:
+        wr	%o4, %g0, %fprs		! fprs = o4   restore fprs
+	retl
+        mov	%g1, %o0
+
+
+	.align ICACHE_LINE_SIZE
+.large:
+
+	! %o0 I/O DST is 64-byte aligned
+	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
+	! %d0 I/O already loaded with SRC data from [%o1-8]
+	! %o2 I/O count (number of bytes that need to be written)
+	! %o3 I   Not written.  If zero, then SRC is double aligned.
+	! %o4 I   Not written.  Holds fprs.
+	! %o5   O The number of doubles that remain to be written.
+
+	! Load the rest of the current block
+	! Recall that %o1 is further into SRC than %o0 is into DST
+
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	prefetch [%o1 + (8 * BLOCK_SIZE)], #one_read
+
+	set	BST_THRESHOLD, %o5
+	cmp	%o2, %o5
+	bgu,pn	%icc, .xlarge
+	prefetch [%o1 + (12 * BLOCK_SIZE)], #one_read
+
+	ldd	[%o1], %f2
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x20], %f10
+	or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
+	faligndata %f6, %f8, %f38
+	prefetch [%o1 + (16 * BLOCK_SIZE)], #one_read
+	ldd	[%o1 + 0x28], %f12
+	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed lter)
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f10, %f12, %f42
+	ldd	[%o1 + 0x38], %f0
+	sub	%o2, BLOCK_SIZE, %o2	! update count
+	add	%o1, BLOCK_SIZE, %o1	! update SRC
+
+	! Main loop.  Write previous block.  Load rest of current block.
+	! Some bytes will be loaded that won't yet be written.
+1:
+	ldd	[%o1], %f2
+	faligndata %f12, %f14, %f44
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f14, %f0, %f46
+	std	%f32, [%o0]
+	std	%f34, [%o0+8]
+	std	%f36, [%o0+16]
+	std	%f38, [%o0+24]
+	std	%f40, [%o0+32]
+	std	%f42, [%o0+40]
+	std	%f44, [%o0+48]
+	std	%f46, [%o0+56]
+	sub	%o2, BLOCK_SIZE, %o2		! update count
+	prefetch [%o1 + (24 * BLOCK_SIZE) + BLOCK_SIZE], #one_read
+	add	%o0, BLOCK_SIZE, %o0		! update DST
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x20], %f10
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x28], %f12
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x38], %f0
+	faligndata %f10, %f12, %f42
+	prefetch [%o1 + (18 * BLOCK_SIZE)], #one_read
+	cmp	%o2, BLOCK_SIZE + 8
+	prefetch [%o0 + (18 * BLOCK_SIZE)], #one_write
+	bgu,pt	%ncc, 1b
+	add	%o1, BLOCK_SIZE, %o1	! update SRC
+	faligndata %f12, %f14, %f44
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
+	cmp	%o2, BLOCK_SIZE
+	bne	%ncc, 2f		! exactly 1 block remaining?
+	add	%o0, BLOCK_SIZE, %o0	! update DST
+	brz,a	%o3, 3f			! is SRC double aligned?
+	ldd	[%o1], %f2
+
+2:
+	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8
+	add	%o5, %o3, %o5
+
+	membar	#StoreLoad|#StoreStore
+
+	ba	.beginmedloop
+	andn	%o5, 7, %o5		! 8 byte aligned count
+
+
+	! This is when there is exactly 1 block remaining and SRC is aligned
+3:
+	ldd	[%o1 + 0x8], %f4
+	ldd	[%o1 + 0x10], %f6
+	fsrc1	%f0, %f32
+	ldd	[%o1 + 0x18], %f8
+	fsrc1	%f2, %f34
+	ldd	[%o1 + 0x20], %f10
+	fsrc1	%f4, %f36
+	ldd	[%o1 + 0x28], %f12
+	fsrc1	%f6, %f38
+	ldd	[%o1 + 0x30], %f14
+	fsrc1	%f8, %f40
+	fsrc1	%f10, %f42
+	fsrc1	%f12, %f44
+	fsrc1	%f14, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	membar	#StoreLoad|#StoreStore
+	wr	%o4, 0, %fprs
+	retl
+	mov	%g1, %o0
+
+
+	.align 16
+	! two nops here causes loop starting at 1f below to be
+	! on a cache line boundary, improving performance
+	nop
+	nop
+.xlarge:
+	! %o0 I/O DST is 64-byte aligned
+	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
+	! %d0 I/O already loaded with SRC data from [%o1-8]
+	! %o2 I/O count (number of bytes that need to be written)
+	! %o3 I   Not written.  If zero, then SRC is double aligned.
+	! %o4 I   Not written.  Holds fprs.
+	! %o5   O The number of doubles that remain to be written.
+
+	! Load the rest of the current block
+	! Recall that %o1 is further into SRC than %o0 is into DST
+
+	ldd	[%o1], %f2
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x20], %f10
+	or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x28], %f12
+	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed later)
+	prefetch [%o1 + (16 * BLOCK_SIZE)], #one_read
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f10, %f12, %f42
+	ldd	[%o1 + 0x38], %f0
+	prefetch [%o1 + (17 * BLOCK_SIZE)], #one_read
+	sub	%o2, BLOCK_SIZE, %o2	! update count
+	add	%o1, BLOCK_SIZE, %o1	! update SRC
+
+	! This point is 32-byte aligned since 24 instructions appear since
+	! the previous alignment directive.
+
+
+	! Main loop.  Write previous block.  Load rest of current block.
+	! Some bytes will be loaded that won't yet be written.
+1:
+	ldd	[%o1], %f2
+	faligndata %f12, %f14, %f44
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	sub	%o2, BLOCK_SIZE, %o2		! update count
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x20], %f10
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x28], %f12
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x30], %f14
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #n_reads
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x38], %f0
+	faligndata %f10, %f12, %f42
+	prefetch [%o1 + (25 * BLOCK_SIZE)], #one_read
+	add	%o0, BLOCK_SIZE, %o0		! update DST
+	cmp	%o2, BLOCK_SIZE + 8
+	! second prefetch important to correct for occasional dropped
+	prefetch [%o1 + (18 * BLOCK_SIZE)], #one_read
+	bgu,pt	%ncc, 1b
+	add	%o1, BLOCK_SIZE, %o1		! update SRC
+
+	faligndata %f12, %f14, %f44
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
+	cmp	%o2, BLOCK_SIZE
+	bne	%ncc, 2f		! exactly 1 block remaining?
+	add	%o0, BLOCK_SIZE, %o0	! update DST
+	brz,a	%o3, 3f			! is SRC double aligned?
+	ldd	[%o1], %f2
+
+2:
+	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8
+	add	%o5, %o3, %o5
+
+	membar	#StoreLoad|#StoreStore
+
+	ba	.beginmedloop
+	andn	%o5, 7, %o5		! 8 byte aligned count
+
+
+	! This is when there is exactly 1 block remaining and SRC is aligned
+3:
+	ldd	[%o1 + 0x8], %f4
+	ldd	[%o1 + 0x10], %f6
+	fsrc1	%f0, %f32
+	ldd	[%o1 + 0x18], %f8
+	fsrc1	%f2, %f34
+	ldd	[%o1 + 0x20], %f10
+	fsrc1	%f4, %f36
+	ldd	[%o1 + 0x28], %f12
+	fsrc1	%f6, %f38
+	ldd	[%o1 + 0x30], %f14
+	fsrc1	%f8, %f40
+	fsrc1	%f10, %f42
+	fsrc1	%f12, %f44
+	fsrc1	%f14, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	membar	#StoreLoad|#StoreStore
+	wr	%o4, 0, %fprs
+	retl
+	mov	%g1, %o0
+
+	SET_SIZE(memcpy)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusb
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9b
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,42 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4u-us3
+GEN_PLATFORM =	sun4u
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o memset.o memcmp.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
+
+MAPFILE-CAP +=	../../$(TRG_PLATFORM)/common/mapfile-cap
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
+		-DBSTORE_SIZE=256
+ASFLAGS =	-P -K pic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u-us3-hwcap1;
+
+SYMBOL_SCOPE {
+	global:
+		_memcmp;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcmp;
+		memmove;
+		memcpy;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusb
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9b
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,42 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4u-us3
+GEN_PLATFORM =	sun4u
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o memset.o memcmp.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
+
+MAPFILE-CAP +=	../../$(TRG_PLATFORM)/common/mapfile-cap
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
+		-DBSTORE_SIZE=65536 -DPANTHER_ONLY
+ASFLAGS =	-P -K pic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u-us3-hwcap2 {
+	HW += POPC;
+};
+
+SYMBOL_SCOPE {
+	global:
+		_memcmp;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcmp;
+		memcpy;
+		memmove;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusb
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEPS_STATE:
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9b
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY {
+	PLATFORM  = "SUNW,A70";
+	PLATFORM += "SUNW,Netra-210";
+	PLATFORM += "SUNW,Netra-240";
+	PLATFORM += "SUNW,Netra-440";
+	PLATFORM += "SUNW,Netra-CP3010";
+	PLATFORM += "SUNW,Netra-T12";
+	PLATFORM += "SUNW,Netra-T4";
+	PLATFORM += "SUNW,Sun-Blade-1000";
+	PLATFORM += "SUNW,Sun-Blade-1500";
+	PLATFORM += "SUNW,Sun-Blade-2500";
+	PLATFORM += "SUNW,Sun-Fire-15000";
+	PLATFORM += "SUNW,Sun-Fire-280R";
+	PLATFORM += "SUNW,Sun-Fire-480R";
+	PLATFORM += "SUNW,Sun-Fire-880";
+	PLATFORM += "SUNW,Sun-Fire-V210";
+	PLATFORM += "SUNW,Sun-Fire-V215";
+	PLATFORM += "SUNW,Sun-Fire-V240";
+	PLATFORM += "SUNW,Sun-Fire-V245";
+	PLATFORM += "SUNW,Sun-Fire-V250";
+	PLATFORM += "SUNW,Sun-Fire-V440";
+	PLATFORM += "SUNW,Sun-Fire-V445";
+	PLATFORM += "SUNW,Sun-Fire-V490";
+	PLATFORM += "SUNW,Sun-Fire-V890";
+	PLATFORM += "SUNW,Sun-Fire";
+	MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+	global:
+		_memcmp;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcmp;
+		memcpy;
+		memmove;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3/common/memcmp.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,165 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcmp.s"
+
+/*
+ * memcmp(s1, s2, len)
+ *
+ * Compare n bytes:  s1>s2: >0  s1==s2: 0  s1<s2: <0
+ *
+ * Fast assembler language version of the following C-program for memcmp
+ * which represents the `standard' for the C-library.
+ *
+ *	int
+ *	memcmp(const void *s1, const void *s2, size_t n)
+ *	{
+ *		if (s1 != s2 && n != 0) {
+ *			const char *ps1 = s1;
+ *			const char *ps2 = s2;
+ *			do {
+ *				if (*ps1++ != *ps2++)
+ *					return(ps1[-1] - ps2[-1]);
+ *			} while (--n != 0);
+ *		}
+ *		return (0);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/machasi.h>
+
+#define	BLOCK_SIZE	64
+
+	ANSI_PRAGMA_WEAK(memcmp,function)
+
+	ENTRY(memcmp)
+	cmp	%o0, %o1		! s1 == s2?
+	be	%ncc, .cmpeq
+	prefetch [%o0], #one_read
+	prefetch [%o1], #one_read
+	
+	! for small counts byte compare immediately
+	cmp	%o2, 48
+	bleu,a 	%ncc, .bytcmp
+	mov	%o2, %o3		! o3 <= 48
+	
+	! Count > 48. We will byte compare (8 + num of bytes to dbl align) 
+	! bytes. We assume that most miscompares will occur in the 1st 8 bytes 
+
+	prefetch [%o0 + (1 * BLOCK_SIZE)], #one_read
+	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
+
+.chkdbl:
+	and     %o0, 7, %o4             ! is s1 aligned on a 8 byte bound
+	mov	8, %o3			! o2 > 48;  o3 = 8
+        sub     %o4, 8, %o4		! o4 = -(num of bytes to dbl align)
+	ba	%ncc, .bytcmp
+        sub     %o3, %o4, %o3           ! o3 = 8 + (num of bytes to dbl align)
+
+1:	ldub	[%o1], %o5        	! byte compare loop
+        inc     %o1
+        inc     %o0
+	dec	%o2
+        cmp     %o4, %o5
+	bne	%ncc, .noteq
+.bytcmp:
+	deccc   %o3
+	bgeu,a	%ncc, 1b
+        ldub    [%o0], %o4
+
+	! Check to see if there are more bytes to compare
+	cmp	%o2, 0			! is o2 > 0
+	bgu	%ncc, .dwcmp		! we should already be dbl aligned
+	nop
+.cmpeq:
+        retl                             ! strings compare equal
+	sub	%g0, %g0, %o0
+
+.noteq:
+	retl				! strings aren't equal
+	sub	%o4, %o5, %o0		! return(*s1 - *s2)
+
+
+        ! double word compare - using ldd and faligndata. Compares upto
+        ! 8 byte multiple count and does byte compare for the residual.
+
+.dwcmp: 
+	prefetch [%o0 + (2 * BLOCK_SIZE)], #one_read
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+
+        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+        ! So set it anyway, without checking.
+        rd      %fprs, %o3              ! o3 = fprs
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+        andn    %o2, 7, %o4             ! o4 has 8 byte aligned cnt
+	sub     %o4, 8, %o4
+        alignaddr %o1, %g0, %g1
+        ldd     [%g1], %d0
+4:
+        add     %g1, 8, %g1
+        ldd     [%g1], %d2
+	ldd	[%o0], %d6
+	prefetch [%g1 + (3 * BLOCK_SIZE)], #one_read
+	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_read
+        faligndata %d0, %d2, %d8
+	fcmpne32 %d6, %d8, %o5
+	fsrc1	%d6, %d6		! 2 fsrc1's added since o5 cannot
+	fsrc1	%d8, %d8		! be used for 3 cycles else we 
+	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
+	brnz,a,pn %o5, 6f
+	sub     %o1, %o0, %o1           ! o1 gets the difference
+        subcc   %o4, 8, %o4
+        add     %o0, 8, %o0
+        add     %o1, 8, %o1
+        bgu,pt	%ncc, 4b
+        sub     %o2, 8, %o2
+
+.residcmp:
+        ba      6f
+	sub     %o1, %o0, %o1           ! o1 gets the difference
+
+5:      ldub    [%o0 + %o1], %o5        ! byte compare loop
+        inc     %o0
+        cmp     %o4, %o5
+        bne     %ncc, .dnoteq
+6:
+        deccc   %o2
+        bgeu,a	%ncc, 5b
+        ldub    [%o0], %o4
+	
+	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+	retl
+	sub	%g0, %g0, %o0		! strings compare equal 
+        
+.dnoteq:
+	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+	retl
+	sub	%o4, %o5, %o0		! return(*s1 - *s2)
+        
+	SET_SIZE(memcmp)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3/common/memcpy.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,1053 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcpy.s"
+
+/*
+ * memcpy(s1, s2, len)
+ *
+ * Copy s2 to s1, always copy n bytes.
+ * Note: this C code does not work for overlapped copies.
+ *       Memmove() and bcopy() do.
+ *
+ * Fast assembler language version of the following C-program for memcpy
+ * which represents the `standard' for the C-library.
+ *
+ *	void * 
+ *	memcpy(void *s, const void *s0, size_t n)
+ *	{
+ *		if (n != 0) {
+ *	   	    char *s1 = s;
+ *		    const char *s2 = s0;
+ *		    do {
+ *			*s1++ = *s2++;
+ *		    } while (--n != 0);
+ *		}
+ *		return (s);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+#include <sys/trap.h>
+
+#define	ICACHE_LINE_SIZE	64
+#define	BLOCK_SIZE	64
+#define	FPRS_FEF	0x4
+
+#define SHORTCOPY	3
+#define	SMALL_MAX	39
+#define	MEDIUM_MAX	255
+#define MED_WMAX	256	/* max copy for medium word-aligned case */
+#define MED_MAX		256	/* max copy for medium longword-aligned case */
+
+#ifndef BSTORE_SIZE
+#define BSTORE_SIZE	256	/* min copy size for block store */
+#endif
+
+	ANSI_PRAGMA_WEAK(memmove,function)
+	ANSI_PRAGMA_WEAK(memcpy,function)
+
+	ENTRY(memmove)
+	cmp	%o1, %o0	! if from address is >= to use forward copy
+	bgeu	%ncc, .forcpy	! else use backward if ...
+	sub	%o0, %o1, %o4	! get difference of two addresses
+	cmp	%o2, %o4	! compare size and difference of addresses
+	bleu	%ncc, .forcpy	! if size is bigger, do overlapped copy
+	nop
+
+        !
+        ! an overlapped copy that must be done "backwards"
+        !
+.ovbc:
+	mov	%o0, %g1		! save dest address for return val
+	add     %o1, %o2, %o1           ! get to end of source space
+        add     %o0, %o2, %o0           ! get to end of destination space
+
+	cmp	%o2, 24
+	bgeu,pn	%ncc, .dbalign
+	nop
+	cmp	%o2, 4
+	blt,pn	%ncc, .byte
+	sub	%o2, 3, %o2
+.byte4loop:
+	ldub	[%o1-1], %o3		! load last byte
+	stb	%o3, [%o0-1]		! store last byte
+	sub	%o1, 4, %o1
+	ldub	[%o1+2], %o3		! load 2nd from last byte
+	stb	%o3, [%o0-2]		! store 2nd from last byte
+	sub	%o0, 4, %o0
+	ldub	[%o1+1], %o3		! load 3rd from last byte
+	stb	%o3, [%o0+1]		! store 3rd from last byte
+	subcc	%o2, 4, %o2
+	ldub	[%o1], %o3		! load 4th from last byte
+	bgu,pt	%ncc, .byte4loop
+	stb	%o3, [%o0]		! store 4th from last byte
+.byte:
+	addcc	%o2, 3, %o2
+	bz,pt	%ncc, .exit
+.byteloop:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o2			! decrement count
+	bgu,pt	%ncc, .byteloop		! loop until done
+	stb	%o3, [%o0]		! write byte
+.exit:
+	retl
+	mov	%g1, %o0
+
+	.align	16
+.dbalign:
+	andcc   %o0, 7, %o5		! bytes till DST 8 byte aligned
+	bz,pt	%ncc, .dbmed
+	sub	%o2, %o5, %o2		! update count
+.dbalign1:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o5			! decrement count
+	bgu,pt	%ncc, .dbalign1		! loop until done
+	stb	%o3, [%o0]		! store a byte
+
+! check for src long word alignment
+.dbmed:
+	andcc	%o1, 7, %g0		! chk src long word alignment
+	bnz,pn	%ncc, .dbbck
+	nop
+!
+! Following code is for overlapping copies where src and dest
+! are long word aligned
+!
+	cmp	%o2, 4095
+	blt,pn	%ncc, .dbmedl32enter	! go to no prefetch code
+	nop
+	prefetch [%o1 - (1 * BLOCK_SIZE)], 20	! into the prefetch cache
+	sub	%o2, 63, %o2		! adjust length to allow cc test
+					! for end of loop
+	prefetch [%o1 - (2 * BLOCK_SIZE)], 20	! into the prefetch cache
+	rd	%fprs, %o3		! o3 = fprs
+	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
+	! So set it anyway, without checking.
+	prefetch [%o1 - (3 * BLOCK_SIZE)], 20	! into the prefetch cache
+	wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+	prefetch [%o1 - (4 * BLOCK_SIZE)], 20	! into the prefetch cache
+.dbmedl64:
+	prefetch [%o1 - (5 * BLOCK_SIZE)], 20	! into the prefetch cache
+	ldd	[%o1-8], %d4		! load
+	subcc	%o2, 64, %o2		! decrement length count
+	std	%d4, [%o0-8]		! and store
+	ldd	[%o1-16], %d2		! a block of 64 bytes
+	sub	%o1, 64, %o1		! decrease src ptr by 64
+	std	%d2, [%o0-16]
+	sub	%o0, 64, %o0		! decrease dst ptr by 64
+	ldd	[%o1+40], %d4
+	std	%d4, [%o0+40]
+	ldd	[%o1+32], %d2
+	std	%d2, [%o0+32]
+	ldd	[%o1+24], %d4
+	std	%d4, [%o0+24]
+	ldd	[%o1+16], %d2
+	std	%d2, [%o0+16]
+	ldd	[%o1+8], %d4
+	std	%d4, [%o0+8]
+	ldd	[%o1], %d2
+	bgu,pt	%ncc, .dbmedl64		! repeat if at least 64 bytes left
+	std	%d2, [%o0]
+	add	%o2, 63, %o2		! restore offset adjustment
+	and	%o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	wr	%o3, %g0, %fprs         ! fprs = o3   restore fprs	
+.dbmedl32enter:
+	subcc	%o2, 31, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt  %ncc, .dbmedl31		! skip big loop if less than 32
+	nop
+.dbmedl32:
+	ldx	[%o1-8], %o4		! load
+	subcc	%o2, 32, %o2		! decrement length count
+	stx	%o4, [%o0-8]		! and store
+	ldx	[%o1-16], %o3		! a block of 32 bytes
+	sub	%o1, 32, %o1		! decrease src ptr by 32
+	stx	%o3, [%o0-16]
+	ldx	[%o1+8], %o4
+	sub	%o0, 32, %o0		! decrease dst ptr by 32
+	stx	%o4, [%o0+8]
+	ldx	[%o1], %o3
+	bgu,pt	%ncc, .dbmedl32		! repeat if at least 32 bytes left
+	stx	%o3, [%o0]
+.dbmedl31:
+	addcc	%o2, 16, %o2		! adjust remaining count
+	ble,pt	%ncc, .dbmedl15		! skip if 15 or fewer bytes left
+	nop				!
+	ldx	[%o1-8], %o4		! load and store 16 bytes
+	sub	%o1, 16, %o1		! decrease src ptr by 16
+	stx	%o4, [%o0-8]		!
+	sub	%o2, 16, %o2		! decrease count by 16
+	ldx	[%o1], %o3		!
+	sub	%o0, 16, %o0		! decrease dst ptr by 16
+	stx	%o3, [%o0]
+.dbmedl15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .dbexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .dbremain		! skip if 7 or fewer bytes left
+	nop
+	ldx	[%o1-8], %o4		! load 8 bytes
+	sub	%o1, 8, %o1		! decrease src ptr by 8
+	stx	%o4, [%o0-8]		! and store 8 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	bnz	%ncc, .dbremain		! exit if finished
+	sub	%o0, 8, %o0		! decrease dst ptr by 8
+	retl
+	mov	%g1, %o0
+
+!
+! Following code is for overlapping copies where src and dest
+! are not long word aligned
+!
+	.align	16
+.dbbck:
+	rd	%fprs, %o3		! o3 = fprs
+ 
+	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
+	! So set it anyway, without checking.
+	wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+	alignaddr %o1, %g0, %o5		! align src
+	ldd	[%o5], %d0		! get first 8 byte block
+	andn	%o2, 7, %o4		! prepare src ptr for finishup code
+	cmp	%o2, 32
+	blt,pn	%ncc, .dbmv8
+	sub	%o1, %o4, %o1		!
+	cmp	%o2, 4095		! check for short memmoves
+	blt,pn	%ncc, .dbmv32enter	! go to no prefetch code
+.dbmv64:
+	ldd	[%o5-8], %d2		! load 8 bytes
+	ldd	[%o5-16], %d4		! load 8 bytes
+	sub	%o5, 64, %o5		!
+	ldd	[%o5+40], %d6		! load 8 bytes
+	sub	%o0, 64, %o0		!
+	ldd	[%o5+32], %d8		! load 8 bytes
+	sub	%o2, 64, %o2		! 64 less bytes to copy
+	ldd	[%o5+24], %d18		! load 8 bytes
+	cmp	%o2, 64			! do we have < 64 bytes remaining
+	ldd	[%o5+16], %d28		! load 8 bytes
+	ldd	[%o5+8], %d30		! load 8 bytes
+	prefetch [%o5 - (5 * BLOCK_SIZE)], 20	! into the prefetch cache
+	faligndata %d2, %d0, %d10	! extract 8 bytes out
+	ldd	[%o5], %d0		! load 8 bytes
+	std	%d10, [%o0+56]		! store the current 8 bytes
+	faligndata %d4, %d2, %d12	! extract 8 bytes out
+	std	%d12, [%o0+48]		! store the current 8 bytes
+	faligndata %d6, %d4, %d14	! extract 8 bytes out
+	std	%d14, [%o0+40]		! store the current 8 bytes
+	faligndata %d8, %d6, %d16	! extract 8 bytes out
+	std	%d16, [%o0+32]		! store the current 8 bytes
+	faligndata %d18, %d8, %d20	! extract 8 bytes out
+	std	%d20, [%o0+24]		! store the current 8 bytes
+	faligndata %d28, %d18, %d22	! extract 8 bytes out
+	std	%d22, [%o0+16]		! store the current 8 bytes
+	faligndata %d30, %d28, %d24	! extract 8 bytes out
+	std	%d24, [%o0+8]		! store the current 8 bytes
+	faligndata %d0, %d30, %d26	! extract 8 bytes out
+	bgeu,pt	%ncc, .dbmv64
+	std	%d26, [%o0]		! store the current 8 bytes
+
+	cmp	%o2, 32
+	blt,pn	%ncc, .dbmvx
+	nop
+.dbmv32:
+	ldd	[%o5-8], %d2		! load 8 bytes
+.dbmv32enter:
+	ldd	[%o5-16], %d4		! load 8 bytes
+	sub	%o5, 32, %o5		!
+	ldd	[%o5+8], %d6		! load 8 bytes
+	sub	%o0, 32, %o0		! 
+	faligndata %d2, %d0, %d10	! extract 8 bytes out
+	ldd	[%o5], %d0		! load 8 bytes
+	sub     %o2,32, %o2		! 32 less bytes to copy
+	std	%d10, [%o0+24]		! store the current 8 bytes
+	cmp	%o2, 32			! do we have < 32 bytes remaining
+	faligndata %d4, %d2, %d12	! extract 8 bytes out
+	std	%d12, [%o0+16]		! store the current 8 bytes
+	faligndata %d6, %d4, %d14	! extract 8 bytes out
+	std	%d14, [%o0+8]		! store the current 8 bytes
+	faligndata %d0, %d6, %d16	! extract 8 bytes out
+	bgeu,pt	%ncc, .dbmv32
+	std	%d16, [%o0]		! store the current 8 bytes
+.dbmvx:
+	cmp	%o2, 8			! do we have < 8 bytes remaining
+	blt,pt	%ncc, .dbmvfinish	! if yes, skip to finish up code
+	nop
+.dbmv8:
+	ldd	[%o5-8], %d2
+	sub	%o0, 8, %o0		! since we are at the end
+					! when we first enter the loop
+	sub     %o2, 8, %o2		! 8 less bytes to copy
+	sub	%o5, 8, %o5
+	cmp	%o2, 8			! do we have < 8 bytes remaining
+	faligndata %d2, %d0, %d8        ! extract 8 bytes out
+	std	%d8, [%o0]		! store the current 8 bytes
+	bgeu,pt	%ncc, .dbmv8
+	fmovd	%d2, %d0
+.dbmvfinish:
+	and	%o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	tst	%o2
+	bz,pt	%ncc, .dbexit
+	wr	%o3, %g0, %fprs         ! fprs = o3   restore fprs
+
+.dbremain:
+	cmp	%o2, 4
+	blt,pn	%ncc, .dbbyte
+	nop
+	ldub	[%o1-1], %o3		! load last byte
+	stb	%o3, [%o0-1]		! store last byte
+	sub	%o1, 4, %o1
+	ldub	[%o1+2], %o3		! load 2nd from last byte
+	stb	%o3, [%o0-2]		! store 2nd from last byte
+	sub	%o0, 4, %o0
+	ldub	[%o1+1], %o3		! load 3rd from last byte
+	stb	%o3, [%o0+1]		! store 3rd from last byte
+	subcc	%o2, 4, %o2
+	ldub	[%o1], %o3		! load 4th from last byte
+	stb	%o3, [%o0]		! store 4th from last byte	
+	bz,pt	%ncc, .dbexit
+.dbbyte:
+	dec	%o1			! decrement src address
+	ldub	[%o1], %o3		! read a byte
+	dec	%o0			! decrement dst address
+	deccc	%o2			! decrement count
+	bgu,pt	%ncc, .dbbyte		! loop until done
+	stb	%o3, [%o0]		! write byte
+.dbexit:
+	retl
+        mov     %g1, %o0
+	SET_SIZE(memmove)
+
+
+	.align ICACHE_LINE_SIZE
+	ENTRY(memcpy)
+					! adjust instruction alignment
+	nop				! Do not remove, these nops affect
+	nop				! icache alignment and performance
+.forcpy:
+	cmp	%o2, SMALL_MAX		! check for not small case
+	bgu,pn	%ncc, .medium		! go to larger cases
+	mov	%o0, %g1		! save %o0
+	cmp	%o2, SHORTCOPY		! check for really short case
+	ble,pt	%ncc, .smallleft	!
+	or	%o0, %o1, %o3		! prepare alignment check
+	andcc	%o3, 0x3, %g0		! test for alignment
+	bz,pt	%ncc, .smallword	! branch to word aligned case
+	sub	%o2, 3, %o2		! adjust count to allow cc zero test
+.smallnotalign4:
+	ldub	[%o1], %o3		! read byte
+	subcc	%o2, 4, %o2		! reduce count by 4
+	stb	%o3, [%o0]		! write byte
+	ldub	[%o1+1], %o3		! repeat for a total of 4 bytes
+	add	%o1, 4, %o1		! advance SRC by 4
+	stb	%o3, [%o0+1]
+	ldub	[%o1-2], %o3
+	add	%o0, 4, %o0		! advance DST by 4
+	stb	%o3, [%o0-2]
+	ldub	[%o1-1], %o3
+	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
+	stb	%o3, [%o0-1]
+	add	%o2, 3, %o2		! restore count
+.smallleft:
+	tst	%o2
+	bz,pt	%ncc, .smallexit
+	nop
+.smallleft3:				! 1, 2, or 3 bytes remain
+	ldub	[%o1], %o3		! load one byte
+	deccc	%o2			! reduce count for cc test
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0]		! store one byte
+	ldub	[%o1+1], %o3		! load second byte
+	deccc	%o2
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+1]		! store second byte
+	ldub	[%o1+2], %o3		! load third byte
+	stb	%o3, [%o0+2]		! store third byte
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align	16
+	nop				! affects loop icache alignment
+.smallwords:
+	lduw	[%o1], %o3		! read word
+.smallwordx:
+	subcc	%o2, 8, %o2		! update count
+	stw	%o3, [%o0]		! write word
+	add	%o1, 8, %o1		! update SRC
+	lduw	[%o1-4], %o3		! read word
+	add	%o0, 8, %o0		! update DST
+	bgu,pt	%ncc, .smallwords	! loop until done
+	stw	%o3, [%o0-4]		! write word
+	addcc	%o2, 7, %o2		! restore count
+	bz,pt	%ncc, .smallexit	! check for completion
+	nop
+	cmp	%o2, 4			! check for 4 or more bytes left
+	blt	.smallleft3		! if not, go to finish up
+	nop
+	lduw	[%o1], %o3
+	add	%o1, 4, %o1
+	subcc	%o2, 4, %o2
+	stw	%o3, [%o0]
+	add	%o0, 4, %o0
+	bnz,pt	%ncc, .smallleft3
+	nop
+	retl
+	mov	%g1, %o0		! restore %o0
+
+.smallword:
+	subcc	%o2, 4, %o2		! update count
+	bgu,pt	%ncc, .smallwordx
+	lduw	[%o1], %o3		! read word
+	addcc	%o2, 3, %o2		! restore count
+	bz,pt	%ncc, .smallexit
+	stw	%o3, [%o0]		! write word
+	deccc	%o2			! reduce count for cc test
+	ldub	[%o1+4], %o3		! load one byte
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+4]		! store one byte
+	ldub	[%o1+5], %o3		! load second byte
+	deccc	%o2
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+5]		! store second byte
+	ldub	[%o1+6], %o3		! load third byte
+	stb	%o3, [%o0+6]		! store third byte
+.smallexit:
+	retl
+	mov	%g1, %o0		! restore %o0
+	.align 16
+.medium:
+	neg	%o0, %o5
+	neg	%o1, %o3	
+	andcc	%o5, 7, %o5	! bytes till DST 8 byte aligned
+	and	%o3, 7, %o3	! bytes till SRC 8 byte aligned
+	
+	bz	%ncc, 2f
+	sub	%o5, %o3, %o3	! -(bytes till SRC aligned after DST aligned)
+				! o3={-7, -6, ... 7}  o3>0 => SRC overaligned
+
+	sub	%o2, %o5, %o2	! update count
+
+1:
+	ldub	[%o1], %o4
+	deccc	%o5
+	inc	%o1
+	stb	%o4, [%o0]
+	bgu,pt	%ncc, 1b
+	inc	%o0
+
+	! Now DST is 8-byte aligned.  o0, o1, o2 are current.
+
+2:
+	andcc	%o1, 0x3, %g0		! test alignment
+	bnz,pt	%ncc, .mediumsetup	! branch to skip aligned cases
+					! if src, dst not aligned
+	prefetch [%o1 + (1 * BLOCK_SIZE)], 20
+
+/*
+ * Handle all cases where src and dest are aligned on word
+ * or long word boundaries.  Use unrolled loops for better
+ * performance.  This option wins over standard large data
+ * move when source and destination is in cache for medium
+ * to short data moves.
+ */
+	andcc	%o1, 0x7, %g0		! test word alignment
+	bz,pt	%ncc, .medlword		! branch to long word aligned case
+	prefetch [%o1 + (2 * BLOCK_SIZE)], 20
+	cmp	%o2, MED_WMAX		! limit to store buffer size
+	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
+	nop
+	subcc	%o2, 15, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt	%ncc, .medw15		! skip big loop if less than 16
+	prefetch [%o1 + (3 * BLOCK_SIZE)], 20
+/*
+ * no need to put prefetch in loop as prefetches have
+ * already been issued for maximum loop size
+ */
+.medw16:
+	ld	[%o1], %o4		! load
+	subcc	%o2, 16, %o2		! decrement length count
+	stw	%o4, [%o0]		! and store
+	ld	[%o1+4], %o3		! a block of 16 bytes
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stw	%o3, [%o0+4]
+	ld	[%o1-8], %o4
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stw	%o4, [%o0-8]
+	ld	[%o1-4], %o3
+	bgu,pt	%ncc, .medw16		! repeat if at least 16 bytes left
+	stw	%o3, [%o0-4]
+.medw15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .medwexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	nop				!
+	ld	[%o1], %o4		! load 4 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	stw	%o4, [%o0]		! and store 4 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	ld	[%o1-4], %o3		! load 4 bytes
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	stw	%o3, [%o0-4]		! and store 4 bytes
+	bz	%ncc, .medwexit		! exit if finished
+	nop
+.medw7:					! count is ge 1, less than 8
+	cmp	%o2, 3			! check for 4 bytes left
+	ble,pt	%ncc, .medw3		! skip if 3 or fewer bytes left
+	nop				!
+	ld	[%o1], %o4		! load 4 bytes
+	sub	%o2, 4, %o2		! decrease count by 4
+	add	%o1, 4, %o1		! increase src ptr by 4
+	stw	%o4, [%o0]		! and store 4 bytes
+	add	%o0, 4, %o0		! increase dst ptr by 4
+	tst	%o2			! check for zero bytes left
+	bz	%ncc, .medwexit		! exit if finished
+	nop
+.medw3:					! count is known to be 1, 2, or 3
+	deccc	%o2			! reduce count by one
+	ldub	[%o1], %o3		! load one byte
+	bz,pt	%ncc, .medwexit		! exit if last byte
+	stb	%o3, [%o0]		! store one byte
+	ldub	[%o1+1], %o3		! load second byte
+	deccc	%o2			! reduce count by one
+	bz,pt	%ncc, .medwexit		! exit if last byte
+	stb	%o3, [%o0+1]		! store second byte
+	ldub	[%o1+2], %o3		! load third byte
+	stb	%o3, [%o0+2]		! store third byte
+.medwexit:
+	retl
+	mov	%g1, %o0		! restore %o0
+	
+/*
+ * Special case for handling when src and dest are both long word aligned
+ * and total data to move is between SMALL_MAX and MED_MAX bytes
+ */
+
+	.align 16
+	nop
+.medlword:				! long word aligned
+					! length > SMALL_MAX
+	cmp	%o2, MED_MAX		! limit to store buffer size
+	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
+	nop
+	subcc	%o2, 31, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt	%ncc, .medl31		! skip big loop if less than 32
+	prefetch [%o1 + (3 * BLOCK_SIZE)], 20	! into the l2 cache
+/*
+ * no need to put prefetch in loop as prefetches have
+ * already been issued for maximum loop size
+ */
+.medl32:
+	ldx	[%o1], %o4		! load
+	subcc	%o2, 32, %o2		! decrement length count
+	stx	%o4, [%o0]		! and store
+	ldx	[%o1+8], %o3		! a block of 32 bytes
+	add	%o1, 32, %o1		! increase src ptr by 32
+	stx	%o3, [%o0+8]
+	ldx	[%o1-16], %o4
+	add	%o0, 32, %o0		! increase dst ptr by 32
+	stx	%o4, [%o0-16]
+	ldx	[%o1-8], %o3
+	bgu,pt	%ncc, .medl32		! repeat if at least 32 bytes left
+	stx	%o3, [%o0-8]
+.medl31:
+	addcc	%o2, 16, %o2		! adjust remaining count
+	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
+	nop				!
+	ldx	[%o1], %o4		! load and store 16 bytes
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stx	%o4, [%o0]		!
+	sub	%o2, 16, %o2		! decrease count by 16
+	ldx	[%o1-8], %o3		!
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stx	%o3, [%o0-8]
+.medl15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .medwexit		! exit if finished
+	nop
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	nop
+	ldx	[%o1], %o4		! load 8 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	stx	%o4, [%o0]		! and store 8 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	bz	%ncc, .medwexit		! exit if finished
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	ba	.medw7
+	nop
+
+	.align 16
+	nop
+	nop
+	nop
+.mediumsetup:
+	prefetch [%o1 + (2 * BLOCK_SIZE)], 21
+.mediumrejoin:
+	rd	%fprs, %o4		! check for unused FPU
+	
+	add	%o1, 8, %o1		! prepare to round SRC upward
+
+	sethi	%hi(0x1234567f), %o5	! For GSR.MASK 
+	or	%o5, 0x67f, %o5
+
+	andcc	%o4, FPRS_FEF, %o4	! test FEF, fprs.du = fprs.dl = 0
+	bz,a	%ncc, 3f
+	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
+3:
+	cmp	%o2, MEDIUM_MAX
+	bmask	%o5, %g0, %g0
+
+	! Compute o5 (number of bytes that need copying using the main loop).
+	! First, compute for the medium case.
+	! Then, if large case, o5 is replaced by count for block alignment.
+	! Be careful not to read past end of SRC
+	! Currently, o2 is the actual count remaining
+	!            o3 is how much sooner we'll cross the alignment boundary
+	!                in SRC compared to in DST
+	!
+	! Examples:  Let # denote bytes that should not be accessed
+	!            Let x denote a byte already copied to align DST
+	!            Let . and - denote bytes not yet copied
+	!            Let | denote double alignment boundaries
+	!
+	!            DST:  ######xx|........|--------|..######   o2 = 18
+	!                          o0
+	!
+	!  o3 = -3:  SRC:  ###xx...|.....---|-----..#|########   o5 = 8
+	!                          o1
+	!
+	!  o3 =  0:  SRC:  ######xx|........|--------|..######   o5 = 16-8 = 8
+	!                                   o1
+	!
+	!  o3 = +1:  SRC:  #######x|x.......|.-------|-..#####   o5 = 16-8 = 8
+	!                                   o1
+
+	or	%g0, -8, %o5
+	alignaddr %o1, %g0, %o1		! set GSR.ALIGN and align o1
+
+	movrlz	%o3, %g0, %o5		! subtract 8 from o2+o3 only if o3>=0
+	add	%o5, %o2, %o5
+	add	%o5, %o3, %o5
+
+	bleu	%ncc, 4f
+	andn	%o5, 7, %o5		! 8 byte aligned count
+	neg	%o0, %o5		! 'large' case
+	and	%o5, BLOCK_SIZE-1, %o5  ! bytes till DST block aligned
+4:	
+	brgez,a	%o3, .beginmedloop
+	ldd	[%o1-8], %d0
+
+	add	%o1, %o3, %o1		! back up o1
+5:
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	andcc	%o1, 7, %g0
+	bnz	%ncc, 5b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+.beginmedloop:	
+	tst	%o5
+	bz	%ncc, .endmedloop
+	sub	%o2, %o5, %o2		! update count for later
+
+	! Main loop to write out doubles.  Note: o5 & 7 == 0
+	
+	ldd	[%o1], %d2
+	subcc	%o5, 8, %o5		! update local count
+	bz,pn	%ncc, 1f
+	add	%o1, 8, %o1		! update SRC
+
+.medloop:
+	faligndata %d0, %d2, %d4
+	ldd	[%o1], %d0
+	subcc	%o5, 8, %o5		! update local count
+	add	%o1, 16, %o1		! update SRC
+	std	%d4, [%o0]
+	bz,pn	%ncc, 2f
+	faligndata %d2, %d0, %d6
+	ldd	[%o1 - 8], %d2
+	subcc	%o5, 8, %o5		! update local count
+	std	%d6, [%o0 + 8]
+	bnz,pt	%ncc, .medloop
+	add	%o0, 16, %o0		! update DST
+
+1:	
+	faligndata %d0, %d2, %d4
+	fmovd	%d2, %d0
+	std	%d4, [%o0]
+	ba	.endmedloop
+	add	%o0, 8, %o0
+	
+2:
+	std	%d6, [%o0 + 8]
+	sub	%o1, 8, %o1
+	add	%o0, 16, %o0
+	
+
+.endmedloop:
+	! Currently, o1 is pointing to the next double-aligned byte in SRC
+	! The 8 bytes starting at [o1-8] are available in d0
+	! At least one, and possibly all, of these need to be written.
+
+	cmp	%o2, BLOCK_SIZE	
+	bgu	%ncc, .large		! otherwise, less than 16 bytes left
+	
+#if 0
+
+	/* This code will use partial stores.  */
+
+	mov	%g0, %o5
+	and	%o3, 7, %o3		! Number of bytes needed to completely
+					! fill %d0 with good (unwritten) data.
+
+	subcc	%o2, 8, %o2		! update count (maybe too much)
+	movl	%ncc, %o2, %o5		
+	addcc	%o3, %o5, %o5		! extra bytes we can stuff into %d0
+	sub	%o3, %o5, %o3		! update o3 (# bad bytes in %d0)
+
+	bz	%ncc, 2f
+	alignaddr %o3, %g0, %g0		! set GSR.ALIGN
+	
+1:
+	deccc	%o5
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	bgu	%ncc, 1b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+2:
+	not     %o3
+	faligndata %d0, %d0, %d0	! shift bytes to the left
+	and	%o3, 7, %o3		! last byte to be stored in [%o0+%o3]
+	edge8n	%g0, %o3, %o5
+	stda	%d0, [%o0]%o5, ASI_PST8_P
+	brlez	%o2, .mediumexit		
+	add	%o0, %o3, %o0		! update DST to last stored byte
+3:	
+	inc	%o0
+	deccc	%o2
+	ldub	[%o1], %o3
+	stb	%o3, [%o0]
+	bgu	%ncc, 3b
+	inc	%o1
+
+#else
+
+	andcc	%o3, 7, %o5		! Number of bytes needed to completely
+					! fill %d0 with good (unwritten) data.
+	bz	%ncc, 2f
+	sub	%o5, 8, %o3		! -(number of good bytes in %d0)
+	cmp	%o2, 8
+	bl,a	%ncc, 3f		! Not enough bytes to fill %d0
+	add	%o1, %o3, %o1 		! Back up %o1
+
+1:
+	deccc	%o5
+	ldda	[%o1]ASI_FL8_P, %d2
+	inc	%o1
+	bgu	%ncc, 1b
+	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
+
+2:	
+	subcc	%o2, 8, %o2
+	std	%d0, [%o0]
+	bz	%ncc, .mediumexit
+	add	%o0, 8, %o0
+3:	
+	ldub	[%o1], %o3
+	deccc	%o2
+	inc	%o1
+	stb	%o3, [%o0]
+	bgu	%ncc, 3b
+	inc	%o0
+#endif	
+
+.mediumexit:
+        wr      %o4, %g0, %fprs		! fprs = o4   restore fprs
+	retl
+        mov     %g1, %o0
+
+
+	.align ICACHE_LINE_SIZE
+.large:
+	! The following test for BSTORE_SIZE is used to decide whether
+	! to store data with a block store or with individual stores.
+	! The block store wins when the amount of data is so large
+	! that it is causes other application data to be moved out
+	! of the L1 or L2 cache.
+	! On a Panther, block store can lose more often because block
+	! store forces the stored data to be removed from the L3 cache.
+	!
+	sethi	%hi(BSTORE_SIZE),%o5
+	or	%o5,%lo(BSTORE_SIZE),%o5
+	cmp	%o2, %o5
+	bgu	%ncc, .xlarge		
+
+	! %o0 I/O DST is 64-byte aligned
+	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
+	! %d0 I/O already loaded with SRC data from [%o1-8]
+	! %o2 I/O count (number of bytes that need to be written)
+	! %o3 I   Not written.  If zero, then SRC is double aligned.
+	! %o4 I   Not written.  Holds fprs.
+	! %o5   O The number of doubles that remain to be written.
+
+	! Load the rest of the current block 
+	! Recall that %o1 is further into SRC than %o0 is into DST
+
+	prefetch [%o0 + (0 * BLOCK_SIZE)], 22
+	prefetch [%o0 + (1 * BLOCK_SIZE)], 22
+	prefetch [%o0 + (2 * BLOCK_SIZE)], 22
+	ldd	[%o1], %f2
+	prefetch [%o1 + (3 * BLOCK_SIZE)], 21
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x20], %f10
+        or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
+	prefetch [%o1 + (4 * BLOCK_SIZE)], 21
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x28], %f12
+	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed lter)
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f10, %f12, %f42
+	ldd	[%o1 + 0x38], %f0
+	sub	%o2, BLOCK_SIZE, %o2	! update count
+	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
+	add	%o1, BLOCK_SIZE, %o1		! update SRC
+
+	! Main loop.  Write previous block.  Load rest of current block.
+	! Some bytes will be loaded that won't yet be written.
+1:	
+	ldd	[%o1], %f2
+	faligndata %f12, %f14, %f44
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f14, %f0, %f46
+	std	%f32, [%o0]
+	std	%f34, [%o0+8]
+	std	%f36, [%o0+16]
+	std	%f38, [%o0+24]
+	std	%f40, [%o0+32]
+	std	%f42, [%o0+40]
+	std	%f44, [%o0+48]
+	std	%f46, [%o0+56]
+	sub	%o2, BLOCK_SIZE, %o2		! update count
+	prefetch [%o0 + (6 * BLOCK_SIZE)], 22
+	prefetch [%o0 + (3 * BLOCK_SIZE)], 22
+	add	%o0, BLOCK_SIZE, %o0		! update DST
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x20], %f10
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x28], %f12
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x38], %f0
+	faligndata %f10, %f12, %f42
+	cmp	%o2, BLOCK_SIZE + 8
+	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
+	bgu,pt	%ncc, 1b
+	add	%o1, BLOCK_SIZE, %o1	! update SRC
+	faligndata %f12, %f14, %f44
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
+	cmp	%o2, BLOCK_SIZE		
+	bne	%ncc, 2f		! exactly 1 block remaining?
+	add	%o0, BLOCK_SIZE, %o0	! update DST
+	brz,a	%o3, 3f			! is SRC double aligned?
+	ldd	[%o1], %f2
+
+2:	
+	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8 
+	add	%o5, %o3, %o5
+
+	membar	#StoreLoad|#StoreStore
+
+	ba	.beginmedloop
+	andn	%o5, 7, %o5		! 8 byte aligned count
+
+
+	! This is when there is exactly 1 block remaining and SRC is aligned
+3:
+	ldd	[%o1 + 0x8], %f4
+	ldd	[%o1 + 0x10], %f6
+	fsrc1	%f0, %f32
+	ldd	[%o1 + 0x18], %f8
+	fsrc1	%f2, %f34
+	ldd	[%o1 + 0x20], %f10
+	fsrc1	%f4, %f36
+	ldd	[%o1 + 0x28], %f12
+	fsrc1	%f6, %f38
+	ldd	[%o1 + 0x30], %f14
+	fsrc1	%f8, %f40
+	fsrc1	%f10, %f42
+	fsrc1	%f12, %f44
+	fsrc1	%f14, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	membar	#StoreLoad|#StoreStore
+	wr	%o4, 0, %fprs
+	retl
+	mov	%g1, %o0
+
+
+	.align 16
+	! two nops here causes loop starting at 1f below to be
+	! on a cache line boundary, improving performance
+	nop
+	nop
+.xlarge:
+	! %o0 I/O DST is 64-byte aligned
+	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
+	! %d0 I/O already loaded with SRC data from [%o1-8]
+	! %o2 I/O count (number of bytes that need to be written)
+	! %o3 I   Not written.  If zero, then SRC is double aligned.
+	! %o4 I   Not written.  Holds fprs.
+	! %o5   O The number of doubles that remain to be written.
+
+	! Load the rest of the current block 
+	! Recall that %o1 is further into SRC than %o0 is into DST
+
+	! prefetch [%o1 + (3 * BLOCK_SIZE)], 21
+	! executed in delay slot for branch to .xlarge
+	prefetch [%o1 + (4 * BLOCK_SIZE)], 21
+	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
+	ldd	[%o1], %f2
+	prefetch [%o1 + (6 * BLOCK_SIZE)], 21
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x20], %f10
+        or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x28], %f12
+	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed later)
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f10, %f12, %f42
+	ldd	[%o1 + 0x38], %f0
+	sub	%o2, BLOCK_SIZE, %o2	! update count
+	prefetch [%o1 + (7 * BLOCK_SIZE)], 21
+	add	%o1, BLOCK_SIZE, %o1	! update SRC
+
+	! This point is 32-byte aligned since 24 instructions appear since
+	! the previous alignment directive.
+	
+
+	! Main loop.  Write previous block.  Load rest of current block.
+	! Some bytes will be loaded that won't yet be written.
+1:
+	ldd	[%o1], %f2
+	faligndata %f12, %f14, %f44
+	ldd	[%o1 + 0x8], %f4
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	sub	%o2, BLOCK_SIZE, %o2		! update count
+	ldd	[%o1 + 0x10], %f6
+	faligndata %f0, %f2, %f32
+	ldd	[%o1 + 0x18], %f8
+	faligndata %f2, %f4, %f34
+	ldd	[%o1 + 0x20], %f10
+	faligndata %f4, %f6, %f36
+	ldd	[%o1 + 0x28], %f12
+	faligndata %f6, %f8, %f38
+	ldd	[%o1 + 0x30], %f14
+	faligndata %f8, %f10, %f40
+	ldd	[%o1 + 0x38], %f0
+	faligndata %f10, %f12, %f42
+	! offset of 8*BLK+8 bytes works best over range of (src-dst) mod 1K
+	prefetch [%o1 + (8 * BLOCK_SIZE) + 8], 21
+	add	%o0, BLOCK_SIZE, %o0		! update DST
+	cmp	%o2, BLOCK_SIZE + 8
+	! second prefetch important to correct for occasional dropped
+	! initial prefetches, 5*BLK works best over range of (src-dst) mod 1K
+	! strong prefetch prevents drops on Panther, but Jaguar and earlier
+	! US-III models treat strong prefetches as weak prefetchs
+	! to avoid regressions on customer hardware, we retain the prefetch
+	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
+	bgu,pt	%ncc, 1b
+	add	%o1, BLOCK_SIZE, %o1		! update SRC
+
+	faligndata %f12, %f14, %f44
+	faligndata %f14, %f0, %f46
+	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
+	cmp	%o2, BLOCK_SIZE		
+	bne	%ncc, 2f		! exactly 1 block remaining?
+	add	%o0, BLOCK_SIZE, %o0	! update DST
+	brz,a	%o3, 3f			! is SRC double aligned?
+	ldd	[%o1], %f2
+
+2:	
+	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8 
+	add	%o5, %o3, %o5
+
+	membar	#StoreLoad|#StoreStore
+
+	ba	.beginmedloop
+	andn	%o5, 7, %o5		! 8 byte aligned count
+
+
+	! This is when there is exactly 1 block remaining and SRC is aligned
+3:
+	ldd	[%o1 + 0x8], %f4
+	ldd	[%o1 + 0x10], %f6
+	fsrc1	%f0, %f32
+	ldd	[%o1 + 0x18], %f8
+	fsrc1	%f2, %f34
+	ldd	[%o1 + 0x20], %f10
+	fsrc1	%f4, %f36
+	ldd	[%o1 + 0x28], %f12
+	fsrc1	%f6, %f38
+	ldd	[%o1 + 0x30], %f14
+	fsrc1	%f8, %f40
+	fsrc1	%f10, %f42
+	fsrc1	%f12, %f44
+	fsrc1	%f14, %f46
+	stda	%f32, [%o0]ASI_BLK_P
+	membar	#StoreLoad|#StoreStore
+	wr	%o4, 0, %fprs
+	retl
+	mov	%g1, %o0
+	
+	SET_SIZE(memcpy)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u-us3/common/memset.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,241 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memset.s"
+
+/*
+ * char *memset(sp, c, n)
+ *
+ * Set an array of n chars starting at sp to the character c.
+ * Return sp.
+ *
+ * Fast assembler language version of the following C-program for memset
+ * which represents the `standard' for the C-library.
+ *
+ *	void *
+ *	memset(void *sp1, int c, size_t n)
+ *	{
+ *	    if (n != 0) {
+ *		char *sp = sp1;
+ *		do {
+ *		    *sp++ = (char)c;
+ *		} while (--n != 0);
+ *	    }
+ *	    return (sp1);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+
+	ANSI_PRAGMA_WEAK(memset,function)
+
+#define	ALIGN8(X)	(((X) + 7) & ~7)
+#define BLOCK_SIZE      64
+
+	.section        ".text"
+	.align 32
+
+	ENTRY(memset)
+	cmp	%o2, 12			! if small counts, just write bytes
+	bgeu,pn	%ncc, .wrbig
+	mov	%o0, %o5		! copy sp1 before using it
+
+.wrchar:
+	deccc   %o2			! byte clearing loop
+        inc     %o5
+	bgeu,a,pt %ncc, .wrchar
+        stb     %o1, [%o5 + -1]         ! we've already incremented the address
+
+        retl
+	.empty	! next instruction is safe, %o0 still good
+
+.wrbig:
+        andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
+        bz,pt	%ncc, .blkchk		! already double aligned
+	and	%o1, 0xff, %o1		! o1 is (char)c
+        sub	%o3, 8, %o3		! -(bytes till double aligned)
+        add	%o2, %o3, %o2		! update o2 with new count
+
+	! Set -(%o3) bytes till sp1 double aligned
+1:	stb	%o1, [%o5]		! there is at least 1 byte to set
+	inccc	%o3			! byte clearing loop 
+        bl,pt	%ncc, 1b
+        inc	%o5 
+
+	
+	! Now sp1 is double aligned (sp1 is found in %o5)
+.blkchk:
+	sll     %o1, 8, %o3
+        or      %o1, %o3, %o1		! now o1 has 2 bytes of c
+
+        sll     %o1, 16, %o3
+        or      %o1, %o3, %o1		! now o1 has 4 bytes of c
+	
+	cmp     %o2, 4095		! if large count use Block ld/st
+	
+	sllx	%o1, 32, %o3
+	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
+
+        bgu,a,pn %ncc, .blkwr		! Do block write for large count
+        andcc   %o5, 63, %o3            ! is sp1 block aligned?
+	
+	and	%o2, 24, %o3		! o3 is {0, 8, 16, 24}
+
+1:	subcc	%o3, 8, %o3		! double-word loop
+	add	%o5, 8, %o5
+	bgeu,a,pt %ncc, 1b
+	stx	%o1, [%o5 - 8]		! already incremented the address
+
+	andncc	%o2, 31, %o4		! o4 has 32 byte aligned count
+	bz,pn	%ncc, 3f		! First instruction of icache line
+2:
+	subcc	%o4, 32, %o4		! main loop, 32 bytes per iteration
+	stx	%o1, [%o5 - 8]
+	stx	%o1, [%o5]
+	stx	%o1, [%o5 + 8]
+	stx	%o1, [%o5 + 16]
+	bnz,pt	%ncc, 2b
+	add	%o5, 32, %o5
+
+3:	
+	and	%o2, 7, %o2		! o2 has the remaining bytes (<8)
+
+4:
+	deccc   %o2                     ! byte clearing loop
+        inc     %o5
+        bgeu,a,pt %ncc, 4b
+        stb     %o1, [%o5 - 9]		! already incremented the address
+
+	retl
+	nop				! %o0 still preserved
+
+.blkwr:
+        bz,pn   %ncc, .blalign		! now block aligned
+        sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
+	add	%o2, %o3, %o2		! o2 is the remainder
+
+        ! Store -(%o3) bytes till dst is block (64 byte) aligned.
+        ! Use double word stores.
+	! Recall that dst is already double word aligned
+1:
+        stx     %o1, [%o5]
+	addcc   %o3, 8, %o3
+	bl,pt	%ncc, 1b
+	add     %o5, 8, %o5
+
+	! sp1 is block aligned                                     
+.blalign:
+        rd      %fprs, %g1              ! g1 = fprs
+
+	and	%o2, 63, %o3		! calc bytes left after blk store.
+
+	andcc	%g1, 0x4, %g1		! fprs.du = fprs.dl = 0
+	bz,a	%ncc, 2f		! Is fprs.fef == 0 
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+2:
+	brnz,pn	%o1, 3f			! %o1 is safe to check all 64-bits
+	andn	%o2, 63, %o4		! calc size of blocks in bytes
+	fzero   %d0
+	fzero   %d2
+	fzero   %d4
+	fzero   %d6
+	fmuld   %d0, %d0, %d8
+	fzero   %d10
+	ba	4f
+	fmuld   %d0, %d0, %d12
+
+3:
+	! allocate 8 bytes of scratch space on the stack
+	add	%sp, -SA(16), %sp
+	stx	%o1, [%sp + STACK_BIAS + ALIGN8(MINFRAME)]  ! move %o1 to %d0
+	ldd	[%sp + STACK_BIAS + ALIGN8(MINFRAME)], %d0
+
+	fmovd	%d0, %d2
+	add	%sp, SA(16), %sp	! deallocate the scratch space
+	fmovd	%d0, %d4	
+	fmovd	%d0, %d6	
+	fmovd	%d0, %d8
+	fmovd	%d0, %d10	
+	fmovd	%d0, %d12	
+4:	
+	fmovd	%d0, %d14
+	
+	! 1st quadrant has 64 bytes of c
+	! instructions 32-byte aligned here
+#ifdef PANTHER_ONLY
+	! Panther only code
+	prefetch	[%o5 + (3 * BLOCK_SIZE)], 22
+	prefetch	[%o5 + (6 * BLOCK_SIZE)], 22
+	std	%d0, [%o5]
+	std	%d0, [%o5 + 8]
+	std	%d0, [%o5 + 16]
+	std	%d0, [%o5 + 24]
+	std	%d0, [%o5 + 32]
+	std	%d0, [%o5 + 40]
+	std	%d0, [%o5 + 48]
+	std	%d0, [%o5 + 56]
+#else	
+	! Cheetah/Jaguar code
+        stda    %d0, [%o5]ASI_BLK_P
+#endif
+        subcc   %o4, 64, %o4
+        bgu,pt	%ncc, 4b
+        add     %o5, 64, %o5
+
+	! Set the remaining doubles
+	subcc   %o3, 8, %o3		! Can we store any doubles?
+	blu,pn  %ncc, 6f
+	and	%o2, 7, %o2		! calc bytes left after doubles
+
+5:	
+	std     %d0, [%o5]		! store the doubles
+	subcc   %o3, 8, %o3
+	bgeu,pt	%ncc, 5b
+        add     %o5, 8, %o5      
+6:
+	! Set the remaining bytes
+	brz	%o2, .exit		! safe to check all 64-bits
+	
+#if 0
+	! Terminate the copy with a partial store. (bug 1200071 does not apply)
+	! The data should be at d0
+        dec     %o2                     ! needed to get the mask right
+	edge8n	%g0, %o2, %o4
+	stda	%d0, [%o5]%o4, ASI_PST8_P
+#else
+7:	
+	deccc	%o2
+	stb	%o1, [%o5]
+	bgu,pt	%ncc, 7b
+	inc	%o5
+#endif
+	
+.exit:	
+        membar  #StoreLoad|#StoreStore
+        retl				! %o0 was preserved
+        wr	%g1, %g0, %fprs         ! fprs = g1  restore fprs
+
+	SET_SIZE(memset)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4u
+GEN_PLATFORM =	sun4u
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o memset.o memcmp.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS)
+ASFLAGS =	-P -K pic
+
+# memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
+# a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
+# the same address is compromised.  The result is .SUNW_dynsymsort: duplicate
+# symbol errors from check_rtime.  Use elfedit to assign a weak binding.
+
+POST_PROCESS_OBJCAP_O =	elfedit -e "sym:st_bind __align_cpy_1 STB_WEAK" $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u {
+	MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+	global:
+		__align_cpy_1;
+		_memcmp;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcmp;
+		memcpy;
+		memmove;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/common/memcmp.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,1119 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcmp.s"
+
+/*
+ * memcmp(s1, s2, len)
+ *
+ * Compare n bytes:  s1>s2: >0  s1==s2: 0  s1<s2: <0
+ *
+ * Fast assembler language version of the following C-program for memcmp
+ * which represents the `standard' for the C-library.
+ *
+ *	int
+ *	memcmp(const void *s1, const void *s2, size_t n)
+ *	{
+ *		if (s1 != s2 && n != 0) {
+ *			const char *ps1 = s1;
+ *			const char *ps2 = s2;
+ *			do {
+ *				if (*ps1++ != *ps2++)
+ *					return(ps1[-1] - ps2[-1]);
+ *			} while (--n != 0);
+ *		}
+ *		return (0);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+
+	ANSI_PRAGMA_WEAK(memcmp,function)
+
+	ENTRY(memcmp)
+	cmp	%o0, %o1		! s1 == s2?
+	be	%ncc, .cmpeq
+	
+	! for small counts byte compare immediately
+	cmp	%o2, 48
+	bleu,a 	%ncc, .bytcmp
+	mov	%o2, %o3		! o3 <= 48
+	
+	! Count > 48. We will byte compare (8 + num of bytes to dbl align) 
+	! bytes. We assume that most miscompares will occur in the 1st 8 bytes 
+
+.chkdbl:
+        and     %o0, 7, %o4             ! is s1 aligned on a 8 byte bound
+	mov	8, %o3			! o2 > 48;  o3 = 8
+        sub     %o4, 8, %o4		! o4 = -(num of bytes to dbl align)
+	ba	%ncc, .bytcmp
+        sub     %o3, %o4, %o3           ! o3 = 8 + (num of bytes to dbl align)
+
+
+1:      ldub    [%o1], %o5        	! byte compare loop
+        inc     %o1
+        inc     %o0
+	dec	%o2
+        cmp     %o4, %o5
+	bne	%ncc, .noteq
+.bytcmp:
+	deccc   %o3
+	bgeu,a   %ncc, 1b
+        ldub    [%o0], %o4
+
+	! Check to see if there are more bytes to compare
+	cmp	%o2, 0			! is o2 > 0
+	bgu,a	%ncc, .blkchk		! we should already be dbl aligned
+	cmp     %o2, 320                ! if cnt < 256 + 64 -  no Block ld/st
+.cmpeq:
+        retl                             ! strings compare equal
+	sub	%g0, %g0, %o0
+
+.noteq:
+	retl				! strings aren't equal
+	sub	%o4, %o5, %o0		! return(*s1 - *s2)
+
+
+        ! Now src1 is Double word aligned
+.blkchk:
+        bgeu,a   %ncc, blkcmp                  ! do block cmp
+        andcc   %o0, 63, %o3            ! is src1 block aligned
+ 
+        ! double word compare - using ldd and faligndata. Compares upto
+        ! 8 byte multiple count and does byte compare for the residual.
+
+.dwcmp: 
+        
+        rd      %fprs, %o3              ! o3 = fprs
+
+        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+        ! So set it anyway, without checking.
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+        andn    %o2, 7, %o4             ! o4 has 8 byte aligned cnt
+	sub     %o4, 8, %o4
+        alignaddr %o1, %g0, %g1
+        ldd     [%g1], %d0
+4:
+        add     %g1, 8, %g1
+        ldd     [%g1], %d2
+	ldd	[%o0], %d6
+        faligndata %d0, %d2, %d8
+	fcmpne32 %d6, %d8, %o5
+	fsrc1	%d6, %d6		! 2 fsrc1's added since o5 cannot
+	fsrc1	%d8, %d8		! be used for 3 cycles else we 
+	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
+	brnz,a,pn %o5, 6f
+	sub     %o1, %o0, %o1           ! o1 gets the difference
+        subcc   %o4, 8, %o4
+        add     %o0, 8, %o0
+        add     %o1, 8, %o1
+        bgu,pt	%ncc, 4b
+        sub     %o2, 8, %o2
+
+.residcmp:
+        ba      6f
+	sub     %o1, %o0, %o1           ! o1 gets the difference
+
+5:      ldub    [%o0 + %o1], %o5        ! byte compare loop
+        inc     %o0
+        cmp     %o4, %o5
+        bne     %ncc, .dnoteq
+6:
+        deccc   %o2
+        bgeu,a	%ncc, 5b
+        ldub    [%o0], %o4
+	
+	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+	retl
+	sub	%g0, %g0, %o0		! strings compare equal 
+        
+.dnoteq:
+	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+	retl
+	sub	%o4, %o5, %o0		! return(*s1 - *s2)
+        
+
+blkcmp:  
+	save    %sp, -SA(MINFRAME), %sp
+        rd      %fprs, %l5              ! l5 = fprs
+
+        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+        ! So set it anyway, without checking.
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+	bz,pn   %ncc, .blalign          ! now block aligned
+        sub     %i3, 64, %i3
+        neg     %i3                     ! bytes till block aligned
+
+        ! Compare %i3 bytes till dst is block (64 byte) aligned. use
+        ! double word compares.
+
+        alignaddr %i1, %g0, %g1
+        ldd     [%g1], %d0
+7:
+        add     %g1, 8, %g1
+        ldd     [%g1], %d2
+        ldd     [%i0], %d6
+        faligndata %d0, %d2, %d8
+        fcmpne32 %d6, %d8, %i5
+	fsrc1	%d6, %d6		! 2 fsrc1's added since i5 cannot
+	fsrc1	%d8, %d8		! be used for 3 cycles else we 
+	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
+        brnz,a,pn  %i5, .remcmp  
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        subcc   %i3, 8, %i3
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+        bgu,pt	%ncc, 7b
+        sub     %i2, 8, %i2
+ 
+.blalign: 
+
+	! src1 is block aligned 
+        membar  #StoreLoad
+        srl     %i1, 3, %l6             ! bits 3,4,5 are now least sig in  %l6
+        andcc   %l6, 7, %l6             ! mask everything except bits 1,2 3
+        andn    %i2, 63, %i3            ! calc number of blocks
+        alignaddr %i1, %g0, %g0         ! gen %gsr
+        andn    %i1, 0x3F, %l7          ! blk aligned address
+        sub     %i2, %i3, %l2
+        andn    %l2, 7, %i4             ! calc doubles left after blkcpy
+
+	be,a	%ncc, 1f	! branch taken if src2 is 64-byte aligned
+	ldda	[%l7]ASI_BLK_P, %d0
+
+	call	.+8		! get the address of this instruction in %o7
+	sll	%l6, 2, %l4
+	add	%o7, %l4, %o7
+	jmp	%o7 + 16	! jump to the starting ldd instruction
+	nop
+	ldd	[%l7+8], %d2
+	ldd	[%l7+16], %d4
+	ldd	[%l7+24], %d6
+	ldd	[%l7+32], %d8
+	ldd	[%l7+40], %d10
+	ldd	[%l7+48], %d12
+	ldd	[%l7+56], %d14
+1:
+        add     %l7, 64, %l7
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	ldda	[%i0]ASI_BLK_P, %d32
+	sub     %i3, 128, %i3
+ 
+        ! switch statement to get us to the right 8 byte blk within a
+        ! 64 byte block
+ 
+        cmp      %l6, 4
+        bgeu,a	hlf
+        cmp      %l6, 6
+        cmp      %l6, 2
+        bgeu,a	sqtr
+        nop
+        cmp      %l6, 1
+        be,a     seg1
+        nop
+        ba       seg0
+        nop
+sqtr:    
+        be,a     seg2
+        nop
+
+        ba,a     seg3
+        nop
+         
+hlf:     
+        bgeu,a	fqtr
+        nop
+        cmp      %l6, 5
+        be,a     seg5
+        nop
+        ba       seg4
+        nop
+fqtr:    
+        be,a     seg6
+        nop
+        ba       seg7
+        nop
+
+! The fsrc1 instructions are to make sure that the results of the fcmpne32
+! are used 3 cycles later - else spitfire adds 9 bubbles.
+         
+#define	FCMPNE32_D32_D48			\
+	fcmpne32	%d48, %d32, %l0		;\
+	fcmpne32	%d50, %d34, %l1		;\
+	fcmpne32	%d52, %d36, %l2		;\
+	fcmpne32	%d54, %d38, %l3		;\
+	brnz,a		%l0, add		;\
+	mov		0, %l4			;\
+	fcmpne32	%d56, %d40, %l0		;\
+	brnz,a		%l1, add		;\
+	mov		8, %l4			;\
+	fcmpne32	%d58, %d42, %l1		;\
+	brnz,a		%l2, add		;\
+	mov		16, %l4			;\
+	fcmpne32	%d60, %d44, %l2		;\
+	brnz,a		%l3, add		;\
+	mov		24, %l4			;\
+	fcmpne32	%d62, %d46, %l3		;\
+	brnz,a		%l0, add		;\
+	mov		32, %l4			;\
+        fsrc1           %d48, %d48              ;\
+	brnz,a		%l1, add		;\
+	mov		40, %l4			;\
+        fsrc1           %d48, %d48              ;\
+	brnz,a		%l2, add		;\
+	mov		48, %l4			;\
+        fsrc1           %d48, %d48              ;\
+	brnz,a		%l3, add		;\
+	mov		56, %l4
+
+add:
+	add	%l4, %i0, %i0
+	add	%l4, %i1, %i1
+	ba	.remcmp
+	sub	%i1, %i0, %i1
+
+#define FALIGN_D0                       \
+        faligndata %d0, %d2, %d48       ;\
+        faligndata %d2, %d4, %d50       ;\
+        faligndata %d4, %d6, %d52       ;\
+        faligndata %d6, %d8, %d54       ;\
+        faligndata %d8, %d10, %d56      ;\
+        faligndata %d10, %d12, %d58     ;\
+        faligndata %d12, %d14, %d60     ;\
+        faligndata %d14, %d16, %d62
+ 
+#define FALIGN_D16                      \
+        faligndata %d16, %d18, %d48     ;\
+        faligndata %d18, %d20, %d50     ;\
+        faligndata %d20, %d22, %d52     ;\
+        faligndata %d22, %d24, %d54     ;\
+        faligndata %d24, %d26, %d56     ;\
+        faligndata %d26, %d28, %d58     ;\
+        faligndata %d28, %d30, %d60     ;\
+        faligndata %d30, %d0, %d62
+ 
+seg0:
+        FALIGN_D0
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D16
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg0
+	ldda	[%i0]ASI_BLK_P, %d32
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D0
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd16
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D16
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd0
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D2                       \
+        faligndata %d2, %d4, %d48       ;\
+        faligndata %d4, %d6, %d50       ;\
+        faligndata %d6, %d8, %d52       ;\
+        faligndata %d8, %d10, %d54      ;\
+        faligndata %d10, %d12, %d56     ;\
+        faligndata %d12, %d14, %d58     ;\
+        faligndata %d14, %d16, %d60     ;\
+        faligndata %d16, %d18, %d62
+
+#define FALIGN_D18                      \
+        faligndata %d18, %d20, %d48     ;\
+        faligndata %d20, %d22, %d50     ;\
+        faligndata %d22, %d24, %d52     ;\
+        faligndata %d24, %d26, %d54     ;\
+        faligndata %d26, %d28, %d56     ;\
+        faligndata %d28, %d30, %d58     ;\
+        faligndata %d30, %d0, %d60      ;\
+        faligndata %d0, %d2, %d62
+
+
+seg1:
+        FALIGN_D2
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D18
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg1
+	ldda	[%i0]ASI_BLK_P, %d32
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D2
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd18
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D18
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd2
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D4                       \
+        faligndata %d4, %d6, %d48       ;\
+        faligndata %d6, %d8, %d50       ;\
+        faligndata %d8, %d10, %d52      ;\
+        faligndata %d10, %d12, %d54     ;\
+        faligndata %d12, %d14, %d56     ;\
+        faligndata %d14, %d16, %d58     ;\
+        faligndata %d16, %d18, %d60     ;\
+        faligndata %d18, %d20, %d62
+ 
+#define FALIGN_D20                      \
+        faligndata %d20, %d22, %d48     ;\
+        faligndata %d22, %d24, %d50     ;\
+        faligndata %d24, %d26, %d52     ;\
+        faligndata %d26, %d28, %d54     ;\
+        faligndata %d28, %d30, %d56     ;\
+        faligndata %d30, %d0, %d58      ;\
+        faligndata %d0, %d2, %d60       ;\
+        faligndata %d2, %d4, %d62
+ 
+seg2:
+	FALIGN_D4
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D20
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg2
+	ldda	[%i0]ASI_BLK_P, %d32
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D4
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd20
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D20
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd4
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D6                       \
+        faligndata %d6, %d8, %d48       ;\
+        faligndata %d8, %d10, %d50      ;\
+        faligndata %d10, %d12, %d52     ;\
+        faligndata %d12, %d14, %d54     ;\
+        faligndata %d14, %d16, %d56     ;\
+        faligndata %d16, %d18, %d58     ;\
+        faligndata %d18, %d20, %d60     ;\
+        faligndata %d20, %d22, %d62
+
+#define FALIGN_D22                      \
+        faligndata %d22, %d24, %d48     ;\
+        faligndata %d24, %d26, %d50     ;\
+        faligndata %d26, %d28, %d52     ;\
+        faligndata %d28, %d30, %d54     ;\
+        faligndata %d30, %d0, %d56      ;\
+        faligndata %d0, %d2, %d58       ;\
+        faligndata %d2, %d4, %d60       ;\
+        faligndata %d4, %d6, %d62
+
+ 
+seg3:
+        FALIGN_D6
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D22
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg3
+	ldda	[%i0]ASI_BLK_P, %d32
+ 
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D6
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd22
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D22
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd6
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D8                       \
+        faligndata %d8, %d10, %d48      ;\
+        faligndata %d10, %d12, %d50     ;\
+        faligndata %d12, %d14, %d52     ;\
+        faligndata %d14, %d16, %d54     ;\
+        faligndata %d16, %d18, %d56     ;\
+        faligndata %d18, %d20, %d58     ;\
+        faligndata %d20, %d22, %d60     ;\
+        faligndata %d22, %d24, %d62
+
+#define FALIGN_D24                      \
+        faligndata %d24, %d26, %d48     ;\
+        faligndata %d26, %d28, %d50     ;\
+        faligndata %d28, %d30, %d52     ;\
+        faligndata %d30, %d0, %d54      ;\
+        faligndata %d0, %d2, %d56       ;\
+        faligndata %d2, %d4, %d58       ;\
+        faligndata %d4, %d6, %d60       ;\
+        faligndata %d6, %d8, %d62
+
+
+seg4:
+        FALIGN_D8
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D24
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg4
+	ldda	[%i0]ASI_BLK_P, %d32
+
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D8
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd24
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D24
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd8
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D10                      \
+        faligndata %d10, %d12, %d48     ;\
+        faligndata %d12, %d14, %d50     ;\
+        faligndata %d14, %d16, %d52     ;\
+        faligndata %d16, %d18, %d54     ;\
+        faligndata %d18, %d20, %d56     ;\
+        faligndata %d20, %d22, %d58     ;\
+        faligndata %d22, %d24, %d60     ;\
+        faligndata %d24, %d26, %d62
+
+#define FALIGN_D26                      \
+        faligndata %d26, %d28, %d48     ;\
+        faligndata %d28, %d30, %d50     ;\
+        faligndata %d30, %d0, %d52      ;\
+        faligndata %d0, %d2, %d54       ;\
+        faligndata %d2, %d4, %d56       ;\
+        faligndata %d4, %d6, %d58       ;\
+        faligndata %d6, %d8, %d60       ;\
+        faligndata %d8, %d10, %d62
+
+
+seg5:
+        FALIGN_D10
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D26
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg5
+	ldda	[%i0]ASI_BLK_P, %d32
+
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D10
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd26
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D26
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd10
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D12                      \
+        faligndata %d12, %d14, %d48     ;\
+        faligndata %d14, %d16, %d50     ;\
+        faligndata %d16, %d18, %d52     ;\
+        faligndata %d18, %d20, %d54     ;\
+        faligndata %d20, %d22, %d56     ;\
+        faligndata %d22, %d24, %d58     ;\
+        faligndata %d24, %d26, %d60     ;\
+        faligndata %d26, %d28, %d62
+
+#define FALIGN_D28                      \
+        faligndata %d28, %d30, %d48     ;\
+        faligndata %d30, %d0, %d50      ;\
+        faligndata %d0, %d2, %d52       ;\
+        faligndata %d2, %d4, %d54       ;\
+        faligndata %d4, %d6, %d56       ;\
+        faligndata %d6, %d8, %d58       ;\
+        faligndata %d8, %d10, %d60      ;\
+        faligndata %d10, %d12, %d62
+
+
+seg6:
+        FALIGN_D12
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D28
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg6
+	ldda	[%i0]ASI_BLK_P, %d32
+
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D12
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd28
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D28
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd12
+        sub     %i2, 64, %i2 
+
+#define FALIGN_D14                      \
+        faligndata %d14, %d16, %d48     ;\
+        faligndata %d16, %d18, %d50     ;\
+        faligndata %d18, %d20, %d52     ;\
+        faligndata %d20, %d22, %d54     ;\
+        faligndata %d22, %d24, %d56     ;\
+        faligndata %d24, %d26, %d58     ;\
+        faligndata %d26, %d28, %d60     ;\
+        faligndata %d28, %d30, %d62
+
+#define FALIGN_D30                      \
+        faligndata %d30, %d0, %d48     ;\
+        faligndata %d0, %d2, %d50      ;\
+        faligndata %d2, %d4, %d52      ;\
+        faligndata %d4, %d6, %d54      ;\
+        faligndata %d6, %d8, %d56      ;\
+        faligndata %d8, %d10, %d58     ;\
+        faligndata %d10, %d12, %d60    ;\
+        faligndata %d12, %d14, %d62
+
+seg7:
+        FALIGN_D14
+        ldda    [%l7]ASI_BLK_P, %d0
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 1f
+        sub     %i2, 64, %i2 
+        ldda    [%i0]ASI_BLK_P, %d32
+        
+        FALIGN_D30
+        ldda    [%l7]ASI_BLK_P, %d16
+        add     %l7, 64, %l7
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+        subcc   %i3, 64, %i3
+        bz,pn   %ncc, 0f
+        sub     %i2, 64, %i2 
+
+        ba	%ncc, seg7
+	ldda	[%i0]ASI_BLK_P, %d32
+
+0:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D14
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd30
+        sub     %i2, 64, %i2 
+
+1:
+	ldda	[%i0]ASI_BLK_P, %d32
+	membar  #Sync
+	FALIGN_D30
+	FCMPNE32_D32_D48
+        add     %i0, 64, %i0
+        add     %i1, 64, %i1
+	ba	%ncc, blkd14
+        sub     %i2, 64, %i2 
+
+
+blkd0:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d0, %d2, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd2:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d2, %d4, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd4:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d4, %d6, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd6:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d6, %d8, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd8:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d8, %d10, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd10:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d10, %d12, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd12:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d12, %d14, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd14:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        ba,pt 	%ncc, blkleft
+	fmovd   %d14, %d0
+
+blkd16:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d16, %d18, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd18:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d18, %d20, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd20:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d20, %d22, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd22:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d22, %d24, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd24:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d24, %d26, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd26:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d26, %d28, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd28:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        faligndata %d28, %d30, %d48
+	ldd	[%i0], %d32
+	fcmpne32 %d32, %d48, %l1
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	fsrc1	%d32, %d32
+	brnz,a	 %l1, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+	sub	%i2, 8, %i2
+
+blkd30:
+        subcc   %i4, 8, %i4
+        blu,a,pn %ncc, .remcmp
+        sub     %i1, %i0, %i1           ! i1 gets the difference
+        fmovd   %d30, %d0
+
+	! This loop handles doubles remaining that were not loaded(ldda`ed)
+	! in the Block Compare loop
+blkleft:
+        ldd     [%l7], %d2
+        add     %l7, 8, %l7
+        faligndata %d0, %d2, %d8
+	ldd     [%i0], %d32
+        fcmpne32 %d32, %d8, %l1
+	fsrc1	%d2, %d0
+	fsrc1	%d2, %d0
+	fsrc1	%d2, %d0
+	brnz,a	%l1, .remcmp
+	sub     %i1, %i0, %i1           ! i1 gets the difference
+        add     %i0, 8, %i0
+        add     %i1, 8, %i1
+        subcc   %i4, 8, %i4
+        bgeu,pt  %ncc, blkleft
+        sub     %i2, 8, %i2
+
+	ba	%ncc, .remcmp
+	sub     %i1, %i0, %i1           ! i1 gets the difference
+
+6:      ldub    [%i0 + %i1], %i5        ! byte compare loop
+        inc     %i0
+        cmp     %i4, %i5
+        bne     %ncc, .bnoteq
+.remcmp:
+        deccc   %i2
+        bgeu,a   %ncc, 6b
+        ldub    [%i0], %i4
+         
+exit:    
+	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
+	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
+	membar  #StoreLoad|#StoreStore
+        ret
+        restore %g0, %g0, %o0
+
+
+.bnoteq:
+	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
+	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
+	membar  #StoreLoad|#StoreStore
+	sub	%i4, %i5, %i0		! return(*s1 - *s2)
+	ret				! strings aren't equal
+	restore %i0, %g0, %o0
+
+
+
+	SET_SIZE(memcmp)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/common/memcpy.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,1265 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcpy.s"
+
+/*
+ * memcpy(s1, s2, len)
+ *
+ * Copy s2 to s1, always copy n bytes.
+ * Note: this does not work for overlapped copies, bcopy() does
+ *
+ * Fast assembler language version of the following C-program for memcpy
+ * which represents the `standard' for the C-library.
+ *
+ *	void * 
+ *	memcpy(void *s, const void *s0, size_t n)
+ *	{
+ *		if (n != 0) {
+ *	   	    char *s1 = s;
+ *		    const char *s2 = s0;
+ *		    do {
+ *			*s1++ = *s2++;
+ *		    } while (--n != 0);
+ *		}
+ *		return ( s );
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+#include <sys/trap.h>
+
+	ANSI_PRAGMA_WEAK(memmove,function)
+	ANSI_PRAGMA_WEAK(memcpy,function)
+
+	ENTRY(memmove)
+	cmp	%o1, %o0	! if from address is >= to use forward copy
+	bgeu	%ncc, forcpy	! else use backward if ...
+	sub	%o0, %o1, %o4	! get difference of two addresses
+	cmp	%o2, %o4	! compare size and difference of addresses
+	bleu	%ncc, forcpy	! if size is bigger, do overlapped copy
+	nop
+
+        !
+        ! an overlapped copy that must be done "backwards"
+        !
+.ovbc:  
+	mov	%o0, %o5		! save des address for return val	
+	add     %o1, %o2, %o1           ! get to end of source space
+        add     %o0, %o2, %o0           ! get to end of destination space
+
+.chksize:
+	cmp	%o2, 8
+	bgeu,pn	%ncc, .dbalign
+	nop
+
+        
+.byte:
+1:	deccc	%o2			! decrement count
+	blu,pn	%ncc, exit		! loop until done
+	dec	%o0			! decrement to address
+	dec	%o1			! decrement from address
+        ldub	[%o1], %o3		! read a byte
+        ba	1b			! loop until done
+	stb	%o3, [%o0]		! write byte
+
+.dbalign:
+	andcc	%o0, 7, %o3
+	bz	%ncc, .dbbck
+	nop
+	dec	%o1
+	dec	%o0
+	dec	%o2
+	ldub	[%o1], %o3
+	ba	.chksize
+	stb	%o3, [%o0]
+
+.dbbck:
+
+        rd      %fprs, %o3              ! o3 = fprs
+ 
+ 
+        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+        ! So set it anyway, without checking.
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+        alignaddr	%o1, %g0, %g1		! align src
+        ldd	[%g1], %d0		! get first 8 byte block
+	sub	%g1, 8, %g1
+	andn	%o2, 7, %o4
+	sub	%o1, %o4, %o1
+
+2:
+	sub	%o0, 8, %o0		! since we are at the end
+					! when we first enter the loop
+        ldd	[%g1], %d2
+        faligndata %d2, %d0, %d8	! extract 8 bytes out 
+        std	%d8, [%o0]		! store it
+
+	sub	%g1, 8, %g1
+        sub	%o2, 8, %o2		! 8 less bytes to copy
+	cmp	%o2, 8			! or do we have < 8 bytes
+        bgeu,pt	%ncc, 2b	
+	fmovd	%d2, %d0
+
+        and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+        ba      .byte
+        wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+ 
+	SET_SIZE(memmove)
+
+
+	ENTRY(memcpy)
+	ENTRY(__align_cpy_1)
+forcpy:
+	mov	%o0, %o5		! save des address for return val
+
+	cmp	%o2, 32			! for small counts copy bytes
+	bgu,a	%ncc, .alignsrc
+	andcc   %o1, 7, %o3             ! is src aligned on a 8 byte bound
+
+.bytecp:
+	! Do byte copy
+	tst	%o2
+	bleu,a,pn %ncc, exit
+	nop
+
+1:	ldub	[%o1], %o4
+	inc 	%o1
+	inc	%o0
+	deccc	%o2
+	bgu	%ncc, 1b
+	stb	%o4, [%o0 - 1]
+
+exit:
+	retl
+	mov	%o5, %o0
+
+.alignsrc:
+        bz      %ncc, .bigcpy		! src already double aligned
+	sub     %o3, 8, %o3
+        neg     %o3                     ! bytes till src double aligned
+
+        sub     %o2, %o3, %o2           ! update o2 with new count
+
+	! Copy %o3 bytes till double aligned
+
+2:      ldub    [%o1], %o4
+        inc     %o1
+        inc     %o0
+        deccc   %o3
+        bgu	%ncc, 2b
+        stb     %o4, [%o0 - 1]
+
+	! Now Source (%o1) is double word aligned
+
+.bigcpy: 				! >= 17 bytes to copy
+	andcc	%o0, 7, %o3		! is dst aligned on a 8 byte bound
+        bz      %ncc, .blkchk		! already double aligned
+	sub     %o3, 8, %o3
+        neg     %o3                     ! bytes till double aligned
+
+        sub     %o2, %o3, %o2           ! update o2 with new count
+
+	! Copy %o3 bytes till double aligned
+
+3:      ldub    [%o1], %o4
+        inc     %o1
+        inc     %o0
+        deccc   %o3
+        bgu	%ncc, 3b
+        stb     %o4, [%o0 - 1]
+
+	! Now Destination (%o0) is double word aligned
+.blkchk:
+	cmp     %o2, 384		! if cnt < 256 + 128 -  no Block ld/st
+	bgeu,a	%ncc, blkcpy		!    do double word copy
+	subcc	%o0, %o1, %o4		! %o4 = dest - src
+
+	! double word copy - using ldd and faligndata. Copies upto
+	! 8 byte multiple count and does byte copy for the residual.
+.dwcpy:
+	rd	%fprs, %o3		! o3 = fprs
+
+	! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+	! So set it anyway, without checking.
+	wr	%g0, 0x4, %fprs 	! fprs.fef = 1
+	andn    %o2, 7, %o4     	! o4 has 8 byte aligned cnt
+	sub	%o4, 8, %o4
+        alignaddr %o1, %g0, %g1
+        ldd     [%g1], %d0
+        add     %g1, 8, %g1
+4:
+        ldd     [%g1], %d2
+        add     %g1, 8, %g1
+        sub     %o2, 8, %o2
+        subcc   %o4, 8, %o4
+        faligndata %d0, %d2, %d8
+        std     %d8, [%o0]
+        add     %o1, 8, %o1
+        bz,pn   %ncc, .residcp
+        add     %o0, 8, %o0
+        ldd     [%g1], %d0
+        add     %g1, 8, %g1
+        sub     %o2, 8, %o2
+        subcc   %o4, 8, %o4
+        faligndata %d2, %d0, %d8
+        std     %d8, [%o0]
+        add     %o1, 8, %o1
+        bgu,pn	%ncc, 4b
+        add     %o0, 8, %o0
+
+.residcp:				! Do byte copy
+	tst	%o2
+	bz,a,pn %ncc, dwexit
+	nop
+
+5:	ldub	[%o1], %o4
+	inc 	%o1
+	inc	%o0
+	deccc	%o2
+	bgu	%ncc, 5b
+	stb	%o4, [%o0 - 1]
+
+dwexit:
+        and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
+        wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
+	retl
+	mov	%o5, %o0
+
+blkcpy:
+	! subcc	%o0, %o1, %o4		! in delay slot of branch
+	bneg,a,pn %ncc, 1f		! %o4 = abs(%o4)
+	neg	%o4
+1:
+	/*
+	 * Compare against 256 since we should be checking block addresses
+	 * and (dest & ~63) - (src & ~63) can be 3 blocks even if
+	 * src = dest + (64 * 3) + 63.
+	 */
+	cmp	%o4, 256		! if smaller than 3 blocks skip
+	blu,pn	%ncc, .dwcpy		! and do it the slower way
+	andcc	%o0, 63, %o3
+
+	save    %sp, -SA(MINFRAME), %sp
+        rd      %fprs, %l3              ! l3 = fprs
+         
+        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
+        ! So set it anyway, without checking.
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+
+        bz,pn   %ncc, blalign           ! now block aligned
+        sub     %i3, 64, %i3
+        neg     %i3                     ! bytes till block aligned
+	sub	%i2, %i3, %i2		! update %i2 with new count
+
+	! Copy %i3 bytes till dst is block (64 byte) aligned. use
+	! double word copies.
+
+        alignaddr %i1, %g0, %g1
+        ldd     [%g1], %d0
+        add     %g1, 8, %g1
+6:
+        ldd     [%g1], %d2
+        add     %g1, 8, %g1
+        subcc   %i3, 8, %i3
+        faligndata %d0, %d2, %d8
+        std     %d8, [%i0]
+        add     %i1, 8, %i1
+        bz,pn   %ncc, blalign
+        add     %i0, 8, %i0
+        ldd     [%g1], %d0
+        add     %g1, 8, %g1
+        subcc   %i3, 8, %i3
+        faligndata %d2, %d0, %d8
+        std     %d8, [%i0]
+        add     %i1, 8, %i1
+        bgu,pn	%ncc, 6b
+        add     %i0, 8, %i0
+ 
+blalign:
+	membar  #StoreLoad
+	! %i2 = total length
+	! %i3 = blocks  (length - 64) / 64
+	! %i4 = doubles remaining  (length - blocks)
+	sub	%i2, 64, %i3
+	andn	%i3, 63, %i3
+	sub	%i2, %i3, %i4
+	andn	%i4, 7, %i4
+	sub	%i4, 16, %i4
+	sub	%i2, %i4, %i2
+	sub	%i2, %i3, %i2
+
+	andn	%i1, 0x3F, %l7		! blk aligned address
+	alignaddr %i1, %g0, %g0		! gen %gsr
+
+	srl	%i1, 3, %l5		! bits 3,4,5 are now least sig in  %l5
+	andcc  	%l5, 7, %l6		! mask everything except bits 1,2 3
+	add	%i1, %i4, %i1
+	add	%i1, %i3, %i1
+
+	be,a	%ncc, 1f	! branch taken if src is 64-byte aligned
+	ldda	[%l7]ASI_BLK_P, %d0
+
+	call	.+8		! get the address of this instruction in %o7
+	sll	%l6, 2, %l4
+	add	%o7, %l4, %o7
+	jmp	%o7 + 16	! jump to the starting ldd instruction
+	nop
+	ldd	[%l7+8], %d2
+	ldd	[%l7+16], %d4
+	ldd	[%l7+24], %d6
+	ldd	[%l7+32], %d8
+	ldd	[%l7+40], %d10
+	ldd	[%l7+48], %d12
+	ldd	[%l7+56], %d14
+1:
+	add	%l7, 64, %l7
+	ldda	[%l7]ASI_BLK_P, %d16
+	add	%l7, 64, %l7
+	ldda	[%l7]ASI_BLK_P, %d32
+	add	%l7, 64, %l7
+	sub	%i3, 128, %i3
+
+
+        ! switch statement to get us to the right 8 byte blk within a
+        ! 64 byte block
+
+	cmp	 %l6, 4
+	bgeu,a	 hlf
+	cmp	 %l6, 6
+	cmp	 %l6, 2
+	bgeu,a	 sqtr
+	nop
+	cmp	 %l6, 1
+	be,a	 seg1
+	nop
+	ba	 seg0
+	nop
+sqtr:
+	be,a	 seg2
+	nop
+	ba,a	 seg3
+	nop
+
+hlf:
+	bgeu,a	 fqtr
+	nop	 
+	cmp	 %l6, 5
+	be,a	 seg5
+	nop
+	ba	 seg4
+	nop
+fqtr:
+	be,a	 seg6
+	nop
+	ba	 seg7
+	nop
+	
+#define	FALIGN_D0			\
+	faligndata %d0, %d2, %d48	;\
+	faligndata %d2, %d4, %d50	;\
+	faligndata %d4, %d6, %d52	;\
+	faligndata %d6, %d8, %d54	;\
+	faligndata %d8, %d10, %d56	;\
+	faligndata %d10, %d12, %d58	;\
+	faligndata %d12, %d14, %d60	;\
+	faligndata %d14, %d16, %d62
+
+#define	FALIGN_D16			\
+	faligndata %d16, %d18, %d48	;\
+	faligndata %d18, %d20, %d50	;\
+	faligndata %d20, %d22, %d52	;\
+	faligndata %d22, %d24, %d54	;\
+	faligndata %d24, %d26, %d56	;\
+	faligndata %d26, %d28, %d58	;\
+	faligndata %d28, %d30, %d60	;\
+	faligndata %d30, %d32, %d62
+
+#define	FALIGN_D32			\
+	faligndata %d32, %d34, %d48	;\
+	faligndata %d34, %d36, %d50	;\
+	faligndata %d36, %d38, %d52	;\
+	faligndata %d38, %d40, %d54	;\
+	faligndata %d40, %d42, %d56	;\
+	faligndata %d42, %d44, %d58	;\
+	faligndata %d44, %d46, %d60	;\
+	faligndata %d46, %d0, %d62
+
+seg0:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D0
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D16
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D32
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg0
+
+0:
+	FALIGN_D16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D32
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd0
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D0
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd16
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D16
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd32
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D2			\
+	faligndata %d2, %d4, %d48	;\
+	faligndata %d4, %d6, %d50	;\
+	faligndata %d6, %d8, %d52	;\
+	faligndata %d8, %d10, %d54	;\
+	faligndata %d10, %d12, %d56	;\
+	faligndata %d12, %d14, %d58	;\
+	faligndata %d14, %d16, %d60	;\
+	faligndata %d16, %d18, %d62
+
+#define	FALIGN_D18			\
+	faligndata %d18, %d20, %d48	;\
+	faligndata %d20, %d22, %d50	;\
+	faligndata %d22, %d24, %d52	;\
+	faligndata %d24, %d26, %d54	;\
+	faligndata %d26, %d28, %d56	;\
+	faligndata %d28, %d30, %d58	;\
+	faligndata %d30, %d32, %d60	;\
+	faligndata %d32, %d34, %d62
+
+#define	FALIGN_D34			\
+	faligndata %d34, %d36, %d48	;\
+	faligndata %d36, %d38, %d50	;\
+	faligndata %d38, %d40, %d52	;\
+	faligndata %d40, %d42, %d54	;\
+	faligndata %d42, %d44, %d56	;\
+	faligndata %d44, %d46, %d58	;\
+	faligndata %d46, %d0, %d60	;\
+	faligndata %d0, %d2, %d62
+
+seg1:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D2
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D18
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D34
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg1
+0:
+	FALIGN_D18
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D34
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd2
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D34
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D2
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd18
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D2
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D18
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd34
+	add	%i0, 64, %i0
+
+#define	FALIGN_D4			\
+	faligndata %d4, %d6, %d48	;\
+	faligndata %d6, %d8, %d50	;\
+	faligndata %d8, %d10, %d52	;\
+	faligndata %d10, %d12, %d54	;\
+	faligndata %d12, %d14, %d56	;\
+	faligndata %d14, %d16, %d58	;\
+	faligndata %d16, %d18, %d60	;\
+	faligndata %d18, %d20, %d62
+
+#define	FALIGN_D20			\
+	faligndata %d20, %d22, %d48	;\
+	faligndata %d22, %d24, %d50	;\
+	faligndata %d24, %d26, %d52	;\
+	faligndata %d26, %d28, %d54	;\
+	faligndata %d28, %d30, %d56	;\
+	faligndata %d30, %d32, %d58	;\
+	faligndata %d32, %d34, %d60	;\
+	faligndata %d34, %d36, %d62
+
+#define	FALIGN_D36			\
+	faligndata %d36, %d38, %d48	;\
+	faligndata %d38, %d40, %d50	;\
+	faligndata %d40, %d42, %d52	;\
+	faligndata %d42, %d44, %d54	;\
+	faligndata %d44, %d46, %d56	;\
+	faligndata %d46, %d0, %d58	;\
+	faligndata %d0, %d2, %d60	;\
+	faligndata %d2, %d4, %d62
+
+seg2:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D4
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D20
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D36
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg2
+
+0:
+	FALIGN_D20
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D36
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd4
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D36
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D4
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd20
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D4
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D20
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd36
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D6			\
+	faligndata %d6, %d8, %d48	;\
+	faligndata %d8, %d10, %d50	;\
+	faligndata %d10, %d12, %d52	;\
+	faligndata %d12, %d14, %d54	;\
+	faligndata %d14, %d16, %d56	;\
+	faligndata %d16, %d18, %d58	;\
+	faligndata %d18, %d20, %d60	;\
+	faligndata %d20, %d22, %d62
+
+#define	FALIGN_D22			\
+	faligndata %d22, %d24, %d48	;\
+	faligndata %d24, %d26, %d50	;\
+	faligndata %d26, %d28, %d52	;\
+	faligndata %d28, %d30, %d54	;\
+	faligndata %d30, %d32, %d56	;\
+	faligndata %d32, %d34, %d58	;\
+	faligndata %d34, %d36, %d60	;\
+	faligndata %d36, %d38, %d62
+
+#define	FALIGN_D38			\
+	faligndata %d38, %d40, %d48	;\
+	faligndata %d40, %d42, %d50	;\
+	faligndata %d42, %d44, %d52	;\
+	faligndata %d44, %d46, %d54	;\
+	faligndata %d46, %d0, %d56	;\
+	faligndata %d0, %d2, %d58	;\
+	faligndata %d2, %d4, %d60	;\
+	faligndata %d4, %d6, %d62
+
+seg3:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D6
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D22
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D38
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg3
+
+0:
+	FALIGN_D22
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D38
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd6
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D38
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D6
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd22
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D6
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D22
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd38
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D8			\
+	faligndata %d8, %d10, %d48	;\
+	faligndata %d10, %d12, %d50	;\
+	faligndata %d12, %d14, %d52	;\
+	faligndata %d14, %d16, %d54	;\
+	faligndata %d16, %d18, %d56	;\
+	faligndata %d18, %d20, %d58	;\
+	faligndata %d20, %d22, %d60	;\
+	faligndata %d22, %d24, %d62
+
+#define	FALIGN_D24			\
+	faligndata %d24, %d26, %d48	;\
+	faligndata %d26, %d28, %d50	;\
+	faligndata %d28, %d30, %d52	;\
+	faligndata %d30, %d32, %d54	;\
+	faligndata %d32, %d34, %d56	;\
+	faligndata %d34, %d36, %d58	;\
+	faligndata %d36, %d38, %d60	;\
+	faligndata %d38, %d40, %d62
+
+#define	FALIGN_D40			\
+	faligndata %d40, %d42, %d48	;\
+	faligndata %d42, %d44, %d50	;\
+	faligndata %d44, %d46, %d52	;\
+	faligndata %d46, %d0, %d54	;\
+	faligndata %d0, %d2, %d56	;\
+	faligndata %d2, %d4, %d58	;\
+	faligndata %d4, %d6, %d60	;\
+	faligndata %d6, %d8, %d62
+
+seg4:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D8
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D24
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D40
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg4
+
+0:
+	FALIGN_D24
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D40
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd8
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D40
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D8
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd24
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D8
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D24
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd40
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D10			\
+	faligndata %d10, %d12, %d48	;\
+	faligndata %d12, %d14, %d50	;\
+	faligndata %d14, %d16, %d52	;\
+	faligndata %d16, %d18, %d54	;\
+	faligndata %d18, %d20, %d56	;\
+	faligndata %d20, %d22, %d58	;\
+	faligndata %d22, %d24, %d60	;\
+	faligndata %d24, %d26, %d62
+
+#define	FALIGN_D26			\
+	faligndata %d26, %d28, %d48	;\
+	faligndata %d28, %d30, %d50	;\
+	faligndata %d30, %d32, %d52	;\
+	faligndata %d32, %d34, %d54	;\
+	faligndata %d34, %d36, %d56	;\
+	faligndata %d36, %d38, %d58	;\
+	faligndata %d38, %d40, %d60	;\
+	faligndata %d40, %d42, %d62
+
+#define	FALIGN_D42			\
+	faligndata %d42, %d44, %d48	;\
+	faligndata %d44, %d46, %d50	;\
+	faligndata %d46, %d0, %d52	;\
+	faligndata %d0, %d2, %d54	;\
+	faligndata %d2, %d4, %d56	;\
+	faligndata %d4, %d6, %d58	;\
+	faligndata %d6, %d8, %d60	;\
+	faligndata %d8, %d10, %d62
+
+seg5:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D10
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D26
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D42
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg5
+
+0:
+	FALIGN_D26
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D42
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd10
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D42
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D10
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd26
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D10
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D26
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd42
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D12			\
+	faligndata %d12, %d14, %d48	;\
+	faligndata %d14, %d16, %d50	;\
+	faligndata %d16, %d18, %d52	;\
+	faligndata %d18, %d20, %d54	;\
+	faligndata %d20, %d22, %d56	;\
+	faligndata %d22, %d24, %d58	;\
+	faligndata %d24, %d26, %d60	;\
+	faligndata %d26, %d28, %d62
+
+#define	FALIGN_D28			\
+	faligndata %d28, %d30, %d48	;\
+	faligndata %d30, %d32, %d50	;\
+	faligndata %d32, %d34, %d52	;\
+	faligndata %d34, %d36, %d54	;\
+	faligndata %d36, %d38, %d56	;\
+	faligndata %d38, %d40, %d58	;\
+	faligndata %d40, %d42, %d60	;\
+	faligndata %d42, %d44, %d62
+
+#define	FALIGN_D44			\
+	faligndata %d44, %d46, %d48	;\
+	faligndata %d46, %d0, %d50	;\
+	faligndata %d0, %d2, %d52	;\
+	faligndata %d2, %d4, %d54	;\
+	faligndata %d4, %d6, %d56	;\
+	faligndata %d6, %d8, %d58	;\
+	faligndata %d8, %d10, %d60	;\
+	faligndata %d10, %d12, %d62
+
+seg6:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D12
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D28
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D44
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg6
+
+0:
+	FALIGN_D28
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D44
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd12
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D44
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D12
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd28
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D12
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D28
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd44
+	add	%i0, 64, %i0
+
+
+#define	FALIGN_D14			\
+	faligndata %d14, %d16, %d48	;\
+	faligndata %d16, %d18, %d50	;\
+	faligndata %d18, %d20, %d52	;\
+	faligndata %d20, %d22, %d54	;\
+	faligndata %d22, %d24, %d56	;\
+	faligndata %d24, %d26, %d58	;\
+	faligndata %d26, %d28, %d60	;\
+	faligndata %d28, %d30, %d62
+
+#define	FALIGN_D30			\
+	faligndata %d30, %d32, %d48	;\
+	faligndata %d32, %d34, %d50	;\
+	faligndata %d34, %d36, %d52	;\
+	faligndata %d36, %d38, %d54	;\
+	faligndata %d38, %d40, %d56	;\
+	faligndata %d40, %d42, %d58	;\
+	faligndata %d42, %d44, %d60	;\
+	faligndata %d44, %d46, %d62
+
+#define	FALIGN_D46			\
+	faligndata %d46, %d0, %d48	;\
+	faligndata %d0, %d2, %d50	;\
+	faligndata %d2, %d4, %d52	;\
+	faligndata %d4, %d6, %d54	;\
+	faligndata %d6, %d8, %d56	;\
+	faligndata %d8, %d10, %d58	;\
+	faligndata %d10, %d12, %d60	;\
+	faligndata %d12, %d14, %d62
+
+seg7:
+	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
+	FALIGN_D14
+	ldda	[%l7]ASI_BLK_P, %d0
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 0f
+	add	%i0, 64, %i0
+	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
+	FALIGN_D30
+	ldda	[%l7]ASI_BLK_P, %d16
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 1f
+	add	%i0, 64, %i0
+	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
+	FALIGN_D46
+	ldda	[%l7]ASI_BLK_P, %d32
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%l7, 64, %l7
+	subcc	%i3, 64, %i3
+	bz,pn	%ncc, 2f
+	add	%i0, 64, %i0
+	ba,a,pt	%ncc, seg7
+
+0:
+	FALIGN_D30
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D46
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd14
+	add	%i0, 64, %i0
+
+1:
+	FALIGN_D46
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D14
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd30
+	add	%i0, 64, %i0
+
+2:
+	FALIGN_D14
+	stda	%d48, [%i0]ASI_BLK_P
+	add	%i0, 64, %i0
+	membar	#Sync
+	FALIGN_D30
+	stda	%d48, [%i0]ASI_BLK_P
+	ba,pt	%ncc, blkd46
+	add	%i0, 64, %i0
+
+
+	!
+	! dribble out the last partial block
+	!
+blkd0:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d0, %d2, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd2:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d2, %d4, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd4:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d4, %d6, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd6:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d6, %d8, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd8:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d8, %d10, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd10:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d10, %d12, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd12:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d12, %d14, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd14:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	fsrc1	%d14, %d0
+	ba,a,pt	%ncc, blkleft
+
+blkd16:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d16, %d18, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd18:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d18, %d20, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd20:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d20, %d22, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd22:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d22, %d24, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd24:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d24, %d26, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd26:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d26, %d28, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd28:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d28, %d30, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd30:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	fsrc1	%d30, %d0
+	ba,a,pt	%ncc, blkleft
+blkd32:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d32, %d34, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd34:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d34, %d36, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd36:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d36, %d38, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd38:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d38, %d40, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd40:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d40, %d42, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd42:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d42, %d44, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd44:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	faligndata %d44, %d46, %d48
+	std	%d48, [%i0]
+	add	%i0, 8, %i0
+blkd46:
+	subcc	%i4, 8, %i4
+	blu,pn	%ncc, blkdone
+	fsrc1	%d46, %d0
+
+blkleft:
+	ldd	[%l7], %d2
+	add	%l7, 8, %l7
+	subcc	%i4, 8, %i4
+	faligndata %d0, %d2, %d8
+	std	%d8, [%i0]
+	blu,pn	%ncc, blkdone
+	add	%i0, 8, %i0
+	ldd	[%l7], %d0
+	add	%l7, 8, %l7
+	subcc	%i4, 8, %i4
+	faligndata %d2, %d0, %d8
+	std	%d8, [%i0]
+	bgeu,pt	%ncc, blkleft
+	add	%i0, 8, %i0
+
+blkdone:
+	tst	%i2
+	bz,pt 	%ncc, blkexit
+	and	%l3, 0x4, %l3		! fprs.du = fprs.dl = 0
+
+7:      ldub    [%i1], %i4
+        inc     %i1
+        inc     %i0
+        deccc   %i2
+        bgu  	%ncc, 7b
+        stb     %i4, [%i0 - 1]
+	
+blkexit:
+        and     %l3, 0x4, %l3           ! fprs.du = fprs.dl = 0
+	wr      %l3, %g0, %fprs         ! fprs = l3 - restore fprs.fef
+	membar  #StoreLoad|#StoreStore
+	ret
+	restore %i5, %g0, %o0
+
+	SET_SIZE(memcpy)
+	SET_SIZE(__align_cpy_1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/common/memset.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,226 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memset.s"
+
+/*
+ * char *memset(sp, c, n)
+ *
+ * Set an array of n chars starting at sp to the character c.
+ * Return sp.
+ *
+ * Fast assembler language version of the following C-program for memset
+ * which represents the `standard' for the C-library.
+ *
+ *	void *
+ *	memset(void *sp1, int c, size_t n)
+ *	{
+ *	    if (n != 0) {
+ *		char *sp = sp1;
+ *		do {
+ *		    *sp++ = (char)c;
+ *		} while (--n != 0);
+ *	    }
+ *	    return (sp1);
+ *	}
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/sun4asi.h>
+
+	ANSI_PRAGMA_WEAK(memset,function)
+
+#define	ALIGN8(X)	(((X) + 7) & ~7)
+
+	.section        ".text"
+	.align 32
+
+	ENTRY(memset)
+	cmp	%o2, 12			! if small counts, just write bytes
+	bgeu,pn	%ncc, .wrbig
+	mov	%o0, %o5		! copy sp1 before using it
+
+.wrchar:
+	deccc   %o2			! byte clearing loop
+        inc     %o5
+	bgeu,a,pt %ncc, .wrchar
+        stb     %o1, [%o5 + -1]         ! we've already incremented the address
+
+        retl
+	.empty	! next instruction is safe, %o0 still good
+
+.wrbig:
+        andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
+        bz,pt	%ncc, .blkchk		! already double aligned
+	and	%o1, 0xff, %o1		! o1 is (char)c
+        sub	%o3, 8, %o3		! -(bytes till double aligned)
+        add	%o2, %o3, %o2		! update o2 with new count
+
+	! Set -(%o3) bytes till sp1 double aligned
+1:	stb	%o1, [%o5]		! there is at least 1 byte to set
+	inccc	%o3			! byte clearing loop 
+        bl,pt	%ncc, 1b
+        inc	%o5 
+
+	
+	! Now sp1 is double aligned (sp1 is found in %o5)
+.blkchk:
+	sll     %o1, 8, %o3
+        or      %o1, %o3, %o1		! now o1 has 2 bytes of c
+
+        sll     %o1, 16, %o3
+        or      %o1, %o3, %o1		! now o1 has 4 bytes of c
+	
+	cmp     %o2, 4095		! if large count use Block ld/st
+	
+	sllx	%o1, 32, %o3
+	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
+
+        bgu,a,pn %ncc, .blkwr		! Do block write for large count
+        andcc   %o5, 63, %o3            ! is sp1 block aligned?
+	
+	and	%o2, 24, %o3		! o3 is {0, 8, 16, 24}
+
+1:	subcc	%o3, 8, %o3		! double-word loop
+	add	%o5, 8, %o5
+	bgeu,a,pt %ncc, 1b
+	stx	%o1, [%o5 - 8]		! already incremented the address
+
+	andncc	%o2, 31, %o4		! o4 has 32 byte aligned count
+	bz,pn	%ncc, 3f		! First instruction of icache line
+2:
+	subcc	%o4, 32, %o4		! main loop, 32 bytes per iteration
+	stx	%o1, [%o5 - 8]
+	stx	%o1, [%o5]
+	stx	%o1, [%o5 + 8]
+	stx	%o1, [%o5 + 16]
+	bnz,pt	%ncc, 2b
+	add	%o5, 32, %o5
+
+3:	
+	and	%o2, 7, %o2		! o2 has the remaining bytes (<8)
+
+4:
+	deccc   %o2                     ! byte clearing loop
+        inc     %o5
+        bgeu,a,pt %ncc, 4b
+        stb     %o1, [%o5 - 9]		! already incremented the address
+
+	retl
+	nop				! %o0 still preserved
+
+.blkwr:
+        bz,pn   %ncc, .blalign		! now block aligned
+        sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
+	add	%o2, %o3, %o2		! o2 is the remainder
+
+        ! Store -(%o3) bytes till dst is block (64 byte) aligned.
+        ! Use double word stores.
+	! Recall that dst is already double word aligned
+1:
+        stx     %o1, [%o5]
+	addcc   %o3, 8, %o3
+	bl,pt	%ncc, 1b
+	add     %o5, 8, %o5
+
+	! sp1 is block aligned                                     
+.blalign:
+        rd      %fprs, %g1              ! g1 = fprs
+
+	and	%o2, 63, %o3		! calc bytes left after blk store.
+
+	andcc	%g1, 0x4, %g1		! fprs.du = fprs.dl = 0
+	bz,a	%ncc, 2f		! Is fprs.fef == 0 
+        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
+2:
+	brnz,pn	%o1, 3f			! %o1 is safe to check all 64-bits
+	andn	%o2, 63, %o4		! calc size of blocks in bytes
+	fzero   %d0
+	fzero   %d2
+	fzero   %d4
+	fzero   %d6
+	fmuld   %d0, %d0, %d8
+	fzero   %d10
+	ba	4f
+	fmuld   %d0, %d0, %d12
+
+3:
+	! allocate 8 bytes of scratch space on the stack
+	add	%sp, -SA(16), %sp
+	stx	%o1, [%sp + STACK_BIAS + ALIGN8(MINFRAME)]  ! move %o1 to %d0
+	ldd	[%sp + STACK_BIAS + ALIGN8(MINFRAME)], %d0
+
+	fmovd	%d0, %d2
+	add	%sp, SA(16), %sp	! deallocate the scratch space
+	fmovd	%d0, %d4	
+	fmovd	%d0, %d6	
+	fmovd	%d0, %d8
+	fmovd	%d0, %d10	
+	fmovd	%d0, %d12	
+4:	
+	fmovd	%d0, %d14
+	
+	! 1st quadrant has 64 bytes of c
+	! instructions 32-byte aligned here
+
+        stda    %d0, [%o5]ASI_BLK_P
+        subcc   %o4, 64, %o4
+        bgu,pt	%ncc, 4b
+        add     %o5, 64, %o5
+
+	! Set the remaining doubles
+	subcc   %o3, 8, %o3		! Can we store any doubles?
+	blu,pn  %ncc, 6f
+	and	%o2, 7, %o2		! calc bytes left after doubles
+
+5:	
+	std     %d0, [%o5]		! store the doubles
+	subcc   %o3, 8, %o3
+	bgeu,pt	%ncc, 5b
+        add     %o5, 8, %o5      
+6:
+	! Set the remaining bytes
+	brz	%o2, .exit		! safe to check all 64-bits
+	
+#if 0
+	! Terminate the copy with a partial store. (bug 1200071 does not apply)
+	! The data should be at d0
+        dec     %o2                     ! needed to get the mask right
+	edge8n	%g0, %o2, %o4
+	stda	%d0, [%o5]%o4, ASI_PST8_P
+#else
+7:	
+	deccc	%o2
+	stb	%o1, [%o5]
+	bgu,pt	%ncc, 7b
+	inc	%o5
+#endif
+	
+.exit:	
+        membar  #StoreLoad|#StoreStore
+        retl				! %o0 was preserved
+        wr	%g1, %g0, %fprs         ! fprs = g1  restore fprs
+
+	SET_SIZE(memset)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusa -warn
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4u/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9a
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4v
+GEN_PLATFORM =	sun4v
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o memset.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/include/v9
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
+		-DNIAGARA_IMPL
+ASFLAGS =	-P -K pic
+
+# memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
+# a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
+# the same address is compromised.  The result is .SUNW_dynsymsort: duplicate
+# symbol errors from check_rtime.  Use elfedit to assign a weak binding.
+
+POST_PROCESS_OBJCAP_O =	elfedit -e "sym:st_bind __align_cpy_1 STB_WEAK" $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,42 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v-hwcap1 {
+	MACHINE = sun4v;
+	HW += ASI_BLK_INIT;
+};
+
+SYMBOL_SCOPE {
+	global:
+		__align_cpy_1;
+		_memcpy;
+		_memmove;
+		_memset;
+		memcpy;
+		memmove;
+		memset;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plus
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+TRG_PLATFORM =	sun4v
+GEN_PLATFORM =	sun4v
+
+include		../../Makefile.com
+
+OBJECTS =	memcpy.o
+
+include		$(SRC)/lib/Makefile.lib
+
+IFLAGS =	-I$(SRC)/uts/$(GEN_PLATFORM) \
+		-I$(ROOT)/usr/platform/sun4v/include \
+		-I$(ROOT)/usr/include/v9
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
+		-DNIAGARA2_IMPL
+ASFLAGS =	-P -K pic
+
+# memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
+# a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
+# the same address is compromised.  The result is .SUNW_dynsymsort: duplicate
+# symbol errors from check_rtime.  Use elfedit to assign a weak binding.
+
+POST_PROCESS_OBJCAP_O =	elfedit -e "sym:st_bind __align_cpy_1 STB_WEAK" $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v-hwcap2 {
+	MACHINE = sun4v;
+	HW += ASI_BLK_INIT VIS;
+};
+
+SYMBOL_SCOPE {
+	global:
+		__align_cpy_1;
+		_memcpy;
+		_memmove;
+		memcpy;
+		memmove;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusa
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9a
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v/common/memcpy.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,2571 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memcpy.s"
+
+/*
+ * memcpy(s1, s2, len)
+ *
+ * Copy s2 to s1, always copy n bytes.
+ * Note: this C code does not work for overlapped copies.
+ *       Memmove() and bcopy() do.
+ *
+ * Added entry __align_cpy_1 is generally for use of the compilers.
+ *
+ * Fast assembler language version of the following C-program for memcpy
+ * which represents the `standard' for the C-library.
+ *
+ *	void *
+ *	memcpy(void *s, const void *s0, size_t n)
+ *	{
+ *		if (n != 0) {
+ *		    char *s1 = s;
+ *		    const char *s2 = s0;
+ *		    do {
+ *			*s1++ = *s2++;
+ *		    } while (--n != 0);
+ *		}
+ *		return (s);
+ *	}
+ *
+ *
+ * N1 Flow :
+ *
+ * if (count < 17) {
+ *	Do the byte copy
+ *	Return destination address
+ * }
+ * if (count < 128) {
+ *	Is source aligned on word boundary
+ *	If no then align source on word boundary then goto .ald
+ *	If yes goto .ald
+ *	.ald:
+ *		Is destination aligned on word boundary
+ *		Depending on destination offset (last 2 bits of destination)
+ *		copy data by shifting and merging.
+ *		Copy residue bytes as byte copy
+ *		Return destination address
+ * } else {
+ *	Align destination on block boundary
+ *	Depending on the source offset (last 4 bits of source address) align
+ *	the data and store to destination. Both the load and store are done
+ *	using ASI_BLK_INIT_ST_QUAD_LDD_P.
+ *	For remaining count copy as much data in 8-byte chunk from source to
+ *	destination.
+ *	Followed by trailing copy using byte copy.
+ *	Return saved destination address
+ * }
+ *
+ *
+ * N2 Flow :
+ * Flow :
+ *
+ * if (count < 128) {
+ *   if count < 3
+ *	copy bytes; exit with dst addr
+ *   if src & dst aligned on word boundary but not long word boundary,
+ *     copy with ldw/stw; branch to finish_up
+ *   if src & dst aligned on long word boundary
+ *     copy with ldx/stx; branch to finish_up
+ *   if src & dst not aligned and length <= 14
+ *     copy bytes; exit with dst addr
+ *   move enough bytes to get src to word boundary
+ *   if dst now on word boundary
+ * move_words:
+ *     copy words; branch to finish_up
+ *   if dst now on half word boundary
+ *     load words, shift half words, store words; branch to finish_up
+ *   if dst on byte 1
+ *     load words, shift 3 bytes, store words; branch to finish_up
+ *   if dst on byte 3
+ *     load words, shift 1 byte, store words; branch to finish_up
+ * finish_up:
+ *     copy bytes; exit with dst addr
+ * } else {                                         More than 128 bytes
+ *   move bytes until dst is on long word boundary
+ *   if( src is on long word boundary ) {
+ *     if (count < 512) {
+ * finish_long:				           src/dst aligned on 8 bytes
+ *       copy with ldx/stx in 8-way unrolled loop;
+ *       copy final 0-63 bytes; exit with dst addr
+ *     } else {                                 src/dst aligned; count > 512
+ *       align dst on 64 byte boundary; use 8-way test for each of 8 possible
+ *       src alignments relative to a 64 byte boundary to select the
+ *       16-way unrolled loop to use for
+ *       block load, fmovd, block-init-store, block-store, fmovd operations
+ *       then go to finish_long.
+ *     }
+ *   } else {                                   src/dst not aligned on 8 bytes
+ *     if src is word aligned and count < 512
+ *       move words in 8-way unrolled loop
+ *       move final 0-31 bytes; exit with dst addr
+ *     if count < 512
+ *       use alignaddr/faligndata combined with ldd/std in 8-way
+ *       unrolled loop to move data.
+ *       go to unalign_done
+ *     else
+ *       setup alignaddr for faligndata instructions
+ *       align dst on 64 byte boundary; use 8-way test for each of 8 possible
+ *       src alignments to nearest long word relative to 64 byte boundary to
+ *       select the 8-way unrolled loop to use for
+ *       block load, falign, fmovd, block-init-store, block-store loop
+ *	 (only use block-init-store when src/dst on 8 byte boundaries.)
+ * unalign_done:
+ *       move remaining bytes for unaligned cases. exit with dst addr.
+ * }
+ *
+ * Comment on N2 memmove and memcpy common code and block-store-init:
+ *   In the man page for memmove, it specifies that copying will take place
+ *   correctly between objects that overlap.  For memcpy, behavior is
+ *   undefined for objects that overlap.
+ *
+ *   In rare cases, some multi-threaded applications may attempt to examine
+ *   the copy destination buffer during the copy. Using the block-store-init
+ *   instruction allows those applications to observe zeros in some
+ *   cache lines of the destination buffer for narrow windows. But the
+ *   the block-store-init provides memory throughput advantages for many
+ *   common applications. To meet both needs, those applications which need
+ *   the destination buffer to retain meaning during the copy should use
+ *   memmove instead of memcpy.  The memmove version duplicates the memcpy
+ *   algorithms except the memmove version does not use block-store-init
+ *   in those cases where memcpy does use block-store-init. Otherwise, when
+ *   memmove can determine the source and destination do not overlap,
+ *   memmove shares the memcpy code.
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/niagaraasi.h>
+#include <sys/asi.h>
+#include <sys/trap.h>
+
+/* documented name for primary block initializing store */
+#define	ASI_STBI_P	ASI_BLK_INIT_ST_QUAD_LDD_P
+
+#define	BLOCK_SIZE	64
+#define	FPRS_FEF	0x4
+
+#define	SHORTCOPY	3
+#define	SHORTCHECK	14
+#define	SHORT_LONG	64	/* max copy for short longword-aligned case */
+				/* must be at least 32 */
+#define	SMALL_MAX	128
+#define	MED_UMAX	512	/* max copy for medium un-aligned case */
+#define	MED_WMAX	512	/* max copy for medium word-aligned case */
+#define	MED_MAX		512	/* max copy for medium longword-aligned case */
+
+#ifdef NIAGARA2_IMPL
+#include <sys/sun4asi.h>
+
+#else	/* NIAGARA2_IMPL */
+/*
+ * This define is to align data for the unaligned source cases.
+ * The data1, data2 and data3 is merged into data1 and data2.
+ * The data3 is preserved for next merge.
+ */
+#define	ALIGN_DATA(data1, data2, data3, lshift, rshift, tmp)	\
+	sllx	data1, lshift, data1				;\
+	srlx	data2, rshift, tmp				;\
+	or	data1, tmp, data1				;\
+	sllx	data2, lshift, data2				;\
+	srlx	data3, rshift, tmp				;\
+	or	data2, tmp, data2
+/*
+ * Align the data. Merge the data1 and data2 into data1.
+ */
+#define	ALIGN_DATA_EW(data1, data2, lshift, rshift, tmp)	\
+	sllx	data1, lshift, data1				;\
+	srlx	data2, rshift, tmp				;\
+	or	data1, tmp, data1
+#endif	/* NIAGARA2_IMPL */
+
+
+	ANSI_PRAGMA_WEAK(memmove,function)
+	ANSI_PRAGMA_WEAK(memcpy,function)
+
+	ENTRY(memmove)
+	cmp	%o1, %o0	! if from address is >= to use forward copy
+	bgeu,pn	%ncc, .forcpy	! else use backward if ...
+	sub	%o0, %o1, %o4	! get difference of two addresses
+	cmp	%o2, %o4	! compare size and difference of addresses
+	bleu,pn	%ncc, .forcpy	! if size is bigger, do overlapped copy
+	add	%o1, %o2, %o5	! get to end of source space
+
+	!
+	! an overlapped copy that must be done "backwards"
+	!
+.chksize:
+	cmp	%o2, 8			! less than 8 byte do byte copy
+	blu,pt %ncc, 2f			! else continue
+
+	! Now size is bigger than 8
+.dbalign:
+	add	%o0, %o2, %g1		! get to end of dest space
+	andcc	%g1, 7, %o3		! %o3 has bytes till dst 8 bytes aligned
+	bz,a,pn	%ncc, .dbbck		! if dst is not 8 byte aligned: align it
+	andn	%o2, 7, %o3		! %o3 count is multiple of 8 bytes size
+	sub	%o2, %o3, %o2		! update o2 with new count
+
+1:	dec	%o5			! decrement source
+	ldub	[%o5], %g1		! load one byte
+	deccc	%o3			! decrement count
+	bgu,pt	%ncc, 1b		! if not done keep copying
+	stb	%g1, [%o5+%o4]		! store one byte into dest
+	andncc	%o2, 7, %o3		! %o3 count is multiple of 8 bytes size
+	bz,pn	%ncc, 2f		! if size < 8, move to byte copy
+
+	! Now Destination is 8 byte aligned
+.dbbck:
+	andcc	%o5, 7, %o0		! %o0 has src offset
+	bz,a,pn	%ncc, .dbcopybc		! if src is aligned to fast mem move
+	sub	%o2, %o3, %o2		! Residue bytes in %o2
+
+.cpy_dbwdbc:				! alignment of src is needed
+	sub	%o2, 8, %o2		! set size one loop ahead
+	sll	%o0, 3, %g1		! %g1 is left shift
+	mov	64, %g5			! init %g5 to be 64
+	sub	%g5, %g1, %g5		! %g5 right shift = (64 - left shift)
+	sub	%o5, %o0, %o5		! align the src at 8 bytes.
+	add	%o4, %o0, %o4		! increase difference between src & dst
+	ldx	[%o5], %o1		! load first 8 bytes
+	srlx	%o1, %g5, %o1
+1:	sub	%o5, 8, %o5		! subtract 8 from src
+	ldx	[%o5], %o0		! load 8 byte
+	sllx	%o0, %g1, %o3		! shift loaded 8 bytes left into tmp reg
+	or	%o1, %o3, %o3		! align data
+	stx	%o3, [%o5+%o4]		! store 8 byte
+	subcc	%o2, 8, %o2		! subtract 8 byte from size
+	bg,pt	%ncc, 1b		! if size > 0 continue
+	srlx	%o0, %g5, %o1		! move extra byte for the next use
+
+	srl	%g1, 3, %o0		! retsote %o0 value for alignment
+	add	%o5, %o0, %o5		! restore src alignment
+	sub	%o4, %o0, %o4		! restore difference between src & dest
+
+	ba	2f			! branch to the trailing byte copy
+	add	%o2, 8, %o2		! restore size value
+
+.dbcopybc:				! alignment of src is not needed
+1:	sub	%o5, 8, %o5		! subtract from src
+	ldx	[%o5], %g1		! load 8 bytes
+	subcc	%o3, 8, %o3		! subtract from size
+	bgu,pt	%ncc, 1b		! if size is bigger 0 continue
+	stx	%g1, [%o5+%o4]		! store 8 bytes to destination
+
+	ba	2f
+	nop
+
+.bcbyte:
+1:	ldub	[%o5], %g1		! load one byte
+	stb	%g1, [%o5+%o4]		! store one byte
+2:	deccc	%o2			! decrement size
+	bgeu,a,pt %ncc, 1b		! if size is >= 0 continue
+	dec	%o5			! decrement from address
+
+.exitbc:				! exit from backward copy
+	retl
+	add	%o5, %o4, %o0		! restore dest addr
+
+#ifdef NIAGARA2_IMPL
+	!
+	! Check to see if memmove is large aligned copy
+	! If so, use special version of copy that avoids
+	! use of block store init
+	!
+.forcpy:
+	cmp	%o2, SMALL_MAX		! check for not small case
+	blt,pn	%ncc, .mv_short		! merge with memcpy
+	mov	%o0, %g1		! save %o0
+	neg	%o0, %o5
+	andcc	%o5, 7, %o5		! bytes till DST 8 byte aligned
+	brz,pt	%o5, .mv_dst_aligned_on_8
+
+	! %o5 has the bytes to be written in partial store.
+	sub	%o2, %o5, %o2
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+7:					! dst aligning loop
+	ldub	[%o1+%o0], %o4		! load one byte
+	subcc	%o5, 1, %o5
+	stb	%o4, [%o0]
+	bgu,pt	%ncc, 7b
+	add	%o0, 1, %o0		! advance dst
+	add	%o1, %o0, %o1		! restore %o1
+.mv_dst_aligned_on_8:
+	andcc	%o1, 7, %o5
+	brnz,pt	%o5, .src_dst_unaligned_on_8
+	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
+
+.mv_src_dst_aligned_on_8:
+	! check if we are copying MED_MAX or more bytes
+	cmp	%o2, MED_MAX		! limit to store buffer size
+	bleu,pt	%ncc, .medlong
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+
+/*
+ * The following memmove code mimics the memcpy code for large aligned copies,
+ * but does not use the ASI_STBI_P (block initializing store) performance
+ * optimization. See memmove rationale section in documentation
+ */
+.mv_large_align8_copy:			! Src and dst share 8 byte alignment
+	rd	%fprs, %g5		! check for unused fp
+	! if fprs.fef == 0, set it.
+	! Setting it when already set costs more than checking
+	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
+	bz,a	%ncc, 1f
+	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
+1:
+	! align dst to 64 byte boundary
+	andcc	%o0, 0x3f, %o3		! %o3 == 0 means dst is 64 byte aligned
+	brz,pn	%o3, .mv_aligned_on_64
+	sub	%o3, 64, %o3		! %o3 has negative bytes to move
+	add	%o2, %o3, %o2		! adjust remaining count
+.mv_align_to_64:
+	ldx	[%o1], %o4
+	add	%o1, 8, %o1		! increment src ptr
+	addcc	%o3, 8, %o3
+	stx	%o4, [%o0]
+	brnz,pt	%o3, .mv_align_to_64
+	add	%o0, 8, %o0		! increment dst ptr
+
+.mv_aligned_on_64:
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+	mov	%asi,%o4		! save %asi
+	! Determine source alignment
+	! to correct 8 byte offset
+	andcc	%o1, 0x20, %o3
+	brnz,pn	%o3, .mv_align_1
+	mov	ASI_BLK_P, %asi		! setup %asi for block load/store
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .mv_align_01
+	nop
+	andcc	%o1, 0x08, %o3
+	brz,pn	%o3, .mv_align_000
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.mv_align_001
+	nop
+.mv_align_01:
+	andcc	%o1, 0x08, %o3
+	brnz,pn	%o3, .mv_align_011
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.mv_align_010
+	nop
+.mv_align_1:
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .mv_align_11
+	nop
+	andcc	%o1, 0x08, %o3
+	brnz,pn	%o3, .mv_align_101
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.mv_align_100
+	nop
+.mv_align_11:
+	andcc	%o1, 0x08, %o3
+	brz,pn	%o3, .mv_align_110
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+.mv_align_111:
+! Alignment off by 8 bytes
+	ldd	[%o1], %d0
+	add	%o1, 8, %o1
+	sub	%o2, 8, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_111_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d2
+	fmovd	%d18, %d4
+	fmovd	%d20, %d6
+	fmovd	%d22, %d8
+	fmovd	%d24, %d10
+	fmovd	%d26, %d12
+	fmovd	%d28, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d0
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d2
+	fmovd	%d18, %d4
+	fmovd	%d20, %d6
+	fmovd	%d22, %d8
+	fmovd	%d24, %d10
+	fmovd	%d26, %d12
+	fmovd	%d28, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d30, %d0
+	bgt,pt	%ncc, .mv_align_111_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	ba	.remain_stuff
+	add	%o0, 8, %o0
+	! END OF mv_align_111
+
+.mv_align_110:
+! Alignment off by 16 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	add	%o1, 16, %o1
+	sub	%o2, 16, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_110_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d4
+	fmovd	%d18, %d6
+	fmovd	%d20, %d8
+	fmovd	%d22, %d10
+	fmovd	%d24, %d12
+	fmovd	%d26, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d28, %d0
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d2
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d4
+	fmovd	%d18, %d6
+	fmovd	%d20, %d8
+	fmovd	%d22, %d10
+	fmovd	%d24, %d12
+	fmovd	%d26, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d28, %d0
+	fmovd	%d30, %d2
+	bgt,pt	%ncc, .mv_align_110_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	ba	.remain_stuff
+	add	%o0, 16, %o0
+	! END OF mv_align_110
+
+.mv_align_101:
+! Alignment off by 24 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	add	%o1, 24, %o1
+	sub	%o2, 24, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_101_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d6
+	fmovd	%d18, %d8
+	fmovd	%d20, %d10
+	fmovd	%d22, %d12
+	fmovd	%d24, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d26, %d0
+	fmovd	%d28, %d2
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d4
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d6
+	fmovd	%d18, %d8
+	fmovd	%d20, %d10
+	fmovd	%d22, %d12
+	fmovd	%d24, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d26, %d0
+	fmovd	%d28, %d2
+	fmovd	%d30, %d4
+	bgt,pt	%ncc, .mv_align_101_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	ba	.remain_stuff
+	add	%o0, 24, %o0
+	! END OF mv_align_101
+
+.mv_align_100:
+! Alignment off by 32 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16],%d4
+	ldd	[%o1+24],%d6
+	add	%o1, 32, %o1
+	sub	%o2, 32, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_100_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d8
+	fmovd	%d18, %d10
+	fmovd	%d20, %d12
+	fmovd	%d22, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d24, %d0
+	fmovd	%d26, %d2
+	fmovd	%d28, %d4
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d6
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d8
+	fmovd	%d18, %d10
+	fmovd	%d20, %d12
+	fmovd	%d22, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d24, %d0
+	fmovd	%d26, %d2
+	fmovd	%d28, %d4
+	fmovd	%d30, %d6
+	bgt,pt	%ncc, .mv_align_100_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	ba	.remain_stuff
+	add	%o0, 32, %o0
+	! END OF mv_align_100
+
+.mv_align_011:
+! Alignment off by 40 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	add	%o1, 40, %o1
+	sub	%o2, 40, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_011_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d10
+	fmovd	%d18, %d12
+	fmovd	%d20, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d22, %d0
+	fmovd	%d24, %d2
+	fmovd	%d26, %d4
+	fmovd	%d28, %d6
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d8
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d10
+	fmovd	%d18, %d12
+	fmovd	%d20, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d22, %d0
+	fmovd	%d24, %d2
+	fmovd	%d26, %d4
+	fmovd	%d28, %d6
+	fmovd	%d30, %d8
+	bgt,pt	%ncc, .mv_align_011_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	ba	.remain_stuff
+	add	%o0, 40, %o0
+	! END OF mv_align_011
+
+.mv_align_010:
+! Alignment off by 48 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	ldd	[%o1+40], %d10
+	add	%o1, 48, %o1
+	sub	%o2, 48, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_010_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d12
+	fmovd	%d18, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d20, %d0
+	fmovd	%d22, %d2
+	fmovd	%d24, %d4
+	fmovd	%d26, %d6
+	fmovd	%d28, %d8
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d10
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d12
+	fmovd	%d18, %d14
+	add	%o1, 128, %o1	! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d20, %d0
+	fmovd	%d22, %d2
+	fmovd	%d24, %d4
+	fmovd	%d26, %d6
+	fmovd	%d28, %d8
+	fmovd	%d30, %d10
+	bgt,pt	%ncc, .mv_align_010_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	std	%d10, [%o0+40]
+	ba	.remain_stuff
+	add	%o0, 48, %o0
+	! END OF mv_align_010
+
+.mv_align_001:
+! Alignment off by 56 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	ldd	[%o1+40], %d10
+	ldd	[%o1+48], %d12
+	add	%o1, 56, %o1
+	sub	%o2, 56, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_001_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d14
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d18, %d0
+	fmovd	%d20, %d2
+	fmovd	%d22, %d4
+	fmovd	%d24, %d6
+	fmovd	%d26, %d8
+	fmovd	%d28, %d10
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d12
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d14
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d18, %d0
+	fmovd	%d20, %d2
+	fmovd	%d22, %d4
+	fmovd	%d24, %d6
+	fmovd	%d26, %d8
+	fmovd	%d28, %d10
+	fmovd	%d30, %d12
+	bgt,pt	%ncc, .mv_align_001_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	std	%d10, [%o0+40]
+	std	%d12, [%o0+48]
+	ba	.remain_stuff
+	add	%o0, 56, %o0
+	! END OF mv_align_001
+
+.mv_align_000:
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.mv_align_000_loop:
+	/* ---- copy line 1 of 2. ---- */
+	subcc	%o5, 128, %o5
+	ldda	[%o1]%asi,%d0
+	stda	%d0,[%o0]%asi
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+
+	/* ---- copy line 2 of 2. ---- */
+	add	%o0, 64, %o0
+	ldda	[%o1+64]%asi,%d0
+	add	%o1, 128, %o1		! increment src
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! increment dst
+	bgt,pt	%ncc, .mv_align_000_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.remain_stuff
+	nop
+
+	! END OF mv_align_000
+#else	/* NIAGARA2_IMPL */
+#endif	/* NIAGARA2_IMPL */
+
+	SET_SIZE(memmove)
+
+	ENTRY(memcpy)
+	ENTRY(__align_cpy_1)
+#ifdef NIAGARA2_IMPL
+	cmp	%o2, SMALL_MAX		! check for not small case
+	bgeu,pn	%ncc, .medium		! go to larger cases
+	mov	%o0, %g1		! save %o0
+.mv_short:
+	cmp	%o2, SHORTCOPY		! check for really short case
+	ble,pt	%ncc, .smallfin
+	or	%o0, %o1, %o4		! prepare alignment check
+	andcc	%o4, 0x3, %o5		! test for alignment
+	bz,pt	%ncc, .smallword	! branch to word aligned case
+	cmp	%o2, SHORTCHECK
+	ble,pt	%ncc, .smallrest
+	andcc	%o1, 0x3, %o5		! is src word aligned
+	bz,pn	%ncc, .aldst
+	cmp	%o5, 2			! is src half-word aligned
+	be,pt	%ncc, .s2algn
+	cmp	%o5, 3			! src is byte aligned
+.s1algn:ldub	[%o1], %o3		! move 1 or 3 bytes to align it
+	inc	1, %o1
+	stb	%o3, [%o0]		! move a byte to align src
+	inc	1, %o0
+	bne,pt	%ncc, .s2algn
+	dec	%o2
+	b	.ald			! now go align dest
+	andcc	%o0, 0x3, %o5
+
+.s2algn:lduh	[%o1], %o3		! know src is 2 byte aligned
+	inc	2, %o1
+	srl	%o3, 8, %o4
+	stb	%o4, [%o0]		! have to do bytes,
+	stb	%o3, [%o0 + 1]		! don't know dst alignment
+	inc	2, %o0
+	dec	2, %o2
+
+.aldst:	andcc	%o0, 0x3, %o5		! align the destination address
+.ald:	bz,pn	%ncc, .w4cp
+	cmp	%o5, 2
+	be,pn	%ncc, .w2cp
+	cmp	%o5, 3
+.w3cp:	lduw	[%o1], %o4
+	inc	4, %o1
+	srl	%o4, 24, %o5
+	stb	%o5, [%o0]
+	bne,pt	%ncc, .w1cp
+	inc	%o0
+	dec	1, %o2
+	andn	%o2, 3, %o3		! %o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+
+1:	sll	%o4, 8, %g5		! save residual bytes
+	lduw	[%o1+%o0], %o4
+	deccc	4, %o3
+	srl	%o4, 24, %o5		! merge with residual
+	or	%o5, %g5, %g5
+	st	%g5, [%o0]
+	bnz,pt	%ncc, 1b
+	inc	4, %o0
+	sub	%o1, 3, %o1		! used one byte of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w1cp:	srl	%o4, 8, %o5
+	sth	%o5, [%o0]
+	inc	2, %o0
+	dec	3, %o2
+	andn	%o2, 3, %o3		! %o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+
+2:	sll	%o4, 24, %g5		! save residual bytes
+	lduw	[%o1+%o0], %o4
+	deccc	4, %o3
+	srl	%o4, 8, %o5		! merge with residual
+	or	%o5, %g5, %g5
+	st	%g5, [%o0]
+	bnz,pt	%ncc, 2b
+	inc	4, %o0
+	sub	%o1, 1, %o1		! used three bytes of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w2cp:	lduw	[%o1], %o4
+	inc	4, %o1
+	srl	%o4, 16, %o5
+	sth	%o5, [%o0]
+	inc	2, %o0
+	dec	2, %o2
+	andn	%o2, 3, %o3		! %o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+
+3:	sll	%o4, 16, %g5		! save residual bytes
+	lduw	[%o1+%o0], %o4
+	deccc	4, %o3
+	srl	%o4, 16, %o5		! merge with residual
+	or	%o5, %g5, %g5
+	st	%g5, [%o0]
+	bnz,pt	%ncc, 3b
+	inc	4, %o0
+	sub	%o1, 2, %o1		! used two bytes of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w4cp:	andn	%o2, 3, %o3		! %o3 is aligned word count
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+
+1:	lduw	[%o1+%o0], %o4		! read from address
+	deccc	4, %o3			! decrement count
+	st	%o4, [%o0]		! write at destination address
+	bgu,pt	%ncc, 1b
+	inc	4, %o0			! increment to address
+	and	%o2, 3, %o2		! number of leftover bytes, if any
+
+	! simple finish up byte copy, works with any alignment
+7:
+	add	%o1, %o0, %o1		! restore %o1
+.smallrest:
+	tst	%o2
+	bz,pt	%ncc, .smallx
+	cmp	%o2, 4
+	blt,pt	%ncc, .smallleft3
+	nop
+	sub	%o2, 3, %o2
+.smallnotalign4:
+	ldub	[%o1], %o3		! read byte
+	subcc	%o2, 4, %o2		! reduce count by 4
+	stb	%o3, [%o0]		! write byte
+	ldub	[%o1+1], %o3		! repeat for total of 4 bytes
+	add	%o1, 4, %o1		! advance SRC by 4
+	stb	%o3, [%o0+1]
+	ldub	[%o1-2], %o3
+	add	%o0, 4, %o0		! advance DST by 4
+	stb	%o3, [%o0-2]
+	ldub	[%o1-1], %o3
+	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
+	stb	%o3, [%o0-1]
+	addcc	%o2, 3, %o2		! restore count
+	bz,pt	%ncc, .smallx
+.smallleft3:				! 1, 2, or 3 bytes remain
+	subcc	%o2, 1, %o2
+	ldub	[%o1], %o3		! load one byte
+	bz,pt	%ncc, .smallx
+	stb	%o3, [%o0]		! store one byte
+	ldub	[%o1+1], %o3		! load second byte
+	subcc	%o2, 1, %o2
+	bz,pt	%ncc, .smallx
+	stb	%o3, [%o0+1]		! store second byte
+	ldub	[%o1+2], %o3		! load third byte
+	stb	%o3, [%o0+2]		! store third byte
+.smallx:
+	retl
+	mov	%g1, %o0		! restore %o0
+
+.smallfin:
+	tst	%o2
+	bnz,pt	%ncc, .smallleft3
+	nop
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align 16
+.smallwords:
+	lduw	[%o1], %o3		! read word
+.smallwordx:
+	subcc	%o2, 8, %o2		! update count
+	stw	%o3, [%o0]		! write word
+	add	%o1, 8, %o1		! update SRC
+	lduw	[%o1-4], %o3		! read word
+	add	%o0, 8, %o0		! update DST
+	bgu,pt	%ncc, .smallwords	! loop until done
+	stw	%o3, [%o0-4]		! write word
+	addcc	%o2, 7, %o2		! restore count
+	bz,pt	%ncc, .smallexit	! check for completion
+	cmp	%o2, 4			! check for 4 or more bytes left
+	blt	%ncc, .smallleft3	! if not, go to finish up
+	nop
+	lduw	[%o1], %o3
+	add	%o1, 4, %o1
+	subcc	%o2, 4, %o2
+	add	%o0, 4, %o0
+	bnz,pt	%ncc, .smallleft3
+	stw	%o3, [%o0-4]
+	retl
+	mov	%g1, %o0		! restore %o0
+
+! 8 or more bytes, src and dest start on word boundary
+! %o4 contains or %o0, %o1; %o3 contains first four bytes of src
+.smalllong:
+	andcc	%o4, 0x7, %o5		! test for long alignment
+	bnz,pt	%ncc, .smallwordx	! branch to word aligned case
+	cmp	%o2, SHORT_LONG-7
+	bge,a	%ncc, .medl64		! if we branch
+	sub	%o2,56,%o2		! adjust %o2 to -31 off count
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+.small_long_l:
+	ldx	[%o1+%o0], %o3
+	subcc	%o2, 8, %o2
+	add	%o0, 8, %o0
+	bgu,pt	%ncc, .small_long_l	! loop until done
+	stx	%o3, [%o0-8]		! write word
+	add	%o1, %o0, %o1		! restore %o1
+	addcc	%o2, 7, %o2		! restore %o2 to correct count
+	bz,pt	%ncc, .smallexit	! check for completion
+	cmp	%o2, 4			! check for 4 or more bytes left
+	blt,pt	%ncc, .smallleft3	! if not, go to finish up
+	nop
+	lduw	[%o1], %o3
+	add	%o1, 4, %o1
+	subcc	%o2, 4, %o2
+	stw	%o3, [%o0]
+	add	%o0, 4, %o0
+	bnz,pt	%ncc, .smallleft3
+	nop
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align 16
+! src and dest start on word boundary
+.smallword:
+	subcc	%o2, 7, %o2		! adjust count
+	bgu,pt	%ncc, .smalllong
+	lduw	[%o1], %o3		! read word
+	addcc	%o2, 3, %o2		! restore count
+	bz,pt	%ncc, .smallexit
+	stw	%o3, [%o0]		! write word
+	deccc	%o2			! reduce count for cc test
+	ldub	[%o1+4], %o3		! load one byte
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+4]		! store one byte
+	ldub	[%o1+5], %o3		! load second byte
+	deccc	%o2
+	bz,pt	%ncc, .smallexit
+	stb	%o3, [%o0+5]		! store second byte
+	ldub	[%o1+6], %o3		! load third byte
+	stb	%o3, [%o0+6]		! store third byte
+.smallexit:
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align 16
+.medium:
+	neg	%o0, %o5
+	andcc	%o5, 7, %o5		! bytes till DST 8 byte aligned
+	brz,pt	%o5, .dst_aligned_on_8
+
+	! %o5 has the bytes to be written in partial store.
+	sub	%o2, %o5, %o2
+	sub	%o1, %o0, %o1		! %o1 gets the difference
+7:					! dst aligning loop
+	ldub	[%o1+%o0], %o4		! load one byte
+	subcc	%o5, 1, %o5
+	stb	%o4, [%o0]
+	bgu,pt	%ncc, 7b
+	add	%o0, 1, %o0		! advance dst
+	add	%o1, %o0, %o1		! restore %o1
+.dst_aligned_on_8:
+	andcc	%o1, 7, %o5
+	brnz,pt	%o5, .src_dst_unaligned_on_8
+	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
+
+.src_dst_aligned_on_8:
+	! check if we are copying MED_MAX or more bytes
+	cmp	%o2, MED_MAX		! limit to store buffer size
+	bgu,pt	%ncc, .large_align8_copy
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+/*
+ * Special case for handling when src and dest are both long word aligned
+ * and total data to move is less than MED_MAX bytes
+ */
+.medlong:
+	subcc	%o2, 63, %o2		! adjust length to allow cc test
+	ble,pt	%ncc, .medl63		! skip big loop if less than 64 bytes
+.medl64:
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read ! into the l2 cache
+	ldx	[%o1], %o4		! load
+	subcc	%o2, 64, %o2		! decrement length count
+	stx	%o4, [%o0]		! and store
+	ldx	[%o1+8], %o3		! a block of 64 bytes
+	stx	%o3, [%o0+8]
+	ldx	[%o1+16], %o4
+	stx	%o4, [%o0+16]
+	ldx	[%o1+24], %o3
+	stx	%o3, [%o0+24]
+	ldx	[%o1+32], %o4		! load
+	stx	%o4, [%o0+32]		! and store
+	ldx	[%o1+40], %o3		! a block of 64 bytes
+	add	%o1, 64, %o1		! increase src ptr by 64
+	stx	%o3, [%o0+40]
+	ldx	[%o1-16], %o4
+	add	%o0, 64, %o0		! increase dst ptr by 64
+	stx	%o4, [%o0-16]
+	ldx	[%o1-8], %o3
+	bgu,pt	%ncc, .medl64		! repeat if at least 64 bytes left
+	stx	%o3, [%o0-8]
+.medl63:
+	addcc	%o2, 32, %o2		! adjust remaining count
+	ble,pt	%ncc, .medl31		! to skip if 31 or fewer bytes left
+	nop
+	ldx	[%o1], %o4		! load
+	sub	%o2, 32, %o2		! decrement length count
+	stx	%o4, [%o0]		! and store
+	ldx	[%o1+8], %o3		! a block of 32 bytes
+	add	%o1, 32, %o1		! increase src ptr by 32
+	stx	%o3, [%o0+8]
+	ldx	[%o1-16], %o4
+	add	%o0, 32, %o0		! increase dst ptr by 32
+	stx	%o4, [%o0-16]
+	ldx	[%o1-8], %o3
+	stx	%o3, [%o0-8]
+.medl31:
+	addcc	%o2, 16, %o2		! adjust remaining count
+	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
+	nop				!
+	ldx	[%o1], %o4		! load and store 16 bytes
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stx	%o4, [%o0]		!
+	sub	%o2, 16, %o2		! decrease count by 16
+	ldx	[%o1-8], %o3		!
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stx	%o3, [%o0-8]
+.medl15:
+	addcc	%o2, 15, %o2		! restore count
+	bz,pt	%ncc, .smallexit	! exit if finished
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	tst	%o2
+	ldx	[%o1], %o4		! load 8 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	subcc	%o2, 8, %o2		! decrease count by 8
+	bnz,pt	%ncc, .medw7
+	stx	%o4, [%o0-8]		! and store 8 bytes
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align 16
+.src_dst_unaligned_on_8:
+	! DST is 8-byte aligned, src is not
+2:
+	andcc	%o1, 0x3, %o5		! test word alignment
+	bnz,pt	%ncc, .unalignsetup	! branch to skip if not word aligned
+	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
+
+/*
+ * Handle all cases where src and dest are aligned on word
+ * boundaries. Use unrolled loops for better performance.
+ * This option wins over standard large data move when
+ * source and destination is in cache for medium
+ * to short data moves.
+ */
+	cmp	%o2, MED_WMAX		! limit to store buffer size
+	bge,pt	%ncc, .unalignrejoin	! otherwise rejoin main loop
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+
+	subcc	%o2, 31, %o2		! adjust length to allow cc test
+					! for end of loop
+	ble,pt	%ncc, .medw31		! skip big loop if less than 16
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+.medw32:
+	ld	[%o1], %o4		! move a block of 32 bytes
+	stw	%o4, [%o0]
+	ld	[%o1+4], %o3
+	stw	%o3, [%o0+4]
+	ld	[%o1+8], %o4
+	stw	%o4, [%o0+8]
+	ld	[%o1+12], %o3
+	stw	%o3, [%o0+12]
+	ld	[%o1+16], %o4
+	subcc	%o2, 32, %o2		! decrement length count
+	stw	%o4, [%o0+16]
+	ld	[%o1+20], %o3
+	add	%o1, 32, %o1		! increase src ptr by 32
+	stw	%o3, [%o0+20]
+	ld	[%o1-8], %o4
+	add	%o0, 32, %o0		! increase dst ptr by 32
+	stw	%o4, [%o0-8]
+	ld	[%o1-4], %o3
+	bgu,pt	%ncc, .medw32		! repeat if at least 32 bytes left
+	stw	%o3, [%o0-4]
+.medw31:
+	addcc	%o2, 31, %o2		! restore count
+
+	bz,pt	%ncc, .smallexit	! exit if finished
+	nop
+	cmp	%o2, 16
+	blt,pt	%ncc, .medw15
+	nop
+	ld	[%o1], %o4		! move a block of 16 bytes
+	subcc	%o2, 16, %o2		! decrement length count
+	stw	%o4, [%o0]
+	ld	[%o1+4], %o3
+	add	%o1, 16, %o1		! increase src ptr by 16
+	stw	%o3, [%o0+4]
+	ld	[%o1-8], %o4
+	add	%o0, 16, %o0		! increase dst ptr by 16
+	stw	%o4, [%o0-8]
+	ld	[%o1-4], %o3
+	stw	%o3, [%o0-4]
+.medw15:
+	bz,pt	%ncc, .smallexit	! exit if finished
+	cmp	%o2, 8
+	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
+	tst	%o2
+	ld	[%o1], %o4		! load 4 bytes
+	subcc	%o2, 8, %o2		! decrease count by 8
+	stw	%o4, [%o0]		! and store 4 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	ld	[%o1-4], %o3		! load 4 bytes
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	stw	%o3, [%o0-4]		! and store 4 bytes
+	bz,pt	%ncc, .smallexit	! exit if finished
+.medw7:					! count is ge 1, less than 8
+	cmp	%o2, 4			! check for 4 bytes left
+	blt,pt	%ncc, .smallleft3	! skip if 3 or fewer bytes left
+	nop				!
+	ld	[%o1], %o4		! load 4 bytes
+	add	%o1, 4, %o1		! increase src ptr by 4
+	add	%o0, 4, %o0		! increase dst ptr by 4
+	subcc	%o2, 4, %o2		! decrease count by 4
+	bnz	.smallleft3
+	stw	%o4, [%o0-4]		! and store 4 bytes
+	retl
+	mov	%g1, %o0		! restore %o0
+
+	.align	16
+.large_align8_copy:			! Src and dst share 8 byte alignment
+	rd	%fprs, %g5		! check for unused fp
+	! if fprs.fef == 0, set it.
+	! Setting it when already set costs more than checking
+	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
+	bz,a	%ncc, 1f
+	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
+1:
+	! align dst to 64 byte boundary
+	andcc	%o0, 0x3f, %o3		! %o3 == 0 means dst is 64 byte aligned
+	brz,pn	%o3, .aligned_to_64
+	andcc	%o0, 8, %o3		! odd long words to move?
+	brz,pt	%o3, .aligned_to_16
+	nop
+	ldx	[%o1], %o4
+	sub	%o2, 8, %o2
+	add	%o1, 8, %o1		! increment src ptr
+	add	%o0, 8, %o0		! increment dst ptr
+	stx	%o4, [%o0-8]
+.aligned_to_16:
+	andcc	%o0, 16, %o3		! pair of long words to move?
+	brz,pt	%o3, .aligned_to_32
+	nop
+	ldx	[%o1], %o4
+	sub	%o2, 16, %o2
+	stx	%o4, [%o0]
+	add	%o1, 16, %o1		! increment src ptr
+	ldx	[%o1-8], %o4
+	add	%o0, 16, %o0		! increment dst ptr
+	stx	%o4, [%o0-8]
+.aligned_to_32:
+	andcc	%o0, 32, %o3		! four long words to move?
+	brz,pt	%o3, .aligned_to_64
+	nop
+	ldx	[%o1], %o4
+	sub	%o2, 32, %o2
+	stx	%o4, [%o0]
+	ldx	[%o1+8], %o4
+	stx	%o4, [%o0+8]
+	ldx	[%o1+16], %o4
+	stx	%o4, [%o0+16]
+	add	%o1, 32, %o1		! increment src ptr
+	ldx	[%o1-8], %o4
+	add	%o0, 32, %o0		! increment dst ptr
+	stx	%o4, [%o0-8]
+.aligned_to_64:
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+	mov	%asi,%o4		! save %asi
+	! Determine source alignment
+	! to correct 8 byte offset
+	andcc	%o1, 0x20, %o3
+	brnz,pn	%o3, .align_1
+	mov	ASI_BLK_P, %asi		! setup %asi for block load/store
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .align_01
+	nop
+	andcc	%o1, 0x08, %o3
+	brz,pn	%o3, .align_000
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.align_001
+	nop
+.align_01:
+	andcc	%o1, 0x08, %o3
+	brnz,pn	%o3, .align_011
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.align_010
+	nop
+.align_1:
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .align_11
+	nop
+	andcc	%o1, 0x08, %o3
+	brnz,pn	%o3, .align_101
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+	ba	.align_100
+	nop
+.align_11:
+	andcc	%o1, 0x08, %o3
+	brz,pn	%o3, .align_110
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+.align_111:
+! Alignment off by 8 bytes
+	ldd	[%o1], %d0
+	add	%o1, 8, %o1
+	sub	%o2, 8, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_111_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d2
+	fmovd	%d18, %d4
+	fmovd	%d20, %d6
+	fmovd	%d22, %d8
+	fmovd	%d24, %d10
+	fmovd	%d26, %d12
+	fmovd	%d28, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d0
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d2
+	fmovd	%d18, %d4
+	fmovd	%d20, %d6
+	fmovd	%d22, %d8
+	fmovd	%d24, %d10
+	fmovd	%d26, %d12
+	fmovd	%d28, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d30, %d0
+	bgt,pt	%ncc, .align_111_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	ba	.remain_stuff
+	add	%o0, 8, %o0
+	! END OF align_111
+
+.align_110:
+! Alignment off by 16 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	add	%o1, 16, %o1
+	sub	%o2, 16, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_110_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d4
+	fmovd	%d18, %d6
+	fmovd	%d20, %d8
+	fmovd	%d22, %d10
+	fmovd	%d24, %d12
+	fmovd	%d26, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d28, %d0
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d2
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d4
+	fmovd	%d18, %d6
+	fmovd	%d20, %d8
+	fmovd	%d22, %d10
+	fmovd	%d24, %d12
+	fmovd	%d26, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d28, %d0
+	fmovd	%d30, %d2
+	bgt,pt	%ncc, .align_110_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	ba	.remain_stuff
+	add	%o0, 16, %o0
+	! END OF align_110
+
+.align_101:
+! Alignment off by 24 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	add	%o1, 24, %o1
+	sub	%o2, 24, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_101_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d6
+	fmovd	%d18, %d8
+	fmovd	%d20, %d10
+	fmovd	%d22, %d12
+	fmovd	%d24, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d26, %d0
+	fmovd	%d28, %d2
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d4
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d6
+	fmovd	%d18, %d8
+	fmovd	%d20, %d10
+	fmovd	%d22, %d12
+	fmovd	%d24, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d26, %d0
+	fmovd	%d28, %d2
+	fmovd	%d30, %d4
+	bgt,pt	%ncc, .align_101_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	ba	.remain_stuff
+	add	%o0, 24, %o0
+	! END OF align_101
+
+.align_100:
+! Alignment off by 32 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16],%d4
+	ldd	[%o1+24],%d6
+	add	%o1, 32, %o1
+	sub	%o2, 32, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_100_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d8
+	fmovd	%d18, %d10
+	fmovd	%d20, %d12
+	fmovd	%d22, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d24, %d0
+	fmovd	%d26, %d2
+	fmovd	%d28, %d4
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d6
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d8
+	fmovd	%d18, %d10
+	fmovd	%d20, %d12
+	fmovd	%d22, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d24, %d0
+	fmovd	%d26, %d2
+	fmovd	%d28, %d4
+	fmovd	%d30, %d6
+	bgt,pt	%ncc, .align_100_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	ba	.remain_stuff
+	add	%o0, 32, %o0
+	! END OF align_100
+
+.align_011:
+! Alignment off by 40 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	add	%o1, 40, %o1
+	sub	%o2, 40, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_011_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d10
+	fmovd	%d18, %d12
+	fmovd	%d20, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d22, %d0
+	fmovd	%d24, %d2
+	fmovd	%d26, %d4
+	fmovd	%d28, %d6
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d8
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d10
+	fmovd	%d18, %d12
+	fmovd	%d20, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d22, %d0
+	fmovd	%d24, %d2
+	fmovd	%d26, %d4
+	fmovd	%d28, %d6
+	fmovd	%d30, %d8
+	bgt,pt	%ncc, .align_011_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	ba	.remain_stuff
+	add	%o0, 40, %o0
+	! END OF align_011
+
+.align_010:
+! Alignment off by 48 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	ldd	[%o1+40], %d10
+	add	%o1, 48, %o1
+	sub	%o2, 48, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_010_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d12
+	fmovd	%d18, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d20, %d0
+	fmovd	%d22, %d2
+	fmovd	%d24, %d4
+	fmovd	%d26, %d6
+	fmovd	%d28, %d8
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d10
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d12
+	fmovd	%d18, %d14
+	add	%o1, 128, %o1	! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d20, %d0
+	fmovd	%d22, %d2
+	fmovd	%d24, %d4
+	fmovd	%d26, %d6
+	fmovd	%d28, %d8
+	fmovd	%d30, %d10
+	bgt,pt	%ncc, .align_010_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	std	%d10, [%o0+40]
+	ba	.remain_stuff
+	add	%o0, 48, %o0
+	! END OF align_010
+
+.align_001:
+! Alignment off by 56 bytes
+	ldd	[%o1], %d0
+	ldd	[%o1+8], %d2
+	ldd	[%o1+16], %d4
+	ldd	[%o1+24], %d6
+	ldd	[%o1+32], %d8
+	ldd	[%o1+40], %d10
+	ldd	[%o1+48], %d12
+	add	%o1, 56, %o1
+	sub	%o2, 56, %o2
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_001_loop:
+	subcc	%o5, 128, %o5
+	/* ---- copy line 1 of 2. ---- */
+
+	ldda	[%o1]%asi,%d16		! block load
+	fmovd	%d16, %d14
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d18, %d0
+	fmovd	%d20, %d2
+	fmovd	%d22, %d4
+	fmovd	%d24, %d6
+	fmovd	%d26, %d8
+	fmovd	%d28, %d10
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+	fmovd	%d30, %d12
+
+	/* ---- copy line 2 of 2. ---- */
+	ldda	[%o1+64]%asi,%d16
+	fmovd	%d16, %d14
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! advance dst
+	fmovd	%d18, %d0
+	fmovd	%d20, %d2
+	fmovd	%d22, %d4
+	fmovd	%d24, %d6
+	fmovd	%d26, %d8
+	fmovd	%d28, %d10
+	fmovd	%d30, %d12
+	bgt,pt	%ncc, .align_001_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	std	%d0, [%o0]
+	std	%d2, [%o0+8]
+	std	%d4, [%o0+16]
+	std	%d6, [%o0+24]
+	std	%d8, [%o0+32]
+	std	%d10, [%o0+40]
+	std	%d12, [%o0+48]
+	ba	.remain_stuff
+	add	%o0, 56, %o0
+	! END OF align_001
+
+.align_000:
+	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
+	and	%o2, 0x7f, %o2		! residue bytes in %o2
+.align_000_loop:
+	/* ---- copy line 1 of 2. ---- */
+	subcc	%o5, 128, %o5
+	ldda	[%o1]%asi,%d0
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
+
+	/* ---- copy line 2 of 2. ---- */
+	add	%o0, 64, %o0
+	ldda	[%o1+64]%asi,%d0
+	add	%o1, 128, %o1		! increment src
+	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
+	stda	%d0,[%o0]%asi
+	add	%o0, 64, %o0		! increment dst
+	bgt,pt	%ncc, .align_000_loop
+	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
+
+	! END OF align_000
+
+.remain_stuff:
+	mov	%o4, %asi		! restore %asi
+	brnz	%g5, .medlong
+	membar	#Sync
+	ba	.medlong
+	wr	%g5, %g0, %fprs
+
+	.align 16
+	! Dst is on 8 byte boundary; src is not; remaining count > SMALL_MAX
+.unalignsetup:
+	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
+.unalignrejoin:
+	rd	%fprs, %g5		! check for unused fp
+	! if fprs.fef == 0, set it.
+	! Setting it when already set costs more than checking
+	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
+	bz,a	%ncc, 1f
+	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
+1:
+	cmp	%o2, MED_UMAX		! check for medium unaligned limit
+	bge,pt	%ncc,.unalign_large
+	nop
+	andn	%o2, 0x3f, %o5		! %o5 is multiple of block size
+	and	%o2, 0x3f, %o2		! residue bytes in %o2
+	cmp	%o2, 8			! Insure we don't load beyond
+	bgt	.unalign_adjust		! end of source buffer
+	andn	%o1, 0x7, %o4		! %o4 has long word aligned src address
+	add	%o2, 64, %o2		! adjust to leave loop
+	sub	%o5, 64, %o5		! early if necessary
+.unalign_adjust:
+	alignaddr %o1, %g0, %g0		! generate %gsr
+	add	%o1, %o5, %o1		! advance %o1 to after blocks
+	ldd	[%o4], %d0
+.unalign_loop:
+	ldd	[%o4+8], %d2
+	faligndata %d0, %d2, %d16
+	ldd	[%o4+16], %d4
+	std	%d16, [%o0]
+	faligndata %d2, %d4, %d18
+	ldd	[%o4+24], %d6
+	std	%d18, [%o0+8]
+	faligndata %d4, %d6, %d20
+	ldd	[%o4+32], %d8
+	std	%d20, [%o0+16]
+	faligndata %d6, %d8, %d22
+	ldd	[%o4+40], %d10
+	std	%d22, [%o0+24]
+	faligndata %d8, %d10, %d24
+	ldd	[%o4+48], %d12
+	std	%d24, [%o0+32]
+	faligndata %d10, %d12, %d26
+	ldd	[%o4+56], %d14
+	std	%d26, [%o0+40]
+	faligndata %d12, %d14, %d28
+	ldd	[%o4+64], %d0
+	std	%d28, [%o0+48]
+	faligndata %d14, %d0, %d30
+	add	%o4, BLOCK_SIZE, %o4
+	std	%d30, [%o0+56]
+	add	%o0, BLOCK_SIZE, %o0
+	subcc	%o5, BLOCK_SIZE, %o5
+	bgu,pt	%ncc, .unalign_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	nop
+
+.unalign_large:
+	andcc	%o0, 0x3f, %o3		! is dst 64-byte block aligned?
+	bz	%ncc, .unalignsrc
+	sub	%o3, 64, %o3		! %o3 will be multiple of 8
+	neg	%o3			! bytes until dest is 64 byte aligned
+	sub	%o2, %o3, %o2		! update cnt with bytes to be moved
+	! Move bytes according to source alignment
+	andcc	%o1, 0x1, %o5
+	bnz	%ncc, .unalignbyte	! check for byte alignment
+	nop
+	andcc	%o1, 2, %o5		! check for half word alignment
+	bnz	%ncc, .unalignhalf
+	nop
+	! Src is word aligned
+.unalignword:
+	ld	[%o1], %o4		! load 4 bytes
+	stw	%o4, [%o0]		! and store 4 bytes
+	ld	[%o1+4], %o4		! load 4 bytes
+	add	%o1, 8, %o1		! increase src ptr by 8
+	stw	%o4, [%o0+4]		! and store 4 bytes
+	subcc	%o3, 8, %o3		! decrease count by 8
+	bnz	%ncc, .unalignword
+	add	%o0, 8, %o0		! increase dst ptr by 8
+	ba	.unalignsrc
+	nop
+
+	! Src is half-word aligned
+.unalignhalf:
+	lduh	[%o1], %o4		! load 2 bytes
+	sllx	%o4, 32, %o5		! shift left
+	lduw	[%o1+2], %o4
+	or	%o4, %o5, %o5
+	sllx	%o5, 16, %o5
+	lduh	[%o1+6], %o4
+	or	%o4, %o5, %o5
+	stx	%o5, [%o0]
+	add	%o1, 8, %o1
+	subcc	%o3, 8, %o3
+	bnz	%ncc, .unalignhalf
+	add	%o0, 8, %o0
+	ba	.unalignsrc
+	nop
+
+	! Src is Byte aligned
+.unalignbyte:
+	sub	%o0, %o1, %o0		! share pointer advance
+.unalignbyte_loop:
+	ldub	[%o1], %o4
+	sllx	%o4, 56, %o5
+	lduh	[%o1+1], %o4
+	sllx	%o4, 40, %o4
+	or	%o4, %o5, %o5
+	lduh	[%o1+3], %o4
+	sllx	%o4, 24, %o4
+	or	%o4, %o5, %o5
+	lduh	[%o1+5], %o4
+	sllx	%o4,  8, %o4
+	or	%o4, %o5, %o5
+	ldub	[%o1+7], %o4
+	or	%o4, %o5, %o5
+	stx	%o5, [%o0+%o1]
+	subcc	%o3, 8, %o3
+	bnz	%ncc, .unalignbyte_loop
+	add	%o1, 8, %o1
+	add	%o0,%o1, %o0 		! restore pointer
+
+	! Destination is now block (64 byte aligned)
+.unalignsrc:
+	andn	%o2, 0x3f, %o5		! %o5 is multiple of block size
+	and	%o2, 0x3f, %o2		! residue bytes in %o2
+	add	%o2, 64, %o2		! Insure we don't load beyond
+	sub	%o5, 64, %o5		! end of source buffer
+
+	andn	%o1, 0x3f, %o4		! %o4 has block aligned src address
+	prefetch [%o4 + (3 * BLOCK_SIZE)], #one_read
+	alignaddr %o1, %g0, %g0		! generate %gsr
+	add	%o1, %o5, %o1		! advance %o1 to after blocks
+	!
+	! Determine source alignment to correct 8 byte offset
+	andcc	%o1, 0x20, %o3
+	brnz,pn	%o3, .unalign_1
+	nop
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .unalign_01
+	nop
+	andcc	%o1, 0x08, %o3
+	brz,a	%o3, .unalign_000
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_001
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+.unalign_01:
+	andcc	%o1, 0x08, %o3
+	brnz,a	%o3, .unalign_011
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_010
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+.unalign_1:
+	andcc	%o1, 0x10, %o3
+	brnz,pn	%o3, .unalign_11
+	nop
+	andcc	%o1, 0x08, %o3
+	brnz,a	%o3, .unalign_101
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_100
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+.unalign_11:
+	andcc	%o1, 0x08, %o3
+	brz,pn	%o3, .unalign_110
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+
+.unalign_111:
+	ldd	[%o4+56], %d14
+.unalign_111_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d14, %d16, %d48
+	faligndata %d16, %d18, %d50
+	faligndata %d18, %d20, %d52
+	faligndata %d20, %d22, %d54
+	faligndata %d22, %d24, %d56
+	faligndata %d24, %d26, %d58
+	faligndata %d26, %d28, %d60
+	faligndata %d28, %d30, %d62
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_111_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_110:
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_110_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d12, %d14, %d48
+	faligndata %d14, %d16, %d50
+	faligndata %d16, %d18, %d52
+	faligndata %d18, %d20, %d54
+	faligndata %d20, %d22, %d56
+	faligndata %d22, %d24, %d58
+	faligndata %d24, %d26, %d60
+	faligndata %d26, %d28, %d62
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_110_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_101:
+	ldd	[%o4+40], %d10
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_101_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d10, %d12, %d48
+	faligndata %d12, %d14, %d50
+	faligndata %d14, %d16, %d52
+	faligndata %d16, %d18, %d54
+	faligndata %d18, %d20, %d56
+	faligndata %d20, %d22, %d58
+	faligndata %d22, %d24, %d60
+	faligndata %d24, %d26, %d62
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_101_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_100:
+	ldd	[%o4+32], %d8
+	ldd	[%o4+40], %d10
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_100_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d8, %d10, %d48
+	faligndata %d10, %d12, %d50
+	faligndata %d12, %d14, %d52
+	faligndata %d14, %d16, %d54
+	faligndata %d16, %d18, %d56
+	faligndata %d18, %d20, %d58
+	faligndata %d20, %d22, %d60
+	faligndata %d22, %d24, %d62
+	fmovd	%d24, %d8
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_100_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_011:
+	ldd	[%o4+24], %d6
+	ldd	[%o4+32], %d8
+	ldd	[%o4+40], %d10
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_011_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d6, %d8, %d48
+	faligndata %d8, %d10, %d50
+	faligndata %d10, %d12, %d52
+	faligndata %d12, %d14, %d54
+	faligndata %d14, %d16, %d56
+	faligndata %d16, %d18, %d58
+	faligndata %d18, %d20, %d60
+	faligndata %d20, %d22, %d62
+	fmovd	%d22, %d6
+	fmovd	%d24, %d8
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_011_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_010:
+	ldd	[%o4+16], %d4
+	ldd	[%o4+24], %d6
+	ldd	[%o4+32], %d8
+	ldd	[%o4+40], %d10
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_010_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d4, %d6, %d48
+	faligndata %d6, %d8, %d50
+	faligndata %d8, %d10, %d52
+	faligndata %d10, %d12, %d54
+	faligndata %d12, %d14, %d56
+	faligndata %d14, %d16, %d58
+	faligndata %d16, %d18, %d60
+	faligndata %d18, %d20, %d62
+	fmovd	%d20, %d4
+	fmovd	%d22, %d6
+	fmovd	%d24, %d8
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_010_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_001:
+	ldd	[%o4+8], %d2
+	ldd	[%o4+16], %d4
+	ldd	[%o4+24], %d6
+	ldd	[%o4+32], %d8
+	ldd	[%o4+40], %d10
+	ldd	[%o4+48], %d12
+	ldd	[%o4+56], %d14
+.unalign_001_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d2, %d4, %d48
+	faligndata %d4, %d6, %d50
+	faligndata %d6, %d8, %d52
+	faligndata %d8, %d10, %d54
+	faligndata %d10, %d12, %d56
+	faligndata %d12, %d14, %d58
+	faligndata %d14, %d16, %d60
+	faligndata %d16, %d18, %d62
+	fmovd	%d18, %d2
+	fmovd	%d20, %d4
+	fmovd	%d22, %d6
+	fmovd	%d24, %d8
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_001_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	ba	.unalign_done
+	membar	#Sync
+
+.unalign_000:
+	ldda	[%o4]ASI_BLK_P, %d0
+.unalign_000_loop:
+	add	%o4, 64, %o4
+	ldda	[%o4]ASI_BLK_P, %d16
+	faligndata %d0, %d2, %d48
+	faligndata %d2, %d4, %d50
+	faligndata %d4, %d6, %d52
+	faligndata %d6, %d8, %d54
+	faligndata %d8, %d10, %d56
+	faligndata %d10, %d12, %d58
+	faligndata %d12, %d14, %d60
+	faligndata %d14, %d16, %d62
+	fmovd	%d16, %d0
+	fmovd	%d18, %d2
+	fmovd	%d20, %d4
+	fmovd	%d22, %d6
+	fmovd	%d24, %d8
+	fmovd	%d26, %d10
+	fmovd	%d28, %d12
+	fmovd	%d30, %d14
+	stda	%d48, [%o0]ASI_BLK_P
+	subcc	%o5, 64, %o5
+	add	%o0, 64, %o0
+	bgu,pt	%ncc, .unalign_000_loop
+	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
+	membar	#Sync
+
+.unalign_done:
+	! Handle trailing bytes, 64 to 127
+	! Dest long word aligned, Src not long word aligned
+	cmp	%o2, 15
+	bleu	%ncc, .unalign_short
+
+	andn	%o2, 0x7, %o5		! %o5 is multiple of 8
+	and	%o2, 0x7, %o2		! residue bytes in %o2
+	add	%o2, 8, %o2
+	sub	%o5, 8, %o5		! insure we don't load past end of src
+	andn	%o1, 0x7, %o4		! %o4 has long word aligned src address
+	add	%o1, %o5, %o1		! advance %o1 to after multiple of 8
+	ldd	[%o4], %d0		! fetch partial word
+.unalign_by8:
+	ldd	[%o4+8], %d2
+	add	%o4, 8, %o4
+	faligndata %d0, %d2, %d16
+	subcc	%o5, 8, %o5
+	std	%d16, [%o0]
+	fmovd	%d2, %d0
+	bgu,pt	%ncc, .unalign_by8
+	add	%o0, 8, %o0
+
+.unalign_short:
+	brnz	%g5, .smallrest
+	nop
+	ba	.smallrest
+	wr	%g5, %g0, %fprs
+#else	/* NIAGARA2_IMPL */
+.forcpy:
+	mov	%o0, %g5		! save des address for return val
+	cmp	%o2, 17			! for small counts copy bytes
+	bleu,pt	%ncc, .dbytecp
+	nop
+
+	cmp	%o2, 0x80		! For lengths less than 128 bytes no
+	bleu,pn	%ncc, .no_blkcpy	! copy using ASI_BLK_INIT_ST_QUAD_LDD_P
+
+	/*
+	 * Make sure that source and destination buffers are 64 bytes apart.
+	 * If they are not, do not use ASI_BLK_INIT_ST_QUAD_LDD_P asi to copy
+	 * the data.
+	 */
+	subcc	%o1, %o0, %o3
+	blu	%ncc, .blkalgndst
+	cmp	%o3, 0x40		! if src - dst >= 0x40
+	bgeu,pt	%ncc, .blkalgndst	! then use ASI_BLK_INIT_ST_QUAD_LDD_P
+.no_blkcpy:
+	andcc	%o1, 3, %o5		! is src word aligned
+	bz,pn	%ncc, .aldst
+	cmp	%o5, 2			! is src half-word aligned
+	be,pt	%ncc, .s2algn
+	cmp	%o5, 3			! src is byte aligned
+.s1algn:ldub	[%o1], %o3		! move 1 or 3 bytes to align it
+	inc	1, %o1
+	stb	%o3, [%g5]		! move a byte to align src
+	inc	1, %g5
+	bne,pt	%ncc, .s2algn
+	dec	%o2
+	b	.ald			! now go align dest
+	andcc	%g5, 3, %o5
+
+.s2algn:lduh	[%o1], %o3		! know src is 2 byte alinged
+	inc	2, %o1
+	srl	%o3, 8, %o4
+	stb	%o4, [%g5]		! have to do bytes,
+	stb	%o3, [%g5 + 1]		! don't know dst alingment
+	inc	2, %g5
+	dec	2, %o2
+
+.aldst:	andcc	%g5, 3, %o5		! align the destination address
+.ald:	bz,pn	%ncc, .w4cp
+	cmp	%o5, 2
+	bz,pn	%ncc, .w2cp
+	cmp	%o5, 3
+.w3cp:	lduw	[%o1], %o4
+	inc	4, %o1
+	srl	%o4, 24, %o5
+	stb	%o5, [%g5]
+	bne,pt	%ncc, .w1cp
+	inc	%g5
+	dec	1, %o2
+	andn	%o2, 3, %o3		! o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %g5, %o1		! o1 gets the difference
+
+1:	sll	%o4, 8, %g1		! save residual bytes
+	lduw	[%o1+%g5], %o4
+	deccc	4, %o3
+	srl	%o4, 24, %o5		! merge with residual
+	or	%o5, %g1, %g1
+	st	%g1, [%g5]
+	bnz,pt	%ncc, 1b
+	inc	4, %g5
+	sub	%o1, 3, %o1		! used one byte of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w1cp:	srl	%o4, 8, %o5
+	sth	%o5, [%g5]
+	inc	2, %g5
+	dec	3, %o2
+	andn	%o2, 3, %o3		! o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %g5, %o1		! o1 gets the difference
+
+2:	sll	%o4, 24, %g1		! save residual bytes
+	lduw	[%o1+%g5], %o4
+	deccc	4, %o3
+	srl	%o4, 8, %o5		! merge with residual
+	or	%o5, %g1, %g1
+	st	%g1, [%g5]
+	bnz,pt	%ncc, 2b
+	inc	4, %g5
+	sub	%o1, 1, %o1		! used three bytes of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w2cp:	lduw	[%o1], %o4
+	inc	4, %o1
+	srl	%o4, 16, %o5
+	sth	%o5, [%g5]
+	inc	2, %g5
+	dec	2, %o2
+	andn	%o2, 3, %o3		! o3 is aligned word count
+	dec	4, %o3			! avoid reading beyond tail of src
+	sub	%o1, %g5, %o1		! o1 gets the difference
+
+3:	sll	%o4, 16, %g1		! save residual bytes
+	lduw	[%o1+%g5], %o4
+	deccc	4, %o3
+	srl	%o4, 16, %o5		! merge with residual
+	or	%o5, %g1, %g1
+	st	%g1, [%g5]
+	bnz,pt	%ncc, 3b
+	inc	4, %g5
+	sub	%o1, 2, %o1		! used two bytes of last word read
+	and	%o2, 3, %o2
+	b	7f
+	inc	4, %o2
+
+.w4cp:	andn	%o2, 3, %o3		! o3 is aligned word count
+	sub	%o1, %g5, %o1		! o1 gets the difference
+
+1:	lduw	[%o1+%g5], %o4		! read from address
+	deccc	4, %o3			! decrement count
+	st	%o4, [%g5]		! write at destination address
+	bgu,pt	%ncc, 1b
+	inc	4, %g5			! increment to address
+	b	7f
+	and	%o2, 3, %o2		! number of leftover bytes, if any
+
+	!
+	! differenced byte copy, works with any alignment
+	!
+.dbytecp:
+	b	7f
+	sub	%o1, %g5, %o1		! o1 gets the difference
+
+4:	stb	%o4, [%g5]		! write to address
+	inc	%g5			! inc to address
+7:	deccc	%o2			! decrement count
+	bgeu,a,pt %ncc,4b		! loop till done
+	ldub	[%o1+%g5], %o4		! read from address
+	retl				! %o0 was preserved
+	nop
+
+.blkalgndst:
+	save	%sp, -SA(MINFRAME), %sp
+
+	! Block (64 bytes) align the destination.
+	andcc	%i0, 0x3f, %i3		! is dst block aligned
+	bz	%ncc, .chksrc		! dst already block aligned
+	sub	%i3, 0x40, %i3
+	neg	%i3			! bytes till dst 64 bytes aligned
+	sub	%i2, %i3, %i2		! update i2 with new count
+
+	! Based on source and destination alignment do
+	! either 8 bytes, 4 bytes, 2 bytes or byte copy.
+
+	! Is dst & src 8B aligned
+	or	%i0, %i1, %o2
+	andcc	%o2, 0x7, %g0
+	bz	%ncc, .alewdcp
+	nop
+
+	! Is dst & src 4B aligned
+	andcc	%o2, 0x3, %g0
+	bz	%ncc, .alwdcp
+	nop
+
+	! Is dst & src 2B aligned
+	andcc	%o2, 0x1, %g0
+	bz	%ncc, .alhlfwdcp
+	nop
+
+	! 1B aligned
+1:	ldub	[%i1], %o2
+	stb	%o2, [%i0]
+	inc	%i1
+	deccc	%i3
+	bgu,pt	%ncc, 1b
+	inc	%i0
+
+	ba	.chksrc
+	nop
+
+	! dst & src 4B aligned
+.alwdcp:
+	ld	[%i1], %o2
+	st	%o2, [%i0]
+	add	%i1, 0x4, %i1
+	subcc	%i3, 0x4, %i3
+	bgu,pt	%ncc, .alwdcp
+	add	%i0, 0x4, %i0
+
+	ba	.chksrc
+	nop
+
+	! dst & src 2B aligned
+.alhlfwdcp:
+	lduh	[%i1], %o2
+	stuh	%o2, [%i0]
+	add	%i1, 0x2, %i1
+	subcc	%i3, 0x2, %i3
+	bgu,pt	%ncc, .alhlfwdcp
+	add	%i0, 0x2, %i0
+
+	ba	.chksrc
+	nop
+
+	! dst & src 8B aligned
+.alewdcp:
+	ldx	[%i1], %o2
+	stx	%o2, [%i0]
+	add	%i1, 0x8, %i1
+	subcc	%i3, 0x8, %i3
+	bgu,pt	%ncc, .alewdcp
+	add	%i0, 0x8, %i0
+
+	! Now Destination is block (64 bytes) aligned
+.chksrc:
+	andn	%i2, 0x3f, %i3		! %i3 count is multiple of block size
+	sub	%i2, %i3, %i2		! Residue bytes in %i2
+	mov	ASI_BLK_INIT_ST_QUAD_LDD_P, %asi
+	andcc	%i1, 0xf, %l1		! is src quadword aligned
+	bz,pn	%ncc, .blkcpy		! src offset in %l1
+	nop
+	cmp	%l1, 0x8
+	bgu	%ncc, .cpy_upper_double
+	nop
+	blu	%ncc, .cpy_lower_double
+	nop
+
+	! Falls through when source offset is equal to 8 i.e.
+	! source is double word aligned.
+	! In this case no shift/merge of data is required
+	sub	%i1, %l1, %i1		! align the src at 16 bytes.
+	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
+	prefetch [%o0+0x0], #one_read
+	ldda	[%i1+0x0]%asi, %o2
+loop0:
+	ldda	[%i1+0x10]%asi, %o4
+	prefetch [%o0+0x40], #one_read
+
+	stxa	%o3, [%i0+0x0]%asi
+	stxa	%o4, [%i0+0x8]%asi
+
+	ldda	[%i1+0x20]%asi, %o2
+	stxa	%o5, [%i0+0x10]%asi
+	stxa	%o2, [%i0+0x18]%asi
+
+	ldda	[%i1+0x30]%asi, %o4
+	stxa	%o3, [%i0+0x20]%asi
+	stxa	%o4, [%i0+0x28]%asi
+
+	ldda	[%i1+0x40]%asi, %o2
+	stxa	%o5, [%i0+0x30]%asi
+	stxa	%o2, [%i0+0x38]%asi
+
+	add	%o0, 0x40, %o0
+	add	%i1, 0x40, %i1
+	subcc	%i3, 0x40, %i3
+	bgu,pt	%ncc, loop0
+	add	%i0, 0x40, %i0
+	ba	.blkdone
+	add	%i1, %l1, %i1		! increment the source by src offset
+
+.cpy_lower_double:
+	sub	%i1, %l1, %i1		! align the src at 16 bytes.
+	sll	%l1, 3, %l2		! %l2 left shift
+	mov	0x40, %l3
+	sub	%l3, %l2, %l3		! %l3 right shift = (64 - left shift)
+	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
+	prefetch [%o0+0x0], #one_read
+	ldda	[%i1+0x0]%asi, %o2	! partial data in %o2 and %o3 has
+					! complete data
+loop1:
+	ldda	[%i1+0x10]%asi, %o4	! %o4 has partial data for this read.
+	ALIGN_DATA(%o2, %o3, %o4, %l2, %l3, %g1)	! merge %o2, %o3 and %o4
+							! into %o2 and %o3
+	prefetch [%o0+0x40], #one_read
+	stxa	%o2, [%i0+0x0]%asi
+	stxa	%o3, [%i0+0x8]%asi
+
+	ldda	[%i1+0x20]%asi, %o2
+	ALIGN_DATA(%o4, %o5, %o2, %l2, %l3, %g1)	! merge %o2 with %o5 and
+	stxa	%o4, [%i0+0x10]%asi			! %o4 from previous read
+	stxa	%o5, [%i0+0x18]%asi			! into %o4 and %o5
+
+	! Repeat the same for next 32 bytes.
+
+	ldda	[%i1+0x30]%asi, %o4
+	ALIGN_DATA(%o2, %o3, %o4, %l2, %l3, %g1)
+	stxa	%o2, [%i0+0x20]%asi
+	stxa	%o3, [%i0+0x28]%asi
+
+	ldda	[%i1+0x40]%asi, %o2
+	ALIGN_DATA(%o4, %o5, %o2, %l2, %l3, %g1)
+	stxa	%o4, [%i0+0x30]%asi
+	stxa	%o5, [%i0+0x38]%asi
+
+	add	%o0, 0x40, %o0
+	add	%i1, 0x40, %i1
+	subcc	%i3, 0x40, %i3
+	bgu,pt	%ncc, loop1
+	add	%i0, 0x40, %i0
+	ba	.blkdone
+	add	%i1, %l1, %i1		! increment the source by src offset
+
+.cpy_upper_double:
+	sub	%i1, %l1, %i1		! align the src at 16 bytes.
+	mov	0x8, %l2
+	sub	%l1, %l2, %l2
+	sll	%l2, 3, %l2		! %l2 left shift
+	mov	0x40, %l3
+	sub	%l3, %l2, %l3		! %l3 right shift = (64 - left shift)
+	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
+	prefetch [%o0+0x0], #one_read
+	ldda	[%i1+0x0]%asi, %o2	! partial data in %o3 for this read and
+					! no data in %o2
+loop2:
+	ldda	[%i1+0x10]%asi, %o4	! %o4 has complete data and %o5 has
+					! partial
+	ALIGN_DATA(%o3, %o4, %o5, %l2, %l3, %g1)	! merge %o3, %o4 and %o5
+							! into %o3 and %o4
+	prefetch [%o0+0x40], #one_read
+	stxa	%o3, [%i0+0x0]%asi
+	stxa	%o4, [%i0+0x8]%asi
+
+	ldda	[%i1+0x20]%asi, %o2
+	ALIGN_DATA(%o5, %o2, %o3, %l2, %l3, %g1)	! merge %o2 and %o3 with
+	stxa	%o5, [%i0+0x10]%asi			! %o5 from previous read
+	stxa	%o2, [%i0+0x18]%asi			! into %o5 and %o2
+
+	! Repeat the same for next 32 bytes.
+
+	ldda	[%i1+0x30]%asi, %o4
+	ALIGN_DATA(%o3, %o4, %o5, %l2, %l3, %g1)
+	stxa	%o3, [%i0+0x20]%asi
+	stxa	%o4, [%i0+0x28]%asi
+
+	ldda	[%i1+0x40]%asi, %o2
+	ALIGN_DATA(%o5, %o2, %o3, %l2, %l3, %g1)
+	stxa	%o5, [%i0+0x30]%asi
+	stxa	%o2, [%i0+0x38]%asi
+
+	add	%o0, 0x40, %o0
+	add	%i1, 0x40, %i1
+	subcc	%i3, 0x40, %i3
+	bgu,pt	%ncc, loop2
+	add	%i0, 0x40, %i0
+	ba	.blkdone
+	add	%i1, %l1, %i1		! increment the source by src offset
+
+	! Do fast copy using ASI_BLK_INIT_ST_QUAD_LDD_P
+.blkcpy:
+	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
+	prefetch [%o0+0x0], #one_read
+1:
+	prefetch [%o0+0x40], #one_read
+
+	ldda	[%i1+0x0]%asi, %o2
+	ldda	[%i1+0x10]%asi, %o4
+
+	stxa	%o2, [%i0+0x0]%asi
+	stxa	%o3, [%i0+0x8]%asi
+	stxa	%o4, [%i0+0x10]%asi
+	stxa	%o5, [%i0+0x18]%asi
+
+	ldda	[%i1+0x20]%asi, %o2
+	ldda	[%i1+0x30]%asi, %o4
+
+	stxa	%o2, [%i0+0x20]%asi
+	stxa	%o3, [%i0+0x28]%asi
+	stxa	%o4, [%i0+0x30]%asi
+	stxa	%o5, [%i0+0x38]%asi
+
+	add	%o0, 0x40, %o0
+	add	%i1, 0x40, %i1
+	subcc	%i3, 0x40, %i3
+	bgu,pt	%ncc, 1b
+	add	%i0, 0x40, %i0
+
+.blkdone:
+	membar	#Sync
+
+	mov	ASI_PNF, %asi		! restore %asi to default
+					! ASI_PRIMARY_NOFAULT value
+	tst	%i2
+	bz,pt	%ncc, .blkexit
+	nop
+
+	! Handle trailing bytes
+	cmp	%i2, 0x8
+	blu,pt	%ncc, .residue
+	nop
+
+	! Can we do some 8B ops
+	or	%i1, %i0, %o2
+	andcc	%o2, 0x7, %g0
+	bnz	%ncc, .last4
+	nop
+
+	! Do 8byte ops as long as possible
+.last8:
+	ldx	[%i1], %o2
+	stx	%o2, [%i0]
+	add	%i1, 0x8, %i1
+	sub	%i2, 0x8, %i2
+	cmp	%i2, 0x8
+	bgu,pt	%ncc, .last8
+	add	%i0, 0x8, %i0
+
+	tst	%i2
+	bz,pt	%ncc, .blkexit
+	nop
+
+	ba	.residue
+	nop
+
+.last4:
+	! Can we do 4B ops
+	andcc	%o2, 0x3, %g0
+	bnz	%ncc, .last2
+	nop
+1:
+	ld	[%i1], %o2
+	st	%o2, [%i0]
+	add	%i1, 0x4, %i1
+	sub	%i2, 0x4, %i2
+	cmp	%i2, 0x4
+	bgu,pt	%ncc, 1b
+	add	%i0, 0x4, %i0
+
+	cmp	%i2, 0
+	bz,pt	%ncc, .blkexit
+	nop
+
+	ba	.residue
+	nop
+
+.last2:
+	! Can we do 2B ops
+	andcc	%o2, 0x1, %g0
+	bnz	%ncc, .residue
+	nop
+
+1:
+	lduh	[%i1], %o2
+	stuh	%o2, [%i0]
+	add	%i1, 0x2, %i1
+	sub	%i2, 0x2, %i2
+	cmp	%i2, 0x2
+	bgu,pt	%ncc, 1b
+	add	%i0, 0x2, %i0
+
+	cmp	%i2, 0
+	bz,pt	%ncc, .blkexit
+	nop
+
+.residue:
+	ldub	[%i1], %o2
+	stb	%o2, [%i0]
+	inc	%i1
+	deccc	%i2
+	bgu,pt	%ncc, .residue
+	inc	%i0
+
+.blkexit:
+
+	ret
+	restore	%g5, %g0, %o0
+
+#endif	/* NIAGARA2_IMPL */
+	SET_SIZE(memcpy)
+	SET_SIZE(__align_cpy_1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libc/capabilities/sun4v/common/memset.s	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,247 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ */
+
+	.file	"memset.s"
+
+/*
+ * char *memset(sp, c, n)
+ *
+ * Set an array of n chars starting at sp to the character c.
+ * Return sp.
+ *
+ * Fast assembler language version of the following C-program for memset
+ * which represents the `standard' for the C-library.
+ *
+ *	void *
+ *	memset(void *sp1, int c, size_t n)
+ *	{
+ *	    if (n != 0) {
+ *		char *sp = sp1;
+ *		do {
+ *		    *sp++ = (char)c;
+ *		} while (--n != 0);
+ *	    }
+ *	    return (sp1);
+ *	}
+ *
+ * Flow :
+ *
+ *	For small 6 or fewer bytes stores, bytes will be stored.
+ *
+ *	For less than 32 bytes stores, align the address on 4 byte boundary.
+ *	Then store as many 4-byte chunks, followed by trailing bytes.
+ *
+ *	For sizes greater than 32 bytes, align the address on 8 byte boundary.
+ *	if (count > 64) {
+ *		store as many 8-bytes chunks to block align the address
+ *		store using ASI_BLK_INIT_ST_QUAD_LDD_P
+ *	}
+ *	Store as many 8-byte chunks, followed by trialing bytes.
+ *		
+ */
+
+#include <sys/asm_linkage.h>
+#include <sys/niagaraasi.h>
+#include <sys/asi.h>
+
+	ANSI_PRAGMA_WEAK(memset,function)
+
+	.section        ".text"
+	.align 32
+
+	ENTRY(memset)
+
+	mov	%o0, %o5		! copy sp1 before using it
+	cmp	%o2, 7			! if small counts, just write bytes
+	blu,pn	%ncc, .wrchar
+	and	%o1, 0xff, %o1		! o1 is (char)c
+
+	sll	%o1, 8, %o3
+	or	%o1, %o3, %o1		! now o1 has 2 bytes of c
+	sll	%o1, 16, %o3
+
+	cmp	%o2, 0x20
+	blu,pn	%ncc, .wdalign
+	or	%o1, %o3, %o1		! now o1 has 4 bytes of c
+
+	sllx	%o1, 32, %o3
+	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
+
+.dbalign:
+	andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
+	bz,pt	%ncc, .blkalign		! already double aligned
+	sub	%o3, 8, %o3		! -(bytes till double aligned)
+	add	%o2, %o3, %o2		! update o2 with new count
+
+	! Set -(%o3) bytes till sp1 double aligned
+1:	stb	%o1, [%o5]		! there is at least 1 byte to set
+	inccc	%o3			! byte clearing loop 
+	bl,pt	%ncc, 1b
+	inc	%o5 
+
+	! Now sp1 is double aligned (sp1 is found in %o5)
+.blkalign:
+	mov	ASI_BLK_INIT_ST_QUAD_LDD_P, %asi
+
+	cmp	%o2, 0x40		! check if there are 64 bytes to set
+	blu,pn	%ncc, 5f
+	mov	%o2, %o3
+
+	andcc	%o5, 63, %o3		! is sp1 block aligned?
+	bz,pt	%ncc, .blkwr		! now block aligned
+	sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
+	add	%o2, %o3, %o2		! o2 is the remainder
+
+	! Store -(%o3) bytes till dst is block (64 byte) aligned.
+	! Use double word stores.
+	! Recall that dst is already double word aligned
+1:
+	stx	%o1, [%o5]
+	addcc	%o3, 8, %o3
+	bl,pt	%ncc, 1b
+	add	%o5, 8, %o5
+
+	! Now sp1 is block aligned
+.blkwr:
+	and	%o2, 63, %o3		! calc bytes left after blk store.
+	andn	%o2, 63, %o4		! calc size of blocks in bytes
+
+	cmp	%o4, 0x100		! check if there are 256 bytes to set
+	blu,pn	%ncc, 3f
+	nop
+2:
+	stxa	%o1, [%o5+0x0]%asi
+	stxa	%o1, [%o5+0x40]%asi
+	stxa	%o1, [%o5+0x80]%asi
+	stxa	%o1, [%o5+0xc0]%asi
+
+	stxa	%o1, [%o5+0x8]%asi
+	stxa	%o1, [%o5+0x10]%asi
+	stxa	%o1, [%o5+0x18]%asi
+	stxa	%o1, [%o5+0x20]%asi
+	stxa	%o1, [%o5+0x28]%asi
+	stxa	%o1, [%o5+0x30]%asi
+	stxa	%o1, [%o5+0x38]%asi
+
+	stxa	%o1, [%o5+0x48]%asi
+	stxa	%o1, [%o5+0x50]%asi
+	stxa	%o1, [%o5+0x58]%asi
+	stxa	%o1, [%o5+0x60]%asi
+	stxa	%o1, [%o5+0x68]%asi
+	stxa	%o1, [%o5+0x70]%asi
+	stxa	%o1, [%o5+0x78]%asi
+
+	stxa	%o1, [%o5+0x88]%asi
+	stxa	%o1, [%o5+0x90]%asi
+	stxa	%o1, [%o5+0x98]%asi
+	stxa	%o1, [%o5+0xa0]%asi
+	stxa	%o1, [%o5+0xa8]%asi
+	stxa	%o1, [%o5+0xb0]%asi
+	stxa	%o1, [%o5+0xb8]%asi
+
+	stxa	%o1, [%o5+0xc8]%asi
+	stxa	%o1, [%o5+0xd0]%asi
+	stxa	%o1, [%o5+0xd8]%asi
+	stxa	%o1, [%o5+0xe0]%asi
+	stxa	%o1, [%o5+0xe8]%asi
+	stxa	%o1, [%o5+0xf0]%asi
+	stxa	%o1, [%o5+0xf8]%asi
+
+	sub	%o4, 0x100, %o4
+	cmp	%o4, 0x100
+	bgu,pt	%ncc, 2b
+	add	%o5, 0x100, %o5
+
+3:
+	cmp	%o4, 0x40		! check if 64 bytes to set
+	blu	%ncc, 5f
+	nop
+4:	
+	stxa	%o1, [%o5+0x0]%asi
+	stxa	%o1, [%o5+0x8]%asi
+	stxa	%o1, [%o5+0x10]%asi
+	stxa	%o1, [%o5+0x18]%asi
+	stxa	%o1, [%o5+0x20]%asi
+	stxa	%o1, [%o5+0x28]%asi
+	stxa	%o1, [%o5+0x30]%asi
+	stxa	%o1, [%o5+0x38]%asi
+
+	subcc	%o4, 0x40, %o4
+	bgu,pt	%ncc, 4b
+	add	%o5, 0x40, %o5
+
+5:
+	! Set the remaining doubles
+	membar	#Sync
+	mov	ASI_PNF, %asi		! restore %asi to default
+					! ASI_PRIMARY_NOFAULT value
+	subcc	%o3, 8, %o3		! Can we store any doubles?
+	blu,pn	%ncc, .wrchar
+	and	%o2, 7, %o2		! calc bytes left after doubles
+
+6:
+	stx	%o1, [%o5]		! store the doubles
+	subcc	%o3, 8, %o3
+	bgeu,pt	%ncc, 6b
+	add	%o5, 8, %o5
+
+	ba	.wrchar
+	nop
+
+.wdalign:			
+	andcc	%o5, 3, %o3		! is sp1 aligned on a word boundary
+	bz,pn	%ncc, .wrword
+	andn	%o2, 3, %o3		! create word sized count in %o3
+
+	dec	%o2			! decrement count
+	stb	%o1, [%o5]		! clear a byte
+	b	.wdalign
+	inc	%o5			! next byte
+
+.wrword:
+	st	%o1, [%o5]		! 4-byte writing loop
+	subcc	%o3, 4, %o3
+	bnz,pt	%ncc, .wrword
+	inc	4, %o5
+
+	and	%o2, 3, %o2		! leftover count, if any
+
+.wrchar:
+	! Set the remaining bytes, if any
+	cmp	%o2, 0
+	be	%ncc, .exit
+	nop
+
+7:
+	deccc	%o2
+	stb	%o1, [%o5]
+	bgu,pt	%ncc, 7b
+	inc	%o5
+
+.exit:
+	retl				! %o0 was preserved
+	nop
+
+	SET_SIZE(memset)
--- a/usr/src/lib/libc/i386/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/i386/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -23,12 +23,13 @@
 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-LIB_PIC= libc_pic.a
-VERS=	.1
-CPP=	/usr/lib/cpp
+LIBCDIR=	$(SRC)/lib/libc
+LIB_PIC=	libc_pic.a
+VERS=		.1
+CPP=		/usr/lib/cpp
 TARGET_ARCH=	i386
 
-VALUES=	values-Xa.o
+VALUES=		values-Xa.o
 
 # objects are grouped by source directory
 
@@ -316,7 +317,7 @@
 	vforkx.o		\
 	xstat.o
 
-# objects under ../port which contain transitional large file interfaces
+# objects under $(LIBCDIR)/port which contain transitional large file interfaces
 PORTGEN64=			\
 	_xftw64.o		\
 	attropen64.o		\
@@ -326,7 +327,7 @@
 	tell64.o		\
 	truncate64.o
 
-# objects from source under ../port
+# objects from source under $(LIBCDIR)/port
 PORTFP=				\
 	__flt_decim.o		\
 	__flt_rounds.o		\
@@ -951,16 +952,17 @@
 ALTPICS= $(TRACEOBJS:%=pics/%)
 
 $(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
-$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
+$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
+		$(EXTPICS) $(LDLIBS)
 
-MAPFILES =	../port/mapfile-vers
+MAPFILES =	$(LIBCDIR)/port/mapfile-vers
 
 #
 # EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
 #
 CFLAGS +=	$(EXTN_CFLAGS)
 CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
-		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
+		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
 ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
 
 # As a favor to the dtrace syscall provider, libc still calls the
@@ -1001,8 +1003,8 @@
 
 # extra files for the clean target
 CLEANFILES=			\
-	../port/gen/errlst.c	\
-	../port/gen/new_list.c	\
+	$(LIBCDIR)/port/gen/errlst.c	\
+	$(LIBCDIR)/port/gen/new_list.c	\
 	assym.h			\
 	genassym		\
 	crt/_rtld.s		\
@@ -1020,21 +1022,21 @@
 	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
 	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
 	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
-	$(PORTFP:%.o=../port/fp/%.c)			\
-	$(PORTGEN:%.o=../port/gen/%.c)			\
-	$(PORTI18N:%.o=../port/i18n/%.c)		\
-	$(PORTPRINT:%.o=../port/print/%.c)		\
-	$(PORTREGEX:%.o=../port/regex/%.c)		\
-	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
-	$(PORTSYS:%.o=../port/sys/%.c)			\
-	$(AIOOBJS:%.o=../port/aio/%.c)			\
-	$(RTOBJS:%.o=../port/rt/%.c)			\
-	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
-	$(THREADSOBJS:%.o=../port/threads/%.c)		\
-	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
+	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
+	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
+	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
+	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
+	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
+	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
+	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
+	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
+	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
+	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
+	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
+	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
 	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
-	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
-	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
+	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
+	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
 	$(LIBCBASE)/gen/ecvt.c				\
 	$(LIBCBASE)/gen/makectxt.c			\
 	$(LIBCBASE)/gen/siginfolst.c			\
@@ -1127,7 +1129,7 @@
 
 all: $(LIBS) $(LIB_PIC)
 
-lint	:=	CPPFLAGS += -I../$(MACH)/fp
+lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
 lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
 lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 
@@ -1135,7 +1137,7 @@
 	@echo $(LINT.c) ...
 	@$(LINT.c) $(SRCS) $(LDLIBS)
 
-$(LINTLIB):= SRCS=../port/llib-lc
+$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
 $(LINTLIB):= LINTFLAGS=-nvx
 
@@ -1144,7 +1146,7 @@
 # pics/mul64.o: $(LIBCBASE)/crt/mul64.il
 
 # include common libc targets
-include ../Makefile.targ
+include $(LIBCDIR)/Makefile.targ
 
 # We need to strip out all CTF and DOF data from the static library
 $(LIB_PIC) := DIR = pics
@@ -1180,7 +1182,7 @@
 
 # assym.h build rules
 
-GENASSYM_C = ../$(MACH)/genassym.c
+GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
 
 # XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
 #	live in Makefile.master
@@ -1189,20 +1191,20 @@
 	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
 
 genassym: $(GENASSYM_C)
-	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
+	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
 		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
 
-OFFSETS = ../$(MACH)/offsets.in
+OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
 
 assym.h: $(OFFSETS) genassym
 	$(OFFSETS_CREATE) <$(OFFSETS) >$@
 	./genassym >>$@
 
 # derived C source and related explicit dependencies
-../port/gen/errlst.c + \
-../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
-	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
+$(LIBCDIR)/port/gen/errlst.c + \
+$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
+	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
 
-pics/errlst.o: ../port/gen/errlst.c
+pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
 
-pics/new_list.o: ../port/gen/new_list.c
+pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
--- a/usr/src/lib/libc/port/mapfile-vers	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/port/mapfile-vers	Mon Jun 28 15:32:48 2010 -0700
@@ -101,6 +101,11 @@
 $endif
 
     protected:
+
+$if sparc32
+	__align_cpy_1;
+$endif
+
 	addrtosymstr;
 	aio_cancel;
 	aiocancel;
@@ -1794,6 +1799,10 @@
 	ldexp			{ TYPE = FUNCTION; FILTER = libm.so.2 };
 	logb			{ TYPE = FUNCTION; FILTER = libm.so.2 };
 	malloc			{ FLAGS = NODIRECT };
+	memcmp;
+	memcpy;
+	memmove;
+	memset;
 	modf			{ TYPE = FUNCTION; FILTER = libm.so.2 };
 	_modf			{ TYPE = FUNCTION; FILTER = libm.so.2 };
 	nextafter		{ TYPE = FUNCTION; FILTER = libm.so.2 };
@@ -1810,14 +1819,6 @@
 	_timezone;
 	tzname;
 	_tzname;
-
-$if _x86
-	memcmp;
-	memcpy;
-	memmove;
-	memset;
-$endif
-
 $if i386
 	_fp_hw;
 $endif
@@ -2507,6 +2508,10 @@
 	_lten			{ FLAGS = NODYNSORT };
 	_lzero			{ FLAGS = NODYNSORT };
 	__malloc_lock;
+	_memcmp;
+	_memcpy			{ FLAGS = NODYNSORT };
+	_memmove;
+	_memset;
 	_modff			{ TYPE = FUNCTION; FILTER = libm.so.2 };
 	__nan_read;
 	__nan_written;
@@ -2576,14 +2581,6 @@
 	__mon_lengths;
 	__yday_to_month;
 $endif
-
-$if _x86
-	_memcmp;
-	_memcpy;
-	_memmove;
-	_memset;
-$endif
-
 $if i386
 	_sse_hw;
 $endif
--- a/usr/src/lib/libc/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -20,8 +20,7 @@
 #
 
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 LIBCBASE=.
@@ -35,6 +34,4 @@
 	strlen.o	\
 	strcpy.o
 
-MAPFILE_AUX =	mapfile-vers-aux
-
 include Makefile.com
--- a/usr/src/lib/libc/sparc/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/sparc/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -24,13 +24,22 @@
 #
 
 LIBCDIR=	$(SRC)/lib/libc
-LIB_PIC= libc_pic.a
-VERS=	.1
-CPP=	/usr/lib/cpp
+LIB_PIC=	libc_pic.a
+VERS=		.1
+CPP=		/usr/lib/cpp
 TARGET_ARCH=	sparc
 
 # objects are grouped by source directory
 
+# Symbol capabilities objects.
+EXTPICS=			\
+	$(LIBCDIR)/capabilities/sun4u/sparc/pics/symcap.o \
+	$(LIBCDIR)/capabilities/sun4u-opl/sparc/pics/symcap.o \
+	$(LIBCDIR)/capabilities/sun4u-us3-hwcap1/sparc/pics/symcap.o \
+	$(LIBCDIR)/capabilities/sun4u-us3-hwcap2/sparc/pics/symcap.o \
+	$(LIBCDIR)/capabilities/sun4v-hwcap1/sparc/pics/symcap.o \
+	$(LIBCDIR)/capabilities/sun4v-hwcap2/sparc/pics/symcap.o
+
 # local objects
 STRETS=				\
 	stret1.o		\
@@ -973,9 +982,9 @@
 ALTPICS= $(TRACEOBJS:%=pics/%)
 
 $(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
-$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
+$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
 
-MAPFILES =	$(LIBCDIR)/port/mapfile-vers $(MAPFILE_AUX)
+MAPFILES =	$(LIBCDIR)/port/mapfile-vers
 
 CFLAGS +=	$(EXTN_CFLAGS)
 CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
--- a/usr/src/lib/libc/sparc/gen/memcpy.s	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/sparc/gen/memcpy.s	Mon Jun 28 15:32:48 2010 -0700
@@ -20,8 +20,7 @@
  */
 
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
 	.file	"memcpy.s"
@@ -54,6 +53,7 @@
 	ANSI_PRAGMA_WEAK(memcpy,function)
 
 	ENTRY(memcpy)
+        ENTRY(__align_cpy_1)
 	st	%o0, [%sp + 68]		! save des address for return val
 	cmp	%o2, 17			! for small counts copy bytes
 	bleu	.dbytecp
--- a/usr/src/lib/libc/sparc/mapfile-vers-aux	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SYSVABI_1.3 {
-    global:
-	memcmp		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-	memcpy		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-	memmove		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-	memset		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-};
-
-SYMBOL_VERSION SUNWprivate_1.1 {
-    global:
-	_memcmp		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-	_memcpy	{
-		AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1;
-		FLAGS = NODYNSORT;
-	};
-	_memmove	{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-	_memset		{ AUXILIARY = /platform/$PLATFORM/lib/libc_psr.so.1 };
-};
--- a/usr/src/lib/libc/sparc_hwcap1/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-LIBCBASE=	$(SRC)/lib/libc/sparc
-
-LIBRARY=	libc_hwcap1.a
-
-EXTN_CPPFLAGS=	-I$(SRC)/uts/sun4v -I$(ROOT)/usr/platform/sun4v/include
-EXTN_ASFLAGS=	-xarch=v8plusd
-EXTN_DYNFLAGS=	-M mapfile
-
-# Defining this means build targets will first try to use source from this
-# directory before falling back to unoptimized sun4v source.
-#
-OPTIMIZED_LIBCBASE=../common
-
-PRFOBJS=		\
-	memcpy.o	\
-	memmove.o	\
-	memset.o	\
-	strlen.o	\
-	strcpy.o	\
-
-MAPFILE_AUX =	mapfile-vers-aux
-
-include $(SRC)/lib/libc/sparc/Makefile.com
--- a/usr/src/lib/libc/sparc_hwcap1/sparc/mapfile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw_1 += 0x10000;
-};
--- a/usr/src/lib/libc/sparc_hwcap1/sparc/mapfile-vers-aux	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SYSVABI_1.3 {
-    global:
-	memcmp;
-	memcpy;
-	memmove;
-	memset;
-};
-
-SYMBOL_VERSION SUNWprivate_1.1 {
-    global:
-	_memcmp;
-	_memcpy			{ FLAGS = NODYNSORT };
-	_memmove;
-	_memset;
-};
--- a/usr/src/lib/libc/sparc_hwcap1/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-LIBCBASE=	$(SRC)/lib/libc/sparcv9
-
-LIBRARY=	libc_hwcap1.a
-
-EXTN_CPPFLAGS=	-I$(SRC)/uts/sun4v -I$(ROOT)/usr/platform/sun4v/include
-EXTN_ASFLAGS=	-xarch=v9d
-EXTN_DYNFLAGS=	-M mapfile
-
-# Defining this means build targets will first try to use source from this
-# directory before falling back to unoptimized sun4v source.
-#
-OPTIMIZED_LIBCBASE=../common
-
-PRFOBJS=		\
-	memcpy.o	\
-	memmove.o	\
-	memset.o	\
-	strlen.o	\
-	strcpy.o	\
-
-MAPFILE_AUX =	mapfile-vers-aux
-
-include $(SRC)/lib/libc/sparcv9/Makefile.com
--- a/usr/src/lib/libc/sparc_hwcap1/sparcv9/mapfile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw_1 += 0x10000;
-};
--- a/usr/src/lib/libc/sparc_hwcap1/sparcv9/mapfile-vers-aux	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNW_0.7 {	# SunOS 5.3 (Solaris 2.3)
-    global:
-	memcmp;
-	memcpy;
-	memmove;
-	memset;
-};
-
-SYMBOL_VERSION SUNWprivate_1.1 {
-    global:
-	_memcmp;
-	_memcpy			{ FLAGS = NODYNSORT };
-	_memmove;
-	_memset;
-};
--- a/usr/src/lib/libc/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -20,8 +20,7 @@
 #
 
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 LIBCBASE=.
@@ -35,6 +34,4 @@
 	strlen.o	\
 	strcpy.o
 
-MAPFILE_AUX =	mapfile-vers-aux
-
 include Makefile.com
--- a/usr/src/lib/libc/sparcv9/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libc/sparcv9/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -24,13 +24,22 @@
 #
 
 LIBCDIR=	$(SRC)/lib/libc
-LIB_PIC= libc_pic.a
-VERS=	.1
-CPP=	/usr/lib/cpp
+LIB_PIC=	libc_pic.a
+VERS=		.1
+CPP=		/usr/lib/cpp
 TARGET_ARCH=	sparc
 
 # objects are grouped by source directory
 
+# Symbol capabilities objects.
+EXTPICS=			\
+        $(LIBCDIR)/capabilities/sun4u/sparcv9/pics/symcap.o \
+        $(LIBCDIR)/capabilities/sun4u-opl/sparcv9/pics/symcap.o \
+        $(LIBCDIR)/capabilities/sun4u-us3-hwcap1/sparcv9/pics/symcap.o \
+        $(LIBCDIR)/capabilities/sun4u-us3-hwcap2/sparcv9/pics/symcap.o \
+        $(LIBCDIR)/capabilities/sun4v-hwcap1/sparcv9/pics/symcap.o \
+        $(LIBCDIR)/capabilities/sun4v-hwcap2/sparcv9/pics/symcap.o
+
 # local objects
 STRETS=
 
@@ -922,9 +931,9 @@
 ALTPICS= $(TRACEOBJS:%=pics/%)
 
 $(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
-$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
+$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
 
-MAPFILES =	$(LIBCDIR)/port/mapfile-vers $(MAPFILE_AUX)
+MAPFILES =	$(LIBCDIR)/port/mapfile-vers
 
 sparcv9_C_PICFLAGS= -K PIC
 CFLAGS64 +=	$(EXTN_CFLAGS)
--- a/usr/src/lib/libc/sparcv9/mapfile-vers-aux	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNW_0.7 {	# SunOS 5.3 (Solaris 2.3)
-    global:
-	memcmp	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-	memcpy	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-	memmove	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-	memset	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-};
-
-SYMBOL_VERSION SUNWprivate_1.1 {
-    global:
-	_memcmp	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-	_memcpy	{
-		AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1;
-		FLAGS = NODYNSORT;
-	};
-	_memmove { AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-	_memset	{ AUXILIARY = /platform/$PLATFORM/lib/sparcv9/libc_psr.so.1 };
-};
--- a/usr/src/lib/libc_psr/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../Makefile.lib
-
-SUBDIRS = etc sun4u sun4u-opl sun4u-us3 sun4u_hwcap1 sun4u_hwcap2 \
-	sun4v sun4v_hwcap1 sun4v_hwcap2
-
-all :=		TARGET= all
-install :=	TARGET= install
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-lint :=		TARGET= lint
-
-.KEEP_STATE:
-
-all install clean clobber lint: $(SUBDIRS)
-
-$(SUBDIRS): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-include $(SRC)/lib/Makefile.targ
-include $(SRC)/Makefile.psm.targ
-
-pics/%.o := ASFLAGS += $(AS_PICFLAGS)
--- a/usr/src/lib/libc_psr/etc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# Makefile for libc_psr (hwcap) flarcreate precreation scripts
-#
-#
-# usr/src/lib/libc_psr/etc/Makefile
-
-include ../../../Makefile.master
-
-FLASHPRESRC=	caplib.ksh
-FLASHPREPROG=	$(FLASHPRESRC:%.ksh=%)
-
-all:=           TARGET= all
-install:=       TARGET= install
-clean:=         TARGET= clean
-clobber:=       TARGET= clobber
-lint:=          TARGET= lint
-
-ROOTETC=	$(ROOT)/etc
-ETCFLASHD=	$(ROOTETC)/flash
-ETCFLASHPREC=	$(ROOTETC)/flash/precreation
-ETCFLASHPREE=	$(ROOTETC)/flash/preexit
-ETCFLASHPOSTC=	$(ROOTETC)/flash/postcreation
-
-DIRS=		$(ETCFLASHPREC) $(ETCFLASHPREE) $(ETCFLASHPOSTC)
-
-ETCFLASHPREPROG=	$(FLASHPREPROG:%=$(ETCFLASHPREC)/%)
-
-$(ETCFLASHD) :=	DIRMODE=	755
-$(ETCFLASHPREC) :=	DIRMODE=	700
-$(ETCFLASHPREE) :=	DIRMODE=	700
-$(ETCFLASHPOSTC) :=	DIRMODE=	700
-$(ETCFLASHPREPROG) :=	FILEMODE=       0500
-
-.KEEP_STATE:
-
-all: $(FLASHPREPROG)
-
-install: all .WAIT $(DIRS) .WAIT $(ETCFLASHPREPROG)
-
-cstyle:
-
-lint:
-
-$(FLASHPREPROG): $(FLASHPRESRC)
-	$(CP) $@.ksh $@
-
-$(DIRS):
-	$(INS.dir)
-
-$(ETCFLASHPREC)/% : %
-	$(INS.file)
-
-$(ETCFLASHPREE)/% : %
-	$(INS.file)
-
-$(ETCFLASHPOSTC)/% : %
-	$(INS.file)
-
-clean:
-	$(RM) $(FLASHPREPROG)
-
-clobber: clean
-	$(RM) $(ETCFLASHPREPROG)
--- a/usr/src/lib/libc_psr/etc/caplib.ksh	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-#!/bin/ksh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# This script is called by flarcreate.sh
-#
-# Unmount any hwcap libraries (like /usr/lib/libc_psr/libc_psr_hwcap2.so.1)
-# and store commands needed to remount them in preexit/remount_hwcap.xxxx
-# scripts, which remounts them in the preexit phase.
-#  
-
-if [ -z "$FLASH_PID" ]; then
-	echo "$0: ERROR: FLASH_PID not set in execution environment, exiting..."
-	exit 1 
-fi
-if [ -z "$FLASH_DIR" ]; then
-	echo "$0: ERROR: FLASH_DIR not set in execution environment, exiting..."
-	exit 1 
-fi
-
-CHMOD=/usr/bin/chmod
-MOUNT=/usr/sbin/mount
-UMOUNT=/usr/sbin/umount
-EGREP=/usr/bin/egrep
-SED=/usr/bin/sed
-CMD_LIST="$CHMOD $MOUNT $UMOUNT $EGREP $SED"
-
-for cmd in $CMD_LIST
-do
-    if [ ! -x $cmd ]; then
-	echo "$0: ERROR: $cmd not found or not executable, exiting..."
-	exit 1
-    fi
-done
-
-#
-# Fill "LIBS" with a list of mounted libraries in the form:
-# 	MOUNTPOUNT:FILE
-# e.g.:
-#	/lib/libc.so.1:/usr/lib/libc/libc_hwcap2.so.1
-#
-LIBS=`$MOUNT | $EGREP "^/platform.*hwcap" | \
-    $SED -e 's:^\(/[^ ]*\) on \([^ ]*\).*$:\1@\2:'`
-
-if [ -z "$LIBS" ]; then
-	exit 0
-fi
-
-REMOUNT_DIR=${FLASH_DIR}/preexit
-REMOUNT=${REMOUNT_DIR}/remount_hwcap.${FLASH_PID}
-
-#
-# Create the flash preexit script directory for the remount scripts if it
-# doesn't already exist.
-#
-if [ ! -d $REMOUNT_DIR ]; then
-	umask 077
-	/usr/bin/mkdir $REMOUNT_DIR
-	if [ $? -ne 0 ]; then
-		echo "$0: ERROR: could not mkdir $REMOUNT_DIR, exiting..."
-		exit 1
-	fi
-fi
-
-#
-# If an old remount script by this name exists, delete it
-#
-if [ -f $REMOUNT ]; then
-	/bin/rm -f $REMOUNT
-fi
-
-umask 477
-
-cat > $REMOUNT << EOF
-#!/bin/sh
-if [ \"\$FLASH_PID\" != \"$FLASH_PID\" ]; then
-	/bin/rm -f $REMOUNT
-	exit 0
-fi
-EOF
-
-if [ $? -ne 0 ]; then
-	echo "$0: ERROR: could not create $REMOUNT, exiting..."
-	exit 1
-fi
-
-#
-# Now process each of the libraries that are mounted.  For each, find out if
-# it's a hwcap library; if it is, unmount it and write instructions to the
-# preexit script as to how to remount it.
-# 
-for entry in $LIBS
-do
-	echo $entry | IFS=@ read MOUNTPOINT MOUNTLIB
-	$UMOUNT $MOUNTPOINT || $UMOUNT -f $MOUNTPOINT || \
-	    { echo "$0: ERROR: Could not unmount" \
-		  "$MOUNTPOINT, exiting..."; \
-	      /bin/sh $REMOUNT; /bin/rm -f $REMOUNT; exit 1; }
-
-	MOUNTOPTS="-O -F lofs"
-	echo "$MOUNT $MOUNTOPTS $MOUNTLIB $MOUNTPOINT" >> $REMOUNT
-done
-
-#
-# Write final cleanup instructions to the flash preexit remount script and make
-# it executable.
-#
-echo "/bin/rm -f $REMOUNT" >> $REMOUNT
-echo "exit 0" >> $REMOUNT
-$CHMOD 0500 $REMOUNT
-exit 0
--- a/usr/src/lib/libc_psr/sun4u-opl/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-PLATFORM=	sun4u-opl
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-MODULE		= libc_psr.so.1
-LIBC_PSR_DIRS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
-LIBC_PSR_LINKS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
-INS.slink6	= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-LIBC_PSR64_DIRS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
-LIBC_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-INS.slink7	= $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-#
-# Used when building links in /platform/$(PLATFORM)/lib
-#
-LINKED_PLATFORMS	= SUNW,SPARC-Enterprise
-
-all install: lib32 $(BUILD64) lib64 $(LIBC_PSR_LINKS) $(LIBC_PSR64_LINKS)
-
-clean clobber: lib32 $(BUILD64) lib64
-
-$(LIBC_PSR_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR_LINKS): $(LIBC_PSR_DIRS)
-	-$(INS.slink6)
-
-$(LIBC_PSR64_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LINKS): $(LIBC_PSR64_DIRS)
-	-$(INS.slink7)
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4u-opl/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-#
-#	Create default so empty rules don't
-#	confuse make
-#
-
-LIBRARY		= libc_psr.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/sun4u \
-		  -I$(ROOT)/usr/platform/sun4u/include
-CPPFLAGS	= -D_REENTRANT -D$(MACH) $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-#
-# install rule
-#
-$(ROOT_PSM_LIB_DIR)/%: % $(ROOT_PSM_LIB_DIR)
-	$(INS.file)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
-
-pics/%.o: ../../$(COMPAT_PLAT)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
--- a/usr/src/lib/libc_psr/sun4u-opl/common/memcpy.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1020 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcpy.s"
-
-/*
- * memcpy(s1, s2, len)
- *
- * Copy s2 to s1, always copy n bytes.
- * Note: this C code does not work for overlapped copies.
- *       Memmove() and bcopy() do.
- *
- * Fast assembler language version of the following C-program for memcpy
- * which represents the `standard' for the C-library.
- *
- *	void *
- *	memcpy(void *s, const void *s0, size_t n)
- *	{
- *		if (n != 0) {
- *	   	    char *s1 = s;
- *		    const char *s2 = s0;
- *		    do {
- *			*s1++ = *s2++;
- *		    } while (--n != 0);
- *		}
- *		return (s);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-#include <sys/trap.h>
-
-#define	ICACHE_LINE_SIZE	64
-#define	BLOCK_SIZE		64
-#define	FPRS_FEF		0x4
-
-#define	ALIGNED8_FPCOPY_THRESHOLD	1024
-#define	ALIGNED4_FPCOPY_THRESHOLD	1024
-#define	BST_THRESHOLD			65536
-
-#define	SHORTCOPY	3
-#define	SMALL_MAX	64
-#define	MEDIUM_MAX	255
-#define	MED_WMAX	256	/* max copy for medium word-aligned case */
-
-#define	N_READS_STRONG	20
-#define	N_WRITES_STRONG	22
-
-
-	ANSI_PRAGMA_WEAK(memmove,function)
-	ANSI_PRAGMA_WEAK(memcpy,function)
-
-	ENTRY(memmove)
-	prefetch [%o1], N_READS_STRONG
-	prefetch [%o0], N_WRITES_STRONG
-	cmp	%o1, %o0	! if from address is >= to use forward copy
-	bgeu	%ncc, .forcpy	! else use backward if ...
-	sub	%o0, %o1, %o4	! get difference of two addresses
-	cmp	%o2, %o4	! compare size and difference of addresses
-	bleu	%ncc, .forcpy	! if size is bigger, do overlapped copy
-	nop
-
-	!
-	! an overlapped copy that must be done "backwards"
-	!
-.ovbc:
-	mov	%o0, %g1		! save dest address for return val
-	add     %o1, %o2, %o1           ! get to end of source space
-	add     %o0, %o2, %o0           ! get to end of destination space
-
-	cmp	%o2, 64
-	bgeu,pn	%ncc, .dbalign
-	nop
-	cmp	%o2, 4
-	blt,pn	%ncc, .byte
-	sub	%o2, 3, %o2
-.byte4loop:
-	ldub	[%o1-1], %o3		! load last byte
-	stb	%o3, [%o0-1]		! store last byte
-	sub	%o1, 4, %o1
-	ldub	[%o1+2], %o3		! load 2nd from last byte
-	stb	%o3, [%o0-2]		! store 2nd from last byte
-	sub	%o0, 4, %o0
-	ldub	[%o1+1], %o3		! load 3rd from last byte
-	stb	%o3, [%o0+1]		! store 3rd from last byte
-	subcc	%o2, 4, %o2
-	ldub	[%o1], %o3		! load 4th from last byte
-	bgu,pt	%ncc, .byte4loop
-	stb	%o3, [%o0]		! store 4th from last byte
-.byte:
-	addcc	%o2, 3, %o2
-	bz,pt	%ncc, .exit
-.byteloop:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o2			! decrement count
-	bgu,pt	%ncc, .byteloop		! loop until done
-	stb	%o3, [%o0]		! write byte
-.exit:
-	retl
-	mov	%g1, %o0
-
-	.align	16
-.dbalign:
-	prefetch [%o1 - (4 * BLOCK_SIZE)], #one_read
-	prefetch [%o0 - (4 * BLOCK_SIZE)], #one_write
-	andcc   %o0, 7, %o5		! bytes till DST 8 byte aligned
-	bz,pt	%ncc, .dbmed
-	sub	%o2, %o5, %o2		! update count
-.dbalign1:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o5			! decrement count
-	bgu,pt	%ncc, .dbalign1		! loop until done
-	stb	%o3, [%o0]		! store a byte
-
-! check for src long word alignment
-.dbmed:
-	andcc	%o1, 7, %g0		! chk src long word alignment
-	bnz,pn	%ncc, .dbbck
-	nop
-!
-! Following code is for overlapping copies where src and dest
-! are long word aligned
-!
-!
-! For SPARC64-VI, prefetch is effective for both integer and fp register
-! operations. There are no benefits in using the fp registers for
-! aligned data copying.
-	
-.dbmedl32enter:
-	subcc	%o2, 31, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt  %ncc, .dbmedl31		! skip big loop if less than 32
-	nop
-.dbmedl32:
-	ldx	[%o1-8], %o4		! load
-	prefetch [%o1 - (8 * BLOCK_SIZE)], #one_read
-	subcc	%o2, 32, %o2		! decrement length count
-	stx	%o4, [%o0-8]		! and store
-	prefetch [%o0 - (8 * BLOCK_SIZE)], #one_write
-	ldx	[%o1-16], %o3		! a block of 32 bytes
-	sub	%o1, 32, %o1		! decrease src ptr by 32
-	stx	%o3, [%o0-16]
-	ldx	[%o1+8], %o4
-	sub	%o0, 32, %o0		! decrease dst ptr by 32
-	stx	%o4, [%o0+8]
-	ldx	[%o1], %o3
-	bgu,pt	%ncc, .dbmedl32		! repeat if at least 32 bytes left
-	stx	%o3, [%o0]
-.dbmedl31:
-	addcc	%o2, 16, %o2		! adjust remaining count
-	ble,pt	%ncc, .dbmedl15		! skip if 15 or fewer bytes left
-	nop				!
-	ldx	[%o1-8], %o4		! load and store 16 bytes
-	sub	%o1, 16, %o1		! decrease src ptr by 16
-	stx	%o4, [%o0-8]		!
-	sub	%o2, 16, %o2		! decrease count by 16
-	ldx	[%o1], %o3		!
-	sub	%o0, 16, %o0		! decrease dst ptr by 16
-	stx	%o3, [%o0]
-.dbmedl15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .dbexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .dbremain		! skip if 7 or fewer bytes left
-	nop
-	ldx	[%o1-8], %o4		! load 8 bytes
-	sub	%o1, 8, %o1		! decrease src ptr by 8
-	stx	%o4, [%o0-8]		! and store 8 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	bnz	%ncc, .dbremain		! exit if finished
-	sub	%o0, 8, %o0		! decrease dst ptr by 8
-	retl
-	mov	%g1, %o0
-
-!
-! Following code is for overlapping copies where src and dest
-! are not long word aligned
-!
-	.align	16
-.dbbck:
-	rd	%fprs, %o3		! o3 = fprs
-
-	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
-	! So set it anyway, without checking.
-	wr	%g0, 0x4, %fprs		! fprs.fef = 1
-
-	alignaddr %o1, %g0, %o5		! align src
-	ldd	[%o5], %d0		! get first 8 byte block
-	andn	%o2, 7, %o4		! prepare src ptr for finishup code
-	cmp	%o2, 32
-	blt,pn	%ncc, .dbmv8
-	sub	%o1, %o4, %o1		!
-	cmp	%o2, 4095		! check for short memmoves
-	blt,pn	%ncc, .dbmv32enter	! go to no prefetch code
-.dbmv64:
-	ldd	[%o5-8], %d2		! load 8 bytes
-	ldd	[%o5-16], %d4		! load 8 bytes
-	sub	%o5, 64, %o5		!
-	ldd	[%o5+40], %d6		! load 8 bytes
-	sub	%o0, 64, %o0		!
-	ldd	[%o5+32], %d8		! load 8 bytes
-	sub	%o2, 64, %o2		! 64 less bytes to copy
-	ldd	[%o5+24], %d18		! load 8 bytes
-	cmp	%o2, 64			! do we have < 64 bytes remaining
-	ldd	[%o5+16], %d28		! load 8 bytes
-	ldd	[%o5+8], %d30		! load 8 bytes
-	faligndata %d2, %d0, %d10	! extract 8 bytes out
-	prefetch [%o5 - (5 * BLOCK_SIZE)], #one_read
-	ldd	[%o5], %d0		! load 8 bytes
-	std	%d10, [%o0+56]		! store the current 8 bytes
-	faligndata %d4, %d2, %d12	! extract 8 bytes out
-	prefetch [%o0 - (5 * BLOCK_SIZE)], #one_write
-	std	%d12, [%o0+48]		! store the current 8 bytes
-	faligndata %d6, %d4, %d14	! extract 8 bytes out
-	std	%d14, [%o0+40]		! store the current 8 bytes
-	faligndata %d8, %d6, %d16	! extract 8 bytes out
-	std	%d16, [%o0+32]		! store the current 8 bytes
-	faligndata %d18, %d8, %d20	! extract 8 bytes out
-	std	%d20, [%o0+24]		! store the current 8 bytes
-	faligndata %d28, %d18, %d22	! extract 8 bytes out
-	std	%d22, [%o0+16]		! store the current 8 bytes
-	faligndata %d30, %d28, %d24	! extract 8 bytes out
-	std	%d24, [%o0+8]		! store the current 8 bytes
-	faligndata %d0, %d30, %d26	! extract 8 bytes out
-	bgeu,pt	%ncc, .dbmv64
-	std	%d26, [%o0]		! store the current 8 bytes
-
-	cmp	%o2, 32
-	blt,pn	%ncc, .dbmvx
-	nop
-.dbmv32:
-	ldd	[%o5-8], %d2		! load 8 bytes
-.dbmv32enter:
-	ldd	[%o5-16], %d4		! load 8 bytes
-	sub	%o5, 32, %o5		!
-	ldd	[%o5+8], %d6		! load 8 bytes
-	sub	%o0, 32, %o0		!
-	faligndata %d2, %d0, %d10	! extract 8 bytes out
-	ldd	[%o5], %d0		! load 8 bytes
-	sub	%o2,32, %o2		! 32 less bytes to copy
-	std	%d10, [%o0+24]		! store the current 8 bytes
-	cmp	%o2, 32			! do we have < 32 bytes remaining
-	faligndata %d4, %d2, %d12	! extract 8 bytes out
-	std	%d12, [%o0+16]		! store the current 8 bytes
-	faligndata %d6, %d4, %d14	! extract 8 bytes out
-	std	%d14, [%o0+8]		! store the current 8 bytes
-	faligndata %d0, %d6, %d16	! extract 8 bytes out
-	bgeu,pt	%ncc, .dbmv32
-	std	%d16, [%o0]		! store the current 8 bytes
-.dbmvx:
-	cmp	%o2, 8			! do we have < 8 bytes remaining
-	blt,pt	%ncc, .dbmvfinish	! if yes, skip to finish up code
-	nop
-.dbmv8:
-	ldd	[%o5-8], %d2
-	sub	%o0, 8, %o0		! since we are at the end
-					! when we first enter the loop
-	sub	%o2, 8, %o2		! 8 less bytes to copy
-	sub	%o5, 8, %o5
-	cmp	%o2, 8			! do we have < 8 bytes remaining
-	faligndata %d2, %d0, %d8	! extract 8 bytes out
-	std	%d8, [%o0]		! store the current 8 bytes
-	bgeu,pt	%ncc, .dbmv8
-	fmovd	%d2, %d0
-.dbmvfinish:
-	and	%o3, 0x4, %o3		! fprs.du = fprs.dl = 0
-	tst	%o2
-	bz,pt	%ncc, .dbexit
-	wr	%o3, %g0, %fprs		! fprs = o3   restore fprs
-
-.dbremain:
-	cmp	%o2, 4
-	blt,pn	%ncc, .dbbyte
-	nop
-	ldub	[%o1-1], %o3		! load last byte
-	stb	%o3, [%o0-1]		! store last byte
-	sub	%o1, 4, %o1
-	ldub	[%o1+2], %o3		! load 2nd from last byte
-	stb	%o3, [%o0-2]		! store 2nd from last byte
-	sub	%o0, 4, %o0
-	ldub	[%o1+1], %o3		! load 3rd from last byte
-	stb	%o3, [%o0+1]		! store 3rd from last byte
-	subcc	%o2, 4, %o2
-	ldub	[%o1], %o3		! load 4th from last byte
-	stb	%o3, [%o0]		! store 4th from last byte
-	bz,pt	%ncc, .dbexit
-.dbbyte:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o2			! decrement count
-	bgu,pt	%ncc, .dbbyte		! loop until done
-	stb	%o3, [%o0]		! write byte
-.dbexit:
-	retl
-	mov	%g1, %o0
-	SET_SIZE(memmove)
-
-
-	.align ICACHE_LINE_SIZE
-	ENTRY(memcpy)
-					! adjust instruction alignment
-	nop				! Do not remove, these nops affect
-	nop				! icache alignment and performance
-.forcpy:
-	prefetch [%o1], N_READS_STRONG
-	prefetch [%o0], N_WRITES_STRONG
-	cmp	%o2, SMALL_MAX		! check for not small case
-	bgu,pn	%ncc, .medium		! go to larger cases
-	mov	%o0, %g1		! save %o0
-	cmp	%o2, SHORTCOPY		! check for really short case
-	ble,pt	%ncc, .smallleft	!
-	or	%o0, %o1, %o3		! prepare alignment check
-	andcc	%o3, 0x3, %g0		! test for alignment
-	bz,pt	%ncc, .smallword	! branch to word aligned case
-	sub	%o2, 3, %o2		! adjust count to allow cc zero test
-.smallnotalign4:
-	ldub	[%o1], %o3		! read byte
-	subcc	%o2, 4, %o2		! reduce count by 4
-	stb	%o3, [%o0]		! write byte
-	ldub	[%o1+1], %o3		! repeat for a total of 4 bytes
-	add	%o1, 4, %o1		! advance SRC by 4
-	stb	%o3, [%o0+1]
-	ldub	[%o1-2], %o3
-	add	%o0, 4, %o0		! advance DST by 4
-	stb	%o3, [%o0-2]
-	ldub	[%o1-1], %o3
-	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
-	stb	%o3, [%o0-1]
-	add	%o2, 3, %o2		! restore count
-.smallleft:
-	tst	%o2
-	bz,pt	%ncc, .smallexit
-	nop
-.smallleft3:				! 1, 2, or 3 bytes remain
-	ldub	[%o1], %o3		! load one byte
-	deccc	%o2			! reduce count for cc test
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0]		! store one byte
-	ldub	[%o1+1], %o3		! load second byte
-	deccc	%o2
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+1]		! store second byte
-	ldub	[%o1+2], %o3		! load third byte
-	stb	%o3, [%o0+2]		! store third byte
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align	16
-	nop				! affects loop icache alignment
-.smallwords:
-	lduw	[%o1], %o3		! read word
-.smallwordx:
-	subcc	%o2, 8, %o2		! update count
-	stw	%o3, [%o0]		! write word
-	add	%o1, 8, %o1		! update SRC
-	lduw	[%o1-4], %o3		! read word
-	add	%o0, 8, %o0		! update DST
-	bgu,pt	%ncc, .smallwords	! loop until done
-	stw	%o3, [%o0-4]		! write word
-	addcc	%o2, 7, %o2		! restore count
-	bz,pt	%ncc, .smallexit	! check for completion
-	nop
-	cmp	%o2, 4			! check for 4 or more bytes left
-	blt	.smallleft3		! if not, go to finish up
-	nop
-	lduw	[%o1], %o3
-	add	%o1, 4, %o1
-	subcc	%o2, 4, %o2
-	stw	%o3, [%o0]
-	add	%o0, 4, %o0
-	bnz,pt	%ncc, .smallleft3
-	nop
-	retl
-	mov	%g1, %o0		! restore %o0
-
-.smallword:
-	subcc	%o2, 4, %o2		! update count
-	bgu,pt	%ncc, .smallwordx
-	lduw	[%o1], %o3		! read word
-	addcc	%o2, 3, %o2		! restore count
-	bz,pt	%ncc, .smallexit
-	stw	%o3, [%o0]		! write word
-	deccc	%o2			! reduce count for cc test
-	ldub	[%o1+4], %o3		! load one byte
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+4]		! store one byte
-	ldub	[%o1+5], %o3		! load second byte
-	deccc	%o2
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+5]		! store second byte
-	ldub	[%o1+6], %o3		! load third byte
-	stb	%o3, [%o0+6]		! store third byte
-.smallexit:
-	retl
-	mov	%g1, %o0		! restore %o0
-	.align 16
-.medium:
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_write
-	neg	%o0, %o5
-	neg	%o1, %o3
-	andcc	%o5, 7, %o5	! bytes till DST 8 byte aligned
-	and	%o3, 7, %o3	! bytes till SRC 8 byte aligned
-
-	bz	%ncc, 2f
-	sub	%o5, %o3, %o3	! -(bytes till SRC aligned after DST aligned)
-				! o3={-7, -6, ... 7}  o3>0 => SRC overaligned
-
-	sub	%o2, %o5, %o2	! update count
-
-1:
-	ldub	[%o1], %o4
-	deccc	%o5
-	inc	%o1
-	stb	%o4, [%o0]
-	bgu,pt	%ncc, 1b
-	inc	%o0
-
-	! Now DST is 8-byte aligned.  o0, o1, o2 are current.
-
-2:
-	andcc	%o1, 0x3, %g0		! test alignment
-	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
-	bnz,pt	%ncc, .mediumsetup	! branch to skip aligned cases
-					! if src, dst not aligned
-	prefetch [%o0 + (1 * BLOCK_SIZE)], #one_write
-
-/*
- * Handle all cases where src and dest are aligned on word
- * or long word boundaries.  Use unrolled loops for better
- * performance.  This option wins over standard large data
- * move when source and destination is in cache for medium
- * to short data moves.
- */
-	andcc	%o1, 0x7, %g0		! test word alignment
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-	bz,pt	%ncc, .medlword		! branch to long word aligned case
-	prefetch [%o0 + (2 * BLOCK_SIZE)], #one_write
-	cmp	%o2, ALIGNED4_FPCOPY_THRESHOLD	! limit to store buffer size
-	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-	subcc	%o2, 15, %o2		! adjust length to allow cc test
-	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_write
-					! for end of loop
-	ble,pt	%ncc, .medw15		! skip big loop if less than 16
-	  .empty
-.medw16:
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ld	[%o1], %o4		! load
-	subcc	%o2, 16, %o2		! decrement length count
-	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_write
-	stw	%o4, [%o0]		! and store
-	ld	[%o1+4], %o3		! a block of 16 bytes
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stw	%o3, [%o0+4]
-	ld	[%o1-8], %o4
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stw	%o4, [%o0-8]
-	ld	[%o1-4], %o3
-	bgu,pt	%ncc, .medw16		! repeat if at least 16 bytes left
-	stw	%o3, [%o0-4]
-.medw15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .medwexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	nop				!
-	ld	[%o1], %o4		! load 4 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	stw	%o4, [%o0]		! and store 4 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	ld	[%o1-4], %o3		! load 4 bytes
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	stw	%o3, [%o0-4]		! and store 4 bytes
-	bz	%ncc, .medwexit		! exit if finished
-	nop
-.medw7:					! count is ge 1, less than 8
-	cmp	%o2, 3			! check for 4 bytes left
-	ble,pt	%ncc, .medw3		! skip if 3 or fewer bytes left
-	nop				!
-	ld	[%o1], %o4		! load 4 bytes
-	sub	%o2, 4, %o2		! decrease count by 4
-	add	%o1, 4, %o1		! increase src ptr by 4
-	stw	%o4, [%o0]		! and store 4 bytes
-	add	%o0, 4, %o0		! increase dst ptr by 4
-	tst	%o2			! check for zero bytes left
-	bz	%ncc, .medwexit		! exit if finished
-	nop
-.medw3:					! count is known to be 1, 2, or 3
-	deccc	%o2			! reduce count by one
-	ldub	[%o1], %o3		! load one byte
-	bz,pt	%ncc, .medwexit		! exit if last byte
-	stb	%o3, [%o0]		! store one byte
-	ldub	[%o1+1], %o3		! load second byte
-	deccc	%o2			! reduce count by one
-	bz,pt	%ncc, .medwexit		! exit if last byte
-	stb	%o3, [%o0+1]		! store second byte
-	ldub	[%o1+2], %o3		! load third byte
-	stb	%o3, [%o0+2]		! store third byte
-.medwexit:
-	retl
-	mov	%g1, %o0		! restore %o0
-
-/*
- * Special case for handling when src and dest are both long word aligned
- * and total data to move is between SMALL_MAX and ALIGNED8_FPCOPY_THRESHOLD
- * bytes.
- */
-
-	.align 16
-	nop
-.medlword:				! long word aligned
-					! length > ALIGNED8_FPCOPY_THRESHOLD
-	cmp	%o2, ALIGNED8_FPCOPY_THRESHOLD
-	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_write
-	subcc	%o2, 31, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt	%ncc, .medl31		! skip big loop if less than 32
-	  .empty
-.medl32:
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ldx	[%o1], %o4		! load
-	subcc	%o2, 32, %o2		! decrement length count
-	prefetch [%o0 + (4 * BLOCK_SIZE)], #one_read
-	stx	%o4, [%o0]		! and store
-	ldx	[%o1+8], %o3		! a block of 32 bytes
-	add	%o1, 32, %o1		! increase src ptr by 32
-	stx	%o3, [%o0+8]
-	ldx	[%o1-16], %o4
-	add	%o0, 32, %o0		! increase dst ptr by 32
-	stx	%o4, [%o0-16]
-	ldx	[%o1-8], %o3
-	bgu,pt	%ncc, .medl32		! repeat if at least 32 bytes left
-	stx	%o3, [%o0-8]
-.medl31:
-	addcc	%o2, 16, %o2		! adjust remaining count
-	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
-	nop				!
-	ldx	[%o1], %o4		! load and store 16 bytes
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stx	%o4, [%o0]		!
-	sub	%o2, 16, %o2		! decrease count by 16
-	ldx	[%o1-8], %o3		!
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stx	%o3, [%o0-8]
-.medl15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .medwexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	nop
-	ldx	[%o1], %o4		! load 8 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	stx	%o4, [%o0]		! and store 8 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	bz	%ncc, .medwexit		! exit if finished
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	ba	.medw7
-	nop
-
-	.align 16
-	nop
-	nop
-	nop
-.mediumsetup:
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-.mediumrejoin:
-	rd	%fprs, %o4		! check for unused FPU
-
-	add	%o1, 8, %o1		! prepare to round SRC upward
-
-	sethi	%hi(0x1234567f), %o5	! For GSR.MASK
-	or	%o5, 0x67f, %o5
-
-	andcc	%o4, FPRS_FEF, %o4	! test FEF, fprs.du = fprs.dl = 0
-	bz,a	%ncc, 3f
-	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
-3:
-	cmp	%o2, MEDIUM_MAX
-	bmask	%o5, %g0, %g0
-
-	! Compute o5 (number of bytes that need copying using the main loop).
-	! First, compute for the medium case.
-	! Then, if large case, o5 is replaced by count for block alignment.
-	! Be careful not to read past end of SRC
-	! Currently, o2 is the actual count remaining
-	!            o3 is how much sooner we'll cross the alignment boundary
-	!                in SRC compared to in DST
-	!
-	! Examples:  Let # denote bytes that should not be accessed
-	!            Let x denote a byte already copied to align DST
-	!            Let . and - denote bytes not yet copied
-	!            Let | denote double alignment boundaries
-	!
-	!            DST:  ######xx|........|--------|..######   o2 = 18
-	!                          o0
-	!
-	!  o3 = -3:  SRC:  ###xx...|.....---|-----..#|########   o5 = 8
-	!                          o1
-	!
-	!  o3 =  0:  SRC:  ######xx|........|--------|..######   o5 = 16-8 = 8
-	!                                   o1
-	!
-	!  o3 = +1:  SRC:  #######x|x.......|.-------|-..#####   o5 = 16-8 = 8
-	!                                   o1
-
-	or	%g0, -8, %o5
-	alignaddr %o1, %g0, %o1		! set GSR.ALIGN and align o1
-
-	movrlz	%o3, %g0, %o5		! subtract 8 from o2+o3 only if o3>=0
-	add	%o5, %o2, %o5
-	add	%o5, %o3, %o5
-
-	bleu	%ncc, 4f
-	andn	%o5, 7, %o5		! 8 byte aligned count
-	neg	%o0, %o5		! 'large' case
-	and	%o5, BLOCK_SIZE-1, %o5  ! bytes till DST block aligned
-4:
-	brgez,a	%o3, .beginmedloop
-	ldd	[%o1-8], %d0
-
-	add	%o1, %o3, %o1		! back up o1
-5:
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	andcc	%o1, 7, %g0
-	bnz	%ncc, 5b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-.beginmedloop:
-	tst	%o5
-	bz	%ncc, .endmedloop
-	sub	%o2, %o5, %o2		! update count for later
-
-	! Main loop to write out doubles.  Note: o5 & 7 == 0
-
-	ldd	[%o1], %d2
-	subcc	%o5, 8, %o5		! update local count
-	bz,pn	%ncc, 1f
-	add	%o1, 8, %o1		! update SRC
-
-.medloop:
-	faligndata %d0, %d2, %d4
-	ldd	[%o1], %d0
-	subcc	%o5, 8, %o5		! update local count
-	add	%o1, 16, %o1		! update SRC
-	std	%d4, [%o0]
-	bz,pn	%ncc, 2f
-	faligndata %d2, %d0, %d6
-	ldd	[%o1 - 8], %d2
-	subcc	%o5, 8, %o5		! update local count
-	std	%d6, [%o0 + 8]
-	bnz,pt	%ncc, .medloop
-	add	%o0, 16, %o0		! update DST
-
-1:
-	faligndata %d0, %d2, %d4
-	fmovd	%d2, %d0
-	std	%d4, [%o0]
-	ba	.endmedloop
-	add	%o0, 8, %o0
-
-2:
-	std	%d6, [%o0 + 8]
-	sub	%o1, 8, %o1
-	add	%o0, 16, %o0
-
-
-.endmedloop:
-	! Currently, o1 is pointing to the next double-aligned byte in SRC
-	! The 8 bytes starting at [o1-8] are available in d0
-	! At least one, and possibly all, of these need to be written.
-
-	cmp	%o2, BLOCK_SIZE
-	bgu	%ncc, .large		! otherwise, less than 16 bytes left
-
-#if 0
-
-	/* This code will use partial stores.  */
-
-	mov	%g0, %o5
-	and	%o3, 7, %o3		! Number of bytes needed to completely
-					! fill %d0 with good (unwritten) data.
-
-	subcc	%o2, 8, %o2		! update count (maybe too much)
-	movl	%ncc, %o2, %o5
-	addcc	%o3, %o5, %o5		! extra bytes we can stuff into %d0
-	sub	%o3, %o5, %o3		! update o3 (# bad bytes in %d0)
-
-	bz	%ncc, 2f
-	alignaddr %o3, %g0, %g0		! set GSR.ALIGN
-
-1:
-	deccc	%o5
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	bgu	%ncc, 1b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-2:
-	not	%o3
-	faligndata %d0, %d0, %d0	! shift bytes to the left
-	and	%o3, 7, %o3		! last byte to be stored in [%o0+%o3]
-	edge8n	%g0, %o3, %o5
-	stda	%d0, [%o0]%o5, ASI_PST8_P
-	brlez	%o2, .mediumexit
-	add	%o0, %o3, %o0		! update DST to last stored byte
-3:
-	inc	%o0
-	deccc	%o2
-	ldub	[%o1], %o3
-	stb	%o3, [%o0]
-	bgu	%ncc, 3b
-	inc	%o1
-
-#else
-
-	andcc	%o3, 7, %o5		! Number of bytes needed to completely
-					! fill %d0 with good (unwritten) data.
-	bz	%ncc, 2f
-	sub	%o5, 8, %o3		! -(number of good bytes in %d0)
-	cmp	%o2, 8
-	bl,a	%ncc, 3f		! Not enough bytes to fill %d0
-	add	%o1, %o3, %o1 		! Back up %o1
-
-1:
-	deccc	%o5
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	bgu	%ncc, 1b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-2:
-	subcc	%o2, 8, %o2
-	std	%d0, [%o0]
-	bz	%ncc, .mediumexit
-	add	%o0, 8, %o0
-3:
-	ldub	[%o1], %o3
-	deccc	%o2
-	inc	%o1
-	stb	%o3, [%o0]
-	bgu	%ncc, 3b
-	inc	%o0
-#endif
-
-.mediumexit:
-        wr	%o4, %g0, %fprs		! fprs = o4   restore fprs
-	retl
-        mov	%g1, %o0
-
-
-	.align ICACHE_LINE_SIZE
-.large:
-
-	! %o0 I/O DST is 64-byte aligned
-	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
-	! %d0 I/O already loaded with SRC data from [%o1-8]
-	! %o2 I/O count (number of bytes that need to be written)
-	! %o3 I   Not written.  If zero, then SRC is double aligned.
-	! %o4 I   Not written.  Holds fprs.
-	! %o5   O The number of doubles that remain to be written.
-
-	! Load the rest of the current block
-	! Recall that %o1 is further into SRC than %o0 is into DST
-
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	prefetch [%o1 + (8 * BLOCK_SIZE)], #one_read
-
-	set	BST_THRESHOLD, %o5
-	cmp	%o2, %o5
-	bgu,pn	%icc, .xlarge
-	prefetch [%o1 + (12 * BLOCK_SIZE)], #one_read
-
-	ldd	[%o1], %f2
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x20], %f10
-	or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
-	faligndata %f6, %f8, %f38
-	prefetch [%o1 + (16 * BLOCK_SIZE)], #one_read
-	ldd	[%o1 + 0x28], %f12
-	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed lter)
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f10, %f12, %f42
-	ldd	[%o1 + 0x38], %f0
-	sub	%o2, BLOCK_SIZE, %o2	! update count
-	add	%o1, BLOCK_SIZE, %o1	! update SRC
-
-	! Main loop.  Write previous block.  Load rest of current block.
-	! Some bytes will be loaded that won't yet be written.
-1:
-	ldd	[%o1], %f2
-	faligndata %f12, %f14, %f44
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f14, %f0, %f46
-	std	%f32, [%o0]
-	std	%f34, [%o0+8]
-	std	%f36, [%o0+16]
-	std	%f38, [%o0+24]
-	std	%f40, [%o0+32]
-	std	%f42, [%o0+40]
-	std	%f44, [%o0+48]
-	std	%f46, [%o0+56]
-	sub	%o2, BLOCK_SIZE, %o2		! update count
-	prefetch [%o1 + (24 * BLOCK_SIZE) + BLOCK_SIZE], #one_read
-	add	%o0, BLOCK_SIZE, %o0		! update DST
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x20], %f10
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x28], %f12
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x38], %f0
-	faligndata %f10, %f12, %f42
-	prefetch [%o1 + (18 * BLOCK_SIZE)], #one_read
-	cmp	%o2, BLOCK_SIZE + 8
-	prefetch [%o0 + (18 * BLOCK_SIZE)], #one_write
-	bgu,pt	%ncc, 1b
-	add	%o1, BLOCK_SIZE, %o1	! update SRC
-	faligndata %f12, %f14, %f44
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
-	cmp	%o2, BLOCK_SIZE
-	bne	%ncc, 2f		! exactly 1 block remaining?
-	add	%o0, BLOCK_SIZE, %o0	! update DST
-	brz,a	%o3, 3f			! is SRC double aligned?
-	ldd	[%o1], %f2
-
-2:
-	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8
-	add	%o5, %o3, %o5
-
-	membar	#StoreLoad|#StoreStore
-
-	ba	.beginmedloop
-	andn	%o5, 7, %o5		! 8 byte aligned count
-
-
-	! This is when there is exactly 1 block remaining and SRC is aligned
-3:
-	ldd	[%o1 + 0x8], %f4
-	ldd	[%o1 + 0x10], %f6
-	fsrc1	%f0, %f32
-	ldd	[%o1 + 0x18], %f8
-	fsrc1	%f2, %f34
-	ldd	[%o1 + 0x20], %f10
-	fsrc1	%f4, %f36
-	ldd	[%o1 + 0x28], %f12
-	fsrc1	%f6, %f38
-	ldd	[%o1 + 0x30], %f14
-	fsrc1	%f8, %f40
-	fsrc1	%f10, %f42
-	fsrc1	%f12, %f44
-	fsrc1	%f14, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	membar	#StoreLoad|#StoreStore
-	wr	%o4, 0, %fprs
-	retl
-	mov	%g1, %o0
-
-
-	.align 16
-	! two nops here causes loop starting at 1f below to be
-	! on a cache line boundary, improving performance
-	nop
-	nop
-.xlarge:
-	! %o0 I/O DST is 64-byte aligned
-	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
-	! %d0 I/O already loaded with SRC data from [%o1-8]
-	! %o2 I/O count (number of bytes that need to be written)
-	! %o3 I   Not written.  If zero, then SRC is double aligned.
-	! %o4 I   Not written.  Holds fprs.
-	! %o5   O The number of doubles that remain to be written.
-
-	! Load the rest of the current block
-	! Recall that %o1 is further into SRC than %o0 is into DST
-
-	ldd	[%o1], %f2
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x20], %f10
-	or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x28], %f12
-	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed later)
-	prefetch [%o1 + (16 * BLOCK_SIZE)], #one_read
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f10, %f12, %f42
-	ldd	[%o1 + 0x38], %f0
-	prefetch [%o1 + (17 * BLOCK_SIZE)], #one_read
-	sub	%o2, BLOCK_SIZE, %o2	! update count
-	add	%o1, BLOCK_SIZE, %o1	! update SRC
-
-	! This point is 32-byte aligned since 24 instructions appear since
-	! the previous alignment directive.
-
-
-	! Main loop.  Write previous block.  Load rest of current block.
-	! Some bytes will be loaded that won't yet be written.
-1:
-	ldd	[%o1], %f2
-	faligndata %f12, %f14, %f44
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	sub	%o2, BLOCK_SIZE, %o2		! update count
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x20], %f10
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x28], %f12
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x30], %f14
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #n_reads
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x38], %f0
-	faligndata %f10, %f12, %f42
-	prefetch [%o1 + (25 * BLOCK_SIZE)], #one_read
-	add	%o0, BLOCK_SIZE, %o0		! update DST
-	cmp	%o2, BLOCK_SIZE + 8
-	! second prefetch important to correct for occasional dropped
-	prefetch [%o1 + (18 * BLOCK_SIZE)], #one_read
-	bgu,pt	%ncc, 1b
-	add	%o1, BLOCK_SIZE, %o1		! update SRC
-
-	faligndata %f12, %f14, %f44
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
-	cmp	%o2, BLOCK_SIZE
-	bne	%ncc, 2f		! exactly 1 block remaining?
-	add	%o0, BLOCK_SIZE, %o0	! update DST
-	brz,a	%o3, 3f			! is SRC double aligned?
-	ldd	[%o1], %f2
-
-2:
-	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8
-	add	%o5, %o3, %o5
-
-	membar	#StoreLoad|#StoreStore
-
-	ba	.beginmedloop
-	andn	%o5, 7, %o5		! 8 byte aligned count
-
-
-	! This is when there is exactly 1 block remaining and SRC is aligned
-3:
-	ldd	[%o1 + 0x8], %f4
-	ldd	[%o1 + 0x10], %f6
-	fsrc1	%f0, %f32
-	ldd	[%o1 + 0x18], %f8
-	fsrc1	%f2, %f34
-	ldd	[%o1 + 0x20], %f10
-	fsrc1	%f4, %f36
-	ldd	[%o1 + 0x28], %f12
-	fsrc1	%f6, %f38
-	ldd	[%o1 + 0x30], %f14
-	fsrc1	%f8, %f40
-	fsrc1	%f10, %f42
-	fsrc1	%f12, %f44
-	fsrc1	%f14, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	membar	#StoreLoad|#StoreStore
-	wr	%o4, 0, %fprs
-	retl
-	mov	%g1, %o0
-
-	SET_SIZE(memcpy)
--- a/usr/src/lib/libc_psr/sun4u-opl/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4u-opl
-COMPAT_PLAT	= sun4u-us3
-CLASS		= 32
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-MAPFILES =	../../sun4u/mapfile-vers $(MAPFILE.FLT)
-
-ASFLAGS	+=	-xarch=v8plusb
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr.so.1
-LIBC_PSR_DIR    = $(ROOT_PSM_LIB_DIR)
-LIBC_PSR_LIB    = $(LIBC_PSR_DIR)/$(MODULE)
-
-$(LIBC_PSR_DIRS):
-	-$(INS.dir)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_DIR) $(ROOT_PSM_LIBS)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u-opl/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4u-opl
-COMPAT_PLAT	= sun4u-us3
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-MAPFILES =	../../sun4u/mapfile-vers $(MAPFILE.FLT)
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS	+=	-xarch=v9b
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr.so.1
-LIBC_PSR64_DIR = $(ROOT_PSM_LIB_DIR)/$(MACH64)
-LIBC_PSR64_LIB  = $(LIBC_PSR64_DIR)/$(MODULE)
-
-$(LIBC_PSR64_DIRS):
-	-$(INS.dir)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_DIR) $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u-us3/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-PLATFORM	=	sun4u-us3
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-TOUCH		= /usr/bin/touch
-
-MODULE		= libc_psr.so.1
-LIBC_PSR_DIRS   = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
-LIBC_PSR_LINKS  = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
-INS.slink6      = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-LIBC_PSR64_DIRS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
-LIBC_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-INS.slink7	= $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-#
-# Used when building links in /platform/$(PLATFORM)/lib
-#
-LINKED_PLATFORMS	= SUNW,Sun-Blade-1000
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-1500
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-2500
-LINKED_PLATFORMS	+= SUNW,A70
-LINKED_PLATFORMS	+= SUNW,Sun-Fire
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V240
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V250
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V440
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-280R
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-15000
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-880
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-480R
-LINKED_PLATFORMS	+= SUNW,Netra-T12
-LINKED_PLATFORMS	+= SUNW,Netra-T4
-LINKED_PLATFORMS	+= SUNW,Netra-CP3010
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V215
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V445
-
-$(ROOT_PSM_LIB_DIR):
-	-$(INS.dir)
-
-$(ROOT_PSM_LIB_DIR)/$(MODULE):	$(ROOT_PSM_LIB_DIR) $(MODULE)
-	$(RM) -r $@; $(INS) -s -f $(@D) $(MODULE)
-
-$(ROOT_PSM_LIB64_DIR):
-	-$(INS.dir)
-
-$(ROOT_PSM_LIB64_DIR)/$(MODULE):	$(ROOT_PSM_LIB64_DIR) $(MODULE)
-	$(RM) -r $@; $(INS) -s -f $(@D) $(MODULE)
-
-$(LIBC_PSR_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR_LINKS): $(LIBC_PSR_DIRS)
-	-$(INS.slink6)
-
-$(LIBC_PSR64_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LINKS): $(LIBC_PSR64_DIRS)
-	-$(INS.slink7)
-
-all:	FRC
-	@$(TOUCH) $(MODULE)
-
-install:	all $(ROOT_PSM_LIB_DIR)/$(MODULE) $(ROOT_PSM_LIB64_DIR)/$(MODULE) $(LIBC_PSR_LINKS) $(LIBC_PSR64_LINKS)
-
-clean clobber : FRC
-	$(RM) $(MODULE)
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4u-us3/common/memcmp.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcmp.s"
-
-/*
- * memcmp(s1, s2, len)
- *
- * Compare n bytes:  s1>s2: >0  s1==s2: 0  s1<s2: <0
- *
- * Fast assembler language version of the following C-program for memcmp
- * which represents the `standard' for the C-library.
- *
- *	int
- *	memcmp(const void *s1, const void *s2, size_t n)
- *	{
- *		if (s1 != s2 && n != 0) {
- *			const char *ps1 = s1;
- *			const char *ps2 = s2;
- *			do {
- *				if (*ps1++ != *ps2++)
- *					return(ps1[-1] - ps2[-1]);
- *			} while (--n != 0);
- *		}
- *		return (0);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/machasi.h>
-
-#define	BLOCK_SIZE	64
-
-	ANSI_PRAGMA_WEAK(memcmp,function)
-
-	ENTRY(memcmp)
-	cmp	%o0, %o1		! s1 == s2?
-	be	%ncc, .cmpeq
-	prefetch [%o0], #one_read
-	prefetch [%o1], #one_read
-	
-	! for small counts byte compare immediately
-	cmp	%o2, 48
-	bleu,a 	%ncc, .bytcmp
-	mov	%o2, %o3		! o3 <= 48
-	
-	! Count > 48. We will byte compare (8 + num of bytes to dbl align) 
-	! bytes. We assume that most miscompares will occur in the 1st 8 bytes 
-
-	prefetch [%o0 + (1 * BLOCK_SIZE)], #one_read
-	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
-
-.chkdbl:
-	and     %o0, 7, %o4             ! is s1 aligned on a 8 byte bound
-	mov	8, %o3			! o2 > 48;  o3 = 8
-        sub     %o4, 8, %o4		! o4 = -(num of bytes to dbl align)
-	ba	%ncc, .bytcmp
-        sub     %o3, %o4, %o3           ! o3 = 8 + (num of bytes to dbl align)
-
-1:	ldub	[%o1], %o5        	! byte compare loop
-        inc     %o1
-        inc     %o0
-	dec	%o2
-        cmp     %o4, %o5
-	bne	%ncc, .noteq
-.bytcmp:
-	deccc   %o3
-	bgeu,a	%ncc, 1b
-        ldub    [%o0], %o4
-
-	! Check to see if there are more bytes to compare
-	cmp	%o2, 0			! is o2 > 0
-	bgu	%ncc, .dwcmp		! we should already be dbl aligned
-	nop
-.cmpeq:
-        retl                             ! strings compare equal
-	sub	%g0, %g0, %o0
-
-.noteq:
-	retl				! strings aren't equal
-	sub	%o4, %o5, %o0		! return(*s1 - *s2)
-
-
-        ! double word compare - using ldd and faligndata. Compares upto
-        ! 8 byte multiple count and does byte compare for the residual.
-
-.dwcmp: 
-	prefetch [%o0 + (2 * BLOCK_SIZE)], #one_read
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-
-        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-        ! So set it anyway, without checking.
-        rd      %fprs, %o3              ! o3 = fprs
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-        andn    %o2, 7, %o4             ! o4 has 8 byte aligned cnt
-	sub     %o4, 8, %o4
-        alignaddr %o1, %g0, %g1
-        ldd     [%g1], %d0
-4:
-        add     %g1, 8, %g1
-        ldd     [%g1], %d2
-	ldd	[%o0], %d6
-	prefetch [%g1 + (3 * BLOCK_SIZE)], #one_read
-	prefetch [%o0 + (3 * BLOCK_SIZE)], #one_read
-        faligndata %d0, %d2, %d8
-	fcmpne32 %d6, %d8, %o5
-	fsrc1	%d6, %d6		! 2 fsrc1's added since o5 cannot
-	fsrc1	%d8, %d8		! be used for 3 cycles else we 
-	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
-	brnz,a,pn %o5, 6f
-	sub     %o1, %o0, %o1           ! o1 gets the difference
-        subcc   %o4, 8, %o4
-        add     %o0, 8, %o0
-        add     %o1, 8, %o1
-        bgu,pt	%ncc, 4b
-        sub     %o2, 8, %o2
-
-.residcmp:
-        ba      6f
-	sub     %o1, %o0, %o1           ! o1 gets the difference
-
-5:      ldub    [%o0 + %o1], %o5        ! byte compare loop
-        inc     %o0
-        cmp     %o4, %o5
-        bne     %ncc, .dnoteq
-6:
-        deccc   %o2
-        bgeu,a	%ncc, 5b
-        ldub    [%o0], %o4
-	
-	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
-	retl
-	sub	%g0, %g0, %o0		! strings compare equal 
-        
-.dnoteq:
-	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
-	retl
-	sub	%o4, %o5, %o0		! return(*s1 - *s2)
-        
-	SET_SIZE(memcmp)
--- a/usr/src/lib/libc_psr/sun4u-us3/common/memcpy.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1054 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcpy.s"
-
-/*
- * memcpy(s1, s2, len)
- *
- * Copy s2 to s1, always copy n bytes.
- * Note: this C code does not work for overlapped copies.
- *       Memmove() and bcopy() do.
- *
- * Fast assembler language version of the following C-program for memcpy
- * which represents the `standard' for the C-library.
- *
- *	void * 
- *	memcpy(void *s, const void *s0, size_t n)
- *	{
- *		if (n != 0) {
- *	   	    char *s1 = s;
- *		    const char *s2 = s0;
- *		    do {
- *			*s1++ = *s2++;
- *		    } while (--n != 0);
- *		}
- *		return (s);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-#include <sys/trap.h>
-
-#define	ICACHE_LINE_SIZE	64
-#define	BLOCK_SIZE	64
-#define	FPRS_FEF	0x4
-
-#define SHORTCOPY	3
-#define	SMALL_MAX	39
-#define	MEDIUM_MAX	255
-#define MED_WMAX	256	/* max copy for medium word-aligned case */
-#define MED_MAX		256	/* max copy for medium longword-aligned case */
-
-#ifndef BSTORE_SIZE
-#define BSTORE_SIZE	256	/* min copy size for block store */
-#endif
-
-	ANSI_PRAGMA_WEAK(memmove,function)
-	ANSI_PRAGMA_WEAK(memcpy,function)
-
-	ENTRY(memmove)
-	cmp	%o1, %o0	! if from address is >= to use forward copy
-	bgeu	%ncc, .forcpy	! else use backward if ...
-	sub	%o0, %o1, %o4	! get difference of two addresses
-	cmp	%o2, %o4	! compare size and difference of addresses
-	bleu	%ncc, .forcpy	! if size is bigger, do overlapped copy
-	nop
-
-        !
-        ! an overlapped copy that must be done "backwards"
-        !
-.ovbc:
-	mov	%o0, %g1		! save dest address for return val
-	add     %o1, %o2, %o1           ! get to end of source space
-        add     %o0, %o2, %o0           ! get to end of destination space
-
-	cmp	%o2, 24
-	bgeu,pn	%ncc, .dbalign
-	nop
-	cmp	%o2, 4
-	blt,pn	%ncc, .byte
-	sub	%o2, 3, %o2
-.byte4loop:
-	ldub	[%o1-1], %o3		! load last byte
-	stb	%o3, [%o0-1]		! store last byte
-	sub	%o1, 4, %o1
-	ldub	[%o1+2], %o3		! load 2nd from last byte
-	stb	%o3, [%o0-2]		! store 2nd from last byte
-	sub	%o0, 4, %o0
-	ldub	[%o1+1], %o3		! load 3rd from last byte
-	stb	%o3, [%o0+1]		! store 3rd from last byte
-	subcc	%o2, 4, %o2
-	ldub	[%o1], %o3		! load 4th from last byte
-	bgu,pt	%ncc, .byte4loop
-	stb	%o3, [%o0]		! store 4th from last byte
-.byte:
-	addcc	%o2, 3, %o2
-	bz,pt	%ncc, .exit
-.byteloop:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o2			! decrement count
-	bgu,pt	%ncc, .byteloop		! loop until done
-	stb	%o3, [%o0]		! write byte
-.exit:
-	retl
-	mov	%g1, %o0
-
-	.align	16
-.dbalign:
-	andcc   %o0, 7, %o5		! bytes till DST 8 byte aligned
-	bz,pt	%ncc, .dbmed
-	sub	%o2, %o5, %o2		! update count
-.dbalign1:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o5			! decrement count
-	bgu,pt	%ncc, .dbalign1		! loop until done
-	stb	%o3, [%o0]		! store a byte
-
-! check for src long word alignment
-.dbmed:
-	andcc	%o1, 7, %g0		! chk src long word alignment
-	bnz,pn	%ncc, .dbbck
-	nop
-!
-! Following code is for overlapping copies where src and dest
-! are long word aligned
-!
-	cmp	%o2, 4095
-	blt,pn	%ncc, .dbmedl32enter	! go to no prefetch code
-	nop
-	prefetch [%o1 - (1 * BLOCK_SIZE)], 20	! into the prefetch cache
-	sub	%o2, 63, %o2		! adjust length to allow cc test
-					! for end of loop
-	prefetch [%o1 - (2 * BLOCK_SIZE)], 20	! into the prefetch cache
-	rd	%fprs, %o3		! o3 = fprs
-	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
-	! So set it anyway, without checking.
-	prefetch [%o1 - (3 * BLOCK_SIZE)], 20	! into the prefetch cache
-	wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-	prefetch [%o1 - (4 * BLOCK_SIZE)], 20	! into the prefetch cache
-.dbmedl64:
-	prefetch [%o1 - (5 * BLOCK_SIZE)], 20	! into the prefetch cache
-	ldd	[%o1-8], %d4		! load
-	subcc	%o2, 64, %o2		! decrement length count
-	std	%d4, [%o0-8]		! and store
-	ldd	[%o1-16], %d2		! a block of 64 bytes
-	sub	%o1, 64, %o1		! decrease src ptr by 64
-	std	%d2, [%o0-16]
-	sub	%o0, 64, %o0		! decrease dst ptr by 64
-	ldd	[%o1+40], %d4
-	std	%d4, [%o0+40]
-	ldd	[%o1+32], %d2
-	std	%d2, [%o0+32]
-	ldd	[%o1+24], %d4
-	std	%d4, [%o0+24]
-	ldd	[%o1+16], %d2
-	std	%d2, [%o0+16]
-	ldd	[%o1+8], %d4
-	std	%d4, [%o0+8]
-	ldd	[%o1], %d2
-	bgu,pt	%ncc, .dbmedl64		! repeat if at least 64 bytes left
-	std	%d2, [%o0]
-	add	%o2, 63, %o2		! restore offset adjustment
-	and	%o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	wr	%o3, %g0, %fprs         ! fprs = o3   restore fprs	
-.dbmedl32enter:
-	subcc	%o2, 31, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt  %ncc, .dbmedl31		! skip big loop if less than 32
-	nop
-.dbmedl32:
-	ldx	[%o1-8], %o4		! load
-	subcc	%o2, 32, %o2		! decrement length count
-	stx	%o4, [%o0-8]		! and store
-	ldx	[%o1-16], %o3		! a block of 32 bytes
-	sub	%o1, 32, %o1		! decrease src ptr by 32
-	stx	%o3, [%o0-16]
-	ldx	[%o1+8], %o4
-	sub	%o0, 32, %o0		! decrease dst ptr by 32
-	stx	%o4, [%o0+8]
-	ldx	[%o1], %o3
-	bgu,pt	%ncc, .dbmedl32		! repeat if at least 32 bytes left
-	stx	%o3, [%o0]
-.dbmedl31:
-	addcc	%o2, 16, %o2		! adjust remaining count
-	ble,pt	%ncc, .dbmedl15		! skip if 15 or fewer bytes left
-	nop				!
-	ldx	[%o1-8], %o4		! load and store 16 bytes
-	sub	%o1, 16, %o1		! decrease src ptr by 16
-	stx	%o4, [%o0-8]		!
-	sub	%o2, 16, %o2		! decrease count by 16
-	ldx	[%o1], %o3		!
-	sub	%o0, 16, %o0		! decrease dst ptr by 16
-	stx	%o3, [%o0]
-.dbmedl15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .dbexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .dbremain		! skip if 7 or fewer bytes left
-	nop
-	ldx	[%o1-8], %o4		! load 8 bytes
-	sub	%o1, 8, %o1		! decrease src ptr by 8
-	stx	%o4, [%o0-8]		! and store 8 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	bnz	%ncc, .dbremain		! exit if finished
-	sub	%o0, 8, %o0		! decrease dst ptr by 8
-	retl
-	mov	%g1, %o0
-
-!
-! Following code is for overlapping copies where src and dest
-! are not long word aligned
-!
-	.align	16
-.dbbck:
-	rd	%fprs, %o3		! o3 = fprs
- 
-	! if fprs.fef == 0, set it. Checking it, requires 2 instructions.
-	! So set it anyway, without checking.
-	wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-	alignaddr %o1, %g0, %o5		! align src
-	ldd	[%o5], %d0		! get first 8 byte block
-	andn	%o2, 7, %o4		! prepare src ptr for finishup code
-	cmp	%o2, 32
-	blt,pn	%ncc, .dbmv8
-	sub	%o1, %o4, %o1		!
-	cmp	%o2, 4095		! check for short memmoves
-	blt,pn	%ncc, .dbmv32enter	! go to no prefetch code
-.dbmv64:
-	ldd	[%o5-8], %d2		! load 8 bytes
-	ldd	[%o5-16], %d4		! load 8 bytes
-	sub	%o5, 64, %o5		!
-	ldd	[%o5+40], %d6		! load 8 bytes
-	sub	%o0, 64, %o0		!
-	ldd	[%o5+32], %d8		! load 8 bytes
-	sub	%o2, 64, %o2		! 64 less bytes to copy
-	ldd	[%o5+24], %d18		! load 8 bytes
-	cmp	%o2, 64			! do we have < 64 bytes remaining
-	ldd	[%o5+16], %d28		! load 8 bytes
-	ldd	[%o5+8], %d30		! load 8 bytes
-	prefetch [%o5 - (5 * BLOCK_SIZE)], 20	! into the prefetch cache
-	faligndata %d2, %d0, %d10	! extract 8 bytes out
-	ldd	[%o5], %d0		! load 8 bytes
-	std	%d10, [%o0+56]		! store the current 8 bytes
-	faligndata %d4, %d2, %d12	! extract 8 bytes out
-	std	%d12, [%o0+48]		! store the current 8 bytes
-	faligndata %d6, %d4, %d14	! extract 8 bytes out
-	std	%d14, [%o0+40]		! store the current 8 bytes
-	faligndata %d8, %d6, %d16	! extract 8 bytes out
-	std	%d16, [%o0+32]		! store the current 8 bytes
-	faligndata %d18, %d8, %d20	! extract 8 bytes out
-	std	%d20, [%o0+24]		! store the current 8 bytes
-	faligndata %d28, %d18, %d22	! extract 8 bytes out
-	std	%d22, [%o0+16]		! store the current 8 bytes
-	faligndata %d30, %d28, %d24	! extract 8 bytes out
-	std	%d24, [%o0+8]		! store the current 8 bytes
-	faligndata %d0, %d30, %d26	! extract 8 bytes out
-	bgeu,pt	%ncc, .dbmv64
-	std	%d26, [%o0]		! store the current 8 bytes
-
-	cmp	%o2, 32
-	blt,pn	%ncc, .dbmvx
-	nop
-.dbmv32:
-	ldd	[%o5-8], %d2		! load 8 bytes
-.dbmv32enter:
-	ldd	[%o5-16], %d4		! load 8 bytes
-	sub	%o5, 32, %o5		!
-	ldd	[%o5+8], %d6		! load 8 bytes
-	sub	%o0, 32, %o0		! 
-	faligndata %d2, %d0, %d10	! extract 8 bytes out
-	ldd	[%o5], %d0		! load 8 bytes
-	sub     %o2,32, %o2		! 32 less bytes to copy
-	std	%d10, [%o0+24]		! store the current 8 bytes
-	cmp	%o2, 32			! do we have < 32 bytes remaining
-	faligndata %d4, %d2, %d12	! extract 8 bytes out
-	std	%d12, [%o0+16]		! store the current 8 bytes
-	faligndata %d6, %d4, %d14	! extract 8 bytes out
-	std	%d14, [%o0+8]		! store the current 8 bytes
-	faligndata %d0, %d6, %d16	! extract 8 bytes out
-	bgeu,pt	%ncc, .dbmv32
-	std	%d16, [%o0]		! store the current 8 bytes
-.dbmvx:
-	cmp	%o2, 8			! do we have < 8 bytes remaining
-	blt,pt	%ncc, .dbmvfinish	! if yes, skip to finish up code
-	nop
-.dbmv8:
-	ldd	[%o5-8], %d2
-	sub	%o0, 8, %o0		! since we are at the end
-					! when we first enter the loop
-	sub     %o2, 8, %o2		! 8 less bytes to copy
-	sub	%o5, 8, %o5
-	cmp	%o2, 8			! do we have < 8 bytes remaining
-	faligndata %d2, %d0, %d8        ! extract 8 bytes out
-	std	%d8, [%o0]		! store the current 8 bytes
-	bgeu,pt	%ncc, .dbmv8
-	fmovd	%d2, %d0
-.dbmvfinish:
-	and	%o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	tst	%o2
-	bz,pt	%ncc, .dbexit
-	wr	%o3, %g0, %fprs         ! fprs = o3   restore fprs
-
-.dbremain:
-	cmp	%o2, 4
-	blt,pn	%ncc, .dbbyte
-	nop
-	ldub	[%o1-1], %o3		! load last byte
-	stb	%o3, [%o0-1]		! store last byte
-	sub	%o1, 4, %o1
-	ldub	[%o1+2], %o3		! load 2nd from last byte
-	stb	%o3, [%o0-2]		! store 2nd from last byte
-	sub	%o0, 4, %o0
-	ldub	[%o1+1], %o3		! load 3rd from last byte
-	stb	%o3, [%o0+1]		! store 3rd from last byte
-	subcc	%o2, 4, %o2
-	ldub	[%o1], %o3		! load 4th from last byte
-	stb	%o3, [%o0]		! store 4th from last byte	
-	bz,pt	%ncc, .dbexit
-.dbbyte:
-	dec	%o1			! decrement src address
-	ldub	[%o1], %o3		! read a byte
-	dec	%o0			! decrement dst address
-	deccc	%o2			! decrement count
-	bgu,pt	%ncc, .dbbyte		! loop until done
-	stb	%o3, [%o0]		! write byte
-.dbexit:
-	retl
-        mov     %g1, %o0
-	SET_SIZE(memmove)
-
-
-	.align ICACHE_LINE_SIZE
-	ENTRY(memcpy)
-					! adjust instruction alignment
-	nop				! Do not remove, these nops affect
-	nop				! icache alignment and performance
-.forcpy:
-	cmp	%o2, SMALL_MAX		! check for not small case
-	bgu,pn	%ncc, .medium		! go to larger cases
-	mov	%o0, %g1		! save %o0
-	cmp	%o2, SHORTCOPY		! check for really short case
-	ble,pt	%ncc, .smallleft	!
-	or	%o0, %o1, %o3		! prepare alignment check
-	andcc	%o3, 0x3, %g0		! test for alignment
-	bz,pt	%ncc, .smallword	! branch to word aligned case
-	sub	%o2, 3, %o2		! adjust count to allow cc zero test
-.smallnotalign4:
-	ldub	[%o1], %o3		! read byte
-	subcc	%o2, 4, %o2		! reduce count by 4
-	stb	%o3, [%o0]		! write byte
-	ldub	[%o1+1], %o3		! repeat for a total of 4 bytes
-	add	%o1, 4, %o1		! advance SRC by 4
-	stb	%o3, [%o0+1]
-	ldub	[%o1-2], %o3
-	add	%o0, 4, %o0		! advance DST by 4
-	stb	%o3, [%o0-2]
-	ldub	[%o1-1], %o3
-	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
-	stb	%o3, [%o0-1]
-	add	%o2, 3, %o2		! restore count
-.smallleft:
-	tst	%o2
-	bz,pt	%ncc, .smallexit
-	nop
-.smallleft3:				! 1, 2, or 3 bytes remain
-	ldub	[%o1], %o3		! load one byte
-	deccc	%o2			! reduce count for cc test
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0]		! store one byte
-	ldub	[%o1+1], %o3		! load second byte
-	deccc	%o2
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+1]		! store second byte
-	ldub	[%o1+2], %o3		! load third byte
-	stb	%o3, [%o0+2]		! store third byte
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align	16
-	nop				! affects loop icache alignment
-.smallwords:
-	lduw	[%o1], %o3		! read word
-.smallwordx:
-	subcc	%o2, 8, %o2		! update count
-	stw	%o3, [%o0]		! write word
-	add	%o1, 8, %o1		! update SRC
-	lduw	[%o1-4], %o3		! read word
-	add	%o0, 8, %o0		! update DST
-	bgu,pt	%ncc, .smallwords	! loop until done
-	stw	%o3, [%o0-4]		! write word
-	addcc	%o2, 7, %o2		! restore count
-	bz,pt	%ncc, .smallexit	! check for completion
-	nop
-	cmp	%o2, 4			! check for 4 or more bytes left
-	blt	.smallleft3		! if not, go to finish up
-	nop
-	lduw	[%o1], %o3
-	add	%o1, 4, %o1
-	subcc	%o2, 4, %o2
-	stw	%o3, [%o0]
-	add	%o0, 4, %o0
-	bnz,pt	%ncc, .smallleft3
-	nop
-	retl
-	mov	%g1, %o0		! restore %o0
-
-.smallword:
-	subcc	%o2, 4, %o2		! update count
-	bgu,pt	%ncc, .smallwordx
-	lduw	[%o1], %o3		! read word
-	addcc	%o2, 3, %o2		! restore count
-	bz,pt	%ncc, .smallexit
-	stw	%o3, [%o0]		! write word
-	deccc	%o2			! reduce count for cc test
-	ldub	[%o1+4], %o3		! load one byte
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+4]		! store one byte
-	ldub	[%o1+5], %o3		! load second byte
-	deccc	%o2
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+5]		! store second byte
-	ldub	[%o1+6], %o3		! load third byte
-	stb	%o3, [%o0+6]		! store third byte
-.smallexit:
-	retl
-	mov	%g1, %o0		! restore %o0
-	.align 16
-.medium:
-	neg	%o0, %o5
-	neg	%o1, %o3	
-	andcc	%o5, 7, %o5	! bytes till DST 8 byte aligned
-	and	%o3, 7, %o3	! bytes till SRC 8 byte aligned
-	
-	bz	%ncc, 2f
-	sub	%o5, %o3, %o3	! -(bytes till SRC aligned after DST aligned)
-				! o3={-7, -6, ... 7}  o3>0 => SRC overaligned
-
-	sub	%o2, %o5, %o2	! update count
-
-1:
-	ldub	[%o1], %o4
-	deccc	%o5
-	inc	%o1
-	stb	%o4, [%o0]
-	bgu,pt	%ncc, 1b
-	inc	%o0
-
-	! Now DST is 8-byte aligned.  o0, o1, o2 are current.
-
-2:
-	andcc	%o1, 0x3, %g0		! test alignment
-	bnz,pt	%ncc, .mediumsetup	! branch to skip aligned cases
-					! if src, dst not aligned
-	prefetch [%o1 + (1 * BLOCK_SIZE)], 20
-
-/*
- * Handle all cases where src and dest are aligned on word
- * or long word boundaries.  Use unrolled loops for better
- * performance.  This option wins over standard large data
- * move when source and destination is in cache for medium
- * to short data moves.
- */
-	andcc	%o1, 0x7, %g0		! test word alignment
-	bz,pt	%ncc, .medlword		! branch to long word aligned case
-	prefetch [%o1 + (2 * BLOCK_SIZE)], 20
-	cmp	%o2, MED_WMAX		! limit to store buffer size
-	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
-	nop
-	subcc	%o2, 15, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt	%ncc, .medw15		! skip big loop if less than 16
-	prefetch [%o1 + (3 * BLOCK_SIZE)], 20
-/*
- * no need to put prefetch in loop as prefetches have
- * already been issued for maximum loop size
- */
-.medw16:
-	ld	[%o1], %o4		! load
-	subcc	%o2, 16, %o2		! decrement length count
-	stw	%o4, [%o0]		! and store
-	ld	[%o1+4], %o3		! a block of 16 bytes
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stw	%o3, [%o0+4]
-	ld	[%o1-8], %o4
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stw	%o4, [%o0-8]
-	ld	[%o1-4], %o3
-	bgu,pt	%ncc, .medw16		! repeat if at least 16 bytes left
-	stw	%o3, [%o0-4]
-.medw15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .medwexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	nop				!
-	ld	[%o1], %o4		! load 4 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	stw	%o4, [%o0]		! and store 4 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	ld	[%o1-4], %o3		! load 4 bytes
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	stw	%o3, [%o0-4]		! and store 4 bytes
-	bz	%ncc, .medwexit		! exit if finished
-	nop
-.medw7:					! count is ge 1, less than 8
-	cmp	%o2, 3			! check for 4 bytes left
-	ble,pt	%ncc, .medw3		! skip if 3 or fewer bytes left
-	nop				!
-	ld	[%o1], %o4		! load 4 bytes
-	sub	%o2, 4, %o2		! decrease count by 4
-	add	%o1, 4, %o1		! increase src ptr by 4
-	stw	%o4, [%o0]		! and store 4 bytes
-	add	%o0, 4, %o0		! increase dst ptr by 4
-	tst	%o2			! check for zero bytes left
-	bz	%ncc, .medwexit		! exit if finished
-	nop
-.medw3:					! count is known to be 1, 2, or 3
-	deccc	%o2			! reduce count by one
-	ldub	[%o1], %o3		! load one byte
-	bz,pt	%ncc, .medwexit		! exit if last byte
-	stb	%o3, [%o0]		! store one byte
-	ldub	[%o1+1], %o3		! load second byte
-	deccc	%o2			! reduce count by one
-	bz,pt	%ncc, .medwexit		! exit if last byte
-	stb	%o3, [%o0+1]		! store second byte
-	ldub	[%o1+2], %o3		! load third byte
-	stb	%o3, [%o0+2]		! store third byte
-.medwexit:
-	retl
-	mov	%g1, %o0		! restore %o0
-	
-/*
- * Special case for handling when src and dest are both long word aligned
- * and total data to move is between SMALL_MAX and MED_MAX bytes
- */
-
-	.align 16
-	nop
-.medlword:				! long word aligned
-					! length > SMALL_MAX
-	cmp	%o2, MED_MAX		! limit to store buffer size
-	bgu,pt	%ncc, .mediumrejoin	! otherwise rejoin main loop
-	nop
-	subcc	%o2, 31, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt	%ncc, .medl31		! skip big loop if less than 32
-	prefetch [%o1 + (3 * BLOCK_SIZE)], 20	! into the l2 cache
-/*
- * no need to put prefetch in loop as prefetches have
- * already been issued for maximum loop size
- */
-.medl32:
-	ldx	[%o1], %o4		! load
-	subcc	%o2, 32, %o2		! decrement length count
-	stx	%o4, [%o0]		! and store
-	ldx	[%o1+8], %o3		! a block of 32 bytes
-	add	%o1, 32, %o1		! increase src ptr by 32
-	stx	%o3, [%o0+8]
-	ldx	[%o1-16], %o4
-	add	%o0, 32, %o0		! increase dst ptr by 32
-	stx	%o4, [%o0-16]
-	ldx	[%o1-8], %o3
-	bgu,pt	%ncc, .medl32		! repeat if at least 32 bytes left
-	stx	%o3, [%o0-8]
-.medl31:
-	addcc	%o2, 16, %o2		! adjust remaining count
-	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
-	nop				!
-	ldx	[%o1], %o4		! load and store 16 bytes
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stx	%o4, [%o0]		!
-	sub	%o2, 16, %o2		! decrease count by 16
-	ldx	[%o1-8], %o3		!
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stx	%o3, [%o0-8]
-.medl15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .medwexit		! exit if finished
-	nop
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	nop
-	ldx	[%o1], %o4		! load 8 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	stx	%o4, [%o0]		! and store 8 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	bz	%ncc, .medwexit		! exit if finished
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	ba	.medw7
-	nop
-
-	.align 16
-	nop
-	nop
-	nop
-.mediumsetup:
-	prefetch [%o1 + (2 * BLOCK_SIZE)], 21
-.mediumrejoin:
-	rd	%fprs, %o4		! check for unused FPU
-	
-	add	%o1, 8, %o1		! prepare to round SRC upward
-
-	sethi	%hi(0x1234567f), %o5	! For GSR.MASK 
-	or	%o5, 0x67f, %o5
-
-	andcc	%o4, FPRS_FEF, %o4	! test FEF, fprs.du = fprs.dl = 0
-	bz,a	%ncc, 3f
-	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
-3:
-	cmp	%o2, MEDIUM_MAX
-	bmask	%o5, %g0, %g0
-
-	! Compute o5 (number of bytes that need copying using the main loop).
-	! First, compute for the medium case.
-	! Then, if large case, o5 is replaced by count for block alignment.
-	! Be careful not to read past end of SRC
-	! Currently, o2 is the actual count remaining
-	!            o3 is how much sooner we'll cross the alignment boundary
-	!                in SRC compared to in DST
-	!
-	! Examples:  Let # denote bytes that should not be accessed
-	!            Let x denote a byte already copied to align DST
-	!            Let . and - denote bytes not yet copied
-	!            Let | denote double alignment boundaries
-	!
-	!            DST:  ######xx|........|--------|..######   o2 = 18
-	!                          o0
-	!
-	!  o3 = -3:  SRC:  ###xx...|.....---|-----..#|########   o5 = 8
-	!                          o1
-	!
-	!  o3 =  0:  SRC:  ######xx|........|--------|..######   o5 = 16-8 = 8
-	!                                   o1
-	!
-	!  o3 = +1:  SRC:  #######x|x.......|.-------|-..#####   o5 = 16-8 = 8
-	!                                   o1
-
-	or	%g0, -8, %o5
-	alignaddr %o1, %g0, %o1		! set GSR.ALIGN and align o1
-
-	movrlz	%o3, %g0, %o5		! subtract 8 from o2+o3 only if o3>=0
-	add	%o5, %o2, %o5
-	add	%o5, %o3, %o5
-
-	bleu	%ncc, 4f
-	andn	%o5, 7, %o5		! 8 byte aligned count
-	neg	%o0, %o5		! 'large' case
-	and	%o5, BLOCK_SIZE-1, %o5  ! bytes till DST block aligned
-4:	
-	brgez,a	%o3, .beginmedloop
-	ldd	[%o1-8], %d0
-
-	add	%o1, %o3, %o1		! back up o1
-5:
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	andcc	%o1, 7, %g0
-	bnz	%ncc, 5b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-.beginmedloop:	
-	tst	%o5
-	bz	%ncc, .endmedloop
-	sub	%o2, %o5, %o2		! update count for later
-
-	! Main loop to write out doubles.  Note: o5 & 7 == 0
-	
-	ldd	[%o1], %d2
-	subcc	%o5, 8, %o5		! update local count
-	bz,pn	%ncc, 1f
-	add	%o1, 8, %o1		! update SRC
-
-.medloop:
-	faligndata %d0, %d2, %d4
-	ldd	[%o1], %d0
-	subcc	%o5, 8, %o5		! update local count
-	add	%o1, 16, %o1		! update SRC
-	std	%d4, [%o0]
-	bz,pn	%ncc, 2f
-	faligndata %d2, %d0, %d6
-	ldd	[%o1 - 8], %d2
-	subcc	%o5, 8, %o5		! update local count
-	std	%d6, [%o0 + 8]
-	bnz,pt	%ncc, .medloop
-	add	%o0, 16, %o0		! update DST
-
-1:	
-	faligndata %d0, %d2, %d4
-	fmovd	%d2, %d0
-	std	%d4, [%o0]
-	ba	.endmedloop
-	add	%o0, 8, %o0
-	
-2:
-	std	%d6, [%o0 + 8]
-	sub	%o1, 8, %o1
-	add	%o0, 16, %o0
-	
-
-.endmedloop:
-	! Currently, o1 is pointing to the next double-aligned byte in SRC
-	! The 8 bytes starting at [o1-8] are available in d0
-	! At least one, and possibly all, of these need to be written.
-
-	cmp	%o2, BLOCK_SIZE	
-	bgu	%ncc, .large		! otherwise, less than 16 bytes left
-	
-#if 0
-
-	/* This code will use partial stores.  */
-
-	mov	%g0, %o5
-	and	%o3, 7, %o3		! Number of bytes needed to completely
-					! fill %d0 with good (unwritten) data.
-
-	subcc	%o2, 8, %o2		! update count (maybe too much)
-	movl	%ncc, %o2, %o5		
-	addcc	%o3, %o5, %o5		! extra bytes we can stuff into %d0
-	sub	%o3, %o5, %o3		! update o3 (# bad bytes in %d0)
-
-	bz	%ncc, 2f
-	alignaddr %o3, %g0, %g0		! set GSR.ALIGN
-	
-1:
-	deccc	%o5
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	bgu	%ncc, 1b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-2:
-	not     %o3
-	faligndata %d0, %d0, %d0	! shift bytes to the left
-	and	%o3, 7, %o3		! last byte to be stored in [%o0+%o3]
-	edge8n	%g0, %o3, %o5
-	stda	%d0, [%o0]%o5, ASI_PST8_P
-	brlez	%o2, .mediumexit		
-	add	%o0, %o3, %o0		! update DST to last stored byte
-3:	
-	inc	%o0
-	deccc	%o2
-	ldub	[%o1], %o3
-	stb	%o3, [%o0]
-	bgu	%ncc, 3b
-	inc	%o1
-
-#else
-
-	andcc	%o3, 7, %o5		! Number of bytes needed to completely
-					! fill %d0 with good (unwritten) data.
-	bz	%ncc, 2f
-	sub	%o5, 8, %o3		! -(number of good bytes in %d0)
-	cmp	%o2, 8
-	bl,a	%ncc, 3f		! Not enough bytes to fill %d0
-	add	%o1, %o3, %o1 		! Back up %o1
-
-1:
-	deccc	%o5
-	ldda	[%o1]ASI_FL8_P, %d2
-	inc	%o1
-	bgu	%ncc, 1b
-	bshuffle %d0, %d2, %d0		! shifts d0 left 1 byte and or's in d2
-
-2:	
-	subcc	%o2, 8, %o2
-	std	%d0, [%o0]
-	bz	%ncc, .mediumexit
-	add	%o0, 8, %o0
-3:	
-	ldub	[%o1], %o3
-	deccc	%o2
-	inc	%o1
-	stb	%o3, [%o0]
-	bgu	%ncc, 3b
-	inc	%o0
-#endif	
-
-.mediumexit:
-        wr      %o4, %g0, %fprs		! fprs = o4   restore fprs
-	retl
-        mov     %g1, %o0
-
-
-	.align ICACHE_LINE_SIZE
-.large:
-	! The following test for BSTORE_SIZE is used to decide whether
-	! to store data with a block store or with individual stores.
-	! The block store wins when the amount of data is so large
-	! that it is causes other application data to be moved out
-	! of the L1 or L2 cache.
-	! On a Panther, block store can lose more often because block
-	! store forces the stored data to be removed from the L3 cache.
-	!
-	sethi	%hi(BSTORE_SIZE),%o5
-	or	%o5,%lo(BSTORE_SIZE),%o5
-	cmp	%o2, %o5
-	bgu	%ncc, .xlarge		
-
-	! %o0 I/O DST is 64-byte aligned
-	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
-	! %d0 I/O already loaded with SRC data from [%o1-8]
-	! %o2 I/O count (number of bytes that need to be written)
-	! %o3 I   Not written.  If zero, then SRC is double aligned.
-	! %o4 I   Not written.  Holds fprs.
-	! %o5   O The number of doubles that remain to be written.
-
-	! Load the rest of the current block 
-	! Recall that %o1 is further into SRC than %o0 is into DST
-
-	prefetch [%o0 + (0 * BLOCK_SIZE)], 22
-	prefetch [%o0 + (1 * BLOCK_SIZE)], 22
-	prefetch [%o0 + (2 * BLOCK_SIZE)], 22
-	ldd	[%o1], %f2
-	prefetch [%o1 + (3 * BLOCK_SIZE)], 21
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x20], %f10
-        or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
-	prefetch [%o1 + (4 * BLOCK_SIZE)], 21
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x28], %f12
-	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed lter)
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f10, %f12, %f42
-	ldd	[%o1 + 0x38], %f0
-	sub	%o2, BLOCK_SIZE, %o2	! update count
-	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
-	add	%o1, BLOCK_SIZE, %o1		! update SRC
-
-	! Main loop.  Write previous block.  Load rest of current block.
-	! Some bytes will be loaded that won't yet be written.
-1:	
-	ldd	[%o1], %f2
-	faligndata %f12, %f14, %f44
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f14, %f0, %f46
-	std	%f32, [%o0]
-	std	%f34, [%o0+8]
-	std	%f36, [%o0+16]
-	std	%f38, [%o0+24]
-	std	%f40, [%o0+32]
-	std	%f42, [%o0+40]
-	std	%f44, [%o0+48]
-	std	%f46, [%o0+56]
-	sub	%o2, BLOCK_SIZE, %o2		! update count
-	prefetch [%o0 + (6 * BLOCK_SIZE)], 22
-	prefetch [%o0 + (3 * BLOCK_SIZE)], 22
-	add	%o0, BLOCK_SIZE, %o0		! update DST
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x20], %f10
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x28], %f12
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x38], %f0
-	faligndata %f10, %f12, %f42
-	cmp	%o2, BLOCK_SIZE + 8
-	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
-	bgu,pt	%ncc, 1b
-	add	%o1, BLOCK_SIZE, %o1	! update SRC
-	faligndata %f12, %f14, %f44
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
-	cmp	%o2, BLOCK_SIZE		
-	bne	%ncc, 2f		! exactly 1 block remaining?
-	add	%o0, BLOCK_SIZE, %o0	! update DST
-	brz,a	%o3, 3f			! is SRC double aligned?
-	ldd	[%o1], %f2
-
-2:	
-	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8 
-	add	%o5, %o3, %o5
-
-	membar	#StoreLoad|#StoreStore
-
-	ba	.beginmedloop
-	andn	%o5, 7, %o5		! 8 byte aligned count
-
-
-	! This is when there is exactly 1 block remaining and SRC is aligned
-3:
-	ldd	[%o1 + 0x8], %f4
-	ldd	[%o1 + 0x10], %f6
-	fsrc1	%f0, %f32
-	ldd	[%o1 + 0x18], %f8
-	fsrc1	%f2, %f34
-	ldd	[%o1 + 0x20], %f10
-	fsrc1	%f4, %f36
-	ldd	[%o1 + 0x28], %f12
-	fsrc1	%f6, %f38
-	ldd	[%o1 + 0x30], %f14
-	fsrc1	%f8, %f40
-	fsrc1	%f10, %f42
-	fsrc1	%f12, %f44
-	fsrc1	%f14, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	membar	#StoreLoad|#StoreStore
-	wr	%o4, 0, %fprs
-	retl
-	mov	%g1, %o0
-
-
-	.align 16
-	! two nops here causes loop starting at 1f below to be
-	! on a cache line boundary, improving performance
-	nop
-	nop
-.xlarge:
-	! %o0 I/O DST is 64-byte aligned
-	! %o1 I/O 8-byte aligned (and we've set GSR.ALIGN)
-	! %d0 I/O already loaded with SRC data from [%o1-8]
-	! %o2 I/O count (number of bytes that need to be written)
-	! %o3 I   Not written.  If zero, then SRC is double aligned.
-	! %o4 I   Not written.  Holds fprs.
-	! %o5   O The number of doubles that remain to be written.
-
-	! Load the rest of the current block 
-	! Recall that %o1 is further into SRC than %o0 is into DST
-
-	! prefetch [%o1 + (3 * BLOCK_SIZE)], 21
-	! executed in delay slot for branch to .xlarge
-	prefetch [%o1 + (4 * BLOCK_SIZE)], 21
-	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
-	ldd	[%o1], %f2
-	prefetch [%o1 + (6 * BLOCK_SIZE)], 21
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x20], %f10
-        or	%g0, -8, %o5		! if %o3 >= 0, %o5 = -8
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x28], %f12
-	movrlz	%o3, %g0, %o5		! if %o3 < 0, %o5 = 0  (needed later)
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f10, %f12, %f42
-	ldd	[%o1 + 0x38], %f0
-	sub	%o2, BLOCK_SIZE, %o2	! update count
-	prefetch [%o1 + (7 * BLOCK_SIZE)], 21
-	add	%o1, BLOCK_SIZE, %o1	! update SRC
-
-	! This point is 32-byte aligned since 24 instructions appear since
-	! the previous alignment directive.
-	
-
-	! Main loop.  Write previous block.  Load rest of current block.
-	! Some bytes will be loaded that won't yet be written.
-1:
-	ldd	[%o1], %f2
-	faligndata %f12, %f14, %f44
-	ldd	[%o1 + 0x8], %f4
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	sub	%o2, BLOCK_SIZE, %o2		! update count
-	ldd	[%o1 + 0x10], %f6
-	faligndata %f0, %f2, %f32
-	ldd	[%o1 + 0x18], %f8
-	faligndata %f2, %f4, %f34
-	ldd	[%o1 + 0x20], %f10
-	faligndata %f4, %f6, %f36
-	ldd	[%o1 + 0x28], %f12
-	faligndata %f6, %f8, %f38
-	ldd	[%o1 + 0x30], %f14
-	faligndata %f8, %f10, %f40
-	ldd	[%o1 + 0x38], %f0
-	faligndata %f10, %f12, %f42
-	! offset of 8*BLK+8 bytes works best over range of (src-dst) mod 1K
-	prefetch [%o1 + (8 * BLOCK_SIZE) + 8], 21
-	add	%o0, BLOCK_SIZE, %o0		! update DST
-	cmp	%o2, BLOCK_SIZE + 8
-	! second prefetch important to correct for occasional dropped
-	! initial prefetches, 5*BLK works best over range of (src-dst) mod 1K
-	! strong prefetch prevents drops on Panther, but Jaguar and earlier
-	! US-III models treat strong prefetches as weak prefetchs
-	! to avoid regressions on customer hardware, we retain the prefetch
-	prefetch [%o1 + (5 * BLOCK_SIZE)], 21
-	bgu,pt	%ncc, 1b
-	add	%o1, BLOCK_SIZE, %o1		! update SRC
-
-	faligndata %f12, %f14, %f44
-	faligndata %f14, %f0, %f46
-	stda	%f32, [%o0]ASI_BLK_P		! store 64 bytes, bypass cache
-	cmp	%o2, BLOCK_SIZE		
-	bne	%ncc, 2f		! exactly 1 block remaining?
-	add	%o0, BLOCK_SIZE, %o0	! update DST
-	brz,a	%o3, 3f			! is SRC double aligned?
-	ldd	[%o1], %f2
-
-2:	
-	add	%o5, %o2, %o5		! %o5 was already set to 0 or -8 
-	add	%o5, %o3, %o5
-
-	membar	#StoreLoad|#StoreStore
-
-	ba	.beginmedloop
-	andn	%o5, 7, %o5		! 8 byte aligned count
-
-
-	! This is when there is exactly 1 block remaining and SRC is aligned
-3:
-	ldd	[%o1 + 0x8], %f4
-	ldd	[%o1 + 0x10], %f6
-	fsrc1	%f0, %f32
-	ldd	[%o1 + 0x18], %f8
-	fsrc1	%f2, %f34
-	ldd	[%o1 + 0x20], %f10
-	fsrc1	%f4, %f36
-	ldd	[%o1 + 0x28], %f12
-	fsrc1	%f6, %f38
-	ldd	[%o1 + 0x30], %f14
-	fsrc1	%f8, %f40
-	fsrc1	%f10, %f42
-	fsrc1	%f12, %f44
-	fsrc1	%f14, %f46
-	stda	%f32, [%o0]ASI_BLK_P
-	membar	#StoreLoad|#StoreStore
-	wr	%o4, 0, %fprs
-	retl
-	mov	%g1, %o0
-	
-	SET_SIZE(memcpy)
--- a/usr/src/lib/libc_psr/sun4u-us3/common/memset.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,242 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memset.s"
-
-/*
- * char *memset(sp, c, n)
- *
- * Set an array of n chars starting at sp to the character c.
- * Return sp.
- *
- * Fast assembler language version of the following C-program for memset
- * which represents the `standard' for the C-library.
- *
- *	void *
- *	memset(void *sp1, int c, size_t n)
- *	{
- *	    if (n != 0) {
- *		char *sp = sp1;
- *		do {
- *		    *sp++ = (char)c;
- *		} while (--n != 0);
- *	    }
- *	    return (sp1);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-
-	ANSI_PRAGMA_WEAK(memset,function)
-
-#define	ALIGN8(X)	(((X) + 7) & ~7)
-#define BLOCK_SIZE      64
-
-	.section        ".text"
-	.align 32
-
-	ENTRY(memset)
-	cmp	%o2, 12			! if small counts, just write bytes
-	bgeu,pn	%ncc, .wrbig
-	mov	%o0, %o5		! copy sp1 before using it
-
-.wrchar:
-	deccc   %o2			! byte clearing loop
-        inc     %o5
-	bgeu,a,pt %ncc, .wrchar
-        stb     %o1, [%o5 + -1]         ! we've already incremented the address
-
-        retl
-	.empty	! next instruction is safe, %o0 still good
-
-.wrbig:
-        andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
-        bz,pt	%ncc, .blkchk		! already double aligned
-	and	%o1, 0xff, %o1		! o1 is (char)c
-        sub	%o3, 8, %o3		! -(bytes till double aligned)
-        add	%o2, %o3, %o2		! update o2 with new count
-
-	! Set -(%o3) bytes till sp1 double aligned
-1:	stb	%o1, [%o5]		! there is at least 1 byte to set
-	inccc	%o3			! byte clearing loop 
-        bl,pt	%ncc, 1b
-        inc	%o5 
-
-	
-	! Now sp1 is double aligned (sp1 is found in %o5)
-.blkchk:
-	sll     %o1, 8, %o3
-        or      %o1, %o3, %o1		! now o1 has 2 bytes of c
-
-        sll     %o1, 16, %o3
-        or      %o1, %o3, %o1		! now o1 has 4 bytes of c
-	
-	cmp     %o2, 4095		! if large count use Block ld/st
-	
-	sllx	%o1, 32, %o3
-	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
-
-        bgu,a,pn %ncc, .blkwr		! Do block write for large count
-        andcc   %o5, 63, %o3            ! is sp1 block aligned?
-	
-	and	%o2, 24, %o3		! o3 is {0, 8, 16, 24}
-
-1:	subcc	%o3, 8, %o3		! double-word loop
-	add	%o5, 8, %o5
-	bgeu,a,pt %ncc, 1b
-	stx	%o1, [%o5 - 8]		! already incremented the address
-
-	andncc	%o2, 31, %o4		! o4 has 32 byte aligned count
-	bz,pn	%ncc, 3f		! First instruction of icache line
-2:
-	subcc	%o4, 32, %o4		! main loop, 32 bytes per iteration
-	stx	%o1, [%o5 - 8]
-	stx	%o1, [%o5]
-	stx	%o1, [%o5 + 8]
-	stx	%o1, [%o5 + 16]
-	bnz,pt	%ncc, 2b
-	add	%o5, 32, %o5
-
-3:	
-	and	%o2, 7, %o2		! o2 has the remaining bytes (<8)
-
-4:
-	deccc   %o2                     ! byte clearing loop
-        inc     %o5
-        bgeu,a,pt %ncc, 4b
-        stb     %o1, [%o5 - 9]		! already incremented the address
-
-	retl
-	nop				! %o0 still preserved
-
-.blkwr:
-        bz,pn   %ncc, .blalign		! now block aligned
-        sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
-	add	%o2, %o3, %o2		! o2 is the remainder
-
-        ! Store -(%o3) bytes till dst is block (64 byte) aligned.
-        ! Use double word stores.
-	! Recall that dst is already double word aligned
-1:
-        stx     %o1, [%o5]
-	addcc   %o3, 8, %o3
-	bl,pt	%ncc, 1b
-	add     %o5, 8, %o5
-
-	! sp1 is block aligned                                     
-.blalign:
-        rd      %fprs, %g1              ! g1 = fprs
-
-	and	%o2, 63, %o3		! calc bytes left after blk store.
-
-	andcc	%g1, 0x4, %g1		! fprs.du = fprs.dl = 0
-	bz,a	%ncc, 2f		! Is fprs.fef == 0 
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-2:
-	brnz,pn	%o1, 3f			! %o1 is safe to check all 64-bits
-	andn	%o2, 63, %o4		! calc size of blocks in bytes
-	fzero   %d0
-	fzero   %d2
-	fzero   %d4
-	fzero   %d6
-	fmuld   %d0, %d0, %d8
-	fzero   %d10
-	ba	4f
-	fmuld   %d0, %d0, %d12
-
-3:
-	! allocate 8 bytes of scratch space on the stack
-	add	%sp, -SA(16), %sp
-	stx	%o1, [%sp + STACK_BIAS + ALIGN8(MINFRAME)]  ! move %o1 to %d0
-	ldd	[%sp + STACK_BIAS + ALIGN8(MINFRAME)], %d0
-
-	fmovd	%d0, %d2
-	add	%sp, SA(16), %sp	! deallocate the scratch space
-	fmovd	%d0, %d4	
-	fmovd	%d0, %d6	
-	fmovd	%d0, %d8
-	fmovd	%d0, %d10	
-	fmovd	%d0, %d12	
-4:	
-	fmovd	%d0, %d14
-	
-	! 1st quadrant has 64 bytes of c
-	! instructions 32-byte aligned here
-#ifdef PANTHER_ONLY
-	! Panther only code
-	prefetch	[%o5 + (3 * BLOCK_SIZE)], 22
-	prefetch	[%o5 + (6 * BLOCK_SIZE)], 22
-	std	%d0, [%o5]
-	std	%d0, [%o5 + 8]
-	std	%d0, [%o5 + 16]
-	std	%d0, [%o5 + 24]
-	std	%d0, [%o5 + 32]
-	std	%d0, [%o5 + 40]
-	std	%d0, [%o5 + 48]
-	std	%d0, [%o5 + 56]
-#else	
-	! Cheetah/Jaguar code
-        stda    %d0, [%o5]ASI_BLK_P
-#endif
-        subcc   %o4, 64, %o4
-        bgu,pt	%ncc, 4b
-        add     %o5, 64, %o5
-
-	! Set the remaining doubles
-	subcc   %o3, 8, %o3		! Can we store any doubles?
-	blu,pn  %ncc, 6f
-	and	%o2, 7, %o2		! calc bytes left after doubles
-
-5:	
-	std     %d0, [%o5]		! store the doubles
-	subcc   %o3, 8, %o3
-	bgeu,pt	%ncc, 5b
-        add     %o5, 8, %o5      
-6:
-	! Set the remaining bytes
-	brz	%o2, .exit		! safe to check all 64-bits
-	
-#if 0
-	! Terminate the copy with a partial store. (bug 1200071 does not apply)
-	! The data should be at d0
-        dec     %o2                     ! needed to get the mask right
-	edge8n	%g0, %o2, %o4
-	stda	%d0, [%o5]%o4, ASI_PST8_P
-#else
-7:	
-	deccc	%o2
-	stb	%o1, [%o5]
-	bgu,pt	%ncc, 7b
-	inc	%o5
-#endif
-	
-.exit:	
-        membar  #StoreLoad|#StoreStore
-        retl				! %o0 was preserved
-        wr	%g1, %g0, %fprs         ! fprs = g1  restore fprs
-
-	SET_SIZE(memset)
--- a/usr/src/lib/libc_psr/sun4u/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../../Makefile.lib
-
-PLATFORM=	sun4u
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber : lib32 \
-				$(BUILD64) lib64
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4u/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-#	Create default so empty rules don't
-#	confuse make
-#
-
-LIBRARY		= libc_psr.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/$(PLATFORM) \
-		  -I$(ROOT)/usr/platform/$(PLATFORM)/include
-CPPFLAGS	= -D_REENTRANT -D$(MACH) $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-MAPFILES	= ../../sun4u/mapfile-vers ../../sun4u/mapfile-memcpy \
-			$(MAPFILE.FLT)
-
-#
-# Used when building links in /platform/$(PLATFORM)/lib
-#
-LINKED_PLATFORMS	= SUNW,Ultra-2
-LINKED_PLATFORMS	+= SUNW,Ultra-4
-LINKED_PLATFORMS	+= SUNW,Ultra-5_10
-LINKED_PLATFORMS	+= SUNW,Ultra-30
-LINKED_PLATFORMS	+= SUNW,Ultra-60
-LINKED_PLATFORMS	+= SUNW,Ultra-80
-LINKED_PLATFORMS	+= SUNW,Ultra-250
-LINKED_PLATFORMS	+= SUNW,Ultra-Enterprise
-LINKED_PLATFORMS	+= SUNW,Ultra-Enterprise-10000
-LINKED_PLATFORMS	+= SUNW,UltraAX-i2
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIi-Netract
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIe-NetraCT-40
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIe-NetraCT-60
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-100
-LINKED_PLATFORMS	+= SUNW,Serverblade1
-LINKED_PLATFORMS	+= SUNW,Netra-CP2300
-
-#
-# install rule
-#
-$(ROOT_PSM_LIB_DIR)/%: % $(ROOT_PSM_LIB_DIR)
-	$(INS.file)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
--- a/usr/src/lib/libc_psr/sun4u/common/memcmp.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1120 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcmp.s"
-
-/*
- * memcmp(s1, s2, len)
- *
- * Compare n bytes:  s1>s2: >0  s1==s2: 0  s1<s2: <0
- *
- * Fast assembler language version of the following C-program for memcmp
- * which represents the `standard' for the C-library.
- *
- *	int
- *	memcmp(const void *s1, const void *s2, size_t n)
- *	{
- *		if (s1 != s2 && n != 0) {
- *			const char *ps1 = s1;
- *			const char *ps2 = s2;
- *			do {
- *				if (*ps1++ != *ps2++)
- *					return(ps1[-1] - ps2[-1]);
- *			} while (--n != 0);
- *		}
- *		return (0);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-
-	ANSI_PRAGMA_WEAK(memcmp,function)
-
-	ENTRY(memcmp)
-	cmp	%o0, %o1		! s1 == s2?
-	be	%ncc, .cmpeq
-	
-	! for small counts byte compare immediately
-	cmp	%o2, 48
-	bleu,a 	%ncc, .bytcmp
-	mov	%o2, %o3		! o3 <= 48
-	
-	! Count > 48. We will byte compare (8 + num of bytes to dbl align) 
-	! bytes. We assume that most miscompares will occur in the 1st 8 bytes 
-
-.chkdbl:
-        and     %o0, 7, %o4             ! is s1 aligned on a 8 byte bound
-	mov	8, %o3			! o2 > 48;  o3 = 8
-        sub     %o4, 8, %o4		! o4 = -(num of bytes to dbl align)
-	ba	%ncc, .bytcmp
-        sub     %o3, %o4, %o3           ! o3 = 8 + (num of bytes to dbl align)
-
-
-1:      ldub    [%o1], %o5        	! byte compare loop
-        inc     %o1
-        inc     %o0
-	dec	%o2
-        cmp     %o4, %o5
-	bne	%ncc, .noteq
-.bytcmp:
-	deccc   %o3
-	bgeu,a   %ncc, 1b
-        ldub    [%o0], %o4
-
-	! Check to see if there are more bytes to compare
-	cmp	%o2, 0			! is o2 > 0
-	bgu,a	%ncc, .blkchk		! we should already be dbl aligned
-	cmp     %o2, 320                ! if cnt < 256 + 64 -  no Block ld/st
-.cmpeq:
-        retl                             ! strings compare equal
-	sub	%g0, %g0, %o0
-
-.noteq:
-	retl				! strings aren't equal
-	sub	%o4, %o5, %o0		! return(*s1 - *s2)
-
-
-        ! Now src1 is Double word aligned
-.blkchk:
-        bgeu,a   %ncc, blkcmp                  ! do block cmp
-        andcc   %o0, 63, %o3            ! is src1 block aligned
- 
-        ! double word compare - using ldd and faligndata. Compares upto
-        ! 8 byte multiple count and does byte compare for the residual.
-
-.dwcmp: 
-        
-        rd      %fprs, %o3              ! o3 = fprs
-
-        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-        ! So set it anyway, without checking.
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-        andn    %o2, 7, %o4             ! o4 has 8 byte aligned cnt
-	sub     %o4, 8, %o4
-        alignaddr %o1, %g0, %g1
-        ldd     [%g1], %d0
-4:
-        add     %g1, 8, %g1
-        ldd     [%g1], %d2
-	ldd	[%o0], %d6
-        faligndata %d0, %d2, %d8
-	fcmpne32 %d6, %d8, %o5
-	fsrc1	%d6, %d6		! 2 fsrc1's added since o5 cannot
-	fsrc1	%d8, %d8		! be used for 3 cycles else we 
-	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
-	brnz,a,pn %o5, 6f
-	sub     %o1, %o0, %o1           ! o1 gets the difference
-        subcc   %o4, 8, %o4
-        add     %o0, 8, %o0
-        add     %o1, 8, %o1
-        bgu,pt	%ncc, 4b
-        sub     %o2, 8, %o2
-
-.residcmp:
-        ba      6f
-	sub     %o1, %o0, %o1           ! o1 gets the difference
-
-5:      ldub    [%o0 + %o1], %o5        ! byte compare loop
-        inc     %o0
-        cmp     %o4, %o5
-        bne     %ncc, .dnoteq
-6:
-        deccc   %o2
-        bgeu,a	%ncc, 5b
-        ldub    [%o0], %o4
-	
-	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
-	retl
-	sub	%g0, %g0, %o0		! strings compare equal 
-        
-.dnoteq:
-	and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-	wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
-	retl
-	sub	%o4, %o5, %o0		! return(*s1 - *s2)
-        
-
-blkcmp:  
-	save    %sp, -SA(MINFRAME), %sp
-        rd      %fprs, %l5              ! l5 = fprs
-
-        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-        ! So set it anyway, without checking.
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-	bz,pn   %ncc, .blalign          ! now block aligned
-        sub     %i3, 64, %i3
-        neg     %i3                     ! bytes till block aligned
-
-        ! Compare %i3 bytes till dst is block (64 byte) aligned. use
-        ! double word compares.
-
-        alignaddr %i1, %g0, %g1
-        ldd     [%g1], %d0
-7:
-        add     %g1, 8, %g1
-        ldd     [%g1], %d2
-        ldd     [%i0], %d6
-        faligndata %d0, %d2, %d8
-        fcmpne32 %d6, %d8, %i5
-	fsrc1	%d6, %d6		! 2 fsrc1's added since i5 cannot
-	fsrc1	%d8, %d8		! be used for 3 cycles else we 
-	fmovd	%d2, %d0		! create 9 bubbles in the pipeline
-        brnz,a,pn  %i5, .remcmp  
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        subcc   %i3, 8, %i3
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-        bgu,pt	%ncc, 7b
-        sub     %i2, 8, %i2
- 
-.blalign: 
-
-	! src1 is block aligned 
-        membar  #StoreLoad
-        srl     %i1, 3, %l6             ! bits 3,4,5 are now least sig in  %l6
-        andcc   %l6, 7, %l6             ! mask everything except bits 1,2 3
-        andn    %i2, 63, %i3            ! calc number of blocks
-        alignaddr %i1, %g0, %g0         ! gen %gsr
-        andn    %i1, 0x3F, %l7          ! blk aligned address
-        sub     %i2, %i3, %l2
-        andn    %l2, 7, %i4             ! calc doubles left after blkcpy
-
-	be,a	%ncc, 1f	! branch taken if src2 is 64-byte aligned
-	ldda	[%l7]ASI_BLK_P, %d0
-
-	call	.+8		! get the address of this instruction in %o7
-	sll	%l6, 2, %l4
-	add	%o7, %l4, %o7
-	jmp	%o7 + 16	! jump to the starting ldd instruction
-	nop
-	ldd	[%l7+8], %d2
-	ldd	[%l7+16], %d4
-	ldd	[%l7+24], %d6
-	ldd	[%l7+32], %d8
-	ldd	[%l7+40], %d10
-	ldd	[%l7+48], %d12
-	ldd	[%l7+56], %d14
-1:
-        add     %l7, 64, %l7
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	ldda	[%i0]ASI_BLK_P, %d32
-	sub     %i3, 128, %i3
- 
-        ! switch statement to get us to the right 8 byte blk within a
-        ! 64 byte block
- 
-        cmp      %l6, 4
-        bgeu,a	hlf
-        cmp      %l6, 6
-        cmp      %l6, 2
-        bgeu,a	sqtr
-        nop
-        cmp      %l6, 1
-        be,a     seg1
-        nop
-        ba       seg0
-        nop
-sqtr:    
-        be,a     seg2
-        nop
-
-        ba,a     seg3
-        nop
-         
-hlf:     
-        bgeu,a	fqtr
-        nop
-        cmp      %l6, 5
-        be,a     seg5
-        nop
-        ba       seg4
-        nop
-fqtr:    
-        be,a     seg6
-        nop
-        ba       seg7
-        nop
-
-! The fsrc1 instructions are to make sure that the results of the fcmpne32
-! are used 3 cycles later - else spitfire adds 9 bubbles.
-         
-#define	FCMPNE32_D32_D48			\
-	fcmpne32	%d48, %d32, %l0		;\
-	fcmpne32	%d50, %d34, %l1		;\
-	fcmpne32	%d52, %d36, %l2		;\
-	fcmpne32	%d54, %d38, %l3		;\
-	brnz,a		%l0, add		;\
-	mov		0, %l4			;\
-	fcmpne32	%d56, %d40, %l0		;\
-	brnz,a		%l1, add		;\
-	mov		8, %l4			;\
-	fcmpne32	%d58, %d42, %l1		;\
-	brnz,a		%l2, add		;\
-	mov		16, %l4			;\
-	fcmpne32	%d60, %d44, %l2		;\
-	brnz,a		%l3, add		;\
-	mov		24, %l4			;\
-	fcmpne32	%d62, %d46, %l3		;\
-	brnz,a		%l0, add		;\
-	mov		32, %l4			;\
-        fsrc1           %d48, %d48              ;\
-	brnz,a		%l1, add		;\
-	mov		40, %l4			;\
-        fsrc1           %d48, %d48              ;\
-	brnz,a		%l2, add		;\
-	mov		48, %l4			;\
-        fsrc1           %d48, %d48              ;\
-	brnz,a		%l3, add		;\
-	mov		56, %l4
-
-add:
-	add	%l4, %i0, %i0
-	add	%l4, %i1, %i1
-	ba	.remcmp
-	sub	%i1, %i0, %i1
-
-#define FALIGN_D0                       \
-        faligndata %d0, %d2, %d48       ;\
-        faligndata %d2, %d4, %d50       ;\
-        faligndata %d4, %d6, %d52       ;\
-        faligndata %d6, %d8, %d54       ;\
-        faligndata %d8, %d10, %d56      ;\
-        faligndata %d10, %d12, %d58     ;\
-        faligndata %d12, %d14, %d60     ;\
-        faligndata %d14, %d16, %d62
- 
-#define FALIGN_D16                      \
-        faligndata %d16, %d18, %d48     ;\
-        faligndata %d18, %d20, %d50     ;\
-        faligndata %d20, %d22, %d52     ;\
-        faligndata %d22, %d24, %d54     ;\
-        faligndata %d24, %d26, %d56     ;\
-        faligndata %d26, %d28, %d58     ;\
-        faligndata %d28, %d30, %d60     ;\
-        faligndata %d30, %d0, %d62
- 
-seg0:
-        FALIGN_D0
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D16
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg0
-	ldda	[%i0]ASI_BLK_P, %d32
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D0
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd16
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D16
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd0
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D2                       \
-        faligndata %d2, %d4, %d48       ;\
-        faligndata %d4, %d6, %d50       ;\
-        faligndata %d6, %d8, %d52       ;\
-        faligndata %d8, %d10, %d54      ;\
-        faligndata %d10, %d12, %d56     ;\
-        faligndata %d12, %d14, %d58     ;\
-        faligndata %d14, %d16, %d60     ;\
-        faligndata %d16, %d18, %d62
-
-#define FALIGN_D18                      \
-        faligndata %d18, %d20, %d48     ;\
-        faligndata %d20, %d22, %d50     ;\
-        faligndata %d22, %d24, %d52     ;\
-        faligndata %d24, %d26, %d54     ;\
-        faligndata %d26, %d28, %d56     ;\
-        faligndata %d28, %d30, %d58     ;\
-        faligndata %d30, %d0, %d60      ;\
-        faligndata %d0, %d2, %d62
-
-
-seg1:
-        FALIGN_D2
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D18
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg1
-	ldda	[%i0]ASI_BLK_P, %d32
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D2
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd18
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D18
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd2
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D4                       \
-        faligndata %d4, %d6, %d48       ;\
-        faligndata %d6, %d8, %d50       ;\
-        faligndata %d8, %d10, %d52      ;\
-        faligndata %d10, %d12, %d54     ;\
-        faligndata %d12, %d14, %d56     ;\
-        faligndata %d14, %d16, %d58     ;\
-        faligndata %d16, %d18, %d60     ;\
-        faligndata %d18, %d20, %d62
- 
-#define FALIGN_D20                      \
-        faligndata %d20, %d22, %d48     ;\
-        faligndata %d22, %d24, %d50     ;\
-        faligndata %d24, %d26, %d52     ;\
-        faligndata %d26, %d28, %d54     ;\
-        faligndata %d28, %d30, %d56     ;\
-        faligndata %d30, %d0, %d58      ;\
-        faligndata %d0, %d2, %d60       ;\
-        faligndata %d2, %d4, %d62
- 
-seg2:
-	FALIGN_D4
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D20
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg2
-	ldda	[%i0]ASI_BLK_P, %d32
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D4
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd20
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D20
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd4
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D6                       \
-        faligndata %d6, %d8, %d48       ;\
-        faligndata %d8, %d10, %d50      ;\
-        faligndata %d10, %d12, %d52     ;\
-        faligndata %d12, %d14, %d54     ;\
-        faligndata %d14, %d16, %d56     ;\
-        faligndata %d16, %d18, %d58     ;\
-        faligndata %d18, %d20, %d60     ;\
-        faligndata %d20, %d22, %d62
-
-#define FALIGN_D22                      \
-        faligndata %d22, %d24, %d48     ;\
-        faligndata %d24, %d26, %d50     ;\
-        faligndata %d26, %d28, %d52     ;\
-        faligndata %d28, %d30, %d54     ;\
-        faligndata %d30, %d0, %d56      ;\
-        faligndata %d0, %d2, %d58       ;\
-        faligndata %d2, %d4, %d60       ;\
-        faligndata %d4, %d6, %d62
-
- 
-seg3:
-        FALIGN_D6
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D22
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg3
-	ldda	[%i0]ASI_BLK_P, %d32
- 
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D6
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd22
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D22
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd6
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D8                       \
-        faligndata %d8, %d10, %d48      ;\
-        faligndata %d10, %d12, %d50     ;\
-        faligndata %d12, %d14, %d52     ;\
-        faligndata %d14, %d16, %d54     ;\
-        faligndata %d16, %d18, %d56     ;\
-        faligndata %d18, %d20, %d58     ;\
-        faligndata %d20, %d22, %d60     ;\
-        faligndata %d22, %d24, %d62
-
-#define FALIGN_D24                      \
-        faligndata %d24, %d26, %d48     ;\
-        faligndata %d26, %d28, %d50     ;\
-        faligndata %d28, %d30, %d52     ;\
-        faligndata %d30, %d0, %d54      ;\
-        faligndata %d0, %d2, %d56       ;\
-        faligndata %d2, %d4, %d58       ;\
-        faligndata %d4, %d6, %d60       ;\
-        faligndata %d6, %d8, %d62
-
-
-seg4:
-        FALIGN_D8
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D24
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg4
-	ldda	[%i0]ASI_BLK_P, %d32
-
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D8
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd24
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D24
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd8
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D10                      \
-        faligndata %d10, %d12, %d48     ;\
-        faligndata %d12, %d14, %d50     ;\
-        faligndata %d14, %d16, %d52     ;\
-        faligndata %d16, %d18, %d54     ;\
-        faligndata %d18, %d20, %d56     ;\
-        faligndata %d20, %d22, %d58     ;\
-        faligndata %d22, %d24, %d60     ;\
-        faligndata %d24, %d26, %d62
-
-#define FALIGN_D26                      \
-        faligndata %d26, %d28, %d48     ;\
-        faligndata %d28, %d30, %d50     ;\
-        faligndata %d30, %d0, %d52      ;\
-        faligndata %d0, %d2, %d54       ;\
-        faligndata %d2, %d4, %d56       ;\
-        faligndata %d4, %d6, %d58       ;\
-        faligndata %d6, %d8, %d60       ;\
-        faligndata %d8, %d10, %d62
-
-
-seg5:
-        FALIGN_D10
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D26
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg5
-	ldda	[%i0]ASI_BLK_P, %d32
-
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D10
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd26
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D26
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd10
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D12                      \
-        faligndata %d12, %d14, %d48     ;\
-        faligndata %d14, %d16, %d50     ;\
-        faligndata %d16, %d18, %d52     ;\
-        faligndata %d18, %d20, %d54     ;\
-        faligndata %d20, %d22, %d56     ;\
-        faligndata %d22, %d24, %d58     ;\
-        faligndata %d24, %d26, %d60     ;\
-        faligndata %d26, %d28, %d62
-
-#define FALIGN_D28                      \
-        faligndata %d28, %d30, %d48     ;\
-        faligndata %d30, %d0, %d50      ;\
-        faligndata %d0, %d2, %d52       ;\
-        faligndata %d2, %d4, %d54       ;\
-        faligndata %d4, %d6, %d56       ;\
-        faligndata %d6, %d8, %d58       ;\
-        faligndata %d8, %d10, %d60      ;\
-        faligndata %d10, %d12, %d62
-
-
-seg6:
-        FALIGN_D12
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D28
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg6
-	ldda	[%i0]ASI_BLK_P, %d32
-
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D12
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd28
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D28
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd12
-        sub     %i2, 64, %i2 
-
-#define FALIGN_D14                      \
-        faligndata %d14, %d16, %d48     ;\
-        faligndata %d16, %d18, %d50     ;\
-        faligndata %d18, %d20, %d52     ;\
-        faligndata %d20, %d22, %d54     ;\
-        faligndata %d22, %d24, %d56     ;\
-        faligndata %d24, %d26, %d58     ;\
-        faligndata %d26, %d28, %d60     ;\
-        faligndata %d28, %d30, %d62
-
-#define FALIGN_D30                      \
-        faligndata %d30, %d0, %d48     ;\
-        faligndata %d0, %d2, %d50      ;\
-        faligndata %d2, %d4, %d52      ;\
-        faligndata %d4, %d6, %d54      ;\
-        faligndata %d6, %d8, %d56      ;\
-        faligndata %d8, %d10, %d58     ;\
-        faligndata %d10, %d12, %d60    ;\
-        faligndata %d12, %d14, %d62
-
-seg7:
-        FALIGN_D14
-        ldda    [%l7]ASI_BLK_P, %d0
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 1f
-        sub     %i2, 64, %i2 
-        ldda    [%i0]ASI_BLK_P, %d32
-        
-        FALIGN_D30
-        ldda    [%l7]ASI_BLK_P, %d16
-        add     %l7, 64, %l7
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-        subcc   %i3, 64, %i3
-        bz,pn   %ncc, 0f
-        sub     %i2, 64, %i2 
-
-        ba	%ncc, seg7
-	ldda	[%i0]ASI_BLK_P, %d32
-
-0:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D14
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd30
-        sub     %i2, 64, %i2 
-
-1:
-	ldda	[%i0]ASI_BLK_P, %d32
-	membar  #Sync
-	FALIGN_D30
-	FCMPNE32_D32_D48
-        add     %i0, 64, %i0
-        add     %i1, 64, %i1
-	ba	%ncc, blkd14
-        sub     %i2, 64, %i2 
-
-
-blkd0:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d0, %d2, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd2:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d2, %d4, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd4:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d4, %d6, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd6:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d6, %d8, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd8:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d8, %d10, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd10:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d10, %d12, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd12:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d12, %d14, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd14:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        ba,pt 	%ncc, blkleft
-	fmovd   %d14, %d0
-
-blkd16:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d16, %d18, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd18:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d18, %d20, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd20:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d20, %d22, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd22:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d22, %d24, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd24:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d24, %d26, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd26:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d26, %d28, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd28:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        faligndata %d28, %d30, %d48
-	ldd	[%i0], %d32
-	fcmpne32 %d32, %d48, %l1
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	fsrc1	%d32, %d32
-	brnz,a	 %l1, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-	sub	%i2, 8, %i2
-
-blkd30:
-        subcc   %i4, 8, %i4
-        blu,a,pn %ncc, .remcmp
-        sub     %i1, %i0, %i1           ! i1 gets the difference
-        fmovd   %d30, %d0
-
-	! This loop handles doubles remaining that were not loaded(ldda`ed)
-	! in the Block Compare loop
-blkleft:
-        ldd     [%l7], %d2
-        add     %l7, 8, %l7
-        faligndata %d0, %d2, %d8
-	ldd     [%i0], %d32
-        fcmpne32 %d32, %d8, %l1
-	fsrc1	%d2, %d0
-	fsrc1	%d2, %d0
-	fsrc1	%d2, %d0
-	brnz,a	%l1, .remcmp
-	sub     %i1, %i0, %i1           ! i1 gets the difference
-        add     %i0, 8, %i0
-        add     %i1, 8, %i1
-        subcc   %i4, 8, %i4
-        bgeu,pt  %ncc, blkleft
-        sub     %i2, 8, %i2
-
-	ba	%ncc, .remcmp
-	sub     %i1, %i0, %i1           ! i1 gets the difference
-
-6:      ldub    [%i0 + %i1], %i5        ! byte compare loop
-        inc     %i0
-        cmp     %i4, %i5
-        bne     %ncc, .bnoteq
-.remcmp:
-        deccc   %i2
-        bgeu,a   %ncc, 6b
-        ldub    [%i0], %i4
-         
-exit:    
-	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
-	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
-	membar  #StoreLoad|#StoreStore
-        ret
-        restore %g0, %g0, %o0
-
-
-.bnoteq:
-	and     %l5, 0x4, %l5           ! fprs.du = fprs.dl = 0
-	wr      %l5, %g0, %fprs         ! fprs = l5 - restore fprs
-	membar  #StoreLoad|#StoreStore
-	sub	%i4, %i5, %i0		! return(*s1 - *s2)
-	ret				! strings aren't equal
-	restore %i0, %g0, %o0
-
-
-
-	SET_SIZE(memcmp)
--- a/usr/src/lib/libc_psr/sun4u/common/memcpy.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1266 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcpy.s"
-
-/*
- * memcpy(s1, s2, len)
- *
- * Copy s2 to s1, always copy n bytes.
- * Note: this does not work for overlapped copies, bcopy() does
- *
- * Fast assembler language version of the following C-program for memcpy
- * which represents the `standard' for the C-library.
- *
- *	void * 
- *	memcpy(void *s, const void *s0, size_t n)
- *	{
- *		if (n != 0) {
- *	   	    char *s1 = s;
- *		    const char *s2 = s0;
- *		    do {
- *			*s1++ = *s2++;
- *		    } while (--n != 0);
- *		}
- *		return ( s );
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-#include <sys/trap.h>
-
-	ANSI_PRAGMA_WEAK(memmove,function)
-	ANSI_PRAGMA_WEAK(memcpy,function)
-
-	ENTRY(memmove)
-	cmp	%o1, %o0	! if from address is >= to use forward copy
-	bgeu	%ncc, forcpy	! else use backward if ...
-	sub	%o0, %o1, %o4	! get difference of two addresses
-	cmp	%o2, %o4	! compare size and difference of addresses
-	bleu	%ncc, forcpy	! if size is bigger, do overlapped copy
-	nop
-
-        !
-        ! an overlapped copy that must be done "backwards"
-        !
-.ovbc:  
-	mov	%o0, %o5		! save des address for return val	
-	add     %o1, %o2, %o1           ! get to end of source space
-        add     %o0, %o2, %o0           ! get to end of destination space
-
-.chksize:
-	cmp	%o2, 8
-	bgeu,pn	%ncc, .dbalign
-	nop
-
-        
-.byte:
-1:	deccc	%o2			! decrement count
-	blu,pn	%ncc, exit		! loop until done
-	dec	%o0			! decrement to address
-	dec	%o1			! decrement from address
-        ldub	[%o1], %o3		! read a byte
-        ba	1b			! loop until done
-	stb	%o3, [%o0]		! write byte
-
-.dbalign:
-	andcc	%o0, 7, %o3
-	bz	%ncc, .dbbck
-	nop
-	dec	%o1
-	dec	%o0
-	dec	%o2
-	ldub	[%o1], %o3
-	ba	.chksize
-	stb	%o3, [%o0]
-
-.dbbck:
-
-        rd      %fprs, %o3              ! o3 = fprs
- 
- 
-        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-        ! So set it anyway, without checking.
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-        alignaddr	%o1, %g0, %g1		! align src
-        ldd	[%g1], %d0		! get first 8 byte block
-	sub	%g1, 8, %g1
-	andn	%o2, 7, %o4
-	sub	%o1, %o4, %o1
-
-2:
-	sub	%o0, 8, %o0		! since we are at the end
-					! when we first enter the loop
-        ldd	[%g1], %d2
-        faligndata %d2, %d0, %d8	! extract 8 bytes out 
-        std	%d8, [%o0]		! store it
-
-	sub	%g1, 8, %g1
-        sub	%o2, 8, %o2		! 8 less bytes to copy
-	cmp	%o2, 8			! or do we have < 8 bytes
-        bgeu,pt	%ncc, 2b	
-	fmovd	%d2, %d0
-
-        and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-        ba      .byte
-        wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
- 
-	SET_SIZE(memmove)
-
-
-	ENTRY(memcpy)
-	ENTRY(__align_cpy_1)
-forcpy:
-	mov	%o0, %o5		! save des address for return val
-
-	cmp	%o2, 32			! for small counts copy bytes
-	bgu,a	%ncc, .alignsrc
-	andcc   %o1, 7, %o3             ! is src aligned on a 8 byte bound
-
-.bytecp:
-	! Do byte copy
-	tst	%o2
-	bleu,a,pn %ncc, exit
-	nop
-
-1:	ldub	[%o1], %o4
-	inc 	%o1
-	inc	%o0
-	deccc	%o2
-	bgu	%ncc, 1b
-	stb	%o4, [%o0 - 1]
-
-exit:
-	retl
-	mov	%o5, %o0
-
-.alignsrc:
-        bz      %ncc, .bigcpy		! src already double aligned
-	sub     %o3, 8, %o3
-        neg     %o3                     ! bytes till src double aligned
-
-        sub     %o2, %o3, %o2           ! update o2 with new count
-
-	! Copy %o3 bytes till double aligned
-
-2:      ldub    [%o1], %o4
-        inc     %o1
-        inc     %o0
-        deccc   %o3
-        bgu	%ncc, 2b
-        stb     %o4, [%o0 - 1]
-
-	! Now Source (%o1) is double word aligned
-
-.bigcpy: 				! >= 17 bytes to copy
-	andcc	%o0, 7, %o3		! is dst aligned on a 8 byte bound
-        bz      %ncc, .blkchk		! already double aligned
-	sub     %o3, 8, %o3
-        neg     %o3                     ! bytes till double aligned
-
-        sub     %o2, %o3, %o2           ! update o2 with new count
-
-	! Copy %o3 bytes till double aligned
-
-3:      ldub    [%o1], %o4
-        inc     %o1
-        inc     %o0
-        deccc   %o3
-        bgu	%ncc, 3b
-        stb     %o4, [%o0 - 1]
-
-	! Now Destination (%o0) is double word aligned
-.blkchk:
-	cmp     %o2, 384		! if cnt < 256 + 128 -  no Block ld/st
-	bgeu,a	%ncc, blkcpy		!    do double word copy
-	subcc	%o0, %o1, %o4		! %o4 = dest - src
-
-	! double word copy - using ldd and faligndata. Copies upto
-	! 8 byte multiple count and does byte copy for the residual.
-.dwcpy:
-	rd	%fprs, %o3		! o3 = fprs
-
-	! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-	! So set it anyway, without checking.
-	wr	%g0, 0x4, %fprs 	! fprs.fef = 1
-	andn    %o2, 7, %o4     	! o4 has 8 byte aligned cnt
-	sub	%o4, 8, %o4
-        alignaddr %o1, %g0, %g1
-        ldd     [%g1], %d0
-        add     %g1, 8, %g1
-4:
-        ldd     [%g1], %d2
-        add     %g1, 8, %g1
-        sub     %o2, 8, %o2
-        subcc   %o4, 8, %o4
-        faligndata %d0, %d2, %d8
-        std     %d8, [%o0]
-        add     %o1, 8, %o1
-        bz,pn   %ncc, .residcp
-        add     %o0, 8, %o0
-        ldd     [%g1], %d0
-        add     %g1, 8, %g1
-        sub     %o2, 8, %o2
-        subcc   %o4, 8, %o4
-        faligndata %d2, %d0, %d8
-        std     %d8, [%o0]
-        add     %o1, 8, %o1
-        bgu,pn	%ncc, 4b
-        add     %o0, 8, %o0
-
-.residcp:				! Do byte copy
-	tst	%o2
-	bz,a,pn %ncc, dwexit
-	nop
-
-5:	ldub	[%o1], %o4
-	inc 	%o1
-	inc	%o0
-	deccc	%o2
-	bgu	%ncc, 5b
-	stb	%o4, [%o0 - 1]
-
-dwexit:
-        and     %o3, 0x4, %o3           ! fprs.du = fprs.dl = 0
-        wr      %o3, %g0, %fprs         ! fprs = o3 - restore fprs
-	retl
-	mov	%o5, %o0
-
-blkcpy:
-	! subcc	%o0, %o1, %o4		! in delay slot of branch
-	bneg,a,pn %ncc, 1f		! %o4 = abs(%o4)
-	neg	%o4
-1:
-	/*
-	 * Compare against 256 since we should be checking block addresses
-	 * and (dest & ~63) - (src & ~63) can be 3 blocks even if
-	 * src = dest + (64 * 3) + 63.
-	 */
-	cmp	%o4, 256		! if smaller than 3 blocks skip
-	blu,pn	%ncc, .dwcpy		! and do it the slower way
-	andcc	%o0, 63, %o3
-
-	save    %sp, -SA(MINFRAME), %sp
-        rd      %fprs, %l3              ! l3 = fprs
-         
-        ! if fprs.fef == 0, set it. Checking it, reqires 2 instructions.
-        ! So set it anyway, without checking.
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-
-        bz,pn   %ncc, blalign           ! now block aligned
-        sub     %i3, 64, %i3
-        neg     %i3                     ! bytes till block aligned
-	sub	%i2, %i3, %i2		! update %i2 with new count
-
-	! Copy %i3 bytes till dst is block (64 byte) aligned. use
-	! double word copies.
-
-        alignaddr %i1, %g0, %g1
-        ldd     [%g1], %d0
-        add     %g1, 8, %g1
-6:
-        ldd     [%g1], %d2
-        add     %g1, 8, %g1
-        subcc   %i3, 8, %i3
-        faligndata %d0, %d2, %d8
-        std     %d8, [%i0]
-        add     %i1, 8, %i1
-        bz,pn   %ncc, blalign
-        add     %i0, 8, %i0
-        ldd     [%g1], %d0
-        add     %g1, 8, %g1
-        subcc   %i3, 8, %i3
-        faligndata %d2, %d0, %d8
-        std     %d8, [%i0]
-        add     %i1, 8, %i1
-        bgu,pn	%ncc, 6b
-        add     %i0, 8, %i0
- 
-blalign:
-	membar  #StoreLoad
-	! %i2 = total length
-	! %i3 = blocks  (length - 64) / 64
-	! %i4 = doubles remaining  (length - blocks)
-	sub	%i2, 64, %i3
-	andn	%i3, 63, %i3
-	sub	%i2, %i3, %i4
-	andn	%i4, 7, %i4
-	sub	%i4, 16, %i4
-	sub	%i2, %i4, %i2
-	sub	%i2, %i3, %i2
-
-	andn	%i1, 0x3F, %l7		! blk aligned address
-	alignaddr %i1, %g0, %g0		! gen %gsr
-
-	srl	%i1, 3, %l5		! bits 3,4,5 are now least sig in  %l5
-	andcc  	%l5, 7, %l6		! mask everything except bits 1,2 3
-	add	%i1, %i4, %i1
-	add	%i1, %i3, %i1
-
-	be,a	%ncc, 1f	! branch taken if src is 64-byte aligned
-	ldda	[%l7]ASI_BLK_P, %d0
-
-	call	.+8		! get the address of this instruction in %o7
-	sll	%l6, 2, %l4
-	add	%o7, %l4, %o7
-	jmp	%o7 + 16	! jump to the starting ldd instruction
-	nop
-	ldd	[%l7+8], %d2
-	ldd	[%l7+16], %d4
-	ldd	[%l7+24], %d6
-	ldd	[%l7+32], %d8
-	ldd	[%l7+40], %d10
-	ldd	[%l7+48], %d12
-	ldd	[%l7+56], %d14
-1:
-	add	%l7, 64, %l7
-	ldda	[%l7]ASI_BLK_P, %d16
-	add	%l7, 64, %l7
-	ldda	[%l7]ASI_BLK_P, %d32
-	add	%l7, 64, %l7
-	sub	%i3, 128, %i3
-
-
-        ! switch statement to get us to the right 8 byte blk within a
-        ! 64 byte block
-
-	cmp	 %l6, 4
-	bgeu,a	 hlf
-	cmp	 %l6, 6
-	cmp	 %l6, 2
-	bgeu,a	 sqtr
-	nop
-	cmp	 %l6, 1
-	be,a	 seg1
-	nop
-	ba	 seg0
-	nop
-sqtr:
-	be,a	 seg2
-	nop
-	ba,a	 seg3
-	nop
-
-hlf:
-	bgeu,a	 fqtr
-	nop	 
-	cmp	 %l6, 5
-	be,a	 seg5
-	nop
-	ba	 seg4
-	nop
-fqtr:
-	be,a	 seg6
-	nop
-	ba	 seg7
-	nop
-	
-#define	FALIGN_D0			\
-	faligndata %d0, %d2, %d48	;\
-	faligndata %d2, %d4, %d50	;\
-	faligndata %d4, %d6, %d52	;\
-	faligndata %d6, %d8, %d54	;\
-	faligndata %d8, %d10, %d56	;\
-	faligndata %d10, %d12, %d58	;\
-	faligndata %d12, %d14, %d60	;\
-	faligndata %d14, %d16, %d62
-
-#define	FALIGN_D16			\
-	faligndata %d16, %d18, %d48	;\
-	faligndata %d18, %d20, %d50	;\
-	faligndata %d20, %d22, %d52	;\
-	faligndata %d22, %d24, %d54	;\
-	faligndata %d24, %d26, %d56	;\
-	faligndata %d26, %d28, %d58	;\
-	faligndata %d28, %d30, %d60	;\
-	faligndata %d30, %d32, %d62
-
-#define	FALIGN_D32			\
-	faligndata %d32, %d34, %d48	;\
-	faligndata %d34, %d36, %d50	;\
-	faligndata %d36, %d38, %d52	;\
-	faligndata %d38, %d40, %d54	;\
-	faligndata %d40, %d42, %d56	;\
-	faligndata %d42, %d44, %d58	;\
-	faligndata %d44, %d46, %d60	;\
-	faligndata %d46, %d0, %d62
-
-seg0:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D0
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D16
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D32
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg0
-
-0:
-	FALIGN_D16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D32
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd0
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D0
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd16
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D16
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd32
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D2			\
-	faligndata %d2, %d4, %d48	;\
-	faligndata %d4, %d6, %d50	;\
-	faligndata %d6, %d8, %d52	;\
-	faligndata %d8, %d10, %d54	;\
-	faligndata %d10, %d12, %d56	;\
-	faligndata %d12, %d14, %d58	;\
-	faligndata %d14, %d16, %d60	;\
-	faligndata %d16, %d18, %d62
-
-#define	FALIGN_D18			\
-	faligndata %d18, %d20, %d48	;\
-	faligndata %d20, %d22, %d50	;\
-	faligndata %d22, %d24, %d52	;\
-	faligndata %d24, %d26, %d54	;\
-	faligndata %d26, %d28, %d56	;\
-	faligndata %d28, %d30, %d58	;\
-	faligndata %d30, %d32, %d60	;\
-	faligndata %d32, %d34, %d62
-
-#define	FALIGN_D34			\
-	faligndata %d34, %d36, %d48	;\
-	faligndata %d36, %d38, %d50	;\
-	faligndata %d38, %d40, %d52	;\
-	faligndata %d40, %d42, %d54	;\
-	faligndata %d42, %d44, %d56	;\
-	faligndata %d44, %d46, %d58	;\
-	faligndata %d46, %d0, %d60	;\
-	faligndata %d0, %d2, %d62
-
-seg1:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D2
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D18
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D34
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg1
-0:
-	FALIGN_D18
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D34
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd2
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D34
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D2
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd18
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D2
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D18
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd34
-	add	%i0, 64, %i0
-
-#define	FALIGN_D4			\
-	faligndata %d4, %d6, %d48	;\
-	faligndata %d6, %d8, %d50	;\
-	faligndata %d8, %d10, %d52	;\
-	faligndata %d10, %d12, %d54	;\
-	faligndata %d12, %d14, %d56	;\
-	faligndata %d14, %d16, %d58	;\
-	faligndata %d16, %d18, %d60	;\
-	faligndata %d18, %d20, %d62
-
-#define	FALIGN_D20			\
-	faligndata %d20, %d22, %d48	;\
-	faligndata %d22, %d24, %d50	;\
-	faligndata %d24, %d26, %d52	;\
-	faligndata %d26, %d28, %d54	;\
-	faligndata %d28, %d30, %d56	;\
-	faligndata %d30, %d32, %d58	;\
-	faligndata %d32, %d34, %d60	;\
-	faligndata %d34, %d36, %d62
-
-#define	FALIGN_D36			\
-	faligndata %d36, %d38, %d48	;\
-	faligndata %d38, %d40, %d50	;\
-	faligndata %d40, %d42, %d52	;\
-	faligndata %d42, %d44, %d54	;\
-	faligndata %d44, %d46, %d56	;\
-	faligndata %d46, %d0, %d58	;\
-	faligndata %d0, %d2, %d60	;\
-	faligndata %d2, %d4, %d62
-
-seg2:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D4
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D20
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D36
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg2
-
-0:
-	FALIGN_D20
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D36
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd4
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D36
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D4
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd20
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D4
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D20
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd36
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D6			\
-	faligndata %d6, %d8, %d48	;\
-	faligndata %d8, %d10, %d50	;\
-	faligndata %d10, %d12, %d52	;\
-	faligndata %d12, %d14, %d54	;\
-	faligndata %d14, %d16, %d56	;\
-	faligndata %d16, %d18, %d58	;\
-	faligndata %d18, %d20, %d60	;\
-	faligndata %d20, %d22, %d62
-
-#define	FALIGN_D22			\
-	faligndata %d22, %d24, %d48	;\
-	faligndata %d24, %d26, %d50	;\
-	faligndata %d26, %d28, %d52	;\
-	faligndata %d28, %d30, %d54	;\
-	faligndata %d30, %d32, %d56	;\
-	faligndata %d32, %d34, %d58	;\
-	faligndata %d34, %d36, %d60	;\
-	faligndata %d36, %d38, %d62
-
-#define	FALIGN_D38			\
-	faligndata %d38, %d40, %d48	;\
-	faligndata %d40, %d42, %d50	;\
-	faligndata %d42, %d44, %d52	;\
-	faligndata %d44, %d46, %d54	;\
-	faligndata %d46, %d0, %d56	;\
-	faligndata %d0, %d2, %d58	;\
-	faligndata %d2, %d4, %d60	;\
-	faligndata %d4, %d6, %d62
-
-seg3:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D6
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D22
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D38
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg3
-
-0:
-	FALIGN_D22
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D38
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd6
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D38
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D6
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd22
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D6
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D22
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd38
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D8			\
-	faligndata %d8, %d10, %d48	;\
-	faligndata %d10, %d12, %d50	;\
-	faligndata %d12, %d14, %d52	;\
-	faligndata %d14, %d16, %d54	;\
-	faligndata %d16, %d18, %d56	;\
-	faligndata %d18, %d20, %d58	;\
-	faligndata %d20, %d22, %d60	;\
-	faligndata %d22, %d24, %d62
-
-#define	FALIGN_D24			\
-	faligndata %d24, %d26, %d48	;\
-	faligndata %d26, %d28, %d50	;\
-	faligndata %d28, %d30, %d52	;\
-	faligndata %d30, %d32, %d54	;\
-	faligndata %d32, %d34, %d56	;\
-	faligndata %d34, %d36, %d58	;\
-	faligndata %d36, %d38, %d60	;\
-	faligndata %d38, %d40, %d62
-
-#define	FALIGN_D40			\
-	faligndata %d40, %d42, %d48	;\
-	faligndata %d42, %d44, %d50	;\
-	faligndata %d44, %d46, %d52	;\
-	faligndata %d46, %d0, %d54	;\
-	faligndata %d0, %d2, %d56	;\
-	faligndata %d2, %d4, %d58	;\
-	faligndata %d4, %d6, %d60	;\
-	faligndata %d6, %d8, %d62
-
-seg4:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D8
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D24
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D40
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg4
-
-0:
-	FALIGN_D24
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D40
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd8
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D40
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D8
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd24
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D8
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D24
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd40
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D10			\
-	faligndata %d10, %d12, %d48	;\
-	faligndata %d12, %d14, %d50	;\
-	faligndata %d14, %d16, %d52	;\
-	faligndata %d16, %d18, %d54	;\
-	faligndata %d18, %d20, %d56	;\
-	faligndata %d20, %d22, %d58	;\
-	faligndata %d22, %d24, %d60	;\
-	faligndata %d24, %d26, %d62
-
-#define	FALIGN_D26			\
-	faligndata %d26, %d28, %d48	;\
-	faligndata %d28, %d30, %d50	;\
-	faligndata %d30, %d32, %d52	;\
-	faligndata %d32, %d34, %d54	;\
-	faligndata %d34, %d36, %d56	;\
-	faligndata %d36, %d38, %d58	;\
-	faligndata %d38, %d40, %d60	;\
-	faligndata %d40, %d42, %d62
-
-#define	FALIGN_D42			\
-	faligndata %d42, %d44, %d48	;\
-	faligndata %d44, %d46, %d50	;\
-	faligndata %d46, %d0, %d52	;\
-	faligndata %d0, %d2, %d54	;\
-	faligndata %d2, %d4, %d56	;\
-	faligndata %d4, %d6, %d58	;\
-	faligndata %d6, %d8, %d60	;\
-	faligndata %d8, %d10, %d62
-
-seg5:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D10
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D26
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D42
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg5
-
-0:
-	FALIGN_D26
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D42
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd10
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D42
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D10
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd26
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D10
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D26
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd42
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D12			\
-	faligndata %d12, %d14, %d48	;\
-	faligndata %d14, %d16, %d50	;\
-	faligndata %d16, %d18, %d52	;\
-	faligndata %d18, %d20, %d54	;\
-	faligndata %d20, %d22, %d56	;\
-	faligndata %d22, %d24, %d58	;\
-	faligndata %d24, %d26, %d60	;\
-	faligndata %d26, %d28, %d62
-
-#define	FALIGN_D28			\
-	faligndata %d28, %d30, %d48	;\
-	faligndata %d30, %d32, %d50	;\
-	faligndata %d32, %d34, %d52	;\
-	faligndata %d34, %d36, %d54	;\
-	faligndata %d36, %d38, %d56	;\
-	faligndata %d38, %d40, %d58	;\
-	faligndata %d40, %d42, %d60	;\
-	faligndata %d42, %d44, %d62
-
-#define	FALIGN_D44			\
-	faligndata %d44, %d46, %d48	;\
-	faligndata %d46, %d0, %d50	;\
-	faligndata %d0, %d2, %d52	;\
-	faligndata %d2, %d4, %d54	;\
-	faligndata %d4, %d6, %d56	;\
-	faligndata %d6, %d8, %d58	;\
-	faligndata %d8, %d10, %d60	;\
-	faligndata %d10, %d12, %d62
-
-seg6:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D12
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D28
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D44
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg6
-
-0:
-	FALIGN_D28
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D44
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd12
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D44
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D12
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd28
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D12
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D28
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd44
-	add	%i0, 64, %i0
-
-
-#define	FALIGN_D14			\
-	faligndata %d14, %d16, %d48	;\
-	faligndata %d16, %d18, %d50	;\
-	faligndata %d18, %d20, %d52	;\
-	faligndata %d20, %d22, %d54	;\
-	faligndata %d22, %d24, %d56	;\
-	faligndata %d24, %d26, %d58	;\
-	faligndata %d26, %d28, %d60	;\
-	faligndata %d28, %d30, %d62
-
-#define	FALIGN_D30			\
-	faligndata %d30, %d32, %d48	;\
-	faligndata %d32, %d34, %d50	;\
-	faligndata %d34, %d36, %d52	;\
-	faligndata %d36, %d38, %d54	;\
-	faligndata %d38, %d40, %d56	;\
-	faligndata %d40, %d42, %d58	;\
-	faligndata %d42, %d44, %d60	;\
-	faligndata %d44, %d46, %d62
-
-#define	FALIGN_D46			\
-	faligndata %d46, %d0, %d48	;\
-	faligndata %d0, %d2, %d50	;\
-	faligndata %d2, %d4, %d52	;\
-	faligndata %d4, %d6, %d54	;\
-	faligndata %d6, %d8, %d56	;\
-	faligndata %d8, %d10, %d58	;\
-	faligndata %d10, %d12, %d60	;\
-	faligndata %d12, %d14, %d62
-
-seg7:
-	! 1st chunk - %d0 low, %d16 high, %d32 pre, %d48 dst
-	FALIGN_D14
-	ldda	[%l7]ASI_BLK_P, %d0
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 0f
-	add	%i0, 64, %i0
-	! 2nd chunk -  %d0 pre, %d16 low, %d32 high, %d48 dst
-	FALIGN_D30
-	ldda	[%l7]ASI_BLK_P, %d16
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 1f
-	add	%i0, 64, %i0
-	! 3rd chunk -  %d0 high, %d16 pre, %d32 low, %d48 dst
-	FALIGN_D46
-	ldda	[%l7]ASI_BLK_P, %d32
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%l7, 64, %l7
-	subcc	%i3, 64, %i3
-	bz,pn	%ncc, 2f
-	add	%i0, 64, %i0
-	ba,a,pt	%ncc, seg7
-
-0:
-	FALIGN_D30
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D46
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd14
-	add	%i0, 64, %i0
-
-1:
-	FALIGN_D46
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D14
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd30
-	add	%i0, 64, %i0
-
-2:
-	FALIGN_D14
-	stda	%d48, [%i0]ASI_BLK_P
-	add	%i0, 64, %i0
-	membar	#Sync
-	FALIGN_D30
-	stda	%d48, [%i0]ASI_BLK_P
-	ba,pt	%ncc, blkd46
-	add	%i0, 64, %i0
-
-
-	!
-	! dribble out the last partial block
-	!
-blkd0:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d0, %d2, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd2:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d2, %d4, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd4:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d4, %d6, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd6:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d6, %d8, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd8:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d8, %d10, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd10:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d10, %d12, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd12:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d12, %d14, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd14:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	fsrc1	%d14, %d0
-	ba,a,pt	%ncc, blkleft
-
-blkd16:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d16, %d18, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd18:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d18, %d20, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd20:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d20, %d22, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd22:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d22, %d24, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd24:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d24, %d26, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd26:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d26, %d28, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd28:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d28, %d30, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd30:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	fsrc1	%d30, %d0
-	ba,a,pt	%ncc, blkleft
-blkd32:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d32, %d34, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd34:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d34, %d36, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd36:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d36, %d38, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd38:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d38, %d40, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd40:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d40, %d42, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd42:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d42, %d44, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd44:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	faligndata %d44, %d46, %d48
-	std	%d48, [%i0]
-	add	%i0, 8, %i0
-blkd46:
-	subcc	%i4, 8, %i4
-	blu,pn	%ncc, blkdone
-	fsrc1	%d46, %d0
-
-blkleft:
-	ldd	[%l7], %d2
-	add	%l7, 8, %l7
-	subcc	%i4, 8, %i4
-	faligndata %d0, %d2, %d8
-	std	%d8, [%i0]
-	blu,pn	%ncc, blkdone
-	add	%i0, 8, %i0
-	ldd	[%l7], %d0
-	add	%l7, 8, %l7
-	subcc	%i4, 8, %i4
-	faligndata %d2, %d0, %d8
-	std	%d8, [%i0]
-	bgeu,pt	%ncc, blkleft
-	add	%i0, 8, %i0
-
-blkdone:
-	tst	%i2
-	bz,pt 	%ncc, blkexit
-	and	%l3, 0x4, %l3		! fprs.du = fprs.dl = 0
-
-7:      ldub    [%i1], %i4
-        inc     %i1
-        inc     %i0
-        deccc   %i2
-        bgu  	%ncc, 7b
-        stb     %i4, [%i0 - 1]
-	
-blkexit:
-        and     %l3, 0x4, %l3           ! fprs.du = fprs.dl = 0
-	wr      %l3, %g0, %fprs         ! fprs = l3 - restore fprs.fef
-	membar  #StoreLoad|#StoreStore
-	ret
-	restore %i5, %g0, %o0
-
-	SET_SIZE(memcpy)
-	SET_SIZE(__align_cpy_1)
--- a/usr/src/lib/libc_psr/sun4u/common/memset.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memset.s"
-
-/*
- * char *memset(sp, c, n)
- *
- * Set an array of n chars starting at sp to the character c.
- * Return sp.
- *
- * Fast assembler language version of the following C-program for memset
- * which represents the `standard' for the C-library.
- *
- *	void *
- *	memset(void *sp1, int c, size_t n)
- *	{
- *	    if (n != 0) {
- *		char *sp = sp1;
- *		do {
- *		    *sp++ = (char)c;
- *		} while (--n != 0);
- *	    }
- *	    return (sp1);
- *	}
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/sun4asi.h>
-
-	ANSI_PRAGMA_WEAK(memset,function)
-
-#define	ALIGN8(X)	(((X) + 7) & ~7)
-
-	.section        ".text"
-	.align 32
-
-	ENTRY(memset)
-	cmp	%o2, 12			! if small counts, just write bytes
-	bgeu,pn	%ncc, .wrbig
-	mov	%o0, %o5		! copy sp1 before using it
-
-.wrchar:
-	deccc   %o2			! byte clearing loop
-        inc     %o5
-	bgeu,a,pt %ncc, .wrchar
-        stb     %o1, [%o5 + -1]         ! we've already incremented the address
-
-        retl
-	.empty	! next instruction is safe, %o0 still good
-
-.wrbig:
-        andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
-        bz,pt	%ncc, .blkchk		! already double aligned
-	and	%o1, 0xff, %o1		! o1 is (char)c
-        sub	%o3, 8, %o3		! -(bytes till double aligned)
-        add	%o2, %o3, %o2		! update o2 with new count
-
-	! Set -(%o3) bytes till sp1 double aligned
-1:	stb	%o1, [%o5]		! there is at least 1 byte to set
-	inccc	%o3			! byte clearing loop 
-        bl,pt	%ncc, 1b
-        inc	%o5 
-
-	
-	! Now sp1 is double aligned (sp1 is found in %o5)
-.blkchk:
-	sll     %o1, 8, %o3
-        or      %o1, %o3, %o1		! now o1 has 2 bytes of c
-
-        sll     %o1, 16, %o3
-        or      %o1, %o3, %o1		! now o1 has 4 bytes of c
-	
-	cmp     %o2, 4095		! if large count use Block ld/st
-	
-	sllx	%o1, 32, %o3
-	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
-
-        bgu,a,pn %ncc, .blkwr		! Do block write for large count
-        andcc   %o5, 63, %o3            ! is sp1 block aligned?
-	
-	and	%o2, 24, %o3		! o3 is {0, 8, 16, 24}
-
-1:	subcc	%o3, 8, %o3		! double-word loop
-	add	%o5, 8, %o5
-	bgeu,a,pt %ncc, 1b
-	stx	%o1, [%o5 - 8]		! already incremented the address
-
-	andncc	%o2, 31, %o4		! o4 has 32 byte aligned count
-	bz,pn	%ncc, 3f		! First instruction of icache line
-2:
-	subcc	%o4, 32, %o4		! main loop, 32 bytes per iteration
-	stx	%o1, [%o5 - 8]
-	stx	%o1, [%o5]
-	stx	%o1, [%o5 + 8]
-	stx	%o1, [%o5 + 16]
-	bnz,pt	%ncc, 2b
-	add	%o5, 32, %o5
-
-3:	
-	and	%o2, 7, %o2		! o2 has the remaining bytes (<8)
-
-4:
-	deccc   %o2                     ! byte clearing loop
-        inc     %o5
-        bgeu,a,pt %ncc, 4b
-        stb     %o1, [%o5 - 9]		! already incremented the address
-
-	retl
-	nop				! %o0 still preserved
-
-.blkwr:
-        bz,pn   %ncc, .blalign		! now block aligned
-        sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
-	add	%o2, %o3, %o2		! o2 is the remainder
-
-        ! Store -(%o3) bytes till dst is block (64 byte) aligned.
-        ! Use double word stores.
-	! Recall that dst is already double word aligned
-1:
-        stx     %o1, [%o5]
-	addcc   %o3, 8, %o3
-	bl,pt	%ncc, 1b
-	add     %o5, 8, %o5
-
-	! sp1 is block aligned                                     
-.blalign:
-        rd      %fprs, %g1              ! g1 = fprs
-
-	and	%o2, 63, %o3		! calc bytes left after blk store.
-
-	andcc	%g1, 0x4, %g1		! fprs.du = fprs.dl = 0
-	bz,a	%ncc, 2f		! Is fprs.fef == 0 
-        wr      %g0, 0x4, %fprs         ! fprs.fef = 1
-2:
-	brnz,pn	%o1, 3f			! %o1 is safe to check all 64-bits
-	andn	%o2, 63, %o4		! calc size of blocks in bytes
-	fzero   %d0
-	fzero   %d2
-	fzero   %d4
-	fzero   %d6
-	fmuld   %d0, %d0, %d8
-	fzero   %d10
-	ba	4f
-	fmuld   %d0, %d0, %d12
-
-3:
-	! allocate 8 bytes of scratch space on the stack
-	add	%sp, -SA(16), %sp
-	stx	%o1, [%sp + STACK_BIAS + ALIGN8(MINFRAME)]  ! move %o1 to %d0
-	ldd	[%sp + STACK_BIAS + ALIGN8(MINFRAME)], %d0
-
-	fmovd	%d0, %d2
-	add	%sp, SA(16), %sp	! deallocate the scratch space
-	fmovd	%d0, %d4	
-	fmovd	%d0, %d6	
-	fmovd	%d0, %d8
-	fmovd	%d0, %d10	
-	fmovd	%d0, %d12	
-4:	
-	fmovd	%d0, %d14
-	
-	! 1st quadrant has 64 bytes of c
-	! instructions 32-byte aligned here
-
-        stda    %d0, [%o5]ASI_BLK_P
-        subcc   %o4, 64, %o4
-        bgu,pt	%ncc, 4b
-        add     %o5, 64, %o5
-
-	! Set the remaining doubles
-	subcc   %o3, 8, %o3		! Can we store any doubles?
-	blu,pn  %ncc, 6f
-	and	%o2, 7, %o2		! calc bytes left after doubles
-
-5:	
-	std     %d0, [%o5]		! store the doubles
-	subcc   %o3, 8, %o3
-	bgeu,pt	%ncc, 5b
-        add     %o5, 8, %o5      
-6:
-	! Set the remaining bytes
-	brz	%o2, .exit		! safe to check all 64-bits
-	
-#if 0
-	! Terminate the copy with a partial store. (bug 1200071 does not apply)
-	! The data should be at d0
-        dec     %o2                     ! needed to get the mask right
-	edge8n	%g0, %o2, %o4
-	stda	%d0, [%o5]%o4, ASI_PST8_P
-#else
-7:	
-	deccc	%o2
-	stb	%o1, [%o5]
-	bgu,pt	%ncc, 7b
-	inc	%o5
-#endif
-	
-.exit:	
-        membar  #StoreLoad|#StoreStore
-        retl				! %o0 was preserved
-        wr	%g1, %g0, %fprs         ! fprs = g1  restore fprs
-
-	SET_SIZE(memset)
--- a/usr/src/lib/libc_psr/sun4u/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-CLASS		= 32
-PLATFORM	= sun4u
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASFLAGS	+=	-xarch=v8plusa -warn
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr.so.1
-LIBC_PSR_DIRS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
-LIBC_PSR_LINKS	= $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
-INS.slink6	= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-
-$(LIBC_PSR_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR_LINKS): $(LIBC_PSR_DIRS)
-	-$(INS.slink6)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_LINKS) $(ROOT_PSM_LIBS)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4u
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS	+=	-xarch=v9a
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr.so.1
-LIBC_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
-LIBC_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-INS.slink6	= $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-$(LIBC_PSR64_DIRS):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LINKS): $(LIBC_PSR64_DIRS)
-	-$(INS.slink6)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_LINKS) $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u_hwcap1/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../../Makefile.lib
-
-PLATFORM=	sun4u-us3
-ALT_PLAT=	sun4u_hwcap1
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber : lib32 \
-				$(BUILD64) lib64
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4u_hwcap1/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-#
-#	Create default so empty rules don't
-#	confuse make
-#
-
-LIBRARY		= libc_psr_hwcap1.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/sun4u \
-		  -I$(ROOT)/usr/platform/sun4u/include
-# See note in memcpy.s for use of bst threshold.
-CPPFLAGS	= -DBSTORE_SIZE=256 \
-		  -D_REENTRANT -D$(MACH) $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-MAPFILES	= ../../sun4u/mapfile-vers $(MAPFILE.FLT)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
-
-pics/%.o: ../../$(COMPAT_PLAT)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
-
--- a/usr/src/lib/libc_psr/sun4u_hwcap1/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr_hwcap1.
-#
-
-PLATFORM	= sun4u-us3
-ALT_PLAT	= sun4u_hwcap1
-COMPAT_PLAT	= sun4u
-CLASS		= 32
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASFLAGS	+=	-xarch=v8plusb
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap1.so.1
-LIBC_PSR_DIR	= $(ROOT_PSM_LIB_DIR)/libc_psr
-LIBC_PSR_LIB	= $(LIBC_PSR_DIR)/$(MODULE)
-INS.libc	= $(RM) -r $@; $(INS) -s -f $(@D) $(MODULE)
-
-$(LIBC_PSR_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR_LIB): $(LIBC_PSR_DIR) $(MODULE)
-	-$(INS.libc)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u_hwcap1/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr_hwcap1.
-#
-
-PLATFORM	= sun4u-us3
-ALT_PLAT	= sun4u_hwcap1
-COMPAT_PLAT	= sun4u
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS	+=	-xarch=v9b
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap1.so.1
-LIBC_PSR64_DIR	= $(ROOT_PSM_LIB_DIR)/$(MACH64)/libc_psr
-LIBC_PSR64_LIB	= $(LIBC_PSR64_DIR)/$(MODULE)
-INS.libc.64	= $(RM) -r $@; $(INS) -s -f $(@D) $(MODULE)
-
-$(LIBC_PSR64_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LIB): $(LIBC_PSR64_DIR) $(MODULE)
-	-$(INS.libc.64)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u_hwcap2/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../../Makefile.lib
-
-PLATFORM=	sun4u-us3
-ALT_PLAT=	sun4u_hwcap2
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber : lib32 \
-				$(BUILD64) lib64
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4u_hwcap2/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-#
-#	Create default so empty rules don't
-#	confuse make
-#
-
-LIBRARY		= libc_psr_hwcap2.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/sun4u \
-		  -I$(ROOT)/usr/platform/sun4u/include
-# See note in memcpy.s for use of bst threshold.
-CPPFLAGS	= -DBSTORE_SIZE=65536 -DPANTHER_ONLY \
-		  -D_REENTRANT -D$(MACH) $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-MAPFILES =	../../sun4u/mapfile-vers ../mapfile $(MAPFILE.FLT)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
-
-pics/%.o: ../../$(COMPAT_PLAT)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
-
--- a/usr/src/lib/libc_psr/sun4u_hwcap2/mapfile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw += popc;
-};
--- a/usr/src/lib/libc_psr/sun4u_hwcap2/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr_hwcap2.
-#
-
-PLATFORM	= sun4u-us3
-ALT_PLAT	= sun4u_hwcap2
-COMPAT_PLAT	= sun4u
-CLASS		= 32
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASFLAGS	+=	-xarch=v8plusb
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap2.so.1
-LIBC_PSR_DIR	= $(ROOT_PSM_LIB_DIR)/libc_psr
-LIBC_PSR_LIB	= $(LIBC_PSR_DIR)/$(MODULE)
-INS.libc	= $(RM) -r $@; $(INS) -s -f $(@D) $(MODULE)
-
-$(LIBC_PSR_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR_LIB): $(LIBC_PSR_DIR) $(MODULE)
-	-$(INS.libc)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4u_hwcap2/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr_hwcap2.
-#
-
-PLATFORM	= sun4u-us3
-ALT_PLAT	= sun4u_hwcap2
-COMPAT_PLAT	= sun4u
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o memcmp.o
-
-include ../Makefile.com
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS	+=	-xarch=v9b
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap2.so.1
-LIBC_PSR64_DIR	= $(ROOT_PSM_LIB_DIR)/$(MACH64)/libc_psr
-LIBC_PSR64_LIB	= $(LIBC_PSR64_DIR)/$(MODULE)
-INS.libc.64	= $(RM) -r $@; $(INS) -f $(@D) $(MODULE)
-
-$(LIBC_PSR64_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LIB): $(LIBC_PSR64_DIR) $(MODULE)
-	-$(INS.libc.64)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4v/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-PLATFORM	=	sun4v
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-TOUCH		= /usr/bin/touch
-
-MODULE		= libc_psr.so.1
-
-$(ROOT_PSM_LIB_DIR):
-	-$(INS.dir)
-
-$(ROOT_PSM_LIB_DIR)/$(MODULE):	$(ROOT_PSM_LIB_DIR) $(MODULE)
-	$(RM) -r $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(MODULE)
-
-$(ROOT_PSM_LIB64_DIR):
-	-$(INS.dir)
-
-$(ROOT_PSM_LIB64_DIR)/$(MODULE):	$(ROOT_PSM_LIB64_DIR) $(MODULE)
-	$(RM) -r $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(MODULE)
-
-all:	FRC
-	@$(TOUCH) $(MODULE)
-
-install:	all $(ROOT_PSM_LIB_DIR)/$(MODULE) $(ROOT_PSM_LIB64_DIR)/$(MODULE)
-
-clean clobber : FRC
-	$(RM) $(MODULE)
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4v/common/memcpy.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2572 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcpy.s"
-
-/*
- * memcpy(s1, s2, len)
- *
- * Copy s2 to s1, always copy n bytes.
- * Note: this C code does not work for overlapped copies.
- *       Memmove() and bcopy() do.
- *
- * Added entry __align_cpy_1 is generally for use of the compilers.
- *
- * Fast assembler language version of the following C-program for memcpy
- * which represents the `standard' for the C-library.
- *
- *	void *
- *	memcpy(void *s, const void *s0, size_t n)
- *	{
- *		if (n != 0) {
- *		    char *s1 = s;
- *		    const char *s2 = s0;
- *		    do {
- *			*s1++ = *s2++;
- *		    } while (--n != 0);
- *		}
- *		return (s);
- *	}
- *
- *
- * N1 Flow :
- *
- * if (count < 17) {
- *	Do the byte copy
- *	Return destination address
- * }
- * if (count < 128) {
- *	Is source aligned on word boundary
- *	If no then align source on word boundary then goto .ald
- *	If yes goto .ald
- *	.ald:
- *		Is destination aligned on word boundary
- *		Depending on destination offset (last 2 bits of destination)
- *		copy data by shifting and merging.
- *		Copy residue bytes as byte copy
- *		Return destination address
- * } else {
- *	Align destination on block boundary
- *	Depending on the source offset (last 4 bits of source address) align
- *	the data and store to destination. Both the load and store are done
- *	using ASI_BLK_INIT_ST_QUAD_LDD_P.
- *	For remaining count copy as much data in 8-byte chunk from source to
- *	destination.
- *	Followed by trailing copy using byte copy.
- *	Return saved destination address
- * }
- *
- *
- * N2 Flow :
- * Flow :
- *
- * if (count < 128) {
- *   if count < 3
- *	copy bytes; exit with dst addr
- *   if src & dst aligned on word boundary but not long word boundary,
- *     copy with ldw/stw; branch to finish_up
- *   if src & dst aligned on long word boundary
- *     copy with ldx/stx; branch to finish_up
- *   if src & dst not aligned and length <= 14
- *     copy bytes; exit with dst addr
- *   move enough bytes to get src to word boundary
- *   if dst now on word boundary
- * move_words:
- *     copy words; branch to finish_up
- *   if dst now on half word boundary
- *     load words, shift half words, store words; branch to finish_up
- *   if dst on byte 1
- *     load words, shift 3 bytes, store words; branch to finish_up
- *   if dst on byte 3
- *     load words, shift 1 byte, store words; branch to finish_up
- * finish_up:
- *     copy bytes; exit with dst addr
- * } else {                                         More than 128 bytes
- *   move bytes until dst is on long word boundary
- *   if( src is on long word boundary ) {
- *     if (count < 512) {
- * finish_long:				           src/dst aligned on 8 bytes
- *       copy with ldx/stx in 8-way unrolled loop;
- *       copy final 0-63 bytes; exit with dst addr
- *     } else {                                 src/dst aligned; count > 512
- *       align dst on 64 byte boundary; use 8-way test for each of 8 possible
- *       src alignments relative to a 64 byte boundary to select the
- *       16-way unrolled loop to use for
- *       block load, fmovd, block-init-store, block-store, fmovd operations
- *       then go to finish_long.
- *     }
- *   } else {                                   src/dst not aligned on 8 bytes
- *     if src is word aligned and count < 512
- *       move words in 8-way unrolled loop
- *       move final 0-31 bytes; exit with dst addr
- *     if count < 512
- *       use alignaddr/faligndata combined with ldd/std in 8-way
- *       unrolled loop to move data.
- *       go to unalign_done
- *     else
- *       setup alignaddr for faligndata instructions
- *       align dst on 64 byte boundary; use 8-way test for each of 8 possible
- *       src alignments to nearest long word relative to 64 byte boundary to
- *       select the 8-way unrolled loop to use for
- *       block load, falign, fmovd, block-init-store, block-store loop
- *	 (only use block-init-store when src/dst on 8 byte boundaries.)
- * unalign_done:
- *       move remaining bytes for unaligned cases. exit with dst addr.
- * }
- *
- * Comment on N2 memmove and memcpy common code and block-store-init:
- *   In the man page for memmove, it specifies that copying will take place
- *   correctly between objects that overlap.  For memcpy, behavior is
- *   undefined for objects that overlap.
- *
- *   In rare cases, some multi-threaded applications may attempt to examine
- *   the copy destination buffer during the copy. Using the block-store-init
- *   instruction allows those applications to observe zeros in some
- *   cache lines of the destination buffer for narrow windows. But the
- *   the block-store-init provides memory throughput advantages for many
- *   common applications. To meet both needs, those applications which need
- *   the destination buffer to retain meaning during the copy should use
- *   memmove instead of memcpy.  The memmove version duplicates the memcpy
- *   algorithms except the memmove version does not use block-store-init
- *   in those cases where memcpy does use block-store-init. Otherwise, when
- *   memmove can determine the source and destination do not overlap,
- *   memmove shares the memcpy code.
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/niagaraasi.h>
-#include <sys/asi.h>
-#include <sys/trap.h>
-
-/* documented name for primary block initializing store */
-#define	ASI_STBI_P	ASI_BLK_INIT_ST_QUAD_LDD_P
-
-#define	BLOCK_SIZE	64
-#define	FPRS_FEF	0x4
-
-#define	SHORTCOPY	3
-#define	SHORTCHECK	14
-#define	SHORT_LONG	64	/* max copy for short longword-aligned case */
-				/* must be at least 32 */
-#define	SMALL_MAX	128
-#define	MED_UMAX	512	/* max copy for medium un-aligned case */
-#define	MED_WMAX	512	/* max copy for medium word-aligned case */
-#define	MED_MAX		512	/* max copy for medium longword-aligned case */
-
-#ifdef NIAGARA2_IMPL
-#include <sys/sun4asi.h>
-
-#else	/* NIAGARA2_IMPL */
-/*
- * This define is to align data for the unaligned source cases.
- * The data1, data2 and data3 is merged into data1 and data2.
- * The data3 is preserved for next merge.
- */
-#define	ALIGN_DATA(data1, data2, data3, lshift, rshift, tmp)	\
-	sllx	data1, lshift, data1				;\
-	srlx	data2, rshift, tmp				;\
-	or	data1, tmp, data1				;\
-	sllx	data2, lshift, data2				;\
-	srlx	data3, rshift, tmp				;\
-	or	data2, tmp, data2
-/*
- * Align the data. Merge the data1 and data2 into data1.
- */
-#define	ALIGN_DATA_EW(data1, data2, lshift, rshift, tmp)	\
-	sllx	data1, lshift, data1				;\
-	srlx	data2, rshift, tmp				;\
-	or	data1, tmp, data1
-#endif	/* NIAGARA2_IMPL */
-
-
-	ANSI_PRAGMA_WEAK(memmove,function)
-	ANSI_PRAGMA_WEAK(memcpy,function)
-
-	ENTRY(memmove)
-	cmp	%o1, %o0	! if from address is >= to use forward copy
-	bgeu,pn	%ncc, .forcpy	! else use backward if ...
-	sub	%o0, %o1, %o4	! get difference of two addresses
-	cmp	%o2, %o4	! compare size and difference of addresses
-	bleu,pn	%ncc, .forcpy	! if size is bigger, do overlapped copy
-	add	%o1, %o2, %o5	! get to end of source space
-
-	!
-	! an overlapped copy that must be done "backwards"
-	!
-.chksize:
-	cmp	%o2, 8			! less than 8 byte do byte copy
-	blu,pt %ncc, 2f			! else continue
-
-	! Now size is bigger than 8
-.dbalign:
-	add	%o0, %o2, %g1		! get to end of dest space
-	andcc	%g1, 7, %o3		! %o3 has bytes till dst 8 bytes aligned
-	bz,a,pn	%ncc, .dbbck		! if dst is not 8 byte aligned: align it
-	andn	%o2, 7, %o3		! %o3 count is multiple of 8 bytes size
-	sub	%o2, %o3, %o2		! update o2 with new count
-
-1:	dec	%o5			! decrement source
-	ldub	[%o5], %g1		! load one byte
-	deccc	%o3			! decrement count
-	bgu,pt	%ncc, 1b		! if not done keep copying
-	stb	%g1, [%o5+%o4]		! store one byte into dest
-	andncc	%o2, 7, %o3		! %o3 count is multiple of 8 bytes size
-	bz,pn	%ncc, 2f		! if size < 8, move to byte copy
-
-	! Now Destination is 8 byte aligned
-.dbbck:
-	andcc	%o5, 7, %o0		! %o0 has src offset
-	bz,a,pn	%ncc, .dbcopybc		! if src is aligned to fast mem move
-	sub	%o2, %o3, %o2		! Residue bytes in %o2
-
-.cpy_dbwdbc:				! alignment of src is needed
-	sub	%o2, 8, %o2		! set size one loop ahead
-	sll	%o0, 3, %g1		! %g1 is left shift
-	mov	64, %g5			! init %g5 to be 64
-	sub	%g5, %g1, %g5		! %g5 right shift = (64 - left shift)
-	sub	%o5, %o0, %o5		! align the src at 8 bytes.
-	add	%o4, %o0, %o4		! increase difference between src & dst
-	ldx	[%o5], %o1		! load first 8 bytes
-	srlx	%o1, %g5, %o1
-1:	sub	%o5, 8, %o5		! subtract 8 from src
-	ldx	[%o5], %o0		! load 8 byte
-	sllx	%o0, %g1, %o3		! shift loaded 8 bytes left into tmp reg
-	or	%o1, %o3, %o3		! align data
-	stx	%o3, [%o5+%o4]		! store 8 byte
-	subcc	%o2, 8, %o2		! subtract 8 byte from size
-	bg,pt	%ncc, 1b		! if size > 0 continue
-	srlx	%o0, %g5, %o1		! move extra byte for the next use
-
-	srl	%g1, 3, %o0		! retsote %o0 value for alignment
-	add	%o5, %o0, %o5		! restore src alignment
-	sub	%o4, %o0, %o4		! restore difference between src & dest
-
-	ba	2f			! branch to the trailing byte copy
-	add	%o2, 8, %o2		! restore size value
-
-.dbcopybc:				! alignment of src is not needed
-1:	sub	%o5, 8, %o5		! subtract from src
-	ldx	[%o5], %g1		! load 8 bytes
-	subcc	%o3, 8, %o3		! subtract from size
-	bgu,pt	%ncc, 1b		! if size is bigger 0 continue
-	stx	%g1, [%o5+%o4]		! store 8 bytes to destination
-
-	ba	2f
-	nop
-
-.bcbyte:
-1:	ldub	[%o5], %g1		! load one byte
-	stb	%g1, [%o5+%o4]		! store one byte
-2:	deccc	%o2			! decrement size
-	bgeu,a,pt %ncc, 1b		! if size is >= 0 continue
-	dec	%o5			! decrement from address
-
-.exitbc:				! exit from backward copy
-	retl
-	add	%o5, %o4, %o0		! restore dest addr
-
-#ifdef NIAGARA2_IMPL
-	!
-	! Check to see if memmove is large aligned copy
-	! If so, use special version of copy that avoids
-	! use of block store init
-	!
-.forcpy:
-	cmp	%o2, SMALL_MAX		! check for not small case
-	blt,pn	%ncc, .mv_short		! merge with memcpy
-	mov	%o0, %g1		! save %o0
-	neg	%o0, %o5
-	andcc	%o5, 7, %o5		! bytes till DST 8 byte aligned
-	brz,pt	%o5, .mv_dst_aligned_on_8
-
-	! %o5 has the bytes to be written in partial store.
-	sub	%o2, %o5, %o2
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-7:					! dst aligning loop
-	ldub	[%o1+%o0], %o4		! load one byte
-	subcc	%o5, 1, %o5
-	stb	%o4, [%o0]
-	bgu,pt	%ncc, 7b
-	add	%o0, 1, %o0		! advance dst
-	add	%o1, %o0, %o1		! restore %o1
-.mv_dst_aligned_on_8:
-	andcc	%o1, 7, %o5
-	brnz,pt	%o5, .src_dst_unaligned_on_8
-	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
-
-.mv_src_dst_aligned_on_8:
-	! check if we are copying MED_MAX or more bytes
-	cmp	%o2, MED_MAX		! limit to store buffer size
-	bleu,pt	%ncc, .medlong
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-
-/*
- * The following memmove code mimics the memcpy code for large aligned copies,
- * but does not use the ASI_STBI_P (block initializing store) performance
- * optimization. See memmove rationale section in documentation
- */
-.mv_large_align8_copy:			! Src and dst share 8 byte alignment
-	rd	%fprs, %g5		! check for unused fp
-	! if fprs.fef == 0, set it.
-	! Setting it when already set costs more than checking
-	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
-	bz,a	%ncc, 1f
-	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
-1:
-	! align dst to 64 byte boundary
-	andcc	%o0, 0x3f, %o3		! %o3 == 0 means dst is 64 byte aligned
-	brz,pn	%o3, .mv_aligned_on_64
-	sub	%o3, 64, %o3		! %o3 has negative bytes to move
-	add	%o2, %o3, %o2		! adjust remaining count
-.mv_align_to_64:
-	ldx	[%o1], %o4
-	add	%o1, 8, %o1		! increment src ptr
-	addcc	%o3, 8, %o3
-	stx	%o4, [%o0]
-	brnz,pt	%o3, .mv_align_to_64
-	add	%o0, 8, %o0		! increment dst ptr
-
-.mv_aligned_on_64:
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-	mov	%asi,%o4		! save %asi
-	! Determine source alignment
-	! to correct 8 byte offset
-	andcc	%o1, 0x20, %o3
-	brnz,pn	%o3, .mv_align_1
-	mov	ASI_BLK_P, %asi		! setup %asi for block load/store
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .mv_align_01
-	nop
-	andcc	%o1, 0x08, %o3
-	brz,pn	%o3, .mv_align_000
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.mv_align_001
-	nop
-.mv_align_01:
-	andcc	%o1, 0x08, %o3
-	brnz,pn	%o3, .mv_align_011
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.mv_align_010
-	nop
-.mv_align_1:
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .mv_align_11
-	nop
-	andcc	%o1, 0x08, %o3
-	brnz,pn	%o3, .mv_align_101
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.mv_align_100
-	nop
-.mv_align_11:
-	andcc	%o1, 0x08, %o3
-	brz,pn	%o3, .mv_align_110
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-.mv_align_111:
-! Alignment off by 8 bytes
-	ldd	[%o1], %d0
-	add	%o1, 8, %o1
-	sub	%o2, 8, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_111_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d2
-	fmovd	%d18, %d4
-	fmovd	%d20, %d6
-	fmovd	%d22, %d8
-	fmovd	%d24, %d10
-	fmovd	%d26, %d12
-	fmovd	%d28, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d0
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d2
-	fmovd	%d18, %d4
-	fmovd	%d20, %d6
-	fmovd	%d22, %d8
-	fmovd	%d24, %d10
-	fmovd	%d26, %d12
-	fmovd	%d28, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d30, %d0
-	bgt,pt	%ncc, .mv_align_111_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	ba	.remain_stuff
-	add	%o0, 8, %o0
-	! END OF mv_align_111
-
-.mv_align_110:
-! Alignment off by 16 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	add	%o1, 16, %o1
-	sub	%o2, 16, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_110_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d4
-	fmovd	%d18, %d6
-	fmovd	%d20, %d8
-	fmovd	%d22, %d10
-	fmovd	%d24, %d12
-	fmovd	%d26, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d28, %d0
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d2
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d4
-	fmovd	%d18, %d6
-	fmovd	%d20, %d8
-	fmovd	%d22, %d10
-	fmovd	%d24, %d12
-	fmovd	%d26, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d28, %d0
-	fmovd	%d30, %d2
-	bgt,pt	%ncc, .mv_align_110_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	ba	.remain_stuff
-	add	%o0, 16, %o0
-	! END OF mv_align_110
-
-.mv_align_101:
-! Alignment off by 24 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	add	%o1, 24, %o1
-	sub	%o2, 24, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_101_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d6
-	fmovd	%d18, %d8
-	fmovd	%d20, %d10
-	fmovd	%d22, %d12
-	fmovd	%d24, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d26, %d0
-	fmovd	%d28, %d2
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d4
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d6
-	fmovd	%d18, %d8
-	fmovd	%d20, %d10
-	fmovd	%d22, %d12
-	fmovd	%d24, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d26, %d0
-	fmovd	%d28, %d2
-	fmovd	%d30, %d4
-	bgt,pt	%ncc, .mv_align_101_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	ba	.remain_stuff
-	add	%o0, 24, %o0
-	! END OF mv_align_101
-
-.mv_align_100:
-! Alignment off by 32 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16],%d4
-	ldd	[%o1+24],%d6
-	add	%o1, 32, %o1
-	sub	%o2, 32, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_100_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d8
-	fmovd	%d18, %d10
-	fmovd	%d20, %d12
-	fmovd	%d22, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d24, %d0
-	fmovd	%d26, %d2
-	fmovd	%d28, %d4
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d6
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d8
-	fmovd	%d18, %d10
-	fmovd	%d20, %d12
-	fmovd	%d22, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d24, %d0
-	fmovd	%d26, %d2
-	fmovd	%d28, %d4
-	fmovd	%d30, %d6
-	bgt,pt	%ncc, .mv_align_100_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	ba	.remain_stuff
-	add	%o0, 32, %o0
-	! END OF mv_align_100
-
-.mv_align_011:
-! Alignment off by 40 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	add	%o1, 40, %o1
-	sub	%o2, 40, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_011_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d10
-	fmovd	%d18, %d12
-	fmovd	%d20, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d22, %d0
-	fmovd	%d24, %d2
-	fmovd	%d26, %d4
-	fmovd	%d28, %d6
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d8
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d10
-	fmovd	%d18, %d12
-	fmovd	%d20, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d22, %d0
-	fmovd	%d24, %d2
-	fmovd	%d26, %d4
-	fmovd	%d28, %d6
-	fmovd	%d30, %d8
-	bgt,pt	%ncc, .mv_align_011_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	ba	.remain_stuff
-	add	%o0, 40, %o0
-	! END OF mv_align_011
-
-.mv_align_010:
-! Alignment off by 48 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	ldd	[%o1+40], %d10
-	add	%o1, 48, %o1
-	sub	%o2, 48, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_010_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d12
-	fmovd	%d18, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d20, %d0
-	fmovd	%d22, %d2
-	fmovd	%d24, %d4
-	fmovd	%d26, %d6
-	fmovd	%d28, %d8
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d10
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d12
-	fmovd	%d18, %d14
-	add	%o1, 128, %o1	! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d20, %d0
-	fmovd	%d22, %d2
-	fmovd	%d24, %d4
-	fmovd	%d26, %d6
-	fmovd	%d28, %d8
-	fmovd	%d30, %d10
-	bgt,pt	%ncc, .mv_align_010_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	std	%d10, [%o0+40]
-	ba	.remain_stuff
-	add	%o0, 48, %o0
-	! END OF mv_align_010
-
-.mv_align_001:
-! Alignment off by 56 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	ldd	[%o1+40], %d10
-	ldd	[%o1+48], %d12
-	add	%o1, 56, %o1
-	sub	%o2, 56, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_001_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d14
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d18, %d0
-	fmovd	%d20, %d2
-	fmovd	%d22, %d4
-	fmovd	%d24, %d6
-	fmovd	%d26, %d8
-	fmovd	%d28, %d10
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d12
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d14
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d18, %d0
-	fmovd	%d20, %d2
-	fmovd	%d22, %d4
-	fmovd	%d24, %d6
-	fmovd	%d26, %d8
-	fmovd	%d28, %d10
-	fmovd	%d30, %d12
-	bgt,pt	%ncc, .mv_align_001_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	std	%d10, [%o0+40]
-	std	%d12, [%o0+48]
-	ba	.remain_stuff
-	add	%o0, 56, %o0
-	! END OF mv_align_001
-
-.mv_align_000:
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.mv_align_000_loop:
-	/* ---- copy line 1 of 2. ---- */
-	subcc	%o5, 128, %o5
-	ldda	[%o1]%asi,%d0
-	stda	%d0,[%o0]%asi
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-
-	/* ---- copy line 2 of 2. ---- */
-	add	%o0, 64, %o0
-	ldda	[%o1+64]%asi,%d0
-	add	%o1, 128, %o1		! increment src
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! increment dst
-	bgt,pt	%ncc, .mv_align_000_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.remain_stuff
-	nop
-
-	! END OF mv_align_000
-#else	/* NIAGARA2_IMPL */
-#endif	/* NIAGARA2_IMPL */
-
-	SET_SIZE(memmove)
-
-	ENTRY(memcpy)
-	ENTRY(__align_cpy_1)
-#ifdef NIAGARA2_IMPL
-	cmp	%o2, SMALL_MAX		! check for not small case
-	bgeu,pn	%ncc, .medium		! go to larger cases
-	mov	%o0, %g1		! save %o0
-.mv_short:
-	cmp	%o2, SHORTCOPY		! check for really short case
-	ble,pt	%ncc, .smallfin
-	or	%o0, %o1, %o4		! prepare alignment check
-	andcc	%o4, 0x3, %o5		! test for alignment
-	bz,pt	%ncc, .smallword	! branch to word aligned case
-	cmp	%o2, SHORTCHECK
-	ble,pt	%ncc, .smallrest
-	andcc	%o1, 0x3, %o5		! is src word aligned
-	bz,pn	%ncc, .aldst
-	cmp	%o5, 2			! is src half-word aligned
-	be,pt	%ncc, .s2algn
-	cmp	%o5, 3			! src is byte aligned
-.s1algn:ldub	[%o1], %o3		! move 1 or 3 bytes to align it
-	inc	1, %o1
-	stb	%o3, [%o0]		! move a byte to align src
-	inc	1, %o0
-	bne,pt	%ncc, .s2algn
-	dec	%o2
-	b	.ald			! now go align dest
-	andcc	%o0, 0x3, %o5
-
-.s2algn:lduh	[%o1], %o3		! know src is 2 byte aligned
-	inc	2, %o1
-	srl	%o3, 8, %o4
-	stb	%o4, [%o0]		! have to do bytes,
-	stb	%o3, [%o0 + 1]		! don't know dst alignment
-	inc	2, %o0
-	dec	2, %o2
-
-.aldst:	andcc	%o0, 0x3, %o5		! align the destination address
-.ald:	bz,pn	%ncc, .w4cp
-	cmp	%o5, 2
-	be,pn	%ncc, .w2cp
-	cmp	%o5, 3
-.w3cp:	lduw	[%o1], %o4
-	inc	4, %o1
-	srl	%o4, 24, %o5
-	stb	%o5, [%o0]
-	bne,pt	%ncc, .w1cp
-	inc	%o0
-	dec	1, %o2
-	andn	%o2, 3, %o3		! %o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-
-1:	sll	%o4, 8, %g5		! save residual bytes
-	lduw	[%o1+%o0], %o4
-	deccc	4, %o3
-	srl	%o4, 24, %o5		! merge with residual
-	or	%o5, %g5, %g5
-	st	%g5, [%o0]
-	bnz,pt	%ncc, 1b
-	inc	4, %o0
-	sub	%o1, 3, %o1		! used one byte of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w1cp:	srl	%o4, 8, %o5
-	sth	%o5, [%o0]
-	inc	2, %o0
-	dec	3, %o2
-	andn	%o2, 3, %o3		! %o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-
-2:	sll	%o4, 24, %g5		! save residual bytes
-	lduw	[%o1+%o0], %o4
-	deccc	4, %o3
-	srl	%o4, 8, %o5		! merge with residual
-	or	%o5, %g5, %g5
-	st	%g5, [%o0]
-	bnz,pt	%ncc, 2b
-	inc	4, %o0
-	sub	%o1, 1, %o1		! used three bytes of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w2cp:	lduw	[%o1], %o4
-	inc	4, %o1
-	srl	%o4, 16, %o5
-	sth	%o5, [%o0]
-	inc	2, %o0
-	dec	2, %o2
-	andn	%o2, 3, %o3		! %o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-
-3:	sll	%o4, 16, %g5		! save residual bytes
-	lduw	[%o1+%o0], %o4
-	deccc	4, %o3
-	srl	%o4, 16, %o5		! merge with residual
-	or	%o5, %g5, %g5
-	st	%g5, [%o0]
-	bnz,pt	%ncc, 3b
-	inc	4, %o0
-	sub	%o1, 2, %o1		! used two bytes of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w4cp:	andn	%o2, 3, %o3		! %o3 is aligned word count
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-
-1:	lduw	[%o1+%o0], %o4		! read from address
-	deccc	4, %o3			! decrement count
-	st	%o4, [%o0]		! write at destination address
-	bgu,pt	%ncc, 1b
-	inc	4, %o0			! increment to address
-	and	%o2, 3, %o2		! number of leftover bytes, if any
-
-	! simple finish up byte copy, works with any alignment
-7:
-	add	%o1, %o0, %o1		! restore %o1
-.smallrest:
-	tst	%o2
-	bz,pt	%ncc, .smallx
-	cmp	%o2, 4
-	blt,pt	%ncc, .smallleft3
-	nop
-	sub	%o2, 3, %o2
-.smallnotalign4:
-	ldub	[%o1], %o3		! read byte
-	subcc	%o2, 4, %o2		! reduce count by 4
-	stb	%o3, [%o0]		! write byte
-	ldub	[%o1+1], %o3		! repeat for total of 4 bytes
-	add	%o1, 4, %o1		! advance SRC by 4
-	stb	%o3, [%o0+1]
-	ldub	[%o1-2], %o3
-	add	%o0, 4, %o0		! advance DST by 4
-	stb	%o3, [%o0-2]
-	ldub	[%o1-1], %o3
-	bgu,pt	%ncc, .smallnotalign4	! loop til 3 or fewer bytes remain
-	stb	%o3, [%o0-1]
-	addcc	%o2, 3, %o2		! restore count
-	bz,pt	%ncc, .smallx
-.smallleft3:				! 1, 2, or 3 bytes remain
-	subcc	%o2, 1, %o2
-	ldub	[%o1], %o3		! load one byte
-	bz,pt	%ncc, .smallx
-	stb	%o3, [%o0]		! store one byte
-	ldub	[%o1+1], %o3		! load second byte
-	subcc	%o2, 1, %o2
-	bz,pt	%ncc, .smallx
-	stb	%o3, [%o0+1]		! store second byte
-	ldub	[%o1+2], %o3		! load third byte
-	stb	%o3, [%o0+2]		! store third byte
-.smallx:
-	retl
-	mov	%g1, %o0		! restore %o0
-
-.smallfin:
-	tst	%o2
-	bnz,pt	%ncc, .smallleft3
-	nop
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align 16
-.smallwords:
-	lduw	[%o1], %o3		! read word
-.smallwordx:
-	subcc	%o2, 8, %o2		! update count
-	stw	%o3, [%o0]		! write word
-	add	%o1, 8, %o1		! update SRC
-	lduw	[%o1-4], %o3		! read word
-	add	%o0, 8, %o0		! update DST
-	bgu,pt	%ncc, .smallwords	! loop until done
-	stw	%o3, [%o0-4]		! write word
-	addcc	%o2, 7, %o2		! restore count
-	bz,pt	%ncc, .smallexit	! check for completion
-	cmp	%o2, 4			! check for 4 or more bytes left
-	blt	%ncc, .smallleft3	! if not, go to finish up
-	nop
-	lduw	[%o1], %o3
-	add	%o1, 4, %o1
-	subcc	%o2, 4, %o2
-	add	%o0, 4, %o0
-	bnz,pt	%ncc, .smallleft3
-	stw	%o3, [%o0-4]
-	retl
-	mov	%g1, %o0		! restore %o0
-
-! 8 or more bytes, src and dest start on word boundary
-! %o4 contains or %o0, %o1; %o3 contains first four bytes of src
-.smalllong:
-	andcc	%o4, 0x7, %o5		! test for long alignment
-	bnz,pt	%ncc, .smallwordx	! branch to word aligned case
-	cmp	%o2, SHORT_LONG-7
-	bge,a	%ncc, .medl64		! if we branch
-	sub	%o2,56,%o2		! adjust %o2 to -31 off count
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-.small_long_l:
-	ldx	[%o1+%o0], %o3
-	subcc	%o2, 8, %o2
-	add	%o0, 8, %o0
-	bgu,pt	%ncc, .small_long_l	! loop until done
-	stx	%o3, [%o0-8]		! write word
-	add	%o1, %o0, %o1		! restore %o1
-	addcc	%o2, 7, %o2		! restore %o2 to correct count
-	bz,pt	%ncc, .smallexit	! check for completion
-	cmp	%o2, 4			! check for 4 or more bytes left
-	blt,pt	%ncc, .smallleft3	! if not, go to finish up
-	nop
-	lduw	[%o1], %o3
-	add	%o1, 4, %o1
-	subcc	%o2, 4, %o2
-	stw	%o3, [%o0]
-	add	%o0, 4, %o0
-	bnz,pt	%ncc, .smallleft3
-	nop
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align 16
-! src and dest start on word boundary
-.smallword:
-	subcc	%o2, 7, %o2		! adjust count
-	bgu,pt	%ncc, .smalllong
-	lduw	[%o1], %o3		! read word
-	addcc	%o2, 3, %o2		! restore count
-	bz,pt	%ncc, .smallexit
-	stw	%o3, [%o0]		! write word
-	deccc	%o2			! reduce count for cc test
-	ldub	[%o1+4], %o3		! load one byte
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+4]		! store one byte
-	ldub	[%o1+5], %o3		! load second byte
-	deccc	%o2
-	bz,pt	%ncc, .smallexit
-	stb	%o3, [%o0+5]		! store second byte
-	ldub	[%o1+6], %o3		! load third byte
-	stb	%o3, [%o0+6]		! store third byte
-.smallexit:
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align 16
-.medium:
-	neg	%o0, %o5
-	andcc	%o5, 7, %o5		! bytes till DST 8 byte aligned
-	brz,pt	%o5, .dst_aligned_on_8
-
-	! %o5 has the bytes to be written in partial store.
-	sub	%o2, %o5, %o2
-	sub	%o1, %o0, %o1		! %o1 gets the difference
-7:					! dst aligning loop
-	ldub	[%o1+%o0], %o4		! load one byte
-	subcc	%o5, 1, %o5
-	stb	%o4, [%o0]
-	bgu,pt	%ncc, 7b
-	add	%o0, 1, %o0		! advance dst
-	add	%o1, %o0, %o1		! restore %o1
-.dst_aligned_on_8:
-	andcc	%o1, 7, %o5
-	brnz,pt	%o5, .src_dst_unaligned_on_8
-	prefetch [%o1 + (1 * BLOCK_SIZE)], #one_read
-
-.src_dst_aligned_on_8:
-	! check if we are copying MED_MAX or more bytes
-	cmp	%o2, MED_MAX		! limit to store buffer size
-	bgu,pt	%ncc, .large_align8_copy
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-/*
- * Special case for handling when src and dest are both long word aligned
- * and total data to move is less than MED_MAX bytes
- */
-.medlong:
-	subcc	%o2, 63, %o2		! adjust length to allow cc test
-	ble,pt	%ncc, .medl63		! skip big loop if less than 64 bytes
-.medl64:
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read ! into the l2 cache
-	ldx	[%o1], %o4		! load
-	subcc	%o2, 64, %o2		! decrement length count
-	stx	%o4, [%o0]		! and store
-	ldx	[%o1+8], %o3		! a block of 64 bytes
-	stx	%o3, [%o0+8]
-	ldx	[%o1+16], %o4
-	stx	%o4, [%o0+16]
-	ldx	[%o1+24], %o3
-	stx	%o3, [%o0+24]
-	ldx	[%o1+32], %o4		! load
-	stx	%o4, [%o0+32]		! and store
-	ldx	[%o1+40], %o3		! a block of 64 bytes
-	add	%o1, 64, %o1		! increase src ptr by 64
-	stx	%o3, [%o0+40]
-	ldx	[%o1-16], %o4
-	add	%o0, 64, %o0		! increase dst ptr by 64
-	stx	%o4, [%o0-16]
-	ldx	[%o1-8], %o3
-	bgu,pt	%ncc, .medl64		! repeat if at least 64 bytes left
-	stx	%o3, [%o0-8]
-.medl63:
-	addcc	%o2, 32, %o2		! adjust remaining count
-	ble,pt	%ncc, .medl31		! to skip if 31 or fewer bytes left
-	nop
-	ldx	[%o1], %o4		! load
-	sub	%o2, 32, %o2		! decrement length count
-	stx	%o4, [%o0]		! and store
-	ldx	[%o1+8], %o3		! a block of 32 bytes
-	add	%o1, 32, %o1		! increase src ptr by 32
-	stx	%o3, [%o0+8]
-	ldx	[%o1-16], %o4
-	add	%o0, 32, %o0		! increase dst ptr by 32
-	stx	%o4, [%o0-16]
-	ldx	[%o1-8], %o3
-	stx	%o3, [%o0-8]
-.medl31:
-	addcc	%o2, 16, %o2		! adjust remaining count
-	ble,pt	%ncc, .medl15		! skip if 15 or fewer bytes left
-	nop				!
-	ldx	[%o1], %o4		! load and store 16 bytes
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stx	%o4, [%o0]		!
-	sub	%o2, 16, %o2		! decrease count by 16
-	ldx	[%o1-8], %o3		!
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stx	%o3, [%o0-8]
-.medl15:
-	addcc	%o2, 15, %o2		! restore count
-	bz,pt	%ncc, .smallexit	! exit if finished
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	tst	%o2
-	ldx	[%o1], %o4		! load 8 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	subcc	%o2, 8, %o2		! decrease count by 8
-	bnz,pt	%ncc, .medw7
-	stx	%o4, [%o0-8]		! and store 8 bytes
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align 16
-.src_dst_unaligned_on_8:
-	! DST is 8-byte aligned, src is not
-2:
-	andcc	%o1, 0x3, %o5		! test word alignment
-	bnz,pt	%ncc, .unalignsetup	! branch to skip if not word aligned
-	prefetch [%o1 + (2 * BLOCK_SIZE)], #one_read
-
-/*
- * Handle all cases where src and dest are aligned on word
- * boundaries. Use unrolled loops for better performance.
- * This option wins over standard large data move when
- * source and destination is in cache for medium
- * to short data moves.
- */
-	cmp	%o2, MED_WMAX		! limit to store buffer size
-	bge,pt	%ncc, .unalignrejoin	! otherwise rejoin main loop
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-
-	subcc	%o2, 31, %o2		! adjust length to allow cc test
-					! for end of loop
-	ble,pt	%ncc, .medw31		! skip big loop if less than 16
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-.medw32:
-	ld	[%o1], %o4		! move a block of 32 bytes
-	stw	%o4, [%o0]
-	ld	[%o1+4], %o3
-	stw	%o3, [%o0+4]
-	ld	[%o1+8], %o4
-	stw	%o4, [%o0+8]
-	ld	[%o1+12], %o3
-	stw	%o3, [%o0+12]
-	ld	[%o1+16], %o4
-	subcc	%o2, 32, %o2		! decrement length count
-	stw	%o4, [%o0+16]
-	ld	[%o1+20], %o3
-	add	%o1, 32, %o1		! increase src ptr by 32
-	stw	%o3, [%o0+20]
-	ld	[%o1-8], %o4
-	add	%o0, 32, %o0		! increase dst ptr by 32
-	stw	%o4, [%o0-8]
-	ld	[%o1-4], %o3
-	bgu,pt	%ncc, .medw32		! repeat if at least 32 bytes left
-	stw	%o3, [%o0-4]
-.medw31:
-	addcc	%o2, 31, %o2		! restore count
-
-	bz,pt	%ncc, .smallexit	! exit if finished
-	nop
-	cmp	%o2, 16
-	blt,pt	%ncc, .medw15
-	nop
-	ld	[%o1], %o4		! move a block of 16 bytes
-	subcc	%o2, 16, %o2		! decrement length count
-	stw	%o4, [%o0]
-	ld	[%o1+4], %o3
-	add	%o1, 16, %o1		! increase src ptr by 16
-	stw	%o3, [%o0+4]
-	ld	[%o1-8], %o4
-	add	%o0, 16, %o0		! increase dst ptr by 16
-	stw	%o4, [%o0-8]
-	ld	[%o1-4], %o3
-	stw	%o3, [%o0-4]
-.medw15:
-	bz,pt	%ncc, .smallexit	! exit if finished
-	cmp	%o2, 8
-	blt,pt	%ncc, .medw7		! skip if 7 or fewer bytes left
-	tst	%o2
-	ld	[%o1], %o4		! load 4 bytes
-	subcc	%o2, 8, %o2		! decrease count by 8
-	stw	%o4, [%o0]		! and store 4 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	ld	[%o1-4], %o3		! load 4 bytes
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	stw	%o3, [%o0-4]		! and store 4 bytes
-	bz,pt	%ncc, .smallexit	! exit if finished
-.medw7:					! count is ge 1, less than 8
-	cmp	%o2, 4			! check for 4 bytes left
-	blt,pt	%ncc, .smallleft3	! skip if 3 or fewer bytes left
-	nop				!
-	ld	[%o1], %o4		! load 4 bytes
-	add	%o1, 4, %o1		! increase src ptr by 4
-	add	%o0, 4, %o0		! increase dst ptr by 4
-	subcc	%o2, 4, %o2		! decrease count by 4
-	bnz	.smallleft3
-	stw	%o4, [%o0-4]		! and store 4 bytes
-	retl
-	mov	%g1, %o0		! restore %o0
-
-	.align	16
-.large_align8_copy:			! Src and dst share 8 byte alignment
-	rd	%fprs, %g5		! check for unused fp
-	! if fprs.fef == 0, set it.
-	! Setting it when already set costs more than checking
-	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
-	bz,a	%ncc, 1f
-	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
-1:
-	! align dst to 64 byte boundary
-	andcc	%o0, 0x3f, %o3		! %o3 == 0 means dst is 64 byte aligned
-	brz,pn	%o3, .aligned_to_64
-	andcc	%o0, 8, %o3		! odd long words to move?
-	brz,pt	%o3, .aligned_to_16
-	nop
-	ldx	[%o1], %o4
-	sub	%o2, 8, %o2
-	add	%o1, 8, %o1		! increment src ptr
-	add	%o0, 8, %o0		! increment dst ptr
-	stx	%o4, [%o0-8]
-.aligned_to_16:
-	andcc	%o0, 16, %o3		! pair of long words to move?
-	brz,pt	%o3, .aligned_to_32
-	nop
-	ldx	[%o1], %o4
-	sub	%o2, 16, %o2
-	stx	%o4, [%o0]
-	add	%o1, 16, %o1		! increment src ptr
-	ldx	[%o1-8], %o4
-	add	%o0, 16, %o0		! increment dst ptr
-	stx	%o4, [%o0-8]
-.aligned_to_32:
-	andcc	%o0, 32, %o3		! four long words to move?
-	brz,pt	%o3, .aligned_to_64
-	nop
-	ldx	[%o1], %o4
-	sub	%o2, 32, %o2
-	stx	%o4, [%o0]
-	ldx	[%o1+8], %o4
-	stx	%o4, [%o0+8]
-	ldx	[%o1+16], %o4
-	stx	%o4, [%o0+16]
-	add	%o1, 32, %o1		! increment src ptr
-	ldx	[%o1-8], %o4
-	add	%o0, 32, %o0		! increment dst ptr
-	stx	%o4, [%o0-8]
-.aligned_to_64:
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-	mov	%asi,%o4		! save %asi
-	! Determine source alignment
-	! to correct 8 byte offset
-	andcc	%o1, 0x20, %o3
-	brnz,pn	%o3, .align_1
-	mov	ASI_BLK_P, %asi		! setup %asi for block load/store
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .align_01
-	nop
-	andcc	%o1, 0x08, %o3
-	brz,pn	%o3, .align_000
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.align_001
-	nop
-.align_01:
-	andcc	%o1, 0x08, %o3
-	brnz,pn	%o3, .align_011
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.align_010
-	nop
-.align_1:
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .align_11
-	nop
-	andcc	%o1, 0x08, %o3
-	brnz,pn	%o3, .align_101
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-	ba	.align_100
-	nop
-.align_11:
-	andcc	%o1, 0x08, %o3
-	brz,pn	%o3, .align_110
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-.align_111:
-! Alignment off by 8 bytes
-	ldd	[%o1], %d0
-	add	%o1, 8, %o1
-	sub	%o2, 8, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_111_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d2
-	fmovd	%d18, %d4
-	fmovd	%d20, %d6
-	fmovd	%d22, %d8
-	fmovd	%d24, %d10
-	fmovd	%d26, %d12
-	fmovd	%d28, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d0
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d2
-	fmovd	%d18, %d4
-	fmovd	%d20, %d6
-	fmovd	%d22, %d8
-	fmovd	%d24, %d10
-	fmovd	%d26, %d12
-	fmovd	%d28, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d30, %d0
-	bgt,pt	%ncc, .align_111_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	ba	.remain_stuff
-	add	%o0, 8, %o0
-	! END OF align_111
-
-.align_110:
-! Alignment off by 16 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	add	%o1, 16, %o1
-	sub	%o2, 16, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_110_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d4
-	fmovd	%d18, %d6
-	fmovd	%d20, %d8
-	fmovd	%d22, %d10
-	fmovd	%d24, %d12
-	fmovd	%d26, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d28, %d0
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d2
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d4
-	fmovd	%d18, %d6
-	fmovd	%d20, %d8
-	fmovd	%d22, %d10
-	fmovd	%d24, %d12
-	fmovd	%d26, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d28, %d0
-	fmovd	%d30, %d2
-	bgt,pt	%ncc, .align_110_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	ba	.remain_stuff
-	add	%o0, 16, %o0
-	! END OF align_110
-
-.align_101:
-! Alignment off by 24 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	add	%o1, 24, %o1
-	sub	%o2, 24, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_101_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d6
-	fmovd	%d18, %d8
-	fmovd	%d20, %d10
-	fmovd	%d22, %d12
-	fmovd	%d24, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d26, %d0
-	fmovd	%d28, %d2
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d4
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d6
-	fmovd	%d18, %d8
-	fmovd	%d20, %d10
-	fmovd	%d22, %d12
-	fmovd	%d24, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d26, %d0
-	fmovd	%d28, %d2
-	fmovd	%d30, %d4
-	bgt,pt	%ncc, .align_101_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	ba	.remain_stuff
-	add	%o0, 24, %o0
-	! END OF align_101
-
-.align_100:
-! Alignment off by 32 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16],%d4
-	ldd	[%o1+24],%d6
-	add	%o1, 32, %o1
-	sub	%o2, 32, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_100_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d8
-	fmovd	%d18, %d10
-	fmovd	%d20, %d12
-	fmovd	%d22, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d24, %d0
-	fmovd	%d26, %d2
-	fmovd	%d28, %d4
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d6
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d8
-	fmovd	%d18, %d10
-	fmovd	%d20, %d12
-	fmovd	%d22, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d24, %d0
-	fmovd	%d26, %d2
-	fmovd	%d28, %d4
-	fmovd	%d30, %d6
-	bgt,pt	%ncc, .align_100_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	ba	.remain_stuff
-	add	%o0, 32, %o0
-	! END OF align_100
-
-.align_011:
-! Alignment off by 40 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	add	%o1, 40, %o1
-	sub	%o2, 40, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_011_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d10
-	fmovd	%d18, %d12
-	fmovd	%d20, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d22, %d0
-	fmovd	%d24, %d2
-	fmovd	%d26, %d4
-	fmovd	%d28, %d6
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d8
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d10
-	fmovd	%d18, %d12
-	fmovd	%d20, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d22, %d0
-	fmovd	%d24, %d2
-	fmovd	%d26, %d4
-	fmovd	%d28, %d6
-	fmovd	%d30, %d8
-	bgt,pt	%ncc, .align_011_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	ba	.remain_stuff
-	add	%o0, 40, %o0
-	! END OF align_011
-
-.align_010:
-! Alignment off by 48 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	ldd	[%o1+40], %d10
-	add	%o1, 48, %o1
-	sub	%o2, 48, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_010_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d12
-	fmovd	%d18, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d20, %d0
-	fmovd	%d22, %d2
-	fmovd	%d24, %d4
-	fmovd	%d26, %d6
-	fmovd	%d28, %d8
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d10
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d12
-	fmovd	%d18, %d14
-	add	%o1, 128, %o1	! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d20, %d0
-	fmovd	%d22, %d2
-	fmovd	%d24, %d4
-	fmovd	%d26, %d6
-	fmovd	%d28, %d8
-	fmovd	%d30, %d10
-	bgt,pt	%ncc, .align_010_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	std	%d10, [%o0+40]
-	ba	.remain_stuff
-	add	%o0, 48, %o0
-	! END OF align_010
-
-.align_001:
-! Alignment off by 56 bytes
-	ldd	[%o1], %d0
-	ldd	[%o1+8], %d2
-	ldd	[%o1+16], %d4
-	ldd	[%o1+24], %d6
-	ldd	[%o1+32], %d8
-	ldd	[%o1+40], %d10
-	ldd	[%o1+48], %d12
-	add	%o1, 56, %o1
-	sub	%o2, 56, %o2
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_001_loop:
-	subcc	%o5, 128, %o5
-	/* ---- copy line 1 of 2. ---- */
-
-	ldda	[%o1]%asi,%d16		! block load
-	fmovd	%d16, %d14
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d18, %d0
-	fmovd	%d20, %d2
-	fmovd	%d22, %d4
-	fmovd	%d24, %d6
-	fmovd	%d26, %d8
-	fmovd	%d28, %d10
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-	fmovd	%d30, %d12
-
-	/* ---- copy line 2 of 2. ---- */
-	ldda	[%o1+64]%asi,%d16
-	fmovd	%d16, %d14
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! advance dst
-	fmovd	%d18, %d0
-	fmovd	%d20, %d2
-	fmovd	%d22, %d4
-	fmovd	%d24, %d6
-	fmovd	%d26, %d8
-	fmovd	%d28, %d10
-	fmovd	%d30, %d12
-	bgt,pt	%ncc, .align_001_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	std	%d0, [%o0]
-	std	%d2, [%o0+8]
-	std	%d4, [%o0+16]
-	std	%d6, [%o0+24]
-	std	%d8, [%o0+32]
-	std	%d10, [%o0+40]
-	std	%d12, [%o0+48]
-	ba	.remain_stuff
-	add	%o0, 56, %o0
-	! END OF align_001
-
-.align_000:
-	andn	%o2, 0x7f, %o5		! %o5 is multiple of 2*block size
-	and	%o2, 0x7f, %o2		! residue bytes in %o2
-.align_000_loop:
-	/* ---- copy line 1 of 2. ---- */
-	subcc	%o5, 128, %o5
-	ldda	[%o1]%asi,%d0
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	prefetch [%o1 + (5 * BLOCK_SIZE)], #one_read
-
-	/* ---- copy line 2 of 2. ---- */
-	add	%o0, 64, %o0
-	ldda	[%o1+64]%asi,%d0
-	add	%o1, 128, %o1		! increment src
-	stxa	%g0,[%o0]ASI_STBI_P	! block initializing store
-	stda	%d0,[%o0]%asi
-	add	%o0, 64, %o0		! increment dst
-	bgt,pt	%ncc, .align_000_loop
-	prefetch [%o1 + (4 * BLOCK_SIZE)], #one_read
-
-	! END OF align_000
-
-.remain_stuff:
-	mov	%o4, %asi		! restore %asi
-	brnz	%g5, .medlong
-	membar	#Sync
-	ba	.medlong
-	wr	%g5, %g0, %fprs
-
-	.align 16
-	! Dst is on 8 byte boundary; src is not; remaining count > SMALL_MAX
-.unalignsetup:
-	prefetch [%o1 + (3 * BLOCK_SIZE)], #one_read
-.unalignrejoin:
-	rd	%fprs, %g5		! check for unused fp
-	! if fprs.fef == 0, set it.
-	! Setting it when already set costs more than checking
-	andcc	%g5, FPRS_FEF, %g5	! test FEF, fprs.du = fprs.dl = 0
-	bz,a	%ncc, 1f
-	wr	%g0, FPRS_FEF, %fprs	! fprs.fef = 1
-1:
-	cmp	%o2, MED_UMAX		! check for medium unaligned limit
-	bge,pt	%ncc,.unalign_large
-	nop
-	andn	%o2, 0x3f, %o5		! %o5 is multiple of block size
-	and	%o2, 0x3f, %o2		! residue bytes in %o2
-	cmp	%o2, 8			! Insure we don't load beyond
-	bgt	.unalign_adjust		! end of source buffer
-	andn	%o1, 0x7, %o4		! %o4 has long word aligned src address
-	add	%o2, 64, %o2		! adjust to leave loop
-	sub	%o5, 64, %o5		! early if necessary
-.unalign_adjust:
-	alignaddr %o1, %g0, %g0		! generate %gsr
-	add	%o1, %o5, %o1		! advance %o1 to after blocks
-	ldd	[%o4], %d0
-.unalign_loop:
-	ldd	[%o4+8], %d2
-	faligndata %d0, %d2, %d16
-	ldd	[%o4+16], %d4
-	std	%d16, [%o0]
-	faligndata %d2, %d4, %d18
-	ldd	[%o4+24], %d6
-	std	%d18, [%o0+8]
-	faligndata %d4, %d6, %d20
-	ldd	[%o4+32], %d8
-	std	%d20, [%o0+16]
-	faligndata %d6, %d8, %d22
-	ldd	[%o4+40], %d10
-	std	%d22, [%o0+24]
-	faligndata %d8, %d10, %d24
-	ldd	[%o4+48], %d12
-	std	%d24, [%o0+32]
-	faligndata %d10, %d12, %d26
-	ldd	[%o4+56], %d14
-	std	%d26, [%o0+40]
-	faligndata %d12, %d14, %d28
-	ldd	[%o4+64], %d0
-	std	%d28, [%o0+48]
-	faligndata %d14, %d0, %d30
-	add	%o4, BLOCK_SIZE, %o4
-	std	%d30, [%o0+56]
-	add	%o0, BLOCK_SIZE, %o0
-	subcc	%o5, BLOCK_SIZE, %o5
-	bgu,pt	%ncc, .unalign_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	nop
-
-.unalign_large:
-	andcc	%o0, 0x3f, %o3		! is dst 64-byte block aligned?
-	bz	%ncc, .unalignsrc
-	sub	%o3, 64, %o3		! %o3 will be multiple of 8
-	neg	%o3			! bytes until dest is 64 byte aligned
-	sub	%o2, %o3, %o2		! update cnt with bytes to be moved
-	! Move bytes according to source alignment
-	andcc	%o1, 0x1, %o5
-	bnz	%ncc, .unalignbyte	! check for byte alignment
-	nop
-	andcc	%o1, 2, %o5		! check for half word alignment
-	bnz	%ncc, .unalignhalf
-	nop
-	! Src is word aligned
-.unalignword:
-	ld	[%o1], %o4		! load 4 bytes
-	stw	%o4, [%o0]		! and store 4 bytes
-	ld	[%o1+4], %o4		! load 4 bytes
-	add	%o1, 8, %o1		! increase src ptr by 8
-	stw	%o4, [%o0+4]		! and store 4 bytes
-	subcc	%o3, 8, %o3		! decrease count by 8
-	bnz	%ncc, .unalignword
-	add	%o0, 8, %o0		! increase dst ptr by 8
-	ba	.unalignsrc
-	nop
-
-	! Src is half-word aligned
-.unalignhalf:
-	lduh	[%o1], %o4		! load 2 bytes
-	sllx	%o4, 32, %o5		! shift left
-	lduw	[%o1+2], %o4
-	or	%o4, %o5, %o5
-	sllx	%o5, 16, %o5
-	lduh	[%o1+6], %o4
-	or	%o4, %o5, %o5
-	stx	%o5, [%o0]
-	add	%o1, 8, %o1
-	subcc	%o3, 8, %o3
-	bnz	%ncc, .unalignhalf
-	add	%o0, 8, %o0
-	ba	.unalignsrc
-	nop
-
-	! Src is Byte aligned
-.unalignbyte:
-	sub	%o0, %o1, %o0		! share pointer advance
-.unalignbyte_loop:
-	ldub	[%o1], %o4
-	sllx	%o4, 56, %o5
-	lduh	[%o1+1], %o4
-	sllx	%o4, 40, %o4
-	or	%o4, %o5, %o5
-	lduh	[%o1+3], %o4
-	sllx	%o4, 24, %o4
-	or	%o4, %o5, %o5
-	lduh	[%o1+5], %o4
-	sllx	%o4,  8, %o4
-	or	%o4, %o5, %o5
-	ldub	[%o1+7], %o4
-	or	%o4, %o5, %o5
-	stx	%o5, [%o0+%o1]
-	subcc	%o3, 8, %o3
-	bnz	%ncc, .unalignbyte_loop
-	add	%o1, 8, %o1
-	add	%o0,%o1, %o0 		! restore pointer
-
-	! Destination is now block (64 byte aligned)
-.unalignsrc:
-	andn	%o2, 0x3f, %o5		! %o5 is multiple of block size
-	and	%o2, 0x3f, %o2		! residue bytes in %o2
-	add	%o2, 64, %o2		! Insure we don't load beyond
-	sub	%o5, 64, %o5		! end of source buffer
-
-	andn	%o1, 0x3f, %o4		! %o4 has block aligned src address
-	prefetch [%o4 + (3 * BLOCK_SIZE)], #one_read
-	alignaddr %o1, %g0, %g0		! generate %gsr
-	add	%o1, %o5, %o1		! advance %o1 to after blocks
-	!
-	! Determine source alignment to correct 8 byte offset
-	andcc	%o1, 0x20, %o3
-	brnz,pn	%o3, .unalign_1
-	nop
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .unalign_01
-	nop
-	andcc	%o1, 0x08, %o3
-	brz,a	%o3, .unalign_000
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_001
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-.unalign_01:
-	andcc	%o1, 0x08, %o3
-	brnz,a	%o3, .unalign_011
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_010
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-.unalign_1:
-	andcc	%o1, 0x10, %o3
-	brnz,pn	%o3, .unalign_11
-	nop
-	andcc	%o1, 0x08, %o3
-	brnz,a	%o3, .unalign_101
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_100
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-.unalign_11:
-	andcc	%o1, 0x08, %o3
-	brz,pn	%o3, .unalign_110
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-
-.unalign_111:
-	ldd	[%o4+56], %d14
-.unalign_111_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d14, %d16, %d48
-	faligndata %d16, %d18, %d50
-	faligndata %d18, %d20, %d52
-	faligndata %d20, %d22, %d54
-	faligndata %d22, %d24, %d56
-	faligndata %d24, %d26, %d58
-	faligndata %d26, %d28, %d60
-	faligndata %d28, %d30, %d62
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_111_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_110:
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_110_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d12, %d14, %d48
-	faligndata %d14, %d16, %d50
-	faligndata %d16, %d18, %d52
-	faligndata %d18, %d20, %d54
-	faligndata %d20, %d22, %d56
-	faligndata %d22, %d24, %d58
-	faligndata %d24, %d26, %d60
-	faligndata %d26, %d28, %d62
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_110_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_101:
-	ldd	[%o4+40], %d10
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_101_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d10, %d12, %d48
-	faligndata %d12, %d14, %d50
-	faligndata %d14, %d16, %d52
-	faligndata %d16, %d18, %d54
-	faligndata %d18, %d20, %d56
-	faligndata %d20, %d22, %d58
-	faligndata %d22, %d24, %d60
-	faligndata %d24, %d26, %d62
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_101_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_100:
-	ldd	[%o4+32], %d8
-	ldd	[%o4+40], %d10
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_100_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d8, %d10, %d48
-	faligndata %d10, %d12, %d50
-	faligndata %d12, %d14, %d52
-	faligndata %d14, %d16, %d54
-	faligndata %d16, %d18, %d56
-	faligndata %d18, %d20, %d58
-	faligndata %d20, %d22, %d60
-	faligndata %d22, %d24, %d62
-	fmovd	%d24, %d8
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_100_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_011:
-	ldd	[%o4+24], %d6
-	ldd	[%o4+32], %d8
-	ldd	[%o4+40], %d10
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_011_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d6, %d8, %d48
-	faligndata %d8, %d10, %d50
-	faligndata %d10, %d12, %d52
-	faligndata %d12, %d14, %d54
-	faligndata %d14, %d16, %d56
-	faligndata %d16, %d18, %d58
-	faligndata %d18, %d20, %d60
-	faligndata %d20, %d22, %d62
-	fmovd	%d22, %d6
-	fmovd	%d24, %d8
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_011_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_010:
-	ldd	[%o4+16], %d4
-	ldd	[%o4+24], %d6
-	ldd	[%o4+32], %d8
-	ldd	[%o4+40], %d10
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_010_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d4, %d6, %d48
-	faligndata %d6, %d8, %d50
-	faligndata %d8, %d10, %d52
-	faligndata %d10, %d12, %d54
-	faligndata %d12, %d14, %d56
-	faligndata %d14, %d16, %d58
-	faligndata %d16, %d18, %d60
-	faligndata %d18, %d20, %d62
-	fmovd	%d20, %d4
-	fmovd	%d22, %d6
-	fmovd	%d24, %d8
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_010_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_001:
-	ldd	[%o4+8], %d2
-	ldd	[%o4+16], %d4
-	ldd	[%o4+24], %d6
-	ldd	[%o4+32], %d8
-	ldd	[%o4+40], %d10
-	ldd	[%o4+48], %d12
-	ldd	[%o4+56], %d14
-.unalign_001_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d2, %d4, %d48
-	faligndata %d4, %d6, %d50
-	faligndata %d6, %d8, %d52
-	faligndata %d8, %d10, %d54
-	faligndata %d10, %d12, %d56
-	faligndata %d12, %d14, %d58
-	faligndata %d14, %d16, %d60
-	faligndata %d16, %d18, %d62
-	fmovd	%d18, %d2
-	fmovd	%d20, %d4
-	fmovd	%d22, %d6
-	fmovd	%d24, %d8
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_001_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	ba	.unalign_done
-	membar	#Sync
-
-.unalign_000:
-	ldda	[%o4]ASI_BLK_P, %d0
-.unalign_000_loop:
-	add	%o4, 64, %o4
-	ldda	[%o4]ASI_BLK_P, %d16
-	faligndata %d0, %d2, %d48
-	faligndata %d2, %d4, %d50
-	faligndata %d4, %d6, %d52
-	faligndata %d6, %d8, %d54
-	faligndata %d8, %d10, %d56
-	faligndata %d10, %d12, %d58
-	faligndata %d12, %d14, %d60
-	faligndata %d14, %d16, %d62
-	fmovd	%d16, %d0
-	fmovd	%d18, %d2
-	fmovd	%d20, %d4
-	fmovd	%d22, %d6
-	fmovd	%d24, %d8
-	fmovd	%d26, %d10
-	fmovd	%d28, %d12
-	fmovd	%d30, %d14
-	stda	%d48, [%o0]ASI_BLK_P
-	subcc	%o5, 64, %o5
-	add	%o0, 64, %o0
-	bgu,pt	%ncc, .unalign_000_loop
-	prefetch [%o4 + (4 * BLOCK_SIZE)], #one_read
-	membar	#Sync
-
-.unalign_done:
-	! Handle trailing bytes, 64 to 127
-	! Dest long word aligned, Src not long word aligned
-	cmp	%o2, 15
-	bleu	%ncc, .unalign_short
-
-	andn	%o2, 0x7, %o5		! %o5 is multiple of 8
-	and	%o2, 0x7, %o2		! residue bytes in %o2
-	add	%o2, 8, %o2
-	sub	%o5, 8, %o5		! insure we don't load past end of src
-	andn	%o1, 0x7, %o4		! %o4 has long word aligned src address
-	add	%o1, %o5, %o1		! advance %o1 to after multiple of 8
-	ldd	[%o4], %d0		! fetch partial word
-.unalign_by8:
-	ldd	[%o4+8], %d2
-	add	%o4, 8, %o4
-	faligndata %d0, %d2, %d16
-	subcc	%o5, 8, %o5
-	std	%d16, [%o0]
-	fmovd	%d2, %d0
-	bgu,pt	%ncc, .unalign_by8
-	add	%o0, 8, %o0
-
-.unalign_short:
-	brnz	%g5, .smallrest
-	nop
-	ba	.smallrest
-	wr	%g5, %g0, %fprs
-#else	/* NIAGARA2_IMPL */
-.forcpy:
-	mov	%o0, %g5		! save des address for return val
-	cmp	%o2, 17			! for small counts copy bytes
-	bleu,pt	%ncc, .dbytecp
-	nop
-
-	cmp	%o2, 0x80		! For lengths less than 128 bytes no
-	bleu,pn	%ncc, .no_blkcpy	! copy using ASI_BLK_INIT_ST_QUAD_LDD_P
-
-	/*
-	 * Make sure that source and destination buffers are 64 bytes apart.
-	 * If they are not, do not use ASI_BLK_INIT_ST_QUAD_LDD_P asi to copy
-	 * the data.
-	 */
-	subcc	%o1, %o0, %o3
-	blu	%ncc, .blkalgndst
-	cmp	%o3, 0x40		! if src - dst >= 0x40
-	bgeu,pt	%ncc, .blkalgndst	! then use ASI_BLK_INIT_ST_QUAD_LDD_P
-.no_blkcpy:
-	andcc	%o1, 3, %o5		! is src word aligned
-	bz,pn	%ncc, .aldst
-	cmp	%o5, 2			! is src half-word aligned
-	be,pt	%ncc, .s2algn
-	cmp	%o5, 3			! src is byte aligned
-.s1algn:ldub	[%o1], %o3		! move 1 or 3 bytes to align it
-	inc	1, %o1
-	stb	%o3, [%g5]		! move a byte to align src
-	inc	1, %g5
-	bne,pt	%ncc, .s2algn
-	dec	%o2
-	b	.ald			! now go align dest
-	andcc	%g5, 3, %o5
-
-.s2algn:lduh	[%o1], %o3		! know src is 2 byte alinged
-	inc	2, %o1
-	srl	%o3, 8, %o4
-	stb	%o4, [%g5]		! have to do bytes,
-	stb	%o3, [%g5 + 1]		! don't know dst alingment
-	inc	2, %g5
-	dec	2, %o2
-
-.aldst:	andcc	%g5, 3, %o5		! align the destination address
-.ald:	bz,pn	%ncc, .w4cp
-	cmp	%o5, 2
-	bz,pn	%ncc, .w2cp
-	cmp	%o5, 3
-.w3cp:	lduw	[%o1], %o4
-	inc	4, %o1
-	srl	%o4, 24, %o5
-	stb	%o5, [%g5]
-	bne,pt	%ncc, .w1cp
-	inc	%g5
-	dec	1, %o2
-	andn	%o2, 3, %o3		! o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %g5, %o1		! o1 gets the difference
-
-1:	sll	%o4, 8, %g1		! save residual bytes
-	lduw	[%o1+%g5], %o4
-	deccc	4, %o3
-	srl	%o4, 24, %o5		! merge with residual
-	or	%o5, %g1, %g1
-	st	%g1, [%g5]
-	bnz,pt	%ncc, 1b
-	inc	4, %g5
-	sub	%o1, 3, %o1		! used one byte of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w1cp:	srl	%o4, 8, %o5
-	sth	%o5, [%g5]
-	inc	2, %g5
-	dec	3, %o2
-	andn	%o2, 3, %o3		! o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %g5, %o1		! o1 gets the difference
-
-2:	sll	%o4, 24, %g1		! save residual bytes
-	lduw	[%o1+%g5], %o4
-	deccc	4, %o3
-	srl	%o4, 8, %o5		! merge with residual
-	or	%o5, %g1, %g1
-	st	%g1, [%g5]
-	bnz,pt	%ncc, 2b
-	inc	4, %g5
-	sub	%o1, 1, %o1		! used three bytes of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w2cp:	lduw	[%o1], %o4
-	inc	4, %o1
-	srl	%o4, 16, %o5
-	sth	%o5, [%g5]
-	inc	2, %g5
-	dec	2, %o2
-	andn	%o2, 3, %o3		! o3 is aligned word count
-	dec	4, %o3			! avoid reading beyond tail of src
-	sub	%o1, %g5, %o1		! o1 gets the difference
-
-3:	sll	%o4, 16, %g1		! save residual bytes
-	lduw	[%o1+%g5], %o4
-	deccc	4, %o3
-	srl	%o4, 16, %o5		! merge with residual
-	or	%o5, %g1, %g1
-	st	%g1, [%g5]
-	bnz,pt	%ncc, 3b
-	inc	4, %g5
-	sub	%o1, 2, %o1		! used two bytes of last word read
-	and	%o2, 3, %o2
-	b	7f
-	inc	4, %o2
-
-.w4cp:	andn	%o2, 3, %o3		! o3 is aligned word count
-	sub	%o1, %g5, %o1		! o1 gets the difference
-
-1:	lduw	[%o1+%g5], %o4		! read from address
-	deccc	4, %o3			! decrement count
-	st	%o4, [%g5]		! write at destination address
-	bgu,pt	%ncc, 1b
-	inc	4, %g5			! increment to address
-	b	7f
-	and	%o2, 3, %o2		! number of leftover bytes, if any
-
-	!
-	! differenced byte copy, works with any alignment
-	!
-.dbytecp:
-	b	7f
-	sub	%o1, %g5, %o1		! o1 gets the difference
-
-4:	stb	%o4, [%g5]		! write to address
-	inc	%g5			! inc to address
-7:	deccc	%o2			! decrement count
-	bgeu,a,pt %ncc,4b		! loop till done
-	ldub	[%o1+%g5], %o4		! read from address
-	retl				! %o0 was preserved
-	nop
-
-.blkalgndst:
-	save	%sp, -SA(MINFRAME), %sp
-
-	! Block (64 bytes) align the destination.
-	andcc	%i0, 0x3f, %i3		! is dst block aligned
-	bz	%ncc, .chksrc		! dst already block aligned
-	sub	%i3, 0x40, %i3
-	neg	%i3			! bytes till dst 64 bytes aligned
-	sub	%i2, %i3, %i2		! update i2 with new count
-
-	! Based on source and destination alignment do
-	! either 8 bytes, 4 bytes, 2 bytes or byte copy.
-
-	! Is dst & src 8B aligned
-	or	%i0, %i1, %o2
-	andcc	%o2, 0x7, %g0
-	bz	%ncc, .alewdcp
-	nop
-
-	! Is dst & src 4B aligned
-	andcc	%o2, 0x3, %g0
-	bz	%ncc, .alwdcp
-	nop
-
-	! Is dst & src 2B aligned
-	andcc	%o2, 0x1, %g0
-	bz	%ncc, .alhlfwdcp
-	nop
-
-	! 1B aligned
-1:	ldub	[%i1], %o2
-	stb	%o2, [%i0]
-	inc	%i1
-	deccc	%i3
-	bgu,pt	%ncc, 1b
-	inc	%i0
-
-	ba	.chksrc
-	nop
-
-	! dst & src 4B aligned
-.alwdcp:
-	ld	[%i1], %o2
-	st	%o2, [%i0]
-	add	%i1, 0x4, %i1
-	subcc	%i3, 0x4, %i3
-	bgu,pt	%ncc, .alwdcp
-	add	%i0, 0x4, %i0
-
-	ba	.chksrc
-	nop
-
-	! dst & src 2B aligned
-.alhlfwdcp:
-	lduh	[%i1], %o2
-	stuh	%o2, [%i0]
-	add	%i1, 0x2, %i1
-	subcc	%i3, 0x2, %i3
-	bgu,pt	%ncc, .alhlfwdcp
-	add	%i0, 0x2, %i0
-
-	ba	.chksrc
-	nop
-
-	! dst & src 8B aligned
-.alewdcp:
-	ldx	[%i1], %o2
-	stx	%o2, [%i0]
-	add	%i1, 0x8, %i1
-	subcc	%i3, 0x8, %i3
-	bgu,pt	%ncc, .alewdcp
-	add	%i0, 0x8, %i0
-
-	! Now Destination is block (64 bytes) aligned
-.chksrc:
-	andn	%i2, 0x3f, %i3		! %i3 count is multiple of block size
-	sub	%i2, %i3, %i2		! Residue bytes in %i2
-	mov	ASI_BLK_INIT_ST_QUAD_LDD_P, %asi
-	andcc	%i1, 0xf, %l1		! is src quadword aligned
-	bz,pn	%ncc, .blkcpy		! src offset in %l1
-	nop
-	cmp	%l1, 0x8
-	bgu	%ncc, .cpy_upper_double
-	nop
-	blu	%ncc, .cpy_lower_double
-	nop
-
-	! Falls through when source offset is equal to 8 i.e.
-	! source is double word aligned.
-	! In this case no shift/merge of data is required
-	sub	%i1, %l1, %i1		! align the src at 16 bytes.
-	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
-	prefetch [%o0+0x0], #one_read
-	ldda	[%i1+0x0]%asi, %o2
-loop0:
-	ldda	[%i1+0x10]%asi, %o4
-	prefetch [%o0+0x40], #one_read
-
-	stxa	%o3, [%i0+0x0]%asi
-	stxa	%o4, [%i0+0x8]%asi
-
-	ldda	[%i1+0x20]%asi, %o2
-	stxa	%o5, [%i0+0x10]%asi
-	stxa	%o2, [%i0+0x18]%asi
-
-	ldda	[%i1+0x30]%asi, %o4
-	stxa	%o3, [%i0+0x20]%asi
-	stxa	%o4, [%i0+0x28]%asi
-
-	ldda	[%i1+0x40]%asi, %o2
-	stxa	%o5, [%i0+0x30]%asi
-	stxa	%o2, [%i0+0x38]%asi
-
-	add	%o0, 0x40, %o0
-	add	%i1, 0x40, %i1
-	subcc	%i3, 0x40, %i3
-	bgu,pt	%ncc, loop0
-	add	%i0, 0x40, %i0
-	ba	.blkdone
-	add	%i1, %l1, %i1		! increment the source by src offset
-
-.cpy_lower_double:
-	sub	%i1, %l1, %i1		! align the src at 16 bytes.
-	sll	%l1, 3, %l2		! %l2 left shift
-	mov	0x40, %l3
-	sub	%l3, %l2, %l3		! %l3 right shift = (64 - left shift)
-	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
-	prefetch [%o0+0x0], #one_read
-	ldda	[%i1+0x0]%asi, %o2	! partial data in %o2 and %o3 has
-					! complete data
-loop1:
-	ldda	[%i1+0x10]%asi, %o4	! %o4 has partial data for this read.
-	ALIGN_DATA(%o2, %o3, %o4, %l2, %l3, %g1)	! merge %o2, %o3 and %o4
-							! into %o2 and %o3
-	prefetch [%o0+0x40], #one_read
-	stxa	%o2, [%i0+0x0]%asi
-	stxa	%o3, [%i0+0x8]%asi
-
-	ldda	[%i1+0x20]%asi, %o2
-	ALIGN_DATA(%o4, %o5, %o2, %l2, %l3, %g1)	! merge %o2 with %o5 and
-	stxa	%o4, [%i0+0x10]%asi			! %o4 from previous read
-	stxa	%o5, [%i0+0x18]%asi			! into %o4 and %o5
-
-	! Repeat the same for next 32 bytes.
-
-	ldda	[%i1+0x30]%asi, %o4
-	ALIGN_DATA(%o2, %o3, %o4, %l2, %l3, %g1)
-	stxa	%o2, [%i0+0x20]%asi
-	stxa	%o3, [%i0+0x28]%asi
-
-	ldda	[%i1+0x40]%asi, %o2
-	ALIGN_DATA(%o4, %o5, %o2, %l2, %l3, %g1)
-	stxa	%o4, [%i0+0x30]%asi
-	stxa	%o5, [%i0+0x38]%asi
-
-	add	%o0, 0x40, %o0
-	add	%i1, 0x40, %i1
-	subcc	%i3, 0x40, %i3
-	bgu,pt	%ncc, loop1
-	add	%i0, 0x40, %i0
-	ba	.blkdone
-	add	%i1, %l1, %i1		! increment the source by src offset
-
-.cpy_upper_double:
-	sub	%i1, %l1, %i1		! align the src at 16 bytes.
-	mov	0x8, %l2
-	sub	%l1, %l2, %l2
-	sll	%l2, 3, %l2		! %l2 left shift
-	mov	0x40, %l3
-	sub	%l3, %l2, %l3		! %l3 right shift = (64 - left shift)
-	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
-	prefetch [%o0+0x0], #one_read
-	ldda	[%i1+0x0]%asi, %o2	! partial data in %o3 for this read and
-					! no data in %o2
-loop2:
-	ldda	[%i1+0x10]%asi, %o4	! %o4 has complete data and %o5 has
-					! partial
-	ALIGN_DATA(%o3, %o4, %o5, %l2, %l3, %g1)	! merge %o3, %o4 and %o5
-							! into %o3 and %o4
-	prefetch [%o0+0x40], #one_read
-	stxa	%o3, [%i0+0x0]%asi
-	stxa	%o4, [%i0+0x8]%asi
-
-	ldda	[%i1+0x20]%asi, %o2
-	ALIGN_DATA(%o5, %o2, %o3, %l2, %l3, %g1)	! merge %o2 and %o3 with
-	stxa	%o5, [%i0+0x10]%asi			! %o5 from previous read
-	stxa	%o2, [%i0+0x18]%asi			! into %o5 and %o2
-
-	! Repeat the same for next 32 bytes.
-
-	ldda	[%i1+0x30]%asi, %o4
-	ALIGN_DATA(%o3, %o4, %o5, %l2, %l3, %g1)
-	stxa	%o3, [%i0+0x20]%asi
-	stxa	%o4, [%i0+0x28]%asi
-
-	ldda	[%i1+0x40]%asi, %o2
-	ALIGN_DATA(%o5, %o2, %o3, %l2, %l3, %g1)
-	stxa	%o5, [%i0+0x30]%asi
-	stxa	%o2, [%i0+0x38]%asi
-
-	add	%o0, 0x40, %o0
-	add	%i1, 0x40, %i1
-	subcc	%i3, 0x40, %i3
-	bgu,pt	%ncc, loop2
-	add	%i0, 0x40, %i0
-	ba	.blkdone
-	add	%i1, %l1, %i1		! increment the source by src offset
-
-	! Do fast copy using ASI_BLK_INIT_ST_QUAD_LDD_P
-.blkcpy:
-	andn	%i1, 0x3f, %o0		! %o0 has block aligned source
-	prefetch [%o0+0x0], #one_read
-1:
-	prefetch [%o0+0x40], #one_read
-
-	ldda	[%i1+0x0]%asi, %o2
-	ldda	[%i1+0x10]%asi, %o4
-
-	stxa	%o2, [%i0+0x0]%asi
-	stxa	%o3, [%i0+0x8]%asi
-	stxa	%o4, [%i0+0x10]%asi
-	stxa	%o5, [%i0+0x18]%asi
-
-	ldda	[%i1+0x20]%asi, %o2
-	ldda	[%i1+0x30]%asi, %o4
-
-	stxa	%o2, [%i0+0x20]%asi
-	stxa	%o3, [%i0+0x28]%asi
-	stxa	%o4, [%i0+0x30]%asi
-	stxa	%o5, [%i0+0x38]%asi
-
-	add	%o0, 0x40, %o0
-	add	%i1, 0x40, %i1
-	subcc	%i3, 0x40, %i3
-	bgu,pt	%ncc, 1b
-	add	%i0, 0x40, %i0
-
-.blkdone:
-	membar	#Sync
-
-	mov	ASI_PNF, %asi		! restore %asi to default
-					! ASI_PRIMARY_NOFAULT value
-	tst	%i2
-	bz,pt	%ncc, .blkexit
-	nop
-
-	! Handle trailing bytes
-	cmp	%i2, 0x8
-	blu,pt	%ncc, .residue
-	nop
-
-	! Can we do some 8B ops
-	or	%i1, %i0, %o2
-	andcc	%o2, 0x7, %g0
-	bnz	%ncc, .last4
-	nop
-
-	! Do 8byte ops as long as possible
-.last8:
-	ldx	[%i1], %o2
-	stx	%o2, [%i0]
-	add	%i1, 0x8, %i1
-	sub	%i2, 0x8, %i2
-	cmp	%i2, 0x8
-	bgu,pt	%ncc, .last8
-	add	%i0, 0x8, %i0
-
-	tst	%i2
-	bz,pt	%ncc, .blkexit
-	nop
-
-	ba	.residue
-	nop
-
-.last4:
-	! Can we do 4B ops
-	andcc	%o2, 0x3, %g0
-	bnz	%ncc, .last2
-	nop
-1:
-	ld	[%i1], %o2
-	st	%o2, [%i0]
-	add	%i1, 0x4, %i1
-	sub	%i2, 0x4, %i2
-	cmp	%i2, 0x4
-	bgu,pt	%ncc, 1b
-	add	%i0, 0x4, %i0
-
-	cmp	%i2, 0
-	bz,pt	%ncc, .blkexit
-	nop
-
-	ba	.residue
-	nop
-
-.last2:
-	! Can we do 2B ops
-	andcc	%o2, 0x1, %g0
-	bnz	%ncc, .residue
-	nop
-
-1:
-	lduh	[%i1], %o2
-	stuh	%o2, [%i0]
-	add	%i1, 0x2, %i1
-	sub	%i2, 0x2, %i2
-	cmp	%i2, 0x2
-	bgu,pt	%ncc, 1b
-	add	%i0, 0x2, %i0
-
-	cmp	%i2, 0
-	bz,pt	%ncc, .blkexit
-	nop
-
-.residue:
-	ldub	[%i1], %o2
-	stb	%o2, [%i0]
-	inc	%i1
-	deccc	%i2
-	bgu,pt	%ncc, .residue
-	inc	%i0
-
-.blkexit:
-
-	ret
-	restore	%g5, %g0, %o0
-
-#endif	/* NIAGARA2_IMPL */
-	SET_SIZE(memcpy)
-	SET_SIZE(__align_cpy_1)
--- a/usr/src/lib/libc_psr/sun4v/common/memset.s	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memset.s"
-
-/*
- * char *memset(sp, c, n)
- *
- * Set an array of n chars starting at sp to the character c.
- * Return sp.
- *
- * Fast assembler language version of the following C-program for memset
- * which represents the `standard' for the C-library.
- *
- *	void *
- *	memset(void *sp1, int c, size_t n)
- *	{
- *	    if (n != 0) {
- *		char *sp = sp1;
- *		do {
- *		    *sp++ = (char)c;
- *		} while (--n != 0);
- *	    }
- *	    return (sp1);
- *	}
- *
- * Flow :
- *
- *	For small 6 or fewer bytes stores, bytes will be stored.
- *
- *	For less than 32 bytes stores, align the address on 4 byte boundary.
- *	Then store as many 4-byte chunks, followed by trailing bytes.
- *
- *	For sizes greater than 32 bytes, align the address on 8 byte boundary.
- *	if (count > 64) {
- *		store as many 8-bytes chunks to block align the address
- *		store using ASI_BLK_INIT_ST_QUAD_LDD_P
- *	}
- *	Store as many 8-byte chunks, followed by trialing bytes.
- *		
- */
-
-#include <sys/asm_linkage.h>
-#include <sys/niagaraasi.h>
-#include <sys/asi.h>
-
-	ANSI_PRAGMA_WEAK(memset,function)
-
-	.section        ".text"
-	.align 32
-
-	ENTRY(memset)
-
-	mov	%o0, %o5		! copy sp1 before using it
-	cmp	%o2, 7			! if small counts, just write bytes
-	blu,pn	%ncc, .wrchar
-	and	%o1, 0xff, %o1		! o1 is (char)c
-
-	sll	%o1, 8, %o3
-	or	%o1, %o3, %o1		! now o1 has 2 bytes of c
-	sll	%o1, 16, %o3
-
-	cmp	%o2, 0x20
-	blu,pn	%ncc, .wdalign
-	or	%o1, %o3, %o1		! now o1 has 4 bytes of c
-
-	sllx	%o1, 32, %o3
-	or	%o1, %o3, %o1		! now o1 has 8 bytes of c
-
-.dbalign:
-	andcc	%o5, 7, %o3		! is sp1 aligned on a 8 byte bound
-	bz,pt	%ncc, .blkalign		! already double aligned
-	sub	%o3, 8, %o3		! -(bytes till double aligned)
-	add	%o2, %o3, %o2		! update o2 with new count
-
-	! Set -(%o3) bytes till sp1 double aligned
-1:	stb	%o1, [%o5]		! there is at least 1 byte to set
-	inccc	%o3			! byte clearing loop 
-	bl,pt	%ncc, 1b
-	inc	%o5 
-
-	! Now sp1 is double aligned (sp1 is found in %o5)
-.blkalign:
-	mov	ASI_BLK_INIT_ST_QUAD_LDD_P, %asi
-
-	cmp	%o2, 0x40		! check if there are 64 bytes to set
-	blu,pn	%ncc, 5f
-	mov	%o2, %o3
-
-	andcc	%o5, 63, %o3		! is sp1 block aligned?
-	bz,pt	%ncc, .blkwr		! now block aligned
-	sub	%o3, 64, %o3		! o3 is -(bytes till block aligned)
-	add	%o2, %o3, %o2		! o2 is the remainder
-
-	! Store -(%o3) bytes till dst is block (64 byte) aligned.
-	! Use double word stores.
-	! Recall that dst is already double word aligned
-1:
-	stx	%o1, [%o5]
-	addcc	%o3, 8, %o3
-	bl,pt	%ncc, 1b
-	add	%o5, 8, %o5
-
-	! Now sp1 is block aligned
-.blkwr:
-	and	%o2, 63, %o3		! calc bytes left after blk store.
-	andn	%o2, 63, %o4		! calc size of blocks in bytes
-
-	cmp	%o4, 0x100		! check if there are 256 bytes to set
-	blu,pn	%ncc, 3f
-	nop
-2:
-	stxa	%o1, [%o5+0x0]%asi
-	stxa	%o1, [%o5+0x40]%asi
-	stxa	%o1, [%o5+0x80]%asi
-	stxa	%o1, [%o5+0xc0]%asi
-
-	stxa	%o1, [%o5+0x8]%asi
-	stxa	%o1, [%o5+0x10]%asi
-	stxa	%o1, [%o5+0x18]%asi
-	stxa	%o1, [%o5+0x20]%asi
-	stxa	%o1, [%o5+0x28]%asi
-	stxa	%o1, [%o5+0x30]%asi
-	stxa	%o1, [%o5+0x38]%asi
-
-	stxa	%o1, [%o5+0x48]%asi
-	stxa	%o1, [%o5+0x50]%asi
-	stxa	%o1, [%o5+0x58]%asi
-	stxa	%o1, [%o5+0x60]%asi
-	stxa	%o1, [%o5+0x68]%asi
-	stxa	%o1, [%o5+0x70]%asi
-	stxa	%o1, [%o5+0x78]%asi
-
-	stxa	%o1, [%o5+0x88]%asi
-	stxa	%o1, [%o5+0x90]%asi
-	stxa	%o1, [%o5+0x98]%asi
-	stxa	%o1, [%o5+0xa0]%asi
-	stxa	%o1, [%o5+0xa8]%asi
-	stxa	%o1, [%o5+0xb0]%asi
-	stxa	%o1, [%o5+0xb8]%asi
-
-	stxa	%o1, [%o5+0xc8]%asi
-	stxa	%o1, [%o5+0xd0]%asi
-	stxa	%o1, [%o5+0xd8]%asi
-	stxa	%o1, [%o5+0xe0]%asi
-	stxa	%o1, [%o5+0xe8]%asi
-	stxa	%o1, [%o5+0xf0]%asi
-	stxa	%o1, [%o5+0xf8]%asi
-
-	sub	%o4, 0x100, %o4
-	cmp	%o4, 0x100
-	bgu,pt	%ncc, 2b
-	add	%o5, 0x100, %o5
-
-3:
-	cmp	%o4, 0x40		! check if 64 bytes to set
-	blu	%ncc, 5f
-	nop
-4:	
-	stxa	%o1, [%o5+0x0]%asi
-	stxa	%o1, [%o5+0x8]%asi
-	stxa	%o1, [%o5+0x10]%asi
-	stxa	%o1, [%o5+0x18]%asi
-	stxa	%o1, [%o5+0x20]%asi
-	stxa	%o1, [%o5+0x28]%asi
-	stxa	%o1, [%o5+0x30]%asi
-	stxa	%o1, [%o5+0x38]%asi
-
-	subcc	%o4, 0x40, %o4
-	bgu,pt	%ncc, 4b
-	add	%o5, 0x40, %o5
-
-5:
-	! Set the remaining doubles
-	membar	#Sync
-	mov	ASI_PNF, %asi		! restore %asi to default
-					! ASI_PRIMARY_NOFAULT value
-	subcc	%o3, 8, %o3		! Can we store any doubles?
-	blu,pn	%ncc, .wrchar
-	and	%o2, 7, %o2		! calc bytes left after doubles
-
-6:
-	stx	%o1, [%o5]		! store the doubles
-	subcc	%o3, 8, %o3
-	bgeu,pt	%ncc, 6b
-	add	%o5, 8, %o5
-
-	ba	.wrchar
-	nop
-
-.wdalign:			
-	andcc	%o5, 3, %o3		! is sp1 aligned on a word boundary
-	bz,pn	%ncc, .wrword
-	andn	%o2, 3, %o3		! create word sized count in %o3
-
-	dec	%o2			! decrement count
-	stb	%o1, [%o5]		! clear a byte
-	b	.wdalign
-	inc	%o5			! next byte
-
-.wrword:
-	st	%o1, [%o5]		! 4-byte writing loop
-	subcc	%o3, 4, %o3
-	bnz,pt	%ncc, .wrword
-	inc	4, %o5
-
-	and	%o2, 3, %o2		! leftover count, if any
-
-.wrchar:
-	! Set the remaining bytes, if any
-	cmp	%o2, 0
-	be	%ncc, .exit
-	nop
-
-7:
-	deccc	%o2
-	stb	%o1, [%o5]
-	bgu,pt	%ncc, 7b
-	inc	%o5
-
-.exit:
-	retl				! %o0 was preserved
-	nop
-
-	SET_SIZE(memset)
--- a/usr/src/lib/libc_psr/sun4v_hwcap1/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../../Makefile.lib
-
-PLATFORM=	sun4v
-ALT_PLAT=	sun4v_hwcap1
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber : lib32 \
-				$(BUILD64) lib64
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4v_hwcap1/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-LIBRARY		= libc_psr_hwcap1.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/sun4v -I$(ROOT)/usr/include/v9
-CPPFLAGS	= -D_REENTRANT -D$(MACH) -DNIAGARA_IMPL $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-MAPFILES	= ../../sun4v/mapfile-vers ../mapfile $(MAPFILE.FLT)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
--- a/usr/src/lib/libc_psr/sun4v_hwcap1/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4v
-ALT_PLAT	= sun4v_hwcap1
-CLASS		= 32
-
-OBJECTS		= memcpy.o memset.o
-
-include ../Makefile.com
-
-ASFLAGS	+=	-xarch=v8plus
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap1.so.1
-LIBC_PSR_DIR	= $(ROOT_PSM_LIB_DIR)/libc_psr
-LIBC_PSR_LIB	= $(LIBC_PSR_DIR)/$(MODULE)
-INS.libc	= $(RM) -r $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(MODULE)
-
-$(LIBC_PSR_LIB) := FILEMODE= 0755
-
-$(LIBC_PSR_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR_LIB): $(LIBC_PSR_DIR) $(MODULE)
-	-$(INS.libc)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4v_hwcap1/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4v
-ALT_PLAT	= sun4v_hwcap1
-
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o
-
-include ../Makefile.com
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS	+=	-xarch=v9
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap1.so.1
-LIBC_PSR64_DIR	= $(ROOT_PSM_LIB_DIR)/$(MACH64)/libc_psr
-LIBC_PSR64_LIB	= $(LIBC_PSR64_DIR)/$(MODULE)
-INS.libc.64	= $(RM) -r $@; $(INS) -m $(FILEMODE) -f $(@D) $(MODULE)
-
-$(LIBC_PSR64_LIB) := FILEMODE= 0755
-
-$(LIBC_PSR64_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LIB): $(LIBC_PSR64_DIR) $(MODULE)
-	-$(INS.libc.64)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4v_hwcap2/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../../Makefile.lib
-
-PLATFORM=	sun4v
-
-SUBDIRS=	$(MACH)
-SUBDIRS64=	$(MACH64)
-
-all		:=	TARGET= all
-install		:=	TARGET= install
-clean		:=	TARGET= clean
-clobber		:=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber : lib32 \
-				$(BUILD64) lib64
-
-lint:
-	@ $(ECHO) "Nothing to lint here: skipping"
-
-lib32: $(SUBDIRS)
-
-lib64: $(SUBDIRS64)
-
-$(SUBDIRS) $(SUBDIRS64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libc_psr/sun4v_hwcap2/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-LIBRARY		= libc_psr_hwcap2.a
-VERS		= .1
-
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/Makefile.psm
-
-#
-# Since libc_psr is strictly assembly, deactivate the CTF build logic.
-#
-CTFCONVERT_POST	= :
-CTFMERGE_LIB	= :
-
-LIBS		= $(DYNLIB)
-IFLAGS		= -I$(SRC)/uts/sun4v \
-		  -I$(ROOT)/usr/platform/sun4v/include -I$(ROOT)/usr/include/v9
-CPPFLAGS	= -D_REENTRANT -D$(MACH) -DNIAGARA2_IMPL $(IFLAGS) $(CPPFLAGS.master)
-ASDEFS		= -D__STDC__ -D_ASM $(CPPFLAGS)
-ASFLAGS		= -P $(ASDEFS)
-
-MAPFILES	= ../../sun4v/mapfile-vers ../mapfile $(MAPFILE.FLT)
-
-#
-# build rules
-#
-pics/%.o: ../../$(PLATFORM)/common/%.s
-	$(AS) $(ASFLAGS) $< -o $@
-	$(POST_PROCESS_O)
--- a/usr/src/lib/libc_psr/sun4v_hwcap2/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4v
-CLASS		= 32
-
-OBJECTS		= memcpy.o memset.o
-
-include ../Makefile.com
-
-ASFLAGS		+= -xarch=v8plusa
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO	= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap2.so.1
-LIBC_PSR_DIR	= $(ROOT_PSM_LIB_DIR)/libc_psr
-LIBC_PSR_LIB	= $(LIBC_PSR_DIR)/$(MODULE)
-INS.libc	= $(RM) -r $@; $(INS) -s -m $(FILEMODE) -f $(@D) $(MODULE)
-
-$(LIBC_PSR_LIB) := FILEMODE= 0755
-
-$(LIBC_PSR_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR_LIB): $(LIBC_PSR_DIR) $(MODULE)
-	-$(INS.libc)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libc_psr/sun4v_hwcap2/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#
-# Platform specific Makefile for libc_psr.
-#
-
-PLATFORM	= sun4v
-CLASS		= 64
-
-OBJECTS		= memcpy.o memset.o
-
-include ../Makefile.com
-
-ASDEFS		+= -D__sparcv9
-ASFLAGS		+= -xarch=v9a
-
-include $(SRC)/Makefile.master.64
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
-
-BUILD.SO	= $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-MODULE		= libc_psr_hwcap2.so.1
-LIBC_PSR64_DIR	= $(ROOT_PSM_LIB_DIR)/$(MACH64)/libc_psr
-LIBC_PSR64_LIB	= $(LIBC_PSR64_DIR)/$(MODULE)
-INS.libc.64	= $(RM) -r $@; $(INS) -m $(FILEMODE) -f $(@D) $(MODULE)
-
-$(LIBC_PSR64_LIB) := FILEMODE= 0755
-
-$(LIBC_PSR64_DIR):
-	-$(INS.dir)
-
-$(LIBC_PSR64_LIB): $(LIBC_PSR64_DIR) $(MODULE)
-	-$(INS.libc.64)
-
-all:		$(LIBS)
-
-install:	all $(LIBC_PSR64_LIB)
-
-include ../../Makefile.targ
--- a/usr/src/lib/libmd/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,19 +18,16 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-include ../Makefile.lib
+include		$(SRC)/lib/Makefile.lib
 
-$(SPARC_BLD)PLATFORMS= sun4u sun4v
+$(SPARC_BLD)CAPDIR = capabilities
 
-SUBDIRS=	$(MACH) $(PLATFORMS)
-$(BUILD64)SUBDIRS += $(MACH64)
+SUBDIRS=	$(MACH) $(BUILD64) $(MACH64)
 
 HDRS =		md4.h md5.h sha1.h sha2.h
 HDRDIR =	common
@@ -43,16 +40,19 @@
 
 .KEEP_STATE:
 
-.PARALLEL: $(SUBDIRS)
+.PARALLEL:	$(SUBDIRS)
 
-all clean clobber install lint: $(SUBDIRS)
+all clean clobber install lint: \
+		$(CAPDIR) .WAIT $(SUBDIRS)
 
 install_h:	$(ROOTHDRS)
 
 check:		$(CHECKHDRS)
 
-$(SUBDIRS): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
+$(CAPDIR) \
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
 FRC:
 
-include ../Makefile.targ
+include		$(SRC)/lib/Makefile.targ
--- a/usr/src/lib/libmd/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -18,96 +18,23 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-# $LIBRARY is set in lower makefiles so we can have platform and
-# processor optimised versions of this library via libmd_psr and libmd_hwcapN
-
-#LIBRARY= libmd.a
-VERS= .1
-
-OBJECTS= md4.o md5.o $(MD5_PSR_OBJECTS) sha1.o $(SHA1_PSR_OBJECTS) \
-		sha2.o $(SHA2_PSR_OBJECTS)
+LIBS =		$(DYNLIB) $(LINTLIB)
+SRCS =		$(COMDIR)/md4/md4.c \
+		$(COMDIR)/md5/md5.c \
+		$(COMDIR)/sha1/sha1.c \
+		$(COMDIR)/sha2/sha2.c
 
-# Use $(SRC) to include makefiles rather than ../../ because the
-# platform subdirs are one level deeper so it would be ../../../ for them
-include $(SRC)/lib/Makefile.lib
-include $(SRC)/lib/Makefile.rootfs
+COMDIR =	$(SRC)/common/crypto
+SRCDIR =	../common
+MAPFILEDIR =	$(SRCDIR)
 
-LIBS =		$(DYNLIB) $(LINTLIB)
-SRCS = \
-	$(COMDIR)/md4/md4.c \
-	$(COMDIR)/md5/md5.c \
-	$(COMDIR)/sha1/sha1.c \
-	$(COMDIR)/sha2/sha2.c
-
-COMDIR= $(SRC)/common/crypto
-
-$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(SRCDIR)
 LDLIBS +=	-lc
 
-SRCDIR =	../common
-COMDIR =	$(SRC)/common/crypto
-
-CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
-CFLAGS64 += $(C_BIGPICFLAGS)
-CPPFLAGS += -I$(SRCDIR)
-
-ROOTLINT= $(LINTSRC:%=$(ROOTLIBDIR)/%)
-
-.KEEP_STATE:
-
-all: $(LIBS)
-
-lint: lintcheck
-
-pics/%.o: $(COMDIR)/md4/%.c
-	$(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/md5/%.c
-	$(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha1/%.c
-	$(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
-	$(COMPILE.s) -P -DPIC -D_ASM -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o: $(COMDIR)/sha2/%.c
-	$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
-	$(POST_PROCESS_O)
-
-#
-# Used when building links in /platform/$(PLATFORM)/lib for libmd_psr.so.1
-#
-
-LIBMD_PSR_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib)
-LIBMD_PSR_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MODULE))
-
-LIBMD_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64))
-LIBMD_PSR64_LINKS = $(LINKED_PLATFORMS:%=$(ROOT_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-
-INS.slink6 = $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-
-INS.slink64 = $(RM) -r $@; $(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-$(LIBMD_PSR_DIRS):
-	-$(INS.dir)
-
-$(LIBMD_PSR_LINKS): $(LIBMD_PSR_DIRS)
-	-$(INS.slink6)
-
-$(LIBMD_PSR64_DIRS):
-	-$(INS.dir)
-
-$(LIBMD_PSR64_LINKS): $(LIBMD_PSR64_DIRS)
-	-$(INS.slink64)
-
-include $(SRC)/lib/Makefile.targ
+$(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+COMDIR =	$(SRC)/common/crypto
+
+pics/%.o: $(COMDIR)/md4/%.c
+		$(COMPILE.c) -I$(COMDIR)/md4 -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/md5/%.c
+		$(COMPILE.c) -I$(COMDIR)/md5 $(INLINES) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/sha1/%.c
+		$(COMPILE.c) -I$(COMDIR)/sha1 -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/sha1_asm.o: $(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
+		$(COMPILE.s) -o pics/sha1_asm.o \
+		$(COMDIR)/sha1/sparc/$(PLATFORM)/sha1_asm.s
+		$(POST_PROCESS_O)
+
+pics/%.o: $(COMDIR)/sha2/%.c
+		$(COMPILE.c) -I$(COMDIR)/sha2 -o $@ $<
+		$(POST_PROCESS_O)
+
+include		$(SRC)/lib/Makefile.targ
--- a/usr/src/lib/libmd/amd64/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/amd64/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -19,40 +19,52 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-LIBRARY= libmd.a
+LIBRARY =	libmd.a
+VERS =		.1
+
+OBJECTS =	md4.o md5.o sha1.o sha2.o
 
-MD5_PSR_OBJECTS = md5_amd64.o
-SHA1_PSR_OBJECTS = sha1-x86_64.o
-SHA2_PSR_OBJECTS = sha512-x86_64.o sha256-x86_64.o
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.rootfs
+include		$(SRC)/lib/Makefile.lib.64
+include		../Makefile.com
 
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+EXTPICS =	pics/md5_amd64.o \
+		pics/sha1-x86_64.o \
+		pics/sha512-x86_64.o \
+		pics/sha256-x86_64.o
 
-CLEANFILES += md5_amd64.s sha1-x86_64.s sha512-x86_64.s sha256-x86_64.s
+CLEANFILES +=	$(EXTPICS) \
+		$(EXTPICS:pics/%.o=%.s)
 
 # This prevents <sys/asm_linkage.h> from including C source:
 AS_CPPFLAGS += -D_ASM
 
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+.KEPP_STATE:
+
+all:		$(LIBS)
+
+install:	all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+
+lint:		lintcheck
 
 pics/%.o: %.s
-	$(COMPILE.s) -o $@ ${@F:.o=.s}
-	$(POST_PROCESS_O)
+		$(COMPILE.s) -o $@ ${@F:.o=.s}
+		$(POST_PROCESS_O)
 
 md5_amd64.s: $(COMDIR)/md5/amd64/md5_amd64.pl
-	$(PERL) $? $@
+		$(PERL) $? $@
 
 sha1-x86_64.s: $(COMDIR)/sha1/amd64/sha1-x86_64.pl
-	$(PERL) $? $@
+		$(PERL) $? $@
 
 sha512-x86_64.s: $(COMDIR)/sha2/amd64/sha512-x86_64.pl
-	$(PERL) $? $@
+		$(PERL) $? $@
 
 sha256-x86_64.s: $(COMDIR)/sha2/amd64/sha512-x86_64.pl
-	$(PERL) $? $@
+		$(PERL) $? $@
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+# Each target directory is responsible for making a symbol capabilities object.
+$(SPARC_BLD)SUBDIRS =	sun4u sun4v
+$(INTEL_BLD)SUBDIRS =
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#include		../../../Makefile.com
+
+MAPFILE-CAP =	../common/mapfile-cap
+MAPOPT-CAP =	$(MAPFILE-CAP:%=-M%)
+
+OBJCAP =	pics/objcap.o
+SYMCAP =	pics/symcap.o
+
+CLOBBERFILES +=	$(OBJCAP) $(SYMCAP)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,71 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# libmd provides two families of optimized functions for SPARC platforms,
+# one for sun4u, and one for sun4v.  Previous implementations provided
+# these families as libmd_psr.so.1 libraries, triggered by tagging libmd.so.1
+# as an auxiliary filter.  These psr filtees were installed under
+# /usr/platform/sun4u/lib, and numerous symlinks were established to provide
+# the necessary $PLATFORM names, ie:
+#
+#  /usr/platform/SUNW,Ultra-2/lib/libmd_psr.so.1 -> ../../../sun4u
+#  /usr/platform/SUNW,Ultra-4/lib/libmd_psr.so.1 -> ../../../sun4u
+#  ....
+#
+# and:
+#
+#  /usr/platform/SUNW,Netra-CP3060/lib/libmd_psr.so.1 -> ../../sun4v
+#  /usr/platform/SUNW,Netra-CP3260/lib/libmd_psr.so.1 -> ../../sun4v/
+#  ....
+#
+# The objects that made up these filtees are now combined into one relocatable
+# object, pics/objcap.o, using ../common/mapfile-cap.  This mapfile identifies
+# the machine hardware name, together with establishing the global symbols that
+# should be exported to define each family.
+#
+# This object capabilities relocatable object is then translated into a symbol
+# capabilities relocatable object, pics/symcap.o.
+#
+# The sun4u and sun4v families of symbol capabilities object are eventually
+# included in the final build of libmd.so.1.
+
+$(SYMCAP):	$(OBJCAP)
+$(OBJCAP):	$(PICS)
+$(PICS):	pics
+
+# Combine all pic objects into one relocatable object.  Assign any capabilities
+# to this object, and define the interface.
+
+pics/objcap.o:	$(PICS) $(MAPFILE-CAP)
+		$(LD) -r -o $@ $(MAPOPT-CAP) -Breduce $(PICS)
+
+# Convert the combined object capabilities object into a symbol capabilities
+# object.
+
+pics/symcap.o:	$(OBJCAP)
+		$(LD) -r -o $@ -z symbolcap $(OBJCAP)
+
+include		../../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,39 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =	sun4u
+
+include		../../Makefile.com
+
+OBJECTS =	md5.o sha1.o sha1_asm.o
+
+include		$(SRC)/lib/Makefile.lib
+
+INLINES =	$(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS +=	$(AS_PICFLAGS) -P
+CFLAGS +=	$(CCVERBOSE) -xarch=sparcvis
+CPPFLAGS +=	-D$(PLATFORM) -DVIS_SHA1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,25 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u {
+	MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+	global:
+		MD5Init;
+		MD5Update;
+		MD5Final;
+		SHA1Init;
+		SHA1Update;
+		SHA1Final;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusa -warn
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4u/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9a
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,38 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =	sun4v
+
+include		../../Makefile.com
+
+OBJECTS =	md5.o
+
+include		$(SRC)/lib/Makefile.lib
+
+INLINES =	$(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS +=	$(AS_PICFLAGS) -P
+CFLAGS +=	$(CCVERBOSE) -xarch=sparcvis
+CPPFLAGS +=	-D$(PLATFORM)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,25 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v {
+	MACHINE = sun4v;
+};
+
+SYMBOL_SCOPE {
+	global:
+		MD5Init;
+                MD5Update;
+                MD5Final;
+        local:
+                *;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plusa -warn
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/libmd/capabilities/sun4v/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,36 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+AS_CPPFLAGS +=	-D__sparcv9
+ASFLAGS +=	-xarch=v9a
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- a/usr/src/lib/libmd/i386/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/i386/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,14 +18,26 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+
+LIBRARY =	libmd.a
+VERS =		.1
+
+OBJECTS =	md4.o md5.o sha1.o sha2.o
 
-LIBRARY= libmd.a
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.rootfs
+include		../Makefile.com
+
+.KEEP_STATE:
 
-include ../Makefile.com
+all:		$(LIBS)
+
+install:	all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
 
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+lint:		lintcheck
+
+include		../Makefile.targ
--- a/usr/src/lib/libmd/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,15 +18,29 @@
 #
 # CDDL HEADER END
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+#
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+
+LIBRARY =	libmd.a
+VERS =		.1
+
+OBJECTS =	md4.o md5.o sha1.o sha2.o
+
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.rootfs
+include		../Makefile.com
 
-LIBRARY= libmd.a
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS =	../capabilities/sun4u/sparc/pics/symcap.o \
+		../capabilities/sun4v/sparc/pics/symcap.o
 
-include ../Makefile.com
+.KEEP_STATE:
 
-DYNFLAGS += -Wl,-f/platform/\$$PLATFORM/lib/$(DYNLIBPSR)
+all:		$(LIBS)
+
+install:	all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
 
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+lint:		lintcheck
+
+include		../Makefile.targ
--- a/usr/src/lib/libmd/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/libmd/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,16 +18,30 @@
 #
 # CDDL HEADER END
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+#
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+
+LIBRARY =	libmd.a
+VERS =		.1
 
-LIBRARY= libmd.a
+OBJECTS =	md4.o md5.o sha1.o sha2.o
+
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.rootfs
+include		$(SRC)/lib/Makefile.lib.64
+include		../Makefile.com
 
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS = 	../capabilities/sun4u/sparcv9/pics/symcap.o \
+		../capabilities/sun4v/sparcv9/pics/symcap.o
+
+.KEEP_STATE:
 
-DYNFLAGS += -Wl,-f/platform/\$$PLATFORM/lib/$(MACH64)/$(DYNLIBPSR)
+all:		$(LIBS)
+
+install:	all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
 
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+lint:		lintcheck
+
+include		../Makefile.targ
--- a/usr/src/lib/libmd/sun4u/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-
-include $(SRC)/Makefile.master
-
-SUBDIRS= $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-all :=		TARGET= all
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-lint :=		TARGET= lint
-install :=	TARGET= install
-
-.KEEP_STATE:
-
-.PARALLEL: $(MACH) $(MACH64)
-
-all clean clobber lint install: $(SUBDIRS)
-
-$(MACH) $(MACH64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libmd/sun4u/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-LIBRARY= libmd_psr.a
-
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
-
-LIBS= $(DYNLIB)
-
-CFLAGS += -m32 -xarch=sparcvis
-CPPFLAGS += -D$(PLATFORM) -DVIS_SHA1
-ASFLAGS	= -P $(ASDEFS)
-
-INLINES= $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
-
-# XXX This seems wrong since we explicitly set LIBS to be DYNLIB only
-$(LINTLIB):= SRCS= ../../common/llib-lmd
--- a/usr/src/lib/libmd/sun4u/Makefile.links	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libmd/Makefile.sun4u.links
-#
-#
-# Used when building links in /platform/sun4u/lib 
-#
-LINKED_PLATFORMS	= SUNW,Ultra-2
-LINKED_PLATFORMS	+= SUNW,Ultra-4
-LINKED_PLATFORMS	+= SUNW,Ultra-5_10
-LINKED_PLATFORMS	+= SUNW,Ultra-30
-LINKED_PLATFORMS	+= SUNW,Ultra-60
-LINKED_PLATFORMS	+= SUNW,Ultra-80
-LINKED_PLATFORMS	+= SUNW,Ultra-250
-LINKED_PLATFORMS	+= SUNW,Ultra-Enterprise
-LINKED_PLATFORMS	+= SUNW,Ultra-Enterprise-10000
-LINKED_PLATFORMS	+= SUNW,UltraAX-i2
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIi-Netract
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIe-NetraCT-40
-LINKED_PLATFORMS	+= SUNW,UltraSPARC-IIe-NetraCT-60
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-100
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-1000
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-1500
-LINKED_PLATFORMS	+= SUNW,Sun-Blade-2500
-LINKED_PLATFORMS	+= SUNW,A70
-LINKED_PLATFORMS	+= SUNW,Sun-Fire
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V215
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V240
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V250
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V440
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-V445
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-280R
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-15000
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-880
-LINKED_PLATFORMS	+= SUNW,Sun-Fire-480R
-LINKED_PLATFORMS	+= SUNW,Serverblade1
-LINKED_PLATFORMS	+= SUNW,Netra-T12
-LINKED_PLATFORMS	+= SUNW,Netra-T4
-LINKED_PLATFORMS	+= SUNW,Netra-CP2300
-LINKED_PLATFORMS	+= SUNW,Netra-CP3010
--- a/usr/src/lib/libmd/sun4u/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-CLASS		= 32
-PLATFORM	= sun4u
-MODULE		= libmd_psr.so.1
-
-include	../Makefile.com
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS		= md5.o sha1.o sha1_asm.o
-
-MAPFILES =	mapfile
-
-ASFLAGS	+=	-xarch=v8plusa -warn
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all:		$(LIBS)
-
-$(ROOT_PSM_LIB_DIR)/% := FILEMODE = 755
-
-install:	all $(LIBMD_PSR_LINKS) $(ROOT_PSM_LIBS)
-
-include $(SRC)/Makefile.psm.targ
--- a/usr/src/lib/libmd/sun4u/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS		= 64
-PLATFORM	= sun4u
-MODULE		= libmd_psr.so.1
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS		= md5.o sha1.o sha1_asm.o
-
-MAPFILES =	mapfile
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS +=	-xarch=v9a $(AS_BIGPICFLAGS)
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all:		$(LIBS)
-
-$(ROOT_PSM_LIB64_DIR)/% := FILEMODE = 755
-
-install:	all $(LIBMD_PSR64_LINKS) $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ
--- a/usr/src/lib/libmd/sun4v/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-
-include $(SRC)/Makefile.master
-
-SUBDIRS= $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-all :=		TARGET= all
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-lint :=		TARGET= lint
-install :=	TARGET= install
-
-.KEEP_STATE:
-
-.PARALLEL: $(MACH) $(MACH64)
-
-all clean clobber lint install: $(SUBDIRS)
-
-$(MACH) $(MACH64): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/libmd/sun4v/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-LIBRARY= libmd_psr.a
-
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
-
-LIBS= $(DYNLIB)
-
-CFLAGS += -m32 -xarch=sparcvis
-CPPFLAGS += -D$(PLATFORM)
-ASFLAGS	= -P $(ASDEFS)
-
-INLINES= $(COMDIR)/md5/$(MACH)/$(PLATFORM)/byteswap.il
-
-# XXX This seems wrong since we explicitly set LIBS to be DYNLIB only
-$(LINTLIB):= SRCS= ../../common/llib-lmd
--- a/usr/src/lib/libmd/sun4v/Makefile.links	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libmd/Makefile.sun4v.links
-#
-#
-# Used when building links in /platform/sun4v/lib 
-#
-LINKED_PLATFORMS	= SUNW,Sun-Fire-T200
--- a/usr/src/lib/libmd/sun4v/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS		= 32
-PLATFORM	= sun4v
-MODULE		= libmd_psr.so.1
-
-include ../Makefile.com
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS		= md5.o
-
-MAPFILES =	mapfile
-
-ASFLAGS	+=	-xarch=v8plusa -warn
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all:		$(LIBS)
-
-$(ROOT_PSM_LIB_DIR)/% := FILEMODE = 755
-
-install:	all $(ROOT_PSM_LIB_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ
--- a/usr/src/lib/libmd/sun4v/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-CLASS		= 64
-PLATFORM	= sun4v
-MODULE		= libmd_psr.so.1
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# Override OBJECTS here because each $MACH/$PLATFORM can have a different
-# set of algortithm optimisations and thus different source and object files.
-OBJECTS		= md5.o
-
-MAPFILES =	mapfile
-
-ASDEFS +=	-D__sparcv9
-ASFLAGS +=	-xarch=v9a $(AS_PICFLAGS)
-
-# Redefine shared object build rule to use $(LD) directly (this avoids .init
-# and .fini sections being added).
- 
-BUILD.SO=	$(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(LDLIBS)
-
-.KEEP_STATE:
-
-all:		$(LIBS)
-
-$(ROOT_PSM_LIB64_DIR)/% := FILEMODE = 755
-
-install:	all $(ROOT_PSM_LIB64_DIR)/$(LIBS)
-
-include $(SRC)/Makefile.psm.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,38 +18,35 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libsoftcrypto/Makefile
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-include $(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.lib
 
-$(SPARC_BLD)PLATFORMS = sun4u sun4v
-$(INTEL_BLD)PLATFORMS = i386_hwcap1
-
-SUBDIRS = $(MACH) $(MACH64) $(PLATFORMS)
+CAPDIR =	capabilities
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64) $(PLATFORMS)
 
 all :=		TARGET= all
-check :=	TARGET= check
 clean :=	TARGET= clean
 clobber :=	TARGET= clobber
 install :=	TARGET= install
 lint :=		TARGET= lint
 
+.KEEP_STATE:
 
-.PARALLEL: $(SUBDIRS)
+.PARALLEL:	$(SUBDIRS)
 
-all check clean clobber install lint: $(SUBDIRS)
+all clean clobber install lint: \
+		$(CAPDIR) .WAIT $(SUBDIRS)
 
-install_h:      $(ROOTHDRS)
+install_h:	$(ROOTHDRS)
 
-check:          $(CHECKHDRS)
+check:		$(CHECKHDRS)
 
-
-$(SUBDIRS): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
+$(CAPDIR) \
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
 
 FRC:
--- a/usr/src/lib/pkcs11/libsoftcrypto/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -23,212 +23,99 @@
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-#
-# lib/pkcs11/libsoftcrypto/Makefile.com
-#
-
 # AES
-AES_DIR= $(SRC)/common/crypto/aes
-AES_COMMON_OBJS= aes_impl.o aes_modes.o
-AES_COMMON_SRC= $(AES_COMMON_OBJS:%.o=$(AES_DIR)/%.c)
-AES_FLAGS= -I$(AES_DIR)
+AES_DIR =		$(SRC)/common/crypto/aes
+AES_COMMON_OBJS =	aes_impl.o aes_modes.o
+AES_COMMON_SRC =	$(AES_COMMON_OBJS:%.o=$(AES_DIR)/%.c)
+AES_FLAGS =		-I$(AES_DIR)
 
 # Blowfish
-BLOWFISH_DIR= $(SRC)/common/crypto/blowfish
-BLOWFISH_COMMON_OBJS= blowfish_impl.o
-BLOWFISH_COMMON_SRC= $(BLOWFISH_COMMON_OBJS:%.o=$(BLOWFISH_DIR)/%.c)
-BLOWFISH_FLAGS= -I$(BLOWFISH_DIR)
+BLOWFISH_DIR =		$(SRC)/common/crypto/blowfish
+BLOWFISH_COMMON_OBJS =	blowfish_impl.o
+BLOWFISH_COMMON_SRC =	$(BLOWFISH_COMMON_OBJS:%.o=$(BLOWFISH_DIR)/%.c)
+BLOWFISH_FLAGS =	-I$(BLOWFISH_DIR)
 
 # ARCFour
-ARCFOUR_DIR= $(SRC)/common/crypto/arcfour
-ARCFOUR_COMMON_OBJS= arcfour_crypt.o
-ARCFOUR_COMMON_SRC= $(ARCFOUR_COMMON_OBJS:%.o=$(ARCFOUR_DIR)/%.c)
-ARCFOUR_FLAGS= -I$(ARCFOUR_DIR)
+ARCFOUR_DIR =		$(SRC)/common/crypto/arcfour
+ARCFOUR_COMMON_OBJS =	arcfour_crypt.o
+ARCFOUR_COMMON_SRC =	$(ARCFOUR_COMMON_OBJS:%.o=$(ARCFOUR_DIR)/%.c)
+ARCFOUR_FLAGS =		-I$(ARCFOUR_DIR)
 
 # DES
-DES_DIR= $(SRC)/common/crypto/des
-DES_COMMON_OBJS= des_impl.o des_ks.o
-DES_COMMON_SRC= $(DES_COMMON_OBJS:%.o=$(DES_DIR)/%.c)
-DES_FLAGS= -I$(DES_DIR)
+DES_DIR =		$(SRC)/common/crypto/des
+DES_COMMON_OBJS =	des_impl.o des_ks.o
+DES_COMMON_SRC =	$(DES_COMMON_OBJS:%.o=$(DES_DIR)/%.c)
+DES_FLAGS =		-I$(DES_DIR)
 
 # BIGNUM -- needed by DH, DSA, RSA
-BIGNUM_DIR= $(SRC)/common/bignum
-BIGNUM_COMMON_OBJS= bignumimpl.o
-BIGNUM_COMMON_SRC= $(BIGNUM_COMMON_OBJS:%.o=$(BIGNUM_DIR)/%.c)
-BIGNUM_FLAGS= -I$(BIGNUM_DIR)
+BIGNUM_DIR =		$(SRC)/common/bignum
+BIGNUM_COMMON_OBJS =	bignumimpl.o
+BIGNUM_COMMON_SRC =	$(BIGNUM_COMMON_OBJS:%.o=$(BIGNUM_DIR)/%.c)
+BIGNUM_FLAGS =		-I$(BIGNUM_DIR)
 
 # Modes
-MODES_DIR= $(SRC)/common/crypto/modes
-MODES_COMMON_OBJS= modes.o ecb.o cbc.o ctr.o
-MODES_COMMON_SRC= $(MODES_COMMON_OBJS:%.o=$(MODES_DIR)/%.c)
-MODES_FLAGS= -I$(MODES_DIR)
+MODES_DIR =		$(SRC)/common/crypto/modes
+MODES_COMMON_OBJS =	modes.o ecb.o cbc.o ctr.o
+MODES_COMMON_SRC =	$(MODES_COMMON_OBJS:%.o=$(MODES_DIR)/%.c)
+MODES_FLAGS =		-I$(MODES_DIR)
 
 # DH
-DH_DIR= $(SRC)/common/crypto/dh
-DH_COMMON_OBJS= dh_impl.o
-DH_COMMON_SRC= $(DH_COMMON_OBJS:%.o=$(DH_DIR)/%.c)
-DH_FLAGS= $(BIGNUM_FLAGS) -I$(DH_DIR)
+DH_DIR =		$(SRC)/common/crypto/dh
+DH_COMMON_OBJS =	dh_impl.o
+DH_COMMON_SRC =		$(DH_COMMON_OBJS:%.o=$(DH_DIR)/%.c)
+DH_FLAGS =		$(BIGNUM_FLAGS) -I$(DH_DIR)
 
 # DSA
-DSA_DIR= $(SRC)/common/crypto/dsa
-DSA_COMMON_OBJS= dsa_impl.o
-DSA_COMMON_SRC= $(DSA_COMMON_OBJS:%.o=$(DSA_DIR)/%.c)
-DSA_FLAGS= $(BIGNUM_FLAGS) -I$(DSA_DIR)
+DSA_DIR =		$(SRC)/common/crypto/dsa
+DSA_COMMON_OBJS =	dsa_impl.o
+DSA_COMMON_SRC =	$(DSA_COMMON_OBJS:%.o=$(DSA_DIR)/%.c)
+DSA_FLAGS =		$(BIGNUM_FLAGS) -I$(DSA_DIR)
 
 # RSA
-RSA_DIR= $(SRC)/common/crypto/rsa
-RSA_COMMON_OBJS= rsa_impl.o
-RSA_COMMON_SRC= $(RSA_COMMON_OBJS:%.o=$(RSA_DIR)/%.c)
-RSA_FLAGS= $(BIGNUM_FLAGS) -I$(RSA_DIR)
+RSA_DIR =		$(SRC)/common/crypto/rsa
+RSA_COMMON_OBJS =	rsa_impl.o
+RSA_COMMON_SRC =	$(RSA_COMMON_OBJS:%.o=$(RSA_DIR)/%.c)
+RSA_FLAGS =		$(BIGNUM_FLAGS) -I$(RSA_DIR)
 
 # PADDING -- needed by RSA
-PAD_DIR= $(SRC)/common/crypto/padding
-PAD_COMMON_OBJS= pkcs1.o pkcs7.o
-PAD_COMMON_SRC= $(PAD_COMMON_OBJS:%.o=$(PAD_DIR)/%.c)
-PAD_FLAGS= -I$(PAD_DIR)
+PAD_DIR =		$(SRC)/common/crypto/padding
+PAD_COMMON_OBJS =	pkcs1.o pkcs7.o
+PAD_COMMON_SRC =	$(PAD_COMMON_OBJS:%.o=$(PAD_DIR)/%.c)
+PAD_FLAGS =		-I$(PAD_DIR)
 
 # Object setup
-AES_OBJS= $(AES_COMMON_OBJS) $(AES_PSM_OBJS)
-ARCFOUR_OBJS= $(ARCFOUR_COMMON_OBJS) $(ARCFOUR_PSM_OBJS)
-BLOWFISH_OBJS= $(BLOWFISH_COMMON_OBJS) $(BLOWFISH_PSM_OBJS)
-DES_OBJS= $(DES_COMMON_OBJS) $(DES_PSM_OBJS)
-BIGNUM_OBJS= $(BIGNUM_COMMON_OBJS) $(BIGNUM_PSM_OBJS)
-MODES_OBJS= $(MODES_COMMON_OBJS) $(MODES_PSM_OBJS)
-DH_OBJS= $(DH_COMMON_OBJS) $(DH_PSM_OBJS)
-DSA_OBJS= $(DSA_COMMON_OBJS) $(DSA_PSM_OBJS)
-RSA_OBJS= $(RSA_COMMON_OBJS) $(RSA_PSM_OBJS)
-PAD_OBJS= $(PAD_COMMON_OBJS) $(PAD_PSM_OBJS)
+AES_OBJS =		$(AES_COMMON_OBJS)	$(AES_PSM_OBJS)
+ARCFOUR_OBJS =		$(ARCFOUR_COMMON_OBJS)	$(ARCFOUR_PSM_OBJS)
+BLOWFISH_OBJS =		$(BLOWFISH_COMMON_OBJS)	$(BLOWFISH_PSM_OBJS)
+DES_OBJS =		$(DES_COMMON_OBJS)	$(DES_PSM_OBJS)
+BIGNUM_OBJS =		$(BIGNUM_COMMON_OBJS)	$(BIGNUM_PSM_OBJS)
+MODES_OBJS =		$(MODES_COMMON_OBJS)	$(MODES_PSM_OBJS)
+DH_OBJS =		$(DH_COMMON_OBJS)	$(DH_PSM_OBJS)
+DSA_OBJS =		$(DSA_COMMON_OBJS)	$(DSA_PSM_OBJS)
+RSA_OBJS =		$(RSA_COMMON_OBJS)	$(RSA_PSM_OBJS)
+PAD_OBJS =		$(PAD_COMMON_OBJS)	$(PAD_PSM_OBJS)
 
-OBJECTS= $(AES_OBJS) $(ARCFOUR_OBJS) $(BIGNUM_OBJS) $(BLOWFISH_OBJS) \
-	$(DES_OBJS) $(MODES_OBJS) $(DH_OBJS) $(DSA_OBJS) \
-	$(RSA_OBJS) $(PAD_OBJS)
-
-include $(SRC)/lib/Makefile.lib
+OBJECTS =		$(AES_OBJS) $(ARCFOUR_OBJS) $(BIGNUM_OBJS) \
+			$(BLOWFISH_OBJS) $(DES_OBJS) $(MODES_OBJS) $(DH_OBJS) \
+			$(DSA_OBJS) $(RSA_OBJS) $(PAD_OBJS)
 
 # Source file setup
-AES_SRC= $(AES_COMMON_SRC) $(AES_PSM_SRC)
-ARCFOUR_SRC= $(ARCFOUR_COMMON_SRC) $(ARCFOUR_PSM_SRC)
-BLOWFISH_SRC= $(BLOWFISH_COMMON_SRC) $(BLOWFISH_PSM_SRC)
-DES_SRC= $(DES_COMMON_SRC) $(DES_PSM_SRC)
-BIGNUM_SRC= $(BIGNUM_COMMON_SRC) $(BIGNUM_PSM_SRC)
-MODES_SRC= $(MODES_COMMON_SRC) $(MODES_PSM_SRC)
-DH_SRC= $(DH_COMMON_SRC) $(DH_PSM_SRC)
-DSA_SRC= $(DSA_COMMON_SRC) $(DSA_PSM_SRC)
-RSA_SRC= $(RSA_COMMON_SRC) $(RSA_PSM_SRC)
-PAD_SRC= $(PAD_COMMON_SRC) $(PAD_PSM_SRC)
-
-SRCS=	$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) $(DES_SRC) \
-	$(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
-	$(PAD_SRC)
-
-# Do not lint ECC and MPI
-LINTABLE= \
-	$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) $(DES_SRC) \
-	$(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) $(PAD_SRC)
-
-#
-# Compiler settings
-#
-
-SRCDIR=	$(SRC)/lib/pkcs11/libsoftcrypto/common/
-CRYPTODIR= $(SRC)/common/crypto/
-UTSDIR= $(SRC)/uts/common/
-ROOTLIBDIR= $(ROOT)/usr/lib
-ROOTLIBDIR64= $(ROOT)/usr/lib/$(MACH64)
-ROOTHWCAPDIR= $(ROOTLIBDIR)/libsoftcrypto
-
-# $(LINTLIB) is not included here;  i386_hwcap1/Makefile does not make
-# a lint library, so each of the other platform-specific Makefiles adds
-# the lint library target individually
-LIBS = $(DYNLIB)
-LDLIBS += -lc
-
-CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
-CPPFLAGS += -I$(SRCDIR) -I$(CRYPTODIR) -I$(UTSDIR) \
-	$(BIGNUM_FLAGS) \
-	-D_POSIX_PTHREAD_SEMANTICS
-ASFLAGS = $(AS_PICFLAGS) -P -D__STDC__ -D_ASM
-EXTRA_LINT_FLAGS = \
-	$(AES_FLAGS) $(BLOWFISH_FLAGS) $(ARCFOUR_FLAGS) $(DES_FLAGS) \
-	$(BIGNUM_FLAGS) $(MODES_FLAGS) $(DH_FLAGS) $(DSA_FLAGS) \
-	$(RSA_FLAGS) $(PAD_FLAGS)
-LINTFLAGS += $(EXTRA_LINT_FLAGS)
-LINTFLAGS64 += $(EXTRA_LINT_FLAGS) -errchk=longptr64
-
-LINTLIB=	llib-l$(LIBNAME).ln
-$(LINTLIB)	:= 	SRCS = $(LINTABLE)
-lintcheck	:=	SRCS = $(LINTABLE)
-
-all:	$(LIBS)
-
-lint:	lintcheck
-
-pics/%.o:	$(AES_DIR)/%.c
-	$(COMPILE.c) $(AES_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+AES_SRC =		$(AES_COMMON_SRC)	$(AES_PSM_SRC)
+ARCFOUR_SRC =		$(ARCFOUR_COMMON_SRC)	$(ARCFOUR_PSM_SRC)
+BLOWFISH_SRC =		$(BLOWFISH_COMMON_SRC)	$(BLOWFISH_PSM_SRC)
+DES_SRC =		$(DES_COMMON_SRC)	$(DES_PSM_SRC)
+BIGNUM_SRC =		$(BIGNUM_COMMON_SRC)	$(BIGNUM_PSM_SRC)
+MODES_SRC =		$(MODES_COMMON_SRC)	$(MODES_PSM_SRC)
+DH_SRC =		$(DH_COMMON_SRC)	$(DH_PSM_SRC)
+DSA_SRC =		$(DSA_COMMON_SRC)	$(DSA_PSM_SRC)
+RSA_SRC =		$(RSA_COMMON_SRC)	$(RSA_PSM_SRC)
+PAD_SRC =		$(PAD_COMMON_SRC)	$(PAD_PSM_SRC)
 
-pics/%.o:	$(ARCFOUR_DIR)/%.c
-	$(COMPILE.c) $(ARCFOUR_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(BIGNUM_DIR)/%.c
-	$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(BLOWFISH_DIR)/%.c
-	$(COMPILE.c) $(BLOWFISH_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(DES_DIR)/%.c
-	$(COMPILE.c) $(DES_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(MODES_DIR)/%.c
-	$(COMPILE.c) $(MODES_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(DH_DIR)/%.c
-	$(COMPILE.c) $(DH_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(DSA_DIR)/%.c
-	$(COMPILE.c) $(DSA_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-pics/%.o:	$(RSA_DIR)/%.c
-	$(COMPILE.c) $(RSA_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+# Header include directories
+CRYPTODIR =		$(SRC)/common/crypto
+UTSDIR =		$(SRC)/uts/common/
 
-pics/%.o:	$(PAD_DIR)/%.c
-	$(COMPILE.c) $(PAD_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
-
-#
-# Platform-specific targets
-#
-
-
-SOFT_PSR_DIRS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib)
-SOFT_PSR_LINKS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/$(MODULE))
-
-SOFT_PSR64_DIRS = $(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/$(MACH64))
-SOFT_PSR64_LINKS = \
-	$(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%/lib/$(MACH64)/$(MODULE))
-
-INS.slink6 = $(RM) -r $@; \
-	$(SYMLINK) ../../$(PLATFORM)/lib/$(MODULE) $@
-INS.slink64 = $(RM) -r $@; \
-	$(SYMLINK) ../../../$(PLATFORM)/lib/$(MACH64)/$(MODULE) $@
-
-$(SOFT_PSR_DIRS) \
-$(SOFT_PSR64_DIRS):
-	-$(INS.dir)
-
-$(SOFT_PSR_LINKS): $(SOFT_PSR_DIRS)
-	-$(INS.slink6)
-
-$(SOFT_PSR64_LINKS): $(SOFT_PSR64_DIRS)
-	-$(INS.slink64)
-
-
-include $(SRC)/lib/Makefile.targ
+# Lint
+EXTRA_LINT_FLAGS =	$(AES_FLAGS) $(BLOWFISH_FLAGS) $(ARCFOUR_FLAGS) \
+			$(DES_FLAGS) $(BIGNUM_FLAGS) $(MODES_FLAGS) \
+			$(DH_FLAGS) $(DSA_FLAGS) $(RSA_FLAGS) $(PAD_FLAGS)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,73 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+AES_DIR =	$(SRC)/common/crypto/aes
+ARCFOUR_DIR =	$(SRC)/common/crypto/arcfour
+BIGNUM_DIR =	$(SRC)/common/bignum
+BLOWFISH_DIR =	$(SRC)/common/crypto/blowfish
+DES_DIR =	$(SRC)/common/crypto/des
+MODES_DIR =	$(SRC)/common/crypto/modes
+
+pics/%.o: $(AES_DIR)/%.c
+		$(COMPILE.c) $(AES_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(ARCFOUR_DIR)/%.c
+		$(COMPILE.c) $(ARCFOUR_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(BIGNUM_DIR)/%.c
+		$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(BLOWFISH_DIR)/%.c
+		$(COMPILE.c) $(BLOWFISH_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(DES_DIR)/%.c
+		$(COMPILE.c) $(DES_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(MODES_DIR)/%.c
+		$(COMPILE.c) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(DH_DIR)/%.c
+		$(COMPILE.c) $(DH_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(DSA_DIR)/%.c
+		$(COMPILE.c) $(DSA_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(RSA_DIR)/%.c
+		$(COMPILE.c) $(RSA_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(PAD_DIR)/%.c
+		$(COMPILE.c) $(PAD_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+include		$(SRC)/lib/Makefile.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -23,56 +23,72 @@
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-#
-# lib/pkcs11/libsoftcrypto/amd64/Makefile
-#
+LIBRARY =	libsoftcrypto.a
+VERS =		.1
 
-LIBRARY=	libsoftcrypto.a
-VERS= .1
+include		../Makefile.com
+
+AES_PSM_OBJS = 	aes_amd64.o aes_intel.o aeskey.o
+ARCFOUR_PSM_OBJS = arcfour-x86_64.o
+BIGNUM_PSM_OBJS = bignum_amd64.o bignum_amd64_asm.o
 
-AES_PSM_OBJS= aes_amd64.o aes_intel.o aeskey.o
-AES_PSM_SRC= $(AES_DIR)/$(MACH64)/aes_amd64.s $(AES_DIR)/$(MACH64)/aes_intel.s \
-		$(AES_DIR)/$(MACH64)/aeskey.c
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.lib.64
 
-ARCFOUR_PSM_OBJS= arcfour-x86_64.o
-ARCFOUR_PSM_SRC= arcfour-x86_64.s
-
-BIGNUM_PSM_OBJS= bignum_amd64.o bignum_amd64_asm.o
-BIGNUM_PSM_SRC= $(BIGNUM_DIR)/$(MACH64)/bignum_amd64.c \
+AES_PSM_SRC =	$(AES_DIR)/$(MACH64)/aes_amd64.s \
+		$(AES_DIR)/$(MACH64)/aes_intel.s \
+		$(AES_DIR)/$(MACH64)/aeskey.c
+ARCFOUR_PSM_SRC = arcfour-x86_64.s
+BIGNUM_PSM_SRC = $(BIGNUM_DIR)/$(MACH64)/bignum_amd64.c \
 		$(BIGNUM_DIR)/$(MACH64)/bignum_amd64_asm.s
 
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+# Sources need to be redefined after Makefile.lib inclusion.
+SRCS =		$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \
+		$(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
+		$(PAD_SRC)
 
-CFLAGS		+= -xO4 -xcrossfile
-BIGNUM_FLAGS	+= -DPSR_MUL
-LINTFLAGS64	+= $(BIGNUM_FLAGS) $(AES_FLAGS) $(ARCFOUR_FLAGS)
-CLEANFILES	+= arcfour-x86_64.s
+SRCDIR =	$(SRC)/lib/pkcs11/libsoftcrypto/common
+
+LIBS =		$(DYNLIB) $(LINTLIB)
+MAPFILEDIR =	../common
 
-LDLIBS += -lcryptoutil
-LIBS += $(LINTLIB)
+CFLAGS +=	-xO4 -xcrossfile
+CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
+ASFLAGS +=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM
+BIGNUM_FLAGS +=	-DPSR_MUL
+CLEANFILES +=	arcfour-x86_64.s
+LDLIBS +=	-lcryptoutil -lc
+LINTFLAGS64 +=	$(EXTRA_LINT_FLAGS)
 
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+.KEEP_STATE:
 
-arcfour-x86_64.s:	$(ARCFOUR_DIR)/amd64/arcfour-x86_64.pl
-	$(PERL) $? $@
+all:		$(LIBS)
+
+lint:		$(SRCS)
 
-pics/%.o:	$(AES_DIR)/$(MACH64)/%.c
-	$(COMPILE.c) $(AES_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+install:	all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
 
-pics/%.o:	$(AES_DIR)/$(MACH64)/%.s
-	$(COMPILE.s) $(AES_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+pics/%.o: $(AES_DIR)/$(MACH64)/%.c
+		$(COMPILE.c) $(AES_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(AES_DIR)/$(MACH64)/%.s
+		$(COMPILE.s) $(AES_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
 
-pics/%.o:	$(BIGNUM_DIR)/$(MACH64)/%.c
-	$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+pics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.c
+		$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
+
+pics/%.o: $(BIGNUM_DIR)/$(MACH64)/%.s
+		$(COMPILE64.s) $(BIGNUM_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
 
-pics/%.o:	$(BIGNUM_DIR)/$(MACH64)/%.s
-	$(COMPILE64.s) $(BIGNUM_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+include		../Makefile.targ
 
-pics/%.o:	arcfour-x86_64.s
-	$(COMPILE64.s) $(ARCFOUR_FLAGS) -o $@ $<
-	$(POST_PROCESS_O)
+arcfour-x86_64.s: $(ARCFOUR_DIR)/amd64/arcfour-x86_64.pl
+		$(PERL) $? $@
+
+pics/%.o: arcfour-x86_64.s
+		$(COMPILE64.s) $(ARCFOUR_FLAGS) -o $@ $<
+		$(POST_PROCESS_O)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+# Each target directory is responsible for making a symbol capabilities object.
+$(SPARC_BLD)SUBDIRS =	sun4u sun4v
+$(INTEL_BLD)SUBDIRS =	intel
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,34 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../../../Makefile.com
+
+MAPFILE-CAP =	../common/mapfile-cap
+MAPOPT-CAP =	$(MAPFILE-CAP:%=-M%)
+
+OBJCAP =	pics/objcap.o
+SYMCAP =	pics/symcap.o
+
+CLOBBERFILES +=	$(OBJCAP) $(SYMCAP)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,71 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# libsoftcrypto provides two families of optimized functions for SPARC
+# platforms, one for sun4u, and one for sun4v.  Previous implementations
+# provided these families as libsoftcrypto_psr.so.1 libraries, triggered
+# by tagging libsoftcrypto.so.1 as an auxiliary filter.  These psr filtees
+# were installed under /usr/platform/sun4u/lib, and numerous symlinks were
+# established to provide the necessary $PLATFORM names, ie:
+#
+#  /usr/platform/SUNW,Ultra-2/lib/libsoftcrypto_psr.so.1 -> ../../../sun4u
+#  /usr/platform/SUNW,Ultra-4/lib/libsoftcrypto_psr.so.1 -> ../../../sun4u
+#  ....
+#
+# and:
+#
+#  /usr/platform/SUNW,Netra-CP3060/lib/libsoftcrypto_psr.so.1 -> ../../sun4v
+#  /usr/platform/SUNW,Netra-CP3260/lib/libsoftcrypto_psr.so.1 -> ../../sun4v/
+#  ....
+#
+# The objects that made up these filtees are now combined into one relocatable
+# object, pics/objcap.o, using ../common/mapfile-cap.  This mapfile identifies
+# the machine hardware name, together with establishing the global symbols that
+# should be exported to define each family.
+#
+# This object capabilities relocatable object is then translated into a symbol
+# capabilities relocatable object, pics/symcap.o.
+#
+# The sun4u and sun4v families of symbol capabilities object are eventually
+# included in the final build of libsoftcrypto.so.1.
+
+$(SYMCAP):	$(OBJCAP)
+$(OBJCAP):	$(PICS)
+$(PICS):	pics
+
+# Combine all pic objects into one relocatable object.  Assign any capabilities
+# to this object, and define the interface.
+
+pics/objcap.o:	$(PICS) $(MAPFILE-CAP)
+		$(LD) -r -o $@ $(MAPOPT-CAP) -Breduce $(PICS)
+
+# Convert the combined object capabilities object into a symbol capabilities
+# object.
+
+pics/symcap.o:	$(OBJCAP)
+		$(LD) -r -o $@ -z symbolcap $(OBJCAP)
+
+include		../../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,56 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+# The only file that contains capabilities symbols is bignum_i386_asm.o,
+# however this is a dependency of bignum_i386.o, which in turn is a dependency
+# of pics/bignumimpl.o.  Only the last object exports any interfaces, hence
+# we compile, and combine all three.  The resulting object is identified as a
+# whole with the bignum_i386_asm.o capabilities flags.
+
+$mapfile_version 2
+
+CAPABILITY i386_hwcap1;
+
+SYMBOL_SCOPE {
+	global:
+		big_add;
+		big_bitlength;
+		big_cmp_abs;
+		big_copy;
+		big_div_pos;
+		big_ext_gcd_pos;
+		big_extend;
+		big_finish;
+		big_init1;
+		big_init;
+		big_modexp;
+		big_modexp_crt;
+		big_mul;
+		big_nextprime_pos;
+		big_sub;
+		big_sub_pos;
+		bignum2bytestring;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,54 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+BIGNUM_PSM_OBJS =	bignum_i386.o bignum_i386_asm.o
+
+include		../../Makefile.com
+
+# Redefine the objects required for this capabilities group.
+OBJECTS =	$(BIGNUM_OBJS)
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS +=	$(AS_PICFLAGS) -P
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
+BIGNUM_FLAGS +=	-DMMX_MANAGE -DHWCAP -DPSR_MUL -DNO_BIG_ONE -DNO_BIG_TWO
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../../Makefile.targ
+
+pics/bignum_i386.o: $(BIGNUM_DIR)/i386/bignum_i386.c
+		$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ \
+		    $(BIGNUM_DIR)/i386/bignum_i386.c
+		$(POST_PROCESS_O)
+
+pics/bignum_i386_asm.o: $(BIGNUM_DIR)/i386/bignum_i386_asm.s
+		$(COMPILE.s) -o $@ $(BIGNUM_DIR)/i386/bignum_i386_asm.s
+		$(POST_PROCESS_O)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,46 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =	sun4u
+
+AES_PSM_OBJS =		aes_crypt_asm.o
+ARCFOUR_PSM_OBJS =	arcfour_crypt_asm.o
+DES_PSM_OBJS =		des_crypt_asm.o
+BIGNUM_PSM_OBJS =	mont_mulf_asm.o
+
+include		../../Makefile.com
+
+# Redefine the objects required for this capabilities group.
+OBJECTS =	$(AES_OBJS) $(ARCFOUR_OBJS) $(DES_OBJS) $(BIGNUM_OBJS) \
+		$(MODES_OBJS)
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS +=	$(AS_PICFLAGS) -P
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \
+		-D_POSIX_PTHREAD_SEMANTICS
+BIGNUM_FLAGS +=	-DUSE_FLOATING_POINT -DNO_BIG_ONE -DNO_BIG_TWO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,38 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../../Makefile.targ
+
+pics/aes_crypt_asm.o: $(AES_DIR)/sun4u/aes_crypt_asm.s
+		$(COMPILE.s) -o $@ $(AES_DIR)/sun4u/aes_crypt_asm.s
+		$(POST_PROCESS_O)
+
+pics/arcfour_crypt_asm.o: $(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
+		$(COMPILE.s) -o $@ $(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
+		$(POST_PROCESS_O)
+
+pics/des_crypt_asm.o: $(DES_DIR)/sun4u/des_crypt_asm.s
+		$(COMPILE.s) -o $@ $(DES_DIR)/sun4u/des_crypt_asm.s
+		$(POST_PROCESS_O)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,67 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4u {
+	MACHINE = sun4u;
+};
+
+SYMBOL_SCOPE {
+	global:
+		aes_alloc_keysched;
+		aes_decrypt_contiguous_blocks;
+		aes_decrypt_block;
+		aes_encrypt_contiguous_blocks;
+		aes_encrypt_block;
+		aes_init_keysched;
+		arcfour_crypt;
+		arcfour_key_init;
+		big_add;
+		big_bitlength;
+		big_cmp_abs;
+		big_copy;
+		big_div_pos;
+		big_ext_gcd_pos;
+		big_extend;
+		big_finish;
+		big_init1;
+		big_init;
+		big_modexp;
+		big_modexp_crt;
+		big_mul;
+		big_nextprime_pos;
+		big_random;
+		big_sub;
+		big_sub_pos;
+		bignum2bytestring;
+		des3_crunch_block;
+		des_alloc_keysched;
+		des_crunch_block;
+		des_init_keysched;
+		des_keycheck;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,39 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+ASFLAGS +=	-xarch=v8plus
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
+
+pics/mont_mulf_asm.o: \
+		$(BIGNUM_DIR)/sun4u/mont_mulf_v8plus.s
+		$(COMPILE.s) -o $@ $(BIGNUM_DIR)/sun4u/mont_mulf_v8plus.s
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,38 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
+
+pics/mont_mulf_asm.o: \
+		$(BIGNUM_DIR)/sun4u/mont_mulf_v9.s
+		$(COMPILE.s) -o $@ $(BIGNUM_DIR)/sun4u/mont_mulf_v9.s
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,47 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		$(SRC)/lib/Makefile.lib
+
+SUBDIRS =	$(MACH) $(BUILD64) $(MACH64)
+
+all :=		TARGET= all
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+install :=	TARGET= install
+
+.KEEP_STATE:
+
+.PARALLEL:	$(SUBDIRS)
+
+all clean clobber install: \
+		$(SUBDIRS)
+
+lint:
+
+$(SUBDIRS):	FRC
+		@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,40 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+PLATFORM =	sun4v
+
+include		../../Makefile.com
+
+# Redefine the objects required for this capabilities group.
+OBJECTS =	$(ARCFOUR_OBJS) $(BIGNUM_OBJS)
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH)
+ASFLAGS +=	$(AS_PICFLAGS) -P
+CFLAGS +=	$(CCVERBOSE) -xO5 -xbuiltin=%all -dalign
+CPPFLAGS +=	-D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \
+		-D_POSIX_PTHREAD_SEMANTICS
+BIGNUM_FLAGS +=	-DUMUL64 -DNO_BIG_ONE -DNO_BIG_TWO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,26 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/common/mapfile-cap	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,56 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+$mapfile_version 2
+
+CAPABILITY sun4v {
+	MACHINE = sun4v;
+};
+
+SYMBOL_SCOPE {
+	global:
+		arcfour_crypt;
+		arcfour_key_init;
+		big_add;
+		big_bitlength;
+		big_cmp_abs;
+		big_copy;
+		big_div_pos;
+		big_ext_gcd_pos;
+		big_extend;
+		big_finish;
+		big_init1;
+		big_init;
+		big_modexp;
+		big_modexp_crt;
+		big_mul;
+		big_nextprime_pos;
+		big_random;
+		big_sub;
+		big_sub_pos;
+		bignum2bytestring;
+	local:
+		*;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -0,0 +1,33 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+include		../Makefile.com
+include		$(SRC)/lib/Makefile.lib.64
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+include		../Makefile.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -23,18 +23,37 @@
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-#
-# lib/pkcs11/libsoftcrypto/i386/Makefile
-#
+LIBRARY =	libsoftcrypto.a
+VERS =		.1
+
+include		../Makefile.com
+
+include		$(SRC)/lib/Makefile.lib
 
-LIBRARY=	libsoftcrypto.a
-VERS= .1
+# Sources need to be redefined after Makefile.lib inclusion.
+SRCS =		$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \
+		$(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
+		$(PAD_SRC)
+
+SRCDIR =	$(SRC)/lib/pkcs11/libsoftcrypto/common
+
+LIBS =		$(DYNLIB) $(LINTLIB)
+MAPFILEDIR =	../common
 
-include ../Makefile.com
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
+LDLIBS +=	-lcryptoutil -lc
+LINTFLAGS +=	$(EXTRA_LINT_FLAGS)
+
+# Symbol capabilities objects are i386.
+EXTPICS =	../capabilities/intel/i386/pics/symcap.o
 
-LDLIBS += -lcryptoutil
-LIBS += $(LINTLIB)
+.KEEP_STATE:
+
+all:		$(LIBS)
 
-DYNFLAGS += -Wl,-f/usr/lib/libsoftcrypto/\$$HWCAP
+lint:		$(SRCS)
 
-install:  all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+install:	all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+
+include		../Makefile.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/i386_hwcap1/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/i386_hwcap1/Makefile
-#
-LIBRARY=	libsoftcrypto_hwcap1.a
-VERS= .1
-
-MODULE= libsoftcrypto_hwcap1.so.1
-
-BIGNUM_PSM_OBJS= bignum_i386.o bignum_i386_asm.o
-BIGNUM_PSM_SRC=	$(BIGNUM_DIR)/i386/bignum_i386_asm.s \
-		$(BIGNUM_DIR)/i386/bignum_i386.c
-
-include ../Makefile.com
-
-BIGNUM_FLAGS += -DMMX_MANAGE -DHWCAP -DPSR_MUL
-LINTFLAGS += $(BIGNUM_FLAGS)
-
-LDLIBS += -lcryptoutil
-
-$(ROOTHWCAPDIR)/% := FILEMODE= 755
-
-install:  all $(ROOTHWCAPDIR)/$(MODULE)
-
-pics/bignum_i386.o:	$(BIGNUM_DIR)/i386/bignum_i386.c
-	$(COMPILE.c) $(BIGNUM_FLAGS) -o $@ $(BIGNUM_DIR)/i386/bignum_i386.c
-	$(POST_PROCESS_O)
-
-pics/bignum_i386_asm.o:	$(BIGNUM_DIR)/i386/bignum_i386_asm.s
-	$(COMPILE.s) -o $@ $(BIGNUM_DIR)/i386/bignum_i386_asm.s
-	$(POST_PROCESS_O)
-
-$(ROOTHWCAPDIR): $(ROOTLIBDIR)
-	$(INS.dir)
-
-$(ROOTHWCAPDIR)/%: $(ROOTHWCAPDIR) %
-	$(INS.file)
--- a/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -23,18 +23,38 @@
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-#
-# lib/pkcs11/libsoftcrypto/sparc/Makefile
-#
+LIBRARY =	libsoftcrypto.a
+VERS =		.1
+
+include		../Makefile.com
+
+include		$(SRC)/lib/Makefile.lib
 
-LIBRARY=	libsoftcrypto.a
-VERS= .1
+# Sources need to be redefined after Makefile.lib inclusion.
+SRCS =		$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \
+		$(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
+		$(PAD_SRC)
+
+SRCDIR =	$(SRC)/lib/pkcs11/libsoftcrypto/common
+
+LIBS =		$(DYNLIB) $(LINTLIB)
+MAPFILEDIR =	../common
 
-include ../Makefile.com
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
+LDLIBS +=	-lcryptoutil -lc
+LINTFLAGS +=	$(EXTRA_LINT_FLAGS)
+
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS =	../capabilities/sun4u/sparc/pics/symcap.o \
+		../capabilities/sun4v/sparc/pics/symcap.o
 
-LDLIBS	+= -lcryptoutil
-LIBS += $(LINTLIB)
+.KEEP_STATE:
+
+all:		$(LIBS)
 
-DYNFLAGS +=     -Wl,-f/usr/platform/\$$PLATFORM/lib/$(DYNLIBPSR)
+lint:		$(SRCS)
 
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+install:	all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+
+include		../Makefile.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -23,19 +23,39 @@
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-#
-# lib/pkcs11/libsoftcrypto/sparcv9/Makefile
-#
+LIBRARY =	libsoftcrypto.a
+VERS =		.1
+
+include		../Makefile.com
+
+include		$(SRC)/lib/Makefile.lib
+include		$(SRC)/lib/Makefile.lib.64
 
-LIBRARY=	libsoftcrypto.a
-VERS= .1
+# Sources need to be redefined after Makefile.lib inclusion.
+SRCS =		$(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \
+		$(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \
+		$(PAD_SRC)
+
+SRCDIR =	$(SRC)/lib/pkcs11/libsoftcrypto/common
+
+LIBS =		$(DYNLIB) $(LINTLIB)
+MAPFILEDIR =	../common
 
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
+CFLAGS +=	$(CCVERBOSE)
+CPPFLAGS +=	-I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS
+LDLIBS +=	-lcryptoutil -lc
+LINTFLAGS64 +=	$(EXTRA_LINT_FLAGS)
+
+# Symbol capabilities objects are added for sun4u and sun4v.
+EXTPICS =	../capabilities/sun4u/sparcv9/pics/symcap.o \
+		../capabilities/sun4v/sparcv9/pics/symcap.o
 
-LDLIBS	+= -lcryptoutil
-LIBS += $(LINTLIB)
+.KEEP_STATE:
+
+all:		$(LIBS)
 
-DYNFLAGS +=     -Wl,-f/usr/platform/\$$PLATFORM/lib/$(MACH64)/$(DYNLIBPSR)
+lint:		$(SRCS)
 
-install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+install:	all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTLINT64)
+
+include		../Makefile.targ
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/pkcs11/libsoftcrypto/sun4u/Makefile
-#
-
-include $(SRC)/lib/Makefile.lib
-
-SUBDIRS = sparc sparcv9
-
-all :=		TARGET= all
-check :=	TARGET= check
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-install :=	TARGET= install
-lint :=		TARGET= lint
-
-.PARALLEL: $(SUBDIRS)
-
-all check clean clobber install lint: $(SUBDIRS)
-
-$(SUBDIRS): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4u/Makefile.com
-#
-
-LIBRARY = libsoftcrypto_psr.a
-VERS= .1
-PLATFORM = sun4u
-MODULE = libsoftcrypto_psr.so.1
-
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
-
-# Platform-specific settings
-#
-# Specifying *_OBJS here brings in both *_COMMON_OBJS and *_PSM_OBJS to this
-# platform-specific implementation, and *supercedes* (replaces) the common
-# version.  Specifying only *_PSM_OBJS is used when the PSM version is
-# intended to *augment* (add onto) the common version.
-#
-# COMMON and PSM source/object setup is done in libsoftcrypto/Makefile.com,
-# and does not need to be repeated here.  Only list *_SRCS/*_PSM_SRCS and
-# *_OBJS/*_PSM_OBJS that are platform-specific here.  Keep SRCS= and
-# OBJECTS= in sync with each other.  Update mapfile-vers to list only
-# the functions that are actually compiled into this platform-specific
-# library; do not duplicate what is already in common/mapfile-vers unless
-# this library is providing a superceded version of that function here.
-#
-# Note:  This Makefile.com is set up to compile the PSM objects for AES,
-# ARCFOUR, and DES to augment the corresponding COMMON objects already
-# included in the base libsoftcrypto library.  It does not compile anything
-# for sun4u sparc/sparcv9 to supercede a COMMON object from libsoftcrypto.
-# See the sun4v platform-specific implementation for an alternate example.
-#
-# NOTE: BIGNUM is different.  There is actually no COMMON object in
-# libsoftcrypto for currently-supported platforms (sun4u, sun4v, i386/amd64).
-# The COMMON objects for BIGNUM are a starting point if a new platform is
-# ever added.  Thus, BIGNUM_OBJS is listed in every currently-supported
-# platform-specific Makefile.com, in effect always overriding what it is
-# in the COMMON implementation.  BIGNUM_PSM_OBJS is then used to further
-# augment BIGNUM_COMMON_OBJS on a platform-by-platform basis.
-#
-# Example:
-# 1.	common/Makefile.com:
-#		FOO_COMMON_OBJS = foo.o
-#		FOO_PSM_OBJS = <blank>
-#		FOO_OBJS = $(FOO_COMMON_OBJS) $(FOO_PSM_OBJS)
-#
-#		BAR_COMMON_OBJS = bar.o
-#		BAR_PSM_OBJS = <blank>
-#		BAR_OBJS = $(BAR_COMMON_OBJS) $(BAR_PSM_OBJS)
-#
-#		OBJECTS = $(FOO_OBJS) $(BAR_OBJS)
-#		LIB = libsoftcrypto
-#
-#	Compiling here will make a library libsoftcrypto.so containing:
-#		foo.o bar.o
-#
-#	Run time sees, unless it is a sun4u or sun4v platform (see below):
-#		foo.o bar.o
-#
-# 2.	sun4u/Makefile.com:
-#		FOO_PSM_OBJS = foo-plus.o
-#		OBJECTS = $(FOO_OBJS)		/* defined in common */
-#		LIB = libsoftcrypto_psr
-#
-#	Compiling here will make a library libsoftcrypto_psr.so containing:
-#		foo-plus.o
-#
-#	Run time sees, on a sun4u platform only:
-#		foo.o bar.o foo-plus.o		/* note the difference */
-#
-# 3.	sun4v/Makefile.com:
-#		BAR_PSM_OBJS = bar'.o
-#		OBJECTS = $(BAR_PSM_OBJS)	/* not $(BAR_OBJS) */
-#		LIB - libsoftcrypto_psr
-#
-#	Compiling here will make a library libsoftcrypto_psr.so containing:
-#		bar'.o
-#
-#	Run time sees, on a sun4v platform only:
-#		foo.o bar'.o			/* note the difference */
-#
-AES_PSM_OBJS= aes_crypt_asm.o
-ARCFOUR_PSM_OBJS= arcfour_crypt_asm.o
-DES_PSM_OBJS= des_crypt_asm.o
-BIGNUM_PSM_OBJS= mont_mulf_asm.o
-BIGNUM_FLAGS += -DUSE_FLOATING_POINT
-
-MAPFILES = ../mapfile-vers
-OBJECTS = $(AES_OBJS) $(ARCFOUR_OBJS) $(DES_OBJS) $(BIGNUM_OBJS) \
-	$(MODES_OBJS)
-
-# Compiler settings
-CFLAGS += -D$(PLATFORM)
-CFLAGS64 += -D$(PLATFORM)
-ASFLAGS += -DPIC
-
-$(USR_PSM_LIB_DIR)/% := FILEMODE = 755
-
-pics/aes_crypt_asm.o: $(AES_DIR)/sun4u/aes_crypt_asm.s
-	$(COMPILE.s) $(AS_BIGPICFLAGS) -o $@ $(AES_DIR)/sun4u/aes_crypt_asm.s
-	$(POST_PROCESS_O)
-
-pics/arcfour_crypt_asm.o: $(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
-	$(COMPILE.s) $(AS_BIGPICFLAGS) -o $@ \
-		$(ARCFOUR_DIR)/sun4u/arcfour_crypt_asm.s
-	$(POST_PROCESS_O)
-
-pics/des_crypt_asm.o: $(DES_DIR)/sun4u/des_crypt_asm.s
-	$(COMPILE.s) $(AS_BIGPICFLAGS) -o $@ $(DES_DIR)/sun4u/des_crypt_asm.s
-	$(POST_PROCESS_O)
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/Makefile.links	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/pkcs11/libsoftcrypto/sun4u/Makefile.links
-#
-# Used when building links in /usr/platform/sun4u/lib/ and
-# /usr/platform/sun4u/lib/sparcv9/
-#
-
-LINKED_PLATFORMS =		\
-		SUNW,Ultra-2 \
-		SUNW,Ultra-4 \
-		SUNW,Ultra-250 \
-		SUNW,Ultra-Enterprise \
-		SUNW,Ultra-Enterprise-10000 \
-		SUNW,UltraSPARC-IIi-Netract \
-		SUNW,UltraSPARC-IIe-NetraCT-40 \
-		SUNW,UltraSPARC-IIe-NetraCT-60 \
-		SUNW,Sun-Blade-100 \
-		SUNW,Sun-Blade-1000 \
-		SUNW,Sun-Blade-1500 \
-		SUNW,Sun-Blade-2500 \
-		SUNW,A70 \
-		SUNW,Sun-Fire \
-		SUNW,Sun-Fire-V215 \
-		SUNW,Sun-Fire-V240 \
-		SUNW,Sun-Fire-V250 \
-		SUNW,Sun-Fire-V440 \
-		SUNW,Sun-Fire-V445 \
-		SUNW,Sun-Fire-280R \
-		SUNW,Sun-Fire-15000 \
-		SUNW,Sun-Fire-880 \
-		SUNW,Sun-Fire-480R \
-		SUNW,Sun-Fire-V890 \
-		SUNW,Sun-Fire-V490 \
-		SUNW,Serverblade1 \
-		SUNW,Netra-T12 \
-		SUNW,Netra-T4 \
-		SUNW,Netra-CP2300 \
-		SUNW,Netra-CP3010
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/mapfile-vers	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNWprivate {
-    global:
-        aes_alloc_keysched;
-	aes_decrypt_contiguous_blocks;
-        aes_decrypt_block;
-	aes_encrypt_contiguous_blocks;
-        aes_encrypt_block;
-        aes_init_keysched;
-	arcfour_crypt;
-	arcfour_key_init;
-	big_One;
-	big_Two;
-	big_add;
-	big_bitlength;
-	big_cmp_abs;
-	big_copy;
-	big_div_pos;
-	big_ext_gcd_pos;
-	big_extend;
-	big_finish;
-	big_init1;
-	big_init;
-	big_modexp;
-	big_modexp_crt;
-	big_mul;
-	big_nextprime_pos;
-	big_random;
-	big_sub;
-	big_sub_pos;
-	bignum2bytestring;
-	conv_d16_to_i32;
-	conv_i32_to_d32;
-	conv_i32_to_d16;
-	conv_i32_to_d32_and_d16;
-	mont_mulf_noconv;
-	des3_crunch_block;
-	des_alloc_keysched;
-	des_crunch_block;
-	des_init_keysched;
-	des_keycheck;
-    local:
-        *;
-};
-
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4u/sparc/Makefile
-#
-
-CLASS = 32
-
-include ../Makefile.com
-
-ASFLAGS +=   -xarch=v8plus
-LINTFLAGS += -D$(PLATFORM) -erroff=E_STATIC_UNUSED
-
-install:  all $(SOFT_PSR_LINKS) $(USR_PSM_LIBS)
-
-include $(SRC)/Makefile.psm.targ
-
-pics/mont_mulf_asm.o: $(BIGNUM_DIR)/sun4u/mont_mulf_v8plus.s
-	$(COMPILE.s) -o $@ $(BIGNUM_DIR)/sun4u/mont_mulf_v8plus.s
-	$(POST_PROCESS_O)
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4u/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4u/sparcv9/Makefile
-#
-
-CLASS = 64
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# E_STATIC_UNUSED is for bignumimpl.c, big_modexp_ncp_int/big_modexp_ncp_float
-LINTFLAGS64 += -D$(PLATFORM) -erroff=E_STATIC_UNUSED
-
-install:  all $(SOFT_PSR64_LINKS) $(USR_PSM_LIBS64)
-
-include $(SRC)/Makefile.psm.targ
-
-pics/mont_mulf_asm.o: $(BIGNUM_DIR)/sun4u/mont_mulf_v9.s
-	$(COMPILE.s) -o $@ $(BIGNUM_DIR)/sun4u/mont_mulf_v9.s
-	$(POST_PROCESS_O)
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/pkcs11/libsoftcrypto/sun4v/Makefile
-#
-
-include $(SRC)/lib/Makefile.lib
-
-SUBDIRS = $(MACH) $(PLATFORMS)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-all :=		TARGET= all
-check :=	TARGET= check
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-install :=	TARGET= install
-lint :=		TARGET= lint
-
-.PARALLEL: $(SUBDIRS)
-
-all check clean clobber install lint: $(SUBDIRS)
-
-$(SUBDIRS): FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile.com	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4v/Makefile.com
-#
-
-LIBRARY = libsoftcrypto_psr.a
-VERS= .1
-PLATFORM = sun4v
-MODULE = libsoftcrypto_psr.so.1
-
-include $(SRC)/Makefile.psm
-include ../Makefile.links
-include ../../Makefile.com
-
-# Platform-specific settings
-#
-# See the sun4u platform-specific Makefile.com for important information
-# that also relates to this file.
-#
-# Note:  This file is set up to compile the PSM objects for ARCFOUR to
-# *augment* (add onto) its common objects from libsoftcrypto, and to compile
-# BIGNUM to *supercede* (replaced) its common objects from libsoftcrypto.
-#
-ARCFOUR_PSM_OBJS=  arcfour_crypt.o
-ARCFOUR_PSM_SRC=   $(ARCFOUR_DIR)/sun4v/arcfour_crypt.c 
-BIGNUM_FLAGS += -DUMUL64
-
-MAPFILES= ../mapfile-vers
-OBJECTS= $(ARCFOUR_PSM_OBJS) $(BIGNUM_OBJS)
-
-# Compiler settings
-sparc_XARCH =      -m32 -xarch=sparc
-sparcv9_XARCH =    -m64 -xarch=sparcvis
-
-# Niagara perf options as per $SRC/uts/sun4v/arcfour
-CFLAGS +=   -xO5 -xbuiltin=%all -dalign -D$(PLATFORM)
-CFLAGS64 += -D$(PLATFORM)
-ASFLAGS +=  -DPIC
-
-$(USR_PSM_LIB_DIR)/% := FILEMODE = 755
-
-pics/arcfour_crypt.o: $(ARCFOUR_DIR)/sun4v/arcfour_crypt.c
-	$(COMPILE.c) -o $@ $(ARCFOUR_DIR)/sun4v/arcfour_crypt.c
-	$(POST_PROCESS_O)
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/Makefile.links	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# lib/libsoftcrypto/sun4v/Makefile.links
-#
-# Used when building links in /usr/platform/sun4v/lib and
-# /usr/platform/sun4v/lib/sparcv9/
-#
-
-LINKED_PLATFORMS =	\
-		SUNW,Netra-CP3060 \
-		SUNW,Netra-CP3260 \
-		SUNW,Netra-T5220 \
-		SUNW,Netra-T5440 \
-		SUNW,SPARC-Enterprise-T5120 \
-		SUNW,Sun-Blade-T6300 \
-		SUNW,Sun-Blade-T6320 \
-		SUNW,Sun-Fire-T200 \
-		SUNW,T5140 \
-		SUNW,USBRDT-5240
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/mapfile-vers	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# MAPFILE HEADER START
-#
-# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
-# Object versioning must comply with the rules detailed in
-#
-#	usr/src/lib/README.mapfiles
-#
-# You should not be making modifications here until you've read the most current
-# copy of that file. If you need help, contact a gatekeeper for guidance.
-#
-# MAPFILE HEADER END
-#
-
-
-$mapfile_version 2
-
-SYMBOL_VERSION SUNWprivate {
-    global:
-	arcfour_crypt;
-	arcfour_key_init;
-	big_One;
-	big_Two;
-	big_add;
-	big_bitlength;
-	big_cmp_abs;
-	big_copy;
-	big_div_pos;
-	big_ext_gcd_pos;
-	big_extend;
-	big_finish;
-	big_init1;
-	big_init;
-	big_modexp;
-	big_modexp_crt;
-	big_mul;
-	big_nextprime_pos;
-	big_random;
-	big_sub;
-	big_sub_pos;
-	bignum2bytestring;
-    local:
-	*;
-};
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparc/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4v/sparc/Makefile
-#
-
-CLASS = 32
-
-include ../Makefile.com
-
-LINTFLAGS += -D$(PLATFORM) -erroff=E_NAME_MULTIPLY_DEF2
-
-install:  all $(SOFT_PSR_LINKS) $(USR_PSM_LIBS)
-
-include $(SRC)/Makefile.psm.targ
-
--- a/usr/src/lib/pkcs11/libsoftcrypto/sun4v/sparcv9/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-
-#
-# lib/pkcs11/libsoftcrypto/sun4v/sparcv9/Makefile
-#
-
-CLASS = 64
-
-include ../Makefile.com
-include $(SRC)/lib/Makefile.lib.64
-
-# E_NAME_MULTIPLY_DEF2 is for arcfour_key_init and arcfour_crypt in
-# different implementations of arcfour_crypt.c
-LINTFLAGS64 += -D$(PLATFORM) -erroff=E_NAME_MULTIPLY_DEF2
-
-install:  all $(SOFT_PSR64_LINKS) $(USR_PSM_LIBS64)
-
-include $(SRC)/Makefile.psm.targ
--- a/usr/src/pkg/manifests/SUNWcs.mf	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/pkg/manifests/SUNWcs.mf	Mon Jun 28 15:32:48 2010 -0700
@@ -1435,6 +1435,7 @@
 file path=usr/sbin/syseventadm group=sys mode=0555
 file path=usr/sbin/syslogd group=sys mode=0555
 file path=usr/sbin/tar mode=0555
+file path=usr/sbin/trapstat mode=0555
 file path=usr/sbin/traceroute mode=4555
 file path=usr/sbin/ttyadm group=sys mode=0755
 $(i386_ONLY)file path=usr/sbin/ucodeadm mode=0555
@@ -2208,7 +2209,6 @@
 hardlink path=usr/sbin/swap target=../../usr/lib/isaexec
 hardlink path=usr/sbin/sysdef target=../../usr/lib/isaexec
 hardlink path=usr/sbin/tapes target=./devfsadm
-hardlink path=usr/sbin/trapstat target=../../usr/lib/platexec
 hardlink path=usr/sbin/unshare target=../../usr/sbin/sharemgr
 hardlink path=usr/sbin/update_drv target=../../usr/lib/isaexec
 hardlink path=usr/sbin/whodo target=../../usr/lib/isaexec
--- a/usr/src/pkg/manifests/system-library-platform.mf	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/pkg/manifests/system-library-platform.mf	Mon Jun 28 15:32:48 2010 -0700
@@ -33,141 +33,98 @@
 dir path=usr/platform group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,A70 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,A70/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,A70/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP2300 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP2300/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP2300/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP2300/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3010 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3010/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3010/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3010/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3060 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3060/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3060/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3060/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3260 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3260/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3260/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-CP3260/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T12 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T12/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T12/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T4 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T4/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T4/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5220 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5220/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5220/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5440 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5440/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Netra-T5440/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise-T5120 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise/lib/cfgadm group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise/lib/cfgadm/$(ARCH64) \
     group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,SPARC-Enterprise/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Serverblade1 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Serverblade1/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Serverblade1/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-100 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-100/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-100/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1000 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1000/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1000/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1500 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1500/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-1500/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-2500 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-2500/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-2500/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6300 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6300/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6300/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6320 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6320/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Blade-T6320/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-15000 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-15000/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-15000/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-280R group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-280R/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-280R/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-480R group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-480R/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-480R/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-880 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-880/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-880/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-T200 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-T200/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-T200/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V215 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V215/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V215/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V215/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V240 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V240/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V240/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V240/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V250 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V250/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V250/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V250/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V440 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V440/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V440/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V445 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V445/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V445/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V445/sbin
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V490 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V490/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V490/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V890 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V890/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire-V890/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Sun-Fire/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,T5140 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,T5140/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,T5140/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,USBRDT-5240 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,USBRDT-5240/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,USBRDT-5240/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-2 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-2/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-2/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-250 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-250/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-250/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-4 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-4/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-4/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise-10000 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise-10000/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise-10000/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,Ultra-Enterprise/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib
-$(sparc_ONLY)dir \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60 group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib
-$(sparc_ONLY)dir \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIi-Netract group=sys
 $(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib
-$(sparc_ONLY)dir path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/$(ARCH64)
 $(i386_ONLY)dir path=usr/platform/i86pc group=sys
 $(i386_ONLY)dir path=usr/platform/i86pc/lib
 $(sparc_ONLY)dir path=usr/platform/sun4u group=sys
@@ -176,7 +133,6 @@
 $(sparc_ONLY)dir path=usr/platform/sun4u-us3 group=sys
 $(sparc_ONLY)dir path=usr/platform/sun4u-us3/lib
 $(sparc_ONLY)dir path=usr/platform/sun4u/lib
-$(sparc_ONLY)dir path=usr/platform/sun4u/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/sun4u/lib/cfgadm
 $(sparc_ONLY)dir path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/sun4u/lib/fs
@@ -188,7 +144,6 @@
 $(sparc_ONLY)dir path=usr/platform/sun4v group=sys
 $(sparc_ONLY)dir path=usr/platform/sun4v/include
 $(sparc_ONLY)dir path=usr/platform/sun4v/lib
-$(sparc_ONLY)dir path=usr/platform/sun4v/lib/$(ARCH64)
 $(sparc_ONLY)dir path=usr/platform/sun4v/lib/fs
 $(sparc_ONLY)dir path=usr/platform/sun4v/lib/fs/hsfs
 $(sparc_ONLY)dir path=usr/platform/sun4v/lib/fs/nfs
@@ -223,7 +178,6 @@
     path=usr/platform/SUNW,Ultra-Enterprise/lib/libprtdiag_psr.so.1
 $(sparc_ONLY)file \
     path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/libprtdiag_psr.so.1
-$(sparc_ONLY)file path=usr/platform/sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/ac.so.1
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/sbd.so.1
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/sysctrl.so.1
@@ -232,19 +186,14 @@
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/cfgadm/sysctrl.so.1
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/fs/nfs/inetboot group=sys
 $(sparc_ONLY)file path=usr/platform/sun4u/lib/libprtdiag.so.1
-$(sparc_ONLY)file path=usr/platform/sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)file path=usr/platform/sun4u/sbin/prtdiag group=sys mode=2755
-$(sparc_ONLY)file path=usr/platform/sun4u/sbin/trapstat mode=0555
 $(sparc_ONLY)file path=usr/platform/sun4v/include/tsalarm.h
-$(sparc_ONLY)file path=usr/platform/sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)file path=usr/platform/sun4v/lib/fs/nfs/inetboot group=sys
 $(sparc_ONLY)file path=usr/platform/sun4v/lib/libpcp.so.1
 $(sparc_ONLY)file path=usr/platform/sun4v/lib/libprtdiag.so.1
-$(sparc_ONLY)file path=usr/platform/sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)file path=usr/platform/sun4v/lib/libtsalarm.so.1
 $(sparc_ONLY)file path=usr/platform/sun4v/sbin/device_remap mode=0544
 $(sparc_ONLY)file path=usr/platform/sun4v/sbin/prtdiag group=sys mode=2755
-$(sparc_ONLY)file path=usr/platform/sun4v/sbin/trapstat mode=0555
 $(i386_ONLY)legacy pkg=SUNWkvm.i arch=$(ARCH).i86pc category=system \
     desc="core software for a specific hardware platform group" \
     hotline="Please contact your local service provider" \
@@ -267,113 +216,60 @@
     vendor="Sun Microsystems, Inc." version=11.11,REV=2009.11.11
 license cr_Sun license=cr_Sun
 license lic_CDDL license=lic_CDDL
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,A70/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,A70/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,A70/lib/fs target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,A70/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,A70/sbin target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-210 target=SUNW,Sun-Fire-V240
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-240 target=SUNW,Sun-Fire-V240
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-440 target=SUNW,Sun-Fire-V440
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP2300/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP2300/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP2300/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP2300/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP2300/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP2300/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3010/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3010/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3010/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3010/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3010/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3010/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3060/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3060/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3060/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3060/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3060/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3060/sbin/prtdiag \
     target=../../sun4v/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3060/sbin/trapstat \
-    target=../../sun4v/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3260/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3260/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3260/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3260/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-CP3260/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3260/sbin/prtdiag \
     target=../../sun4v/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-CP3260/sbin/trapstat \
-    target=../../sun4v/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T12/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T12/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T12/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-T12/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T12/sbin target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T2000 target=SUNW,Sun-Fire-T200
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T4/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T4/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T4/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Netra-T4/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T4/sbin target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/include \
     target=../sun4v/include
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T5220/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T5220/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/lib/libtsalarm.so \
     target=../../sun4v/lib/libtsalarm.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/lib/libtsalarm.so.1 \
@@ -381,18 +277,12 @@
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5220/sbin target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/include \
     target=../sun4v/include
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T5440/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Netra-T5440/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/lib/libtsalarm.so \
     target=../../sun4v/lib/libtsalarm.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Netra-T5440/lib/libtsalarm.so.1 \
@@ -402,9 +292,6 @@
     target=SUNW,Sun-Fire-T200
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise-T2000 \
     target=SUNW,Sun-Fire-T200
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/libpcp.so \
@@ -412,9 +299,6 @@
 $(sparc_ONLY)link \
     path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,SPARC-Enterprise-T5120/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise-T5120/sbin \
     target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise-T5220 \
@@ -428,71 +312,36 @@
     target=../../sun4u/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,SPARC-Enterprise/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Serverblade1/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Serverblade1/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Serverblade1/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Serverblade1/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Serverblade1/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-100/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-100/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-100/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-100/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-100/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-1000/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1000/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1000/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-1000/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1000/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-1500/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1500/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1500/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-1500/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-1500/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-2500/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-2500/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-2500/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-2500/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-2500/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-T6300/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6300/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6300/lib/libpcp.so \
@@ -502,95 +351,53 @@
 $(sparc_ONLY)link \
     path=usr/platform/SUNW,Sun-Blade-T6300/lib/libprtdiag_psr.so.1 \
     target=../../SUNW,Sun-Fire-T200/lib/libprtdiag_psr.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-T6300/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6300/sbin \
     target=../sun4v/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-T6320/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6320/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6320/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6320/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Blade-T6320/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6320/sbin \
     target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Blade-T6340 target=SUNW,T5140
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-15000/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-15000/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-15000/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-15000/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-15000/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-280R/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-280R/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-280R/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-280R/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-280R/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-480R/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-480R/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-480R/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-480R/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-480R/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-880/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-880/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-880/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-880/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-880/sbin \
     target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-T1000 \
     target=SUNW,Sun-Fire-T200
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-T200/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-T200/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-T200/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-T200/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-T200/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-T200/sbin \
     target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V210 \
     target=SUNW,Sun-Fire-V240
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V215/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/lib/fs \
@@ -599,38 +406,22 @@
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/lib/librsc.so.1 \
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V215/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/lib/llib-lrsc.ln \
     target=../../SUNW,Sun-Fire-V240/lib/llib-lrsc.ln
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/sbin/scadm \
     target=../../SUNW,Sun-Fire-V240/sbin/scadm
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V215/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V240/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V240/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V240/lib/fs \
     target=../../sun4u/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V240/lib/librsc.so \
     target=./librsc.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V240/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V240/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V240/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V245 \
     target=SUNW,Sun-Fire-V215
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V250/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/lib/fs \
@@ -639,20 +430,12 @@
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/lib/librsc.so.1 \
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V250/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/lib/llib-lrsc.ln \
     target=../../SUNW,Sun-Fire-V240/lib/llib-lrsc.ln
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/sbin/scadm \
     target=../../SUNW,Sun-Fire-V240/sbin/scadm
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V250/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V440/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V440/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V440/lib/fs \
@@ -661,16 +444,10 @@
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V440/lib/librsc.so.1 \
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V440/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V440/lib/llib-lrsc.ln \
     target=../../SUNW,Sun-Fire-V240/lib/llib-lrsc.ln
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V440/sbin \
     target=../SUNW,Sun-Fire-V240/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V445/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/lib/fs \
@@ -679,144 +456,84 @@
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/lib/librsc.so.1 \
     target=../../SUNW,Sun-Fire-V240/lib/librsc.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V445/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/lib/llib-lrsc.ln \
     target=../../SUNW,Sun-Fire-V240/lib/llib-lrsc.ln
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/sbin/prtdiag \
     target=../../sun4u/sbin/prtdiag
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/sbin/scadm \
     target=../../SUNW,Sun-Fire-V240/sbin/scadm
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V445/sbin/trapstat \
-    target=../../sun4u/sbin/trapstat
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V490/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V490/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V490/lib/fs \
     target=../../sun4u/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V490/lib/libprtdiag_psr.so.1 \
     target=../../SUNW,Sun-Fire-480R/lib/libprtdiag_psr.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V490/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V490/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V890/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V890/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V890/lib/fs \
     target=../../sun4u/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V890/lib/libprtdiag_psr.so.1 \
     target=../../SUNW,Sun-Fire-880/lib/libprtdiag_psr.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire-V890/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire-V890/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Sun-Fire/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
-$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire/sbin target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,T5140/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
+$(sparc_ONLY)link path=usr/platform/SUNW,Sun-Fire/sbin \
+    target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,T5140/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,T5140/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,T5140/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link path=usr/platform/SUNW,T5140/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
-$(sparc_ONLY)link path=usr/platform/SUNW,T5140/sbin target=../sun4v/sbin
+$(sparc_ONLY)link path=usr/platform/SUNW,T5140/sbin \
+    target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,T5240 target=SUNW,T5140
 $(sparc_ONLY)link path=usr/platform/SUNW,T5440 target=SUNW,T5140
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,USBRDT-5240/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4v/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,USBRDT-5240/lib/fs \
     target=../../sun4v/lib/fs
 $(sparc_ONLY)link path=usr/platform/SUNW,USBRDT-5240/lib/libpcp.so \
     target=../../sun4v/lib/libpcp.so
 $(sparc_ONLY)link path=usr/platform/SUNW,USBRDT-5240/lib/libpcp.so.1 \
     target=../../sun4v/lib/libpcp.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,USBRDT-5240/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4v/lib/libsoftcrypto_psr.so.1
-$(sparc_ONLY)link path=usr/platform/SUNW,USBRDT-5240/sbin target=../sun4v/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-2/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
+$(sparc_ONLY)link path=usr/platform/SUNW,USBRDT-5240/sbin \
+    target=../sun4v/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-2/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-2/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Ultra-2/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-2/sbin target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-250/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-250/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-250/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Ultra-250/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-250/sbin target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-30 target=SUNW,Ultra-2
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-4/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-4/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-4/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link path=usr/platform/SUNW,Ultra-4/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-4/sbin target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-5_10 target=SUNW,Ultra-2
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-60 target=SUNW,Ultra-2
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-80 target=SUNW,Ultra-2
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-Enterprise-10000/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise-10000/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise-10000/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-Enterprise-10000/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise-10000/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-Enterprise/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,Ultra-Enterprise/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,Ultra-Enterprise/sbin \
     target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraAX-i2 target=sun4u
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/fs \
@@ -824,33 +541,18 @@
 $(sparc_ONLY)link \
     path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/libprtdiag_psr.so.1 \
     target=../../SUNW,UltraSPARC-IIi-Netract/lib/libprtdiag_psr.so.1
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-40/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIe-NetraCT-60/sbin \
     target=../sun4u/sbin
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/$(ARCH64)/libsoftcrypto_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/cfgadm \
     target=../../sun4u/lib/cfgadm
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/fs \
     target=../../sun4u/lib/fs
-$(sparc_ONLY)link \
-    path=usr/platform/SUNW,UltraSPARC-IIi-Netract/lib/libsoftcrypto_psr.so.1 \
-    target=../../sun4u/lib/libsoftcrypto_psr.so.1
 $(sparc_ONLY)link path=usr/platform/SUNW,UltraSPARC-IIi-Netract/sbin \
     target=../sun4u/sbin
 $(sparc_ONLY)link path=usr/platform/sun4u/lib/cfgadm/$(ARCH64)/ac.so \
--- a/usr/src/pkg/manifests/system-library-processor.mf	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/pkg/manifests/system-library-processor.mf	Mon Jun 28 15:32:48 2010 -0700
@@ -31,134 +31,31 @@
 set name=variant.arch value=$(ARCH)
 $(sparc_ONLY)dir path=etc group=sys
 $(sparc_ONLY)dir path=etc/flash group=sys
-$(sparc_ONLY)dir path=etc/flash/postcreation group=sys mode=0700
 $(sparc_ONLY)dir path=etc/flash/postdeployment group=sys
-$(sparc_ONLY)dir path=etc/flash/precreation group=sys mode=0700
-$(sparc_ONLY)dir path=etc/flash/preexit group=sys mode=0700
 dir path=platform group=sys
-$(sparc_ONLY)dir path=platform/SUNW,A70 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,A70/lib
-$(sparc_ONLY)dir path=platform/SUNW,A70/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP2300 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP2300/lib
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP2300/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP3010 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP3010/lib
-$(sparc_ONLY)dir path=platform/SUNW,Netra-CP3010/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Netra-CP3060 group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Netra-CP3060/kernel group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Netra-CP3060/kernel/misc group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Netra-CP3060/kernel/misc/$(ARCH64) \
     group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T12 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T12/lib
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T12/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T4 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T4/lib
-$(sparc_ONLY)dir path=platform/SUNW,Netra-T4/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,SPARC-Enterprise group=sys
-$(sparc_ONLY)dir path=platform/SUNW,SPARC-Enterprise/lib
-$(sparc_ONLY)dir path=platform/SUNW,SPARC-Enterprise/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Serverblade1 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Serverblade1/lib
-$(sparc_ONLY)dir path=platform/SUNW,Serverblade1/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-100 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-100/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-100/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1000 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1000/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1000/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1500 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1500/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-1500/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-2500 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-2500/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Blade-2500/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-15000 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-15000/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-15000/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-280R group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-280R/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-280R/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-480R group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-480R/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-480R/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-880 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-880/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-880/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-T200 group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-T200/kernel group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-T200/kernel/misc group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-T200/kernel/misc/$(ARCH64) \
     group=sys
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V215 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V215/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V215/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V240 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V240/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V240/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V250 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V250/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V250/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V440 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V440/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V440/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V445 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V445/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire-V445/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire/lib
-$(sparc_ONLY)dir path=platform/SUNW,Sun-Fire/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Ultra-2 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-2/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-2/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-250 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-250/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-250/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Ultra-30 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-30/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-30/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-4 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-4/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-4/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-5_10 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-5_10/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-5_10/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/SUNW,Ultra-60 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-60/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-60/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-80 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-80/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-80/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise-10000 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise-10000/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise-10000/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise/lib
-$(sparc_ONLY)dir path=platform/SUNW,Ultra-Enterprise/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,UltraAX-i2 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,UltraAX-i2/lib
-$(sparc_ONLY)dir path=platform/SUNW,UltraAX-i2/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-40 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-60 group=sys
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIi-Netract group=sys
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIi-Netract/lib
-$(sparc_ONLY)dir path=platform/SUNW,UltraSPARC-IIi-Netract/lib/$(ARCH64)
 $(i386_ONLY)dir path=platform/i86pc group=sys
 $(i386_ONLY)dir path=platform/i86xpv group=sys
 $(sparc_ONLY)dir path=platform/sun4u group=sys
-$(sparc_ONLY)dir path=platform/sun4u-opl group=sys
-$(sparc_ONLY)dir path=platform/sun4u-opl/lib group=sys
-$(sparc_ONLY)dir path=platform/sun4u-opl/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/sun4u-us3 group=sys
-$(sparc_ONLY)dir path=platform/sun4u-us3/lib group=sys
-$(sparc_ONLY)dir path=platform/sun4u-us3/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/sun4u-us3/lib/$(ARCH64)/libc_psr
-$(sparc_ONLY)dir path=platform/sun4u-us3/lib/libc_psr group=sys
 $(sparc_ONLY)dir path=platform/sun4u/lib
 $(sparc_ONLY)dir path=platform/sun4u/lib/$(ARCH64)
 $(sparc_ONLY)dir path=platform/sun4u/lib/fs
@@ -168,40 +65,18 @@
 $(sparc_ONLY)dir path=platform/sun4v group=sys
 $(sparc_ONLY)dir path=platform/sun4v/lib
 $(sparc_ONLY)dir path=platform/sun4v/lib/$(ARCH64)
-$(sparc_ONLY)dir path=platform/sun4v/lib/$(ARCH64)/libc_psr
 $(sparc_ONLY)dir path=platform/sun4v/lib/fs
 $(sparc_ONLY)dir path=platform/sun4v/lib/fs/hsfs
 $(sparc_ONLY)dir path=platform/sun4v/lib/fs/ufs
 $(sparc_ONLY)dir path=platform/sun4v/lib/fs/zfs
-$(sparc_ONLY)dir path=platform/sun4v/lib/libc_psr
 $(sparc_ONLY)file path=etc/flash/postdeployment/ttydefs.cleanup group=sys \
     mode=0744
-$(sparc_ONLY)file path=etc/flash/precreation/caplib group=sys mode=0500
 $(sparc_ONLY)file \
     path=platform/SUNW,Netra-CP3060/kernel/misc/$(ARCH64)/platmod group=sys \
     mode=0755
 $(sparc_ONLY)file \
     path=platform/SUNW,Sun-Fire-T200/kernel/misc/$(ARCH64)/platmod group=sys \
     mode=0755
-$(sparc_ONLY)file path=platform/sun4u-opl/lib/$(ARCH64)/libc_psr.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u-opl/lib/libc_psr.so.1 reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u-us3/lib/$(ARCH64)/libc_psr.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file \
-    path=platform/sun4u-us3/lib/$(ARCH64)/libc_psr/libc_psr_hwcap1.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file \
-    path=platform/sun4u-us3/lib/$(ARCH64)/libc_psr/libc_psr_hwcap2.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u-us3/lib/libc_psr.so.1 reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap1.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u-us3/lib/libc_psr/libc_psr_hwcap2.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u/lib/$(ARCH64)/libc_psr.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u/lib/$(ARCH64)/libmd_psr.so.1
 # We force bootblks into a new BE because we want to make sure
 # the user can recover from a pre-existing copy of the bootblk
 # in the event that something goes horribly wrong.
@@ -211,17 +86,6 @@
     reboot-needed=true
 $(sparc_ONLY)file path=platform/sun4u/lib/fs/zfs/bootblk group=sys mode=0444 \
     reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u/lib/libc_psr.so.1 reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)file path=platform/sun4v/lib/$(ARCH64)/libc_psr.so.1 mode=0644 \
-    reboot-needed=true
-$(sparc_ONLY)file \
-    path=platform/sun4v/lib/$(ARCH64)/libc_psr/libc_psr_hwcap1.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file \
-    path=platform/sun4v/lib/$(ARCH64)/libc_psr/libc_psr_hwcap2.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4v/lib/$(ARCH64)/libmd_psr.so.1
 # We force bootblks into a new BE because we want to make sure
 # the user can recover from a pre-existing copy of the bootblk
 # in the event that something goes horribly wrong.
@@ -231,13 +95,6 @@
     reboot-needed=true
 $(sparc_ONLY)file path=platform/sun4v/lib/fs/zfs/bootblk group=sys mode=0444 \
     reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4v/lib/libc_psr.so.1 mode=0644 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4v/lib/libc_psr/libc_psr_hwcap1.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4v/lib/libc_psr/libc_psr_hwcap2.so.1 \
-    reboot-needed=true
-$(sparc_ONLY)file path=platform/sun4v/lib/libmd_psr.so.1
 $(i386_ONLY)legacy pkg=SUNWcar.i arch=$(ARCH).i86pc category=system \
     desc="core software for a specific hardware platform group" \
     hotline="Please contact your local service provider" \
@@ -265,52 +122,12 @@
     version=11.11,REV=2009.11.11
 license cr_Sun license=cr_Sun
 license lic_CDDL license=lic_CDDL
-$(sparc_ONLY)link path=platform/SUNW,A70/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,A70/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,A70/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,A70/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Netra-210 target=SUNW,Sun-Fire-V240
 $(sparc_ONLY)link path=platform/SUNW,Netra-240 target=SUNW,Sun-Fire-V240
 $(sparc_ONLY)link path=platform/SUNW,Netra-440 target=SUNW,Sun-Fire-V440
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP2300/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP2300/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP2300/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP2300/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP3010/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP3010/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP3010/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-CP3010/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Netra-CP3060/lib target=../sun4v/lib
 $(sparc_ONLY)link path=platform/SUNW,Netra-CP3260 target=sun4v
-$(sparc_ONLY)link path=platform/SUNW,Netra-T12/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T12/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T12/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T12/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Netra-T2000 target=SUNW,Sun-Fire-T200
-$(sparc_ONLY)link path=platform/SUNW,Netra-T4/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T4/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T4/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Netra-T4/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Netra-T5220 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,Netra-T5440 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,SPARC-Enterprise-T1000 target=sun4v
@@ -318,275 +135,16 @@
     target=SUNW,Sun-Fire-T200
 $(sparc_ONLY)link path=platform/SUNW,SPARC-Enterprise-T5120 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,SPARC-Enterprise-T5220 target=sun4v
-$(sparc_ONLY)link \
-    path=platform/SUNW,SPARC-Enterprise/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-opl/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1 \
-    target=../../sun4u-opl/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Serverblade1/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Serverblade1/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Serverblade1/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Serverblade1/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-100/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-100/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-100/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-1000/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-1000/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-1000/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-1000/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-1500/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-1500/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-1500/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-1500/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-2500/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Blade-2500/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-2500/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Blade-2500/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Sun-Blade-T6300 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,Sun-Blade-T6320 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,Sun-Blade-T6340 target=sun4v
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-15000/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-15000/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-15000/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-15000/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-280R/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-280R/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-280R/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-280R/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-480R/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-480R/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-480R/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-480R/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-880/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-880/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-880/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-880/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-T1000 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-T200/lib target=../sun4v/lib
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V210 target=SUNW,Sun-Fire-V240
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V215/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-V215/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V215/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V215/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V240/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-V240/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V240/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V240/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V245 target=SUNW,Sun-Fire-V215
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V250/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-V250/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V250/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V250/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V440/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-V440/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V440/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V445/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Sun-Fire-V445/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V445/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V445/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V490 target=SUNW,Sun-Fire-480R
 $(sparc_ONLY)link path=platform/SUNW,Sun-Fire-V890 target=SUNW,Sun-Fire-880
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u-us3/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire/lib/libc_psr.so.1 \
-    target=../../sun4u-us3/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Sun-Fire/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
 $(sparc_ONLY)link path=platform/SUNW,T5140 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,T5240 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,T5440 target=sun4v
 $(sparc_ONLY)link path=platform/SUNW,USBRDT-5240 target=sun4v
-$(sparc_ONLY)link path=platform/SUNW,Ultra-2/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-2/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-2/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-2/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-250/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-250/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-250/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-250/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-30/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-30/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-30/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-30/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-4/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-4/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-4/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-4/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-5_10/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-5_10/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-5_10/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-5_10/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-60/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-60/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-60/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-60/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-80/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-80/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-80/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-80/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Ultra-Enterprise-10000/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Ultra-Enterprise-10000/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-Enterprise-10000/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-Enterprise-10000/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Ultra-Enterprise/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,Ultra-Enterprise/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,Ultra-Enterprise/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraAX-i2/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraAX-i2/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraAX-i2/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraAX-i2/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-40/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIe-NetraCT-60/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIi-Netract/lib/$(ARCH64)/libc_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libc_psr.so.1
-$(sparc_ONLY)link \
-    path=platform/SUNW,UltraSPARC-IIi-Netract/lib/$(ARCH64)/libmd_psr.so.1 \
-    target=../../../sun4u/lib/$(ARCH64)/libmd_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraSPARC-IIi-Netract/lib/libc_psr.so.1 \
-    target=../../sun4u/lib/libc_psr.so.1
-$(sparc_ONLY)link path=platform/SUNW,UltraSPARC-IIi-Netract/lib/libmd_psr.so.1 \
-    target=../../sun4u/lib/libmd_psr.so.1
--- a/usr/src/pkg/manifests/system-library.mf	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/pkg/manifests/system-library.mf	Mon Jun 28 15:32:48 2010 -0700
@@ -48,12 +48,10 @@
 dir path=usr/ccs/lib/$(ARCH64)
 dir path=usr/lib
 dir path=usr/lib/$(ARCH64)
-$(sparc_ONLY)dir path=usr/lib/$(ARCH64)/libc
 dir path=usr/lib/cfgadm
 dir path=usr/lib/cfgadm/$(ARCH64)
 dir path=usr/lib/iconv/$(ARCH64)
-dir path=usr/lib/libc
-$(i386_ONLY)dir path=usr/lib/libsoftcrypto
+$(i386_ONLY)dir path=usr/lib/libc
 dir path=usr/lib/lwp
 dir path=usr/lib/lwp/$(ARCH64)
 dir path=usr/lib/python2.4
@@ -239,7 +237,6 @@
 file path=usr/lib/$(ARCH64)/libadutils.so.1
 file path=usr/lib/$(ARCH64)/libast.so.1
 file path=usr/lib/$(ARCH64)/libbsdmalloc.so.1
-$(sparc_ONLY)file path=usr/lib/$(ARCH64)/libc/libc_hwcap1.so.1
 file path=usr/lib/$(ARCH64)/libcfgadm.so.1
 file path=usr/lib/$(ARCH64)/libcmd.so.1
 file path=usr/lib/$(ARCH64)/libcommputil.so.1
@@ -312,7 +309,6 @@
 file path=usr/lib/libadutils.so.1
 file path=usr/lib/libast.so.1
 file path=usr/lib/libbsdmalloc.so.1
-$(sparc_ONLY)file path=usr/lib/libc/libc_hwcap1.so.1
 $(i386_ONLY)file path=usr/lib/libc/libc_hwcap1.so.1 reboot-needed=true
 $(i386_ONLY)file path=usr/lib/libc/libc_hwcap2.so.1 reboot-needed=true
 $(i386_ONLY)file path=usr/lib/libc/libc_hwcap3.so.1 reboot-needed=true
@@ -358,7 +354,6 @@
 file path=usr/lib/libsldap.so.1
 file path=usr/lib/libsmbios.so.1
 file path=usr/lib/libsoftcrypto.so.1
-$(i386_ONLY)file path=usr/lib/libsoftcrypto/libsoftcrypto_hwcap1.so.1
 file path=usr/lib/libsum.so.1
 file path=usr/lib/libsys.so.1
 $(sparc_ONLY)file path=usr/lib/libv12n.so.1
--- a/usr/src/uts/sun4u/boston/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/boston/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 # uts/sun4u/boston/Makefile
 #
@@ -71,7 +68,6 @@
 		$(USR_BOSTON_INC_DIR) \
 		$(USR_BOSTON_SBIN_PRTDIAG) \
 		$(USR_BOSTON_SBIN_FRUADM) \
-		$(USR_BOSTON_SBIN_TRAPSTAT) \
 		$(USR_BOSTON_LIB_DIR) \
 		$(BOSTON_CRYPTO_LINKS) \
 		.WAIT $(BOSTON_KMODS)
--- a/usr/src/uts/sun4u/boston/Makefile.boston	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/boston/Makefile.boston	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4u implementation specific modules.
 #
@@ -55,7 +52,6 @@
 USR_BOSTON_SBIN_DIR	= $(USR_BOSTON_DIR)/sbin
 USR_BOSTON_SBIN_PRTDIAG	= $(USR_BOSTON_SBIN_DIR)/prtdiag
 USR_BOSTON_SBIN_FRUADM	= $(USR_BOSTON_SBIN_DIR)/fruadm
-USR_BOSTON_SBIN_TRAPSTAT = $(USR_BOSTON_SBIN_DIR)/trapstat
 USR_BOSTON_LIB_DIR	= $(USR_BOSTON_DIR)/lib
 
 BOSTON_LINT_LIB_DIR= $(UTSBASE)/$(PLATFORM)/boston/lint-libs/$(OBJS_DIR)
--- a/usr/src/uts/sun4u/boston/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/boston/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -20,8 +20,7 @@
 #
 
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Common targets for sun4u implementation specific modules.
 #
@@ -68,9 +67,6 @@
 $(USR_BOSTON_SBIN_PRTDIAG): $(USR_BOSTON_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_BOSTON_SBIN_TRAPSTAT): $(USR_BOSTON_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_BOSTON_SBIN_FRUADM): $(USR_BOSTON_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4u/mpxu/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/mpxu/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -19,11 +19,7 @@
 # CDDL HEADER END
 #
 #
-# uts/sun4u/mpxu/Makefile
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -78,7 +74,6 @@
 install:	$(ROOT_MPXU_DIR) $(USR_MPXU_DIR) \
 		$(USR_MPXU_INC_DIR) \
 		$(USR_MPXU_SBIN_PRTDIAG) \
-		$(USR_MPXU_SBIN_TRAPSTAT) \
 		$(USR_MPXU_SBIN_FRUADM) \
 		$(USR_MPXU_LIB_DIR) \
 		$(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%) \
--- a/usr/src/uts/sun4u/mpxu/Makefile.mpxu.shared	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/mpxu/Makefile.mpxu.shared	Mon Jun 28 15:32:48 2010 -0700
@@ -19,11 +19,7 @@
 # CDDL HEADER END
 #
 #
-# uts/sun4u/mpxu/Makefile.mpxu
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -57,7 +53,6 @@
 USR_MPXU_ISYS_DIR	= $(USR_MPXU_INC_DIR)/sys
 USR_MPXU_SBIN_DIR	= $(USR_MPXU_DIR)/sbin
 USR_MPXU_SBIN_PRTDIAG	= $(USR_MPXU_SBIN_DIR)/prtdiag
-USR_MPXU_SBIN_TRAPSTAT	= $(USR_MPXU_SBIN_DIR)/trapstat
 USR_MPXU_SBIN_FRUADM	= $(USR_MPXU_SBIN_DIR)/fruadm
 USR_MPXU_LIB_DIR	= $(USR_MPXU_DIR)/lib
 
--- a/usr/src/uts/sun4u/mpxu/Makefile.targ.shared	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/mpxu/Makefile.targ.shared	Mon Jun 28 15:32:48 2010 -0700
@@ -19,8 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
 #
@@ -71,9 +70,6 @@
 $(USR_MPXU_SBIN_PRTDIAG): $(USR_MPXU_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_MPXU_SBIN_TRAPSTAT): $(USR_MPXU_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_MPXU_SBIN_FRUADM): $(USR_MPXU_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4u/opl/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/opl/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -19,10 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	This makefile drives the production of the sun4u opl platform
 #	module.
@@ -75,7 +72,6 @@
 	$(USR_OPL_INC_DIR) \
 	$(USR_OPL_SBIN_DIR) \
 	$(USR_OPL_SBIN_PRTDIAG) \
-	$(USR_OPL_SBIN_TRAPSTAT) \
 	$(USR_OPL_SBIN_FRUADM) \
 	$(USR_OPL_LIB_DIR) \
 	$(OPL_CRYPTO_LINKS) \
--- a/usr/src/uts/sun4u/opl/Makefile.opl.shared	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/opl/Makefile.opl.shared	Mon Jun 28 15:32:48 2010 -0700
@@ -19,10 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4u opl implementation specific modules.
 #
@@ -60,7 +57,6 @@
 USR_OPL_LIB_DIR		= $(USR_OPL_DIR)/lib
 USR_OPL_SBIN_DIR	= $(USR_OPL_DIR)/sbin
 USR_OPL_SBIN_PRTDIAG	= $(USR_OPL_SBIN_DIR)/prtdiag
-USR_OPL_SBIN_TRAPSTAT	= $(USR_OPL_SBIN_DIR)/trapstat
 USR_OPL_SBIN_FRUADM	= $(USR_OPL_SBIN_DIR)/fruadm
 USR_OPL_INC_DIR		= $(USR_OPL_DIR)/include
 USR_OPL_ISYS_DIR	= $(USR_OPL_INC_DIR)/sys
--- a/usr/src/uts/sun4u/opl/Makefile.targ.shared	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/opl/Makefile.targ.shared	Mon Jun 28 15:32:48 2010 -0700
@@ -19,8 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Common targets for sun4u opl implementation specific modules.
 #
@@ -74,9 +73,6 @@
 $(USR_OPL_SBIN_PRTDIAG): $(USR_OPL_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_OPL_SBIN_TRAPSTAT): $(USR_OPL_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_OPL_SBIN_FRUADM): $(USR_OPL_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4u/schumacher/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/schumacher/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -18,10 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	This makefile drives the production of the sun4u schumacher platform
 #	module.
@@ -67,7 +64,6 @@
 		$(USR_SCHUMACHER_INC_DIR) \
 		$(USR_SCHUMACHER_SBIN_DIR) \
 		$(USR_SCHUMACHER_SBIN_PRTDIAG) \
-		$(USR_SCHUMACHER_SBIN_TRAPSTAT) \
 		$(USR_SCHUMACHER_SBIN_FRUADM) \
 		$(USR_SCHUMACHER_LIB_DIR) \
 		$(SCHUMACHER_CRYPTO_LINKS) \
--- a/usr/src/uts/sun4u/schumacher/Makefile.schumacher	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/schumacher/Makefile.schumacher	Mon Jun 28 15:32:48 2010 -0700
@@ -18,10 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4u implementation specific modules.
 #
@@ -52,7 +49,6 @@
 USR_SCHUMACHER_ISYS_DIR	= $(USR_SCHUMACHER_INC_DIR)/sys
 USR_SCHUMACHER_SBIN_DIR	= $(USR_SCHUMACHER_DIR)/sbin
 USR_SCHUMACHER_SBIN_PRTDIAG = $(USR_SCHUMACHER_SBIN_DIR)/prtdiag
-USR_SCHUMACHER_SBIN_TRAPSTAT = $(USR_SCHUMACHER_SBIN_DIR)/trapstat
 USR_SCHUMACHER_SBIN_FRUADM = $(USR_SCHUMACHER_SBIN_DIR)/fruadm
 USR_SCHUMACHER_LIB_DIR	= $(USR_SCHUMACHER_DIR)/lib
 
--- a/usr/src/uts/sun4u/schumacher/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/schumacher/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -18,8 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Common targets for sun4u implementation specific modules.
 #
@@ -67,9 +66,6 @@
 $(USR_SCHUMACHER_SBIN_PRTDIAG): $(USR_SCHUMACHER_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_SCHUMACHER_SBIN_TRAPSTAT): $(USR_SCHUMACHER_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_SCHUMACHER_SBIN_FRUADM): $(USR_SCHUMACHER_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4u/seattle/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/seattle/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 # uts/sun4u/seattle/Makefile
 #
@@ -72,7 +69,6 @@
 		$(USR_SEATTLE_DIR) \
 		$(USR_SEATTLE_INC_DIR) \
 		$(USR_SEATTLE_SBIN_PRTDIAG) \
-		$(USR_SEATTLE_SBIN_TRAPSTAT) \
 		$(USR_SEATTLE_SBIN_FRUADM) \
 		$(USR_SEATTLE_LIB_DIR) \
 		$(LINKED_PLATFORMS:%=$(USR_PLAT_DIR)/%) \
--- a/usr/src/uts/sun4u/seattle/Makefile.seattle	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/seattle/Makefile.seattle	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 #
 
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4u implementation specific modules.
 #
@@ -54,7 +51,6 @@
 USR_SEATTLE_ISYS_DIR	= $(USR_SEATTLE_INC_DIR)/sys
 USR_SEATTLE_SBIN_DIR	= $(USR_SEATTLE_DIR)/sbin
 USR_SEATTLE_SBIN_PRTDIAG = $(USR_SEATTLE_SBIN_DIR)/prtdiag
-USR_SEATTLE_SBIN_TRAPSTAT = $(USR_SEATTLE_SBIN_DIR)/trapstat
 USR_SEATTLE_SBIN_FRUADM	= $(USR_SEATTLE_SBIN_DIR)/fruadm
 USR_SEATTLE_LIB_DIR	= $(USR_SEATTLE_DIR)/lib
 
--- a/usr/src/uts/sun4u/seattle/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/seattle/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -20,8 +20,7 @@
 #
 
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Common targets for sun4u implementation specific modules.
 #
@@ -68,9 +67,6 @@
 $(USR_SEATTLE_SBIN_PRTDIAG): $(USR_SEATTLE_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_SEATTLE_SBIN_TRAPSTAT): $(USR_SEATTLE_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_SEATTLE_SBIN_FRUADM): $(USR_SEATTLE_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4u/snowbird/Makefile	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/snowbird/Makefile	Mon Jun 28 15:32:48 2010 -0700
@@ -19,11 +19,7 @@
 # CDDL HEADER END
 #
 #
-# uts/sun4u/snowbird/Makefile
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	This makefile drives the production of the sun4u snowbird platform
 #	module.
@@ -71,7 +67,6 @@
 		$(USR_SNOWBIRD_INC_DIR) \
 		$(USR_SNOWBIRD_SBIN_DIR) \
 		$(USR_SNOWBIRD_SBIN_PRTDIAG) \
-		$(USR_SNOWBIRD_SBIN_TRAPSTAT) \
 		$(USR_SNOWBIRD_SBIN_FRUADM) \
 		$(USR_SNOWBIRD_LIB_DIR) \
 		.WAIT $(SNOWBIRD_KMODS) \
--- a/usr/src/uts/sun4u/snowbird/Makefile.snowbird	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/snowbird/Makefile.snowbird	Mon Jun 28 15:32:48 2010 -0700
@@ -19,10 +19,8 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 #
 #	Global definitions for sun4u snowbird implementation specific modules.
 # uts/sun4u/snowbird/Makefile.snowbird
@@ -67,7 +65,6 @@
 USR_SNOWBIRD_INC_DIR		= $(USR_SNOWBIRD_DIR)/include
 USR_SNOWBIRD_SBIN_DIR		= $(USR_SNOWBIRD_DIR)/sbin
 USR_SNOWBIRD_SBIN_PRTDIAG	= $(USR_SNOWBIRD_SBIN_DIR)/prtdiag
-USR_SNOWBIRD_SBIN_TRAPSTAT	= $(USR_SNOWBIRD_SBIN_DIR)/trapstat
 USR_SNOWBIRD_SBIN_FRUADM	= $(USR_SNOWBIRD_SBIN_DIR)/fruadm
 USR_SNOWBIRD_LIB_DIR		= $(USR_SNOWBIRD_DIR)/lib
 USR_SNOWBIRD_ISYS_DIR		= $(USR_SNOWBIRD_INC_DIR)/sys
--- a/usr/src/uts/sun4u/snowbird/Makefile.targ	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4u/snowbird/Makefile.targ	Mon Jun 28 15:32:48 2010 -0700
@@ -19,8 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 # uts/sun4u/snowbird/Makefile.targ
 #	Common targets for sun4u snowbird implementation specific modules.
@@ -89,9 +88,6 @@
 $(USR_SNOWBIRD_SBIN_PRTDIAG): $(USR_SNOWBIRD_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/prtdiag $@
 
-$(USR_SNOWBIRD_SBIN_TRAPSTAT): $(USR_SNOWBIRD_SBIN_DIR)
-	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/trapstat $@
-
 $(USR_SNOWBIRD_SBIN_FRUADM): $(USR_SNOWBIRD_SBIN_DIR)
 	$(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/sbin/fruadm $@
 
--- a/usr/src/uts/sun4v/Makefile.monza	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4v/Makefile.monza	Mon Jun 28 15:32:48 2010 -0700
@@ -20,10 +20,7 @@
 #
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4v Monza implementation specific modules.
 #
@@ -36,4 +33,3 @@
 USR_MONZA_DIR		= $(USR_PLAT_DIR)/SUNW,Netra-CP3260
 USR_MONZA_SBIN_DIR	= $(USR_MONZA_DIR)/sbin
 USR_MONZA_SBIN_LINKS	= $(USR_MONZA_SBIN_DIR)/prtdiag
-USR_MONZA_SBIN_LINKS	+= $(USR_MONZA_SBIN_DIR)/trapstat
--- a/usr/src/uts/sun4v/montoya/Makefile.montoya	Tue Jun 01 16:51:51 2010 +0200
+++ b/usr/src/uts/sun4v/montoya/Makefile.montoya	Mon Jun 28 15:32:48 2010 -0700
@@ -19,11 +19,7 @@
 # CDDL HEADER END
 #
 #
-# uts/sun4v/montoya/Makefile
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-#ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 #	Global definitions for sun4v montoya implementation specific modules.
 #
@@ -57,7 +53,6 @@
 USR_MONTOYA_ISYS_DIR	= $(USR_MONTOYA_INC_DIR)/sys
 
 USR_MONTOYA_SBIN_LINKS	= $(USR_MONTOYA_SBIN_DIR)/prtdiag
-USR_MONTOYA_SBIN_LINKS	+= $(USR_MONTOYA_SBIN_DIR)/trapstat
 
 MONTOYA_LINT_LIB_DIR= $(UTSBASE)/$(PLATFORM)/montoya/lint-libs/$(OBJS_DIR)