From nobody Wed May 1 22:40:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1515269041371444.56804418833053; Sat, 6 Jan 2018 12:04:01 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 230C9222275AC; Sat, 6 Jan 2018 11:58:51 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7491422227592 for ; Sat, 6 Jan 2018 11:58:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 766A781DF0; Sat, 6 Jan 2018 20:03:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-146.rdu2.redhat.com [10.10.120.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0F705D6A2; Sat, 6 Jan 2018 20:03:55 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Sat, 6 Jan 2018 21:03:53 +0100 Message-Id: <20180106200353.18334-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 06 Jan 2018 20:03:57 +0000 (UTC) Subject: [edk2] [PATCH] ShellPkg/UefiShellLevel2CommandsLib: add missing EFIAPI call conv spec X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Ruiyu Ni , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" UefiShellLevel2CommandsLib (somewhat questionably) calls the BaseLib-internal function InternalCharToUpper(). This function is declared in "MdePkg/Library/BaseLib/BaseLibInternals.h", which is not a public library class header. UefiShellLevel2CommandsLib therefore duplicates the function declaration, but a mistake was made: the EFIAPI calling convention is not spelled out on the duplicated declaration. Therefore calls made from UefiShellLevel2CommandsLib will not match the actual function definition in "MdePkg/Library/BaseLib/String.c", when GCC/X64 toolchains are used. One consequence of this is that cross-filesystem copies don't work in the UEFI shell (see the StrniCmp() function in "UefiShellLevel2CommandsLib.c"). From the original report: > FS0:\efi\ubuntu\> cp grubx64.efi fs1:\ > > cp: The source and destination are the same. Copy the declaration from "BaseLibInternals.h" to "UefiShellLevel2CommandsLib.c" verbatim. Reported-by: Rebecca Cran Analyzed-by: Thomas Palmer Analyzed-by: Liming Gao Ref: http://mid.mail-archive.com/47cd17d8-f022-6ca5-2f52-06a8250f8d14@cran.= org.uk Cc: Jaben Carsey Cc: Liming Gao Cc: Rebecca Cran Cc: Ruiyu Ni Cc: Thomas Palmer Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c |= 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Com= mandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Com= mandsLib.c index 7948e53cfc46..e9ce63189224 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLi= b.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLi= b.c @@ -268,8 +268,9 @@ VerifyIntermediateDirectories ( @return Char as an upper case character. **/ CHAR16 +EFIAPI InternalCharToUpper ( - IN CONST CHAR16 Char + IN CHAR16 Char ); =20 /** --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel