diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2016-05-30 18:52:08 -0700 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2016-06-28 09:50:53 +0800 |
commit | 053a51bd09703d73c759c19664d8159771e0111b (patch) | |
tree | c2277744104391f817e4d31b17e1749192d2b994 | |
parent | 98b85271eedd1bfd2944ba9f467ab879ff6f0bca (diff) | |
download | edk2-platforms-053a51bd09703d73c759c19664d8159771e0111b.tar.xz |
MdePkg BaseMemoryLibOptDxe: Convert X64/ZeroMem.asm to NASM
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
X64/ZeroMem.asm to X64/ZeroMem.nasm
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf | 1 | ||||
-rw-r--r-- | MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf b/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf index b9497d16d3..e8268bf043 100644 --- a/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf +++ b/MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf @@ -107,6 +107,7 @@ X64/CompareMem.nasm
X64/CompareMem.asm
X64/CompareMem.S
+ X64/ZeroMem.nasm
X64/ZeroMem.asm
X64/ZeroMem.S
X64/SetMem64.asm
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm new file mode 100644 index 0000000000..39ad9e0808 --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.nasm @@ -0,0 +1,50 @@ +;------------------------------------------------------------------------------
+;
+; Copyright (c) 2006, 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:
+;
+; ZeroMem.Asm
+;
+; Abstract:
+;
+; ZeroMem function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+ DEFAULT REL
+ SECTION .text
+
+;------------------------------------------------------------------------------
+; VOID *
+; InternalMemZeroMem (
+; IN VOID *Buffer,
+; IN UINTN Count
+; );
+;------------------------------------------------------------------------------
+global ASM_PFX(InternalMemZeroMem)
+ASM_PFX(InternalMemZeroMem):
+ push rdi
+ push rcx ; push Buffer
+ xor rax, rax ; rax = 0
+ mov rdi, rcx ; rdi = Buffer
+ mov rcx, rdx ; rcx = Count
+ shr rcx, 3 ; rcx = rcx / 8
+ and rdx, 7 ; rdx = rdx & 7
+ cld
+ rep stosq
+ mov rcx, rdx ; rcx = rdx
+ rep stosb
+ pop rax ; rax = Buffer
+ pop rdi
+ ret
+
|