Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com> --- CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 2 +- CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf | 2 +- CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf | 2 +- CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf | 2 +- .../BaseCryptLib/SysCall/Ia32/MathMultS64x64.S | 77 ---------------------- .../BaseCryptLib/SysCall/Ia32/MathMultS64x64.nasm | 71 ++++++++++++++++++++ 6 files changed, 75 insertions(+), 81 deletions(-) delete mode 100644 CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.S create mode 100644 CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.nasm
diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf index a6e6dca..b1e0590 100644 --- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf @@ -69,7 +69,7 @@ SysCall/Ia32/MathLShiftS64.c | INTEL SysCall/Ia32/MathRShiftU64.c | INTEL - SysCall/Ia32/MathMultS64x64.S | GCC + SysCall/Ia32/MathMultS64x64.nasm | GCC SysCall/Ia32/MathDivU64x64.S | GCC SysCall/Ia32/MathReminderU64x64.S | GCC SysCall/Ia32/MathLShiftS64.S | GCC diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf index 74ca6a9..89a2264 100644 --- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf @@ -79,7 +79,7 @@ SysCall/Ia32/MathLShiftS64.c | INTEL SysCall/Ia32/MathRShiftU64.c | INTEL - SysCall/Ia32/MathMultS64x64.S | GCC + SysCall/Ia32/MathMultS64x64.nasm | GCC SysCall/Ia32/MathDivU64x64.S | GCC SysCall/Ia32/MathReminderU64x64.S | GCC SysCall/Ia32/MathLShiftS64.S | GCC diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf index 355ecc4..6b68dcc 100644 --- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf @@ -74,7 +74,7 @@ SysCall/Ia32/MathLShiftS64.c | INTEL SysCall/Ia32/MathRShiftU64.c | INTEL - SysCall/Ia32/MathMultS64x64.S | GCC + SysCall/Ia32/MathMultS64x64.nasm | GCC SysCall/Ia32/MathDivU64x64.S | GCC SysCall/Ia32/MathReminderU64x64.S | GCC SysCall/Ia32/MathLShiftS64.S | GCC diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf index c62da1a..14b6493 100644 --- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf +++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf @@ -74,7 +74,7 @@ SysCall/Ia32/MathLShiftS64.c | INTEL SysCall/Ia32/MathRShiftU64.c | INTEL - SysCall/Ia32/MathMultS64x64.S | GCC + SysCall/Ia32/MathMultS64x64.nasm | GCC SysCall/Ia32/MathDivU64x64.S | GCC SysCall/Ia32/MathReminderU64x64.S | GCC SysCall/Ia32/MathLShiftS64.S | GCC diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.S b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.S deleted file mode 100644 index 8a5f330..0000000 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.S +++ /dev/null @@ -1,77 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php. -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# Module Name: -# -# MathMultS64x64.S -# -# Abstract: -# -# 64-bit Math Worker Function. -# Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value -# and returns a 64-bit result -# -#------------------------------------------------------------------------------ - - .686: - .code: - -ASM_GLOBAL ASM_PFX(_mulll), ASM_PFX(MultS64x64) - -#------------------------------------------------------------------------------ -# -# void __cdecl __mulll (void) -# -#------------------------------------------------------------------------------ -ASM_PFX(__mulll): - # Original local stack when calling __mulll - # ----------------- - # | | - # |---------------| - # | | - # |--Multiplier --| - # | | - # |---------------| - # | | - # |--Multiplicand-| - # | | - # |---------------| - # | ReturnAddr** | - # ESP---->|---------------| - # - - # - # Set up the local stack for Multiplicand parameter - # - movl 16(%esp), %eax - push %eax - movl 16(%esp), %eax - push %eax - - # - # Set up the local stack for Multiplier parameter - # - movl 16(%esp), %eax - push %eax - movl 16(%esp), %eax - push %eax - - # - # Call native MulS64x64 of BaseLib - # - jmp ASM_PFX(MultS64x64) - - # - # Adjust stack - # - add $16, %esp - - ret $16 diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.nasm b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.nasm new file mode 100644 index 0000000..041ed2b --- /dev/null +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathMultS64x64.nasm @@ -0,0 +1,71 @@ +;------------------------------------------------------------------------------ +; @file +; 64-bit Math Worker Function. +; Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value +; and returns a 64-bit result +; +; Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR> +; This program and the accompanying materials +; are licensed and made available under the terms and conditions of the BSD License +; which accompanies this distribution. The full text of the license may be found at +; http://opensource.org/licenses/bsd-license.php. +; +; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +; +;------------------------------------------------------------------------------ + +SECTION .text + +extern ASM_PFX(MultS64x64) + +;------------------------------------------------------------------------------ +; +; void __cdecl __mulll (void) +; +;------------------------------------------------------------------------------ +global ASM_PFX(_mulll) +ASM_PFX(__mulll): + ; Original local stack when calling __mulll + ; ----------------- + ; | | + ; |---------------| + ; | | + ; |--Multiplier --| + ; | | + ; |---------------| + ; | | + ; |--Multiplicand-| + ; | | + ; |---------------| + ; | ReturnAddr** | + ; ESP---->|---------------| + ; + + ; + ; Set up the local stack for Multiplicand parameter + ; + mov eax, [esp + 16] + push eax + mov eax, [esp + 16] + push eax + + ; + ; Set up the local stack for Multiplier parameter + ; + mov eax, [esp + 16] + push eax + mov eax, [esp + 16] + push eax + + ; + ; Call native MulS64x64 of BaseLib + ; + jmp ASM_PFX(MultS64x64) + + ; + ; Adjust stack + ; + add esp, 16 + + ret 16 -- 2.1.1 ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel