Also, fixed Reminder => Remainder.

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 +-
 .../SysCall/Ia32/MathRemainderU64x64.nasm          | 83 ++++++++++++++++++++
 .../BaseCryptLib/SysCall/Ia32/MathReminderU64x64.S | 89 ----------------------
 6 files changed, 87 insertions(+), 93 deletions(-)
 create mode 100644 
CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRemainderU64x64.nasm
 delete mode 100644 
CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathReminderU64x64.S

diff --git a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
index 2358102..b1a28a8 100644
--- a/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -71,7 +71,7 @@
 
   SysCall/Ia32/MathMultS64x64.nasm  | GCC
   SysCall/Ia32/MathDivU64x64.nasm   | GCC
-  SysCall/Ia32/MathReminderU64x64.S | GCC
+  SysCall/Ia32/MathRemainderU64x64.nasm | GCC
   SysCall/Ia32/MathLShiftS64.S      | GCC
   SysCall/Ia32/MathRShiftU64.S      | GCC
 
diff --git a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
index a0dd683..26b5562 100644
--- a/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
@@ -81,7 +81,7 @@
 
   SysCall/Ia32/MathMultS64x64.nasm  | GCC
   SysCall/Ia32/MathDivU64x64.nasm   | GCC
-  SysCall/Ia32/MathReminderU64x64.S | GCC
+  SysCall/Ia32/MathRemainderU64x64.nasm | GCC
   SysCall/Ia32/MathLShiftS64.S      | GCC
   SysCall/Ia32/MathRShiftU64.S      | GCC
 
diff --git a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
index 57d0852..ece9209 100644
--- a/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
@@ -76,7 +76,7 @@
 
   SysCall/Ia32/MathMultS64x64.nasm  | GCC
   SysCall/Ia32/MathDivU64x64.nasm   | GCC
-  SysCall/Ia32/MathReminderU64x64.S | GCC
+  SysCall/Ia32/MathRemainderU64x64.nasm | GCC
   SysCall/Ia32/MathLShiftS64.S      | GCC
   SysCall/Ia32/MathRShiftU64.S      | GCC
 
diff --git a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf 
b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
index e3972bc..6e876ab 100644
--- a/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
+++ b/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
@@ -76,7 +76,7 @@
 
   SysCall/Ia32/MathMultS64x64.nasm  | GCC
   SysCall/Ia32/MathDivU64x64.nasm   | GCC
-  SysCall/Ia32/MathReminderU64x64.S | GCC
+  SysCall/Ia32/MathRemainderU64x64.nasm | GCC
   SysCall/Ia32/MathLShiftS64.S      | GCC
   SysCall/Ia32/MathRShiftU64.S      | GCC
 
diff --git 
a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRemainderU64x64.nasm 
b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRemainderU64x64.nasm
new file mode 100644
index 0000000..b84902d
--- /dev/null
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathRemainderU64x64.nasm
@@ -0,0 +1,83 @@
+;------------------------------------------------------------------------------
+; @file
+;   64-bit Math Worker Function.
+;   Divides a 64-bit unsigned value by another 64-bit unsigned value and 
returns
+;   the 64-bit unsigned remainder
+;
+; 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(DivU64x64Remainder)
+
+;------------------------------------------------------------------------------
+;
+; void __cdecl __umoddi3 (void)
+;
+;------------------------------------------------------------------------------
+global ASM_PFX(__umoddi3)
+ASM_PFX(__umoddi3):
+    ; Original local stack when calling __umoddi3
+    ;               -----------------
+    ;               |               |
+    ;               |---------------|
+    ;               |               |
+    ;               |--  Divisor  --|
+    ;               |               |
+    ;               |---------------|
+    ;               |               |
+    ;               |--  Dividend --|
+    ;               |               |
+    ;               |---------------|
+    ;               |  ReturnAddr** |
+    ;       ESP---->|---------------|
+    ;
+
+    ;
+    ; Set up the local stack for Reminder pointer
+    ;
+    sub     esp, 8
+    push    esp
+
+    ;
+    ; Set up the local stack for Divisor parameter
+    ;
+    mov     eax, [esp + 28]
+    push    eax
+    mov     eax, [esp + 28]
+    push    eax
+
+    ;
+    ; Set up the local stack for Dividend parameter
+    ;
+    mov     eax, [esp + 28]
+    push    eax
+    mov     eax, [esp + 28]
+    push    eax
+
+    ;
+    ; Call native DivU64x64Remainder of BaseLib
+    ;
+    jmp     ASM_PFX(DivU64x64Remainder)
+
+    ;
+    ; Put the Reminder in EDX:EAX as return value
+    ;
+    mov     eax, [esp + 20]
+    mov     edx, [esp + 24]
+
+    ;
+    ; Adjust stack
+    ;
+    add     esp, 28
+
+    ret     16
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathReminderU64x64.S 
b/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathReminderU64x64.S
deleted file mode 100644
index 7c1f971..0000000
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/Ia32/MathReminderU64x64.S
+++ /dev/null
@@ -1,89 +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:
-#
-#   MathReminderU64x64.S
-#
-# Abstract:
-#
-#   64-bit Math Worker Function.
-#   Divides a 64-bit unsigned value by another 64-bit unsigned value and 
returns
-#   the 64-bit unsigned remainder
-#
-#------------------------------------------------------------------------------
-
-    .686:
-    .code:
-
-ASM_GLOBAL ASM_PFX(__umoddi3), ASM_PFX(DivU64x64Remainder)
-
-#------------------------------------------------------------------------------
-#
-# void __cdecl __umoddi3 (void)
-#
-#------------------------------------------------------------------------------
-ASM_PFX(__umoddi3):
-    # Original local stack when calling __umoddi3
-    #               -----------------
-    #               |               |
-    #               |---------------|
-    #               |               |
-    #               |--  Divisor  --|
-    #               |               |
-    #               |---------------|
-    #               |               |
-    #               |--  Dividend --|
-    #               |               |
-    #               |---------------|
-    #               |  ReturnAddr** |
-    #       ESP---->|---------------|
-    #
-
-    #
-    # Set up the local stack for Reminder pointer
-    #
-    sub     $8, %esp
-    push    %esp
-
-    #
-    # Set up the local stack for Divisor parameter
-    #
-    movl    28(%esp), %eax
-    push    %eax
-    movl    28(%esp), %eax
-    push    %eax
-
-    #
-    # Set up the local stack for Dividend parameter
-    #
-    movl    28(%esp), %eax
-    push    %eax
-    movl    28(%esp), %eax
-    push    %eax
-
-    #
-    # Call native DivU64x64Remainder of BaseLib
-    #
-    jmp     ASM_PFX(DivU64x64Remainder)
-
-    #
-    # Put the Reminder in EDX:EAX as return value
-    #
-    movl    20(%esp), %eax
-    movl    24(%esp), %edx
-
-    #
-    # Adjust stack
-    #
-    add     $28, %esp
-    
-    ret     $16
-- 
2.1.1


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to