Received: by mail.netbsd.org (Postfix, from userid 605) id C501084D35; Sat, 22 Dec 2018 21:27:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id BDEBB84D2C for ; Sat, 22 Dec 2018 21:27:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 6dm8yCiUkWIp for ; Sat, 22 Dec 2018 21:27:23 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id E164984CFB for ; Sat, 22 Dec 2018 21:27:22 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DAAB6FB16; Sat, 22 Dec 2018 21:27:22 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sat, 22 Dec 2018 21:27:22 +0000 From: "Cherry G. Mathew" Subject: CVS commit: src/sys/arch To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20181222212722.DAAB6FB16@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Cherry G. Mathew" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: cherry Date: Sat Dec 22 21:27:22 UTC 2018 Modified Files: src/sys/arch/amd64/amd64: cpufunc.S src/sys/arch/i386/i386: cpufunc.S i386func.S src/sys/arch/xen/x86: xenfunc.c Log Message: Introduce a weak alias method of exporting different implementations of the same API. For eg: the amd64 native implementation of invlpg() now becomes amd64_invlpg() with a weak symbol export of invlpg(), while the XEN implementation becomes xen_invlpg(), also weakly exported as invlpg() Note that linking in both together without having an override function named invlpg() would be a mistake, as we have limited control over which of the two options would emerge as the finally exported invlpg() resulting in a potential situation where the wrong function is finally exported. This change avoids this situation. We should however include an override function invlpg() in that case, such that it is able to then pass on the call to the appropriate backing function (amd64_invlpg() in the case of native, and xen_invlpg() in the case of under XEN virtualisation) at runtime. This change does not introduce such a function and therefore does not alter builds to include native as well as XEN implementations in the same binary. This will be done later, with the introduction of XEN PVHVM mode, where precisely such a runtime switch is required. There are no operational changes introduced by this change. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/amd64/cpufunc.S cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/i386/cpufunc.S cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/i386/i386func.S cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/xenfunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.