]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/UefiShellLevel2CommandsLib: add missing EFIAPI call conv spec
authorLaszlo Ersek <lersek@redhat.com>
Sat, 6 Jan 2018 19:24:11 +0000 (20:24 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 8 Jan 2018 22:15:02 +0000 (23:15 +0100)
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 <rebecca@bluestop.org>
Analyzed-by: Thomas Palmer <thomas.palmer@hpe.com>
Analyzed-by: Liming Gao <liming.gao@intel.com>
Ref: http://mid.mail-archive.com/47cd17d8-f022-6ca5-2f52-06a8250f8d14@cran.org.uk
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Rebecca Cran <rebecca@bluestop.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Thomas Palmer <thomas.palmer@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c

index 7948e53cfc469ae1c54915436a25d4981956110e..e9ce6318922422225365675c8695858ffc629d28 100644 (file)
@@ -268,8 +268,9 @@ VerifyIntermediateDirectories (
   @return Char as an upper case character.\r
 **/\r
 CHAR16\r
+EFIAPI\r
 InternalCharToUpper (\r
-  IN CONST CHAR16                    Char\r
+  IN      CHAR16                    Char\r
   );\r
 \r
 /**\r