]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg BaseMemoryLibOptPei: Convert X64/CompareMem.asm to NASM
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 31 May 2016 01:52:09 +0000 (18:52 -0700)
committerLiming Gao <liming.gao@intel.com>
Tue, 28 Jun 2016 01:51:07 +0000 (09:51 +0800)
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
X64/CompareMem.asm to X64/CompareMem.nasm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf
MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.nasm [new file with mode: 0644]

index 89f31375663fa8bc59b9699c3c087e85793cb62c..7f5bc240bbe462e23967e2c289f609818f276f98 100644 (file)
   X64/ScanMem8.nasm\r
   X64/ScanMem8.asm\r
   X64/ScanMem8.S\r
+  X64/CompareMem.nasm\r
   X64/CompareMem.asm\r
   X64/CompareMem.S\r
   X64/ZeroMem.asm\r
diff --git a/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.nasm b/MdePkg/Library/BaseMemoryLibOptPei/X64/CompareMem.nasm
new file mode 100644 (file)
index 0000000..293a39b
--- /dev/null
@@ -0,0 +1,58 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   CompareMem.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   CompareMem function\r
+;\r
+; Notes:\r
+;\r
+;   The following BaseMemoryLib instances contain the same copy of this file:\r
+;\r
+;       BaseMemoryLibRepStr\r
+;       BaseMemoryLibMmx\r
+;       BaseMemoryLibSse2\r
+;       BaseMemoryLibOptDxe\r
+;       BaseMemoryLibOptPei\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    DEFAULT REL\r
+    SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; INTN\r
+; EFIAPI\r
+; InternalMemCompareMem (\r
+;   IN      CONST VOID                *DestinationBuffer,\r
+;   IN      CONST VOID                *SourceBuffer,\r
+;   IN      UINTN                     Length\r
+;   );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(InternalMemCompareMem)\r
+ASM_PFX(InternalMemCompareMem):\r
+    push    rsi\r
+    push    rdi\r
+    mov     rsi, rcx\r
+    mov     rdi, rdx\r
+    mov     rcx, r8\r
+    repe    cmpsb\r
+    movzx   rax, byte [rsi - 1]\r
+    movzx   rdx, byte [rdi - 1]\r
+    sub     rax, rdx\r
+    pop     rdi\r
+    pop     rsi\r
+    ret\r
+\r