diff options
-rw-r--r-- | MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf | 2 | ||||
-rw-r--r-- | MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm | 54 |
2 files changed, 56 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf b/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf index a6a717165b..7eb8a31c3b 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf +++ b/MdePkg/Library/BaseMemoryLibMmx/BaseMemoryLibMmx.inf @@ -66,6 +66,7 @@ Ia32/SetMem32.S
Ia32/SetMem16.nasm
Ia32/SetMem16.S
+ Ia32/ZeroMem.nasm
Ia32/ZeroMem.S
Ia32/SetMem.S
Ia32/CopyMem.S
@@ -85,6 +86,7 @@ Ia32/SetMem32.asm
Ia32/SetMem16.nasm
Ia32/SetMem16.asm
+ Ia32/ZeroMem.nasm
Ia32/ZeroMem.asm
Ia32/SetMem.asm
Ia32/CopyMem.asm
diff --git a/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm new file mode 100644 index 0000000000..ad80dc324e --- /dev/null +++ b/MdePkg/Library/BaseMemoryLibMmx/Ia32/ZeroMem.nasm @@ -0,0 +1,54 @@ +;------------------------------------------------------------------------------
+;
+; 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.nasm
+;
+; Abstract:
+;
+; ZeroMem function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+ SECTION .text
+
+;------------------------------------------------------------------------------
+; VOID *
+; InternalMemZeroMem (
+; IN VOID *Buffer,
+; IN UINTN Count
+; );
+;------------------------------------------------------------------------------
+global ASM_PFX(InternalMemZeroMem)
+ASM_PFX(InternalMemZeroMem):
+ push edi
+ mov edi, [esp + 8]
+ mov ecx, [esp + 12]
+ mov edx, ecx
+ shr ecx, 3
+ jz @ZeroBytes
+ pxor mm0, mm0
+.0:
+ movq [edi], mm0
+ add edi, 8
+ loop .0
+@ZeroBytes:
+ and edx, 7
+ xor eax, eax
+ mov ecx, edx
+ rep stosb
+ mov eax, [esp + 8]
+ pop edi
+ ret
+
|