From owner-svn-src-all@freebsd.org Thu May 24 21:11:34 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 BA49AEFE577; Thu, 24 May 2018 21:11:34 +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 5EABD84267; Thu, 24 May 2018 21:11:34 +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 3DE5F178DD; Thu, 24 May 2018 21:11:34 +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 w4OLBYfS009939; Thu, 24 May 2018 21:11:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4OLBXoo009938; Thu, 24 May 2018 21:11:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805242111.w4OLBXoo009938@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:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334183 - in head/sys: conf i386/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf i386/i386 X-SVN-Commit-Revision: 334183 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:34 -0000 Author: imp Date: Thu May 24 21:11:33 2018 New Revision: 334183 URL: https://svnweb.freebsd.org/changeset/base/334183 Log: Make memmove and bcopy share code Make memmove the primary interface, but have bcopy be an alternative entry point that jumps into memmove. This will slightly pessimize bcopy calls, but those are about to get much rarer. Return dst always, but it will be ignored by bcopy callers. We can remove just the alt entry point if we ever remove bcopy entirely. Differential Revision: https://reviews.freebsd.org/D15374 Modified: head/sys/conf/files.i386 head/sys/i386/i386/support.s Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu May 24 21:11:28 2018 (r334182) +++ head/sys/conf/files.i386 Thu May 24 21:11:33 2018 (r334183) @@ -553,7 +553,6 @@ kern/subr_sfbuf.c standard libkern/divdi3.c standard libkern/ffsll.c standard libkern/flsll.c standard -libkern/memmove.c standard libkern/memset.c standard libkern/moddi3.c standard libkern/qdivrem.c standard Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Thu May 24 21:11:28 2018 (r334182) +++ head/sys/i386/i386/support.s Thu May 24 21:11:33 2018 (r334183) @@ -146,6 +146,7 @@ ENTRY(fillw) END(fillw) /* + * memmove(dst, src, cnt) (return dst) * bcopy(src, dst, cnt) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ @@ -156,6 +157,15 @@ ENTRY(bcopy) pushl %edi movl 8(%ebp),%esi movl 12(%ebp),%edi + jmp 1f +ALTENTRY(memmove) + pushl %ebp + movl %esp,%ebp + pushl %esi + pushl %edi + movl 8(%ebp),%edi + movl 12(%ebp),%esi +1: movl 16(%ebp),%ecx movl %edi,%eax @@ -172,6 +182,7 @@ ENTRY(bcopy) movsb popl %edi popl %esi + movl 8(%ebp),%eax /* return dst for memmove */ popl %ebp ret @@ -194,6 +205,7 @@ ENTRY(bcopy) popl %edi popl %esi cld + movl 8(%ebp),%eax /* return dst for memmove */ popl %ebp ret END(bcopy)