From owner-svn-src-all@freebsd.org Thu May 24 21:11:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26C6FEFE570; Thu, 24 May 2018 21:11:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E58D84208; Thu, 24 May 2018 21:11:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B217178D3; Thu, 24 May 2018 21:11:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4OLBT1Y009884; Thu, 24 May 2018 21:11:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4OLBTRv009882; Thu, 24 May 2018 21:11:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805242111.w4OLBTRv009882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 24 May 2018 21:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334182 - in head/sys: conf sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf sparc64/sparc64 X-SVN-Commit-Revision: 334182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 21:11:33 -0000 Author: imp Date: Thu May 24 21:11:28 2018 New Revision: 334182 URL: https://svnweb.freebsd.org/changeset/base/334182 Log: Define memmove and make bcopy alt entry point Make a memmove entry point just before bcopy and have it swap its args before continuing into the body of bcopy. Adjust the returns to return dst (original %o0 swapped to %o1) from both entry points. bcopy users will ignore them. Since these are in the branch delay slot, it should take no additional time. I use %o6 for this rather than just move %o1 back to %o2 at the end since my sparc64 assembler knowledge is weak. Also eliminate wrapper call from memmove to bcopy. Differential Revision: https://reviews.freebsd.org/D15374 Modified: head/sys/conf/files.sparc64 head/sys/sparc64/sparc64/support.S Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Thu May 24 21:11:24 2018 (r334181) +++ head/sys/conf/files.sparc64 Thu May 24 21:11:28 2018 (r334182) @@ -71,7 +71,6 @@ libkern/ffsll.c standard libkern/fls.c standard libkern/flsl.c standard libkern/flsll.c standard -libkern/memmove.c standard sparc64/central/central.c optional central sparc64/ebus/ebus.c optional ebus sparc64/ebus/epic.c optional epic ebus Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Thu May 24 21:11:24 2018 (r334181) +++ head/sys/sparc64/sparc64/support.S Thu May 24 21:11:28 2018 (r334182) @@ -265,10 +265,18 @@ ENTRY(bcmp) END(bcmp) /* + * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(bcopy) +ENTRY(memmove) /* + * Swap src/dst for memmove/bcopy differences + */ + mov %o0, %o6 + mov %o1, %o0 + mov %o6, %o1 +ALTENTRY(bcopy) + /* * Check for overlap, and copy backwards if so. */ sub %o1, %o0, %g1 @@ -290,15 +298,15 @@ ENTRY(bcopy) ba %xcc, 1b stb %g1, [%o1] 2: retl - nop + mov %o6, %o0 /* * Do the fast version. */ 3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl - nop -END(bcopy) + mov %o6, %o0 +END(memmove) /* * void bzero(void *b, size_t len)