--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; CopyMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; EFIAPI\r
+; EfiCommonLibCopyMem (\r
+; OUT VOID *Destination,\r
+; IN VOID *Source,\r
+; IN UINTN Count\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibCopyMem PROC USES rsi rdi\r
+ cmp rdx, rcx ; if Source == Destination, do nothing\r
+ je @CopyMemDone\r
+ cmp r8, 0 ; if Count == 0, do nothing\r
+ je @CopyMemDone\r
+ mov rsi, rdx ; rsi <- Source\r
+ mov rdi, rcx ; rdi <- Destination\r
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
+ cmp rsi, rdi\r
+ mov rax, rdi ; rax <- Destination as return value\r
+ jae @F\r
+ cmp r9, rdi\r
+ jae @CopyBackward ; Copy backward if overlapped\r
+@@:\r
+ mov rcx, r8\r
+ and r8, 7\r
+ shr rcx, 3 ; rcx <- # of Qwords to copy\r
+ jz @CopyBytes\r
+ DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10)\r
+@@:\r
+ DB 0fh, 6fh, 06h ; movd mm0, [rsi]\r
+ DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
+ add rsi, 8\r
+ add rdi, 8\r
+ loop @B\r
+ DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0)\r
+ jmp @CopyBytes\r
+@CopyBackward:\r
+ mov rsi, r9 ; rsi <- End of Source\r
+ lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination\r
+ std ; set direction flag\r
+@CopyBytes:\r
+ mov rcx, r8\r
+ rep movsb ; Copy bytes backward\r
+ cld\r
+@CopyMemDone: \r
+ ret\r
+EfiCommonLibCopyMem ENDP\r
+\r
+ END\r
--- /dev/null
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+#
+# EfiCopyMemRep1.S
+#
+# Abstract:
+#
+# CopyMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+ .code:
+
+.global ASM_PFX(EfiCommonLibCopyMem)
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiCommonLibCopyMem (
+# OUT VOID *Destination,
+# IN VOID *Source,
+# IN UINTN Count
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiCommonLibCopyMem):
+ push %rsi
+ push %rdi
+ cmp %rcx,%rdx
+ je CopyMemDone
+ cmp $0x0,%r8
+ je CopyMemDone
+ mov %rdx,%rsi
+ mov %rcx,%rdi
+ lea -1(%r8,%rsi,1),%r9
+ cmp %rdi,%rsi
+ jae CopyBytes
+ cmp %rdi,%r9
+ jb CopyBytes
+ mov %r9,%rsi
+ lea -1(%r8,%rdi,1),%rdi
+ std
+
+CopyBytes:
+ mov %r8,%rcx
+ rep movsb %ds:(%rsi),%es:(%rdi)
+ cld
+
+CopyMemDone:
+ pop %rdi
+ pop %rsi
+ retq
+
+
+
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiCopyMemRep1.asm\r
+;\r
+; Abstract:\r
+;\r
+; CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibCopyMem (\r
+; OUT VOID *Destination,\r
+; IN VOID *Source,\r
+; IN UINTN Count\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibCopyMem PROC USES rsi rdi\r
+ cmp rdx, rcx ; if Source == Destination, do nothing\r
+ je @CopyMemDone\r
+ cmp r8, 0 ; if Count == 0, do nothing\r
+ je @CopyMemDone\r
+ mov rsi, rdx ; rsi <- Source\r
+ mov rdi, rcx ; rdi <- Destination\r
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
+ cmp rsi, rdi\r
+ jae @CopyBytes\r
+ cmp r9, rdi\r
+ jb @CopyBytes ; Copy backward if overlapped\r
+ mov rsi, r9 ; rsi <- End of Source\r
+ lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
+ std ; set direction flag\r
+@CopyBytes:\r
+ mov rcx, r8\r
+ rep movsb ; Copy bytes backward\r
+ cld\r
+@CopyMemDone:\r
+ ret\r
+EfiCommonLibCopyMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiCopyMemRep4.asm\r
+;\r
+; Abstract:\r
+;\r
+; CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibCopyMem (\r
+; OUT VOID *Destination,\r
+; IN VOID *Source,\r
+; IN UINTN Count\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibCopyMem PROC USES rsi rdi\r
+ cmp rdx, rcx ; if Source == Destination, do nothing\r
+ je @CopyMemDone\r
+ cmp r8, 0 ; if Count == 0, do nothing\r
+ je @CopyMemDone\r
+ mov rsi, rdx ; rsi <- Source\r
+ mov rdi, rcx ; rdi <- Destination\r
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
+ cmp rsi, rdi\r
+ jae @F\r
+ cmp r9, rdi\r
+ jae @CopyBackward ; Copy backward if overlapped\r
+@@:\r
+ mov rcx, r8\r
+ and r8, 3\r
+ shr rcx, 2\r
+ rep movsd ; Copy as many Dwords as possible\r
+ jmp @CopyBytes\r
+@CopyBackward:\r
+ mov rsi, r9 ; rsi <- End of Source\r
+ lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
+ std ; set direction flag\r
+@CopyBytes:\r
+ mov rcx, r8\r
+ rep movsb ; Copy bytes backward\r
+ cld\r
+@CopyMemDone:\r
+ ret\r
+EfiCommonLibCopyMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiCopyMemRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+; CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibCopyMem (\r
+; OUT VOID *Destination,\r
+; IN VOID *Source,\r
+; IN UINTN Count\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibCopyMem PROC USES rsi rdi\r
+ cmp rdx, rcx ; if Source == Destination, do nothing\r
+ je @CopyMemDone\r
+ cmp r8, 0 ; if Count == 0, do nothing\r
+ je @CopyMemDone\r
+ mov rsi, rdx ; rsi <- Source\r
+ mov rdi, rcx ; rdi <- Destination\r
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
+ cmp rsi, rdi\r
+ jae @F\r
+ cmp r9, rdi\r
+ jae @CopyBackward ; Copy backward if overlapped\r
+@@:\r
+ mov rcx, r8\r
+ and r8, 7\r
+ shr rcx, 3\r
+ rep movsq ; Copy as many Qwords as possible\r
+ jmp @CopyBytes\r
+@CopyBackward:\r
+ mov rsi, r9 ; rsi <- End of Source\r
+ lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
+ std ; set direction flag\r
+@CopyBytes:\r
+ mov rcx, r8\r
+ rep movsb ; Copy bytes backward\r
+ cld\r
+@CopyMemDone:\r
+ ret\r
+EfiCommonLibCopyMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; CopyMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; CopyMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibCopyMem (\r
+; OUT VOID *Destination,\r
+; IN VOID *Source,\r
+; IN UINTN Count\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibCopyMem PROC USES rsi rdi\r
+ cmp rdx, rcx ; if Source == Destination, do nothing\r
+ je @CopyMemDone\r
+ cmp r8, 0 ; if Count == 0, do nothing\r
+ je @CopyMemDone\r
+ mov rsi, rdx ; rsi <- Source\r
+ mov rdi, rcx ; rdi <- Destination\r
+ lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
+ cmp rsi, rdi\r
+ mov rax, rdi ; rax <- Destination as return value\r
+ jae @F ; Copy forward if Source > Destination\r
+ cmp r9, rdi ; Overlapped?\r
+ jae @CopyBackward ; Copy backward if overlapped\r
+@@:\r
+ xor rcx, rcx\r
+ sub rcx, rdi ; rcx <- -rdi\r
+ and rcx, 15 ; rcx + rsi should be 16 bytes aligned\r
+ jz @F ; skip if rcx == 0\r
+ cmp rcx, r8\r
+ cmova rcx, r8\r
+ sub r8, rcx\r
+ rep movsb\r
+@@:\r
+ mov rcx, r8\r
+ and r8, 15\r
+ shr rcx, 4 ; rcx <- # of DQwords to copy\r
+ jz @CopyBytes\r
+@@:\r
+ movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned\r
+ movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
+ add rsi, 16\r
+ add rdi, 16\r
+ loop @B\r
+ jmp @CopyBytes ; copy remaining bytes\r
+@CopyBackward:\r
+ mov rsi, r9 ; rsi <- Last byte of Source\r
+ lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination\r
+ std\r
+@CopyBytes:\r
+ mov rcx, r8\r
+ rep movsb\r
+ cld\r
+@CopyMemDone: \r
+ ret\r
+EfiCommonLibCopyMem ENDP\r
+\r
+ END\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; EFIAPI\r
+; EfiCommonLibSetMem (\r
+; OUT VOID *Buffer,\r
+; IN UINTN Size,\r
+; IN UINT8 Value\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibSetMem PROC USES rdi\r
+ cmp rdx, 0 ; if Size == 0, do nothing\r
+ je @SetDone\r
+ mov rax, r8\r
+ mov ah, al\r
+ DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax\r
+ mov r8, rcx\r
+ mov rdi, r8 ; rdi <- Buffer\r
+ mov rcx, rdx\r
+ and edx, 7\r
+ shr rcx, 3\r
+ jz @SetBytes\r
+ DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h\r
+@@:\r
+ DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
+ add rdi, 8\r
+ loop @B\r
+@SetBytes:\r
+ mov ecx, edx\r
+ rep stosb\r
+ mov rax, r8\r
+@SetDone:\r
+ ret\r
+EfiCommonLibSetMem ENDP\r
+\r
+ END\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiSetMemRep1.asm\r
+;\r
+; Abstract:\r
+;\r
+; SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibSetMem (\r
+; OUT VOID *Buffer,\r
+; IN UINTN Size,\r
+; IN UINT8 Value\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibSetMem PROC USES rdi\r
+ cmp rdx, 0 ; if Size == 0, do nothing\r
+ je @SetDone\r
+ mov rax, r8\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ rep stosb\r
+@SetDone:\r
+ ret\r
+EfiCommonLibSetMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+#
+# EfiSetMemRep4.S
+#
+# Abstract:
+#
+# SetMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+ .code:
+
+.global ASM_PFX(EfiCommonLibCopyMem)
+
+#------------------------------------------------------------------------------
+# VOID
+# EfiCommonLibSetMem (
+# OUT VOID *Buffer,
+# IN UINTN Size,
+# IN UINT8 Value
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiCommonLibSetMem):
+ push %rdi
+ cmp $0x0,%rdx
+ je SetDone
+ mov %rcx,%rdi
+ mov %r8b,%al
+ mov %al,%ah
+ shrd $0x10,%eax,%ecx
+ shld $0x10,%ecx,%eax
+ mov %rdx,%rcx
+ shr $0x2,%rcx
+ rep stos %eax,%es:(%rdi)
+ mov %rdx,%rcx
+ and $0x3,%rcx
+ rep stos %al,%es:(%rdi)
+SetDone:
+ pop %rdi
+ retq
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiSetMemRep4.asm\r
+;\r
+; Abstract:\r
+;\r
+; SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibSetMem (\r
+; OUT VOID *Buffer,\r
+; IN UINTN Size,\r
+; IN UINT8 Value\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibSetMem PROC USES rdi\r
+ cmp rdx, 0 ; if Size == 0, do nothing\r
+ je @SetDone\r
+ mov rdi, rcx\r
+ mov al, r8b\r
+ mov ah, al\r
+ shrd ecx, eax, 16\r
+ shld eax, ecx, 16\r
+ mov rcx, rdx\r
+ shr rcx, 2\r
+ rep stosd\r
+ mov rcx, rdx\r
+ and rcx, 3\r
+ rep stosb\r
+@SetDone:\r
+ ret\r
+EfiCommonLibSetMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiSetMemRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+; SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibSetMem (\r
+; OUT VOID *Buffer,\r
+; IN UINTN Size,\r
+; IN UINT8 Value\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibSetMem PROC USES rdi rbx\r
+ cmp rdx, 0 ; if Size == 0, do nothing\r
+ je @SetDone\r
+ mov rax, r8\r
+ mov bl, al\r
+ mov bh, bl\r
+ mov ax, bx\r
+ shl rax, 10h\r
+ mov ax, bx\r
+ mov ebx, eax \r
+ shl rax, 20h\r
+ mov eax, ebx\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ shr rcx, 3\r
+ rep stosq\r
+ mov rcx, rdx\r
+ and rcx, 7\r
+ rep stosb\r
+@SetDone:\r
+ ret\r
+EfiCommonLibSetMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; SetMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; SetMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibSetMem (\r
+; OUT VOID *Buffer,\r
+; IN UINTN Size,\r
+; IN UINT8 Value\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibSetMem PROC USES rdi\r
+ cmp rdx, 0 ; if Size == 0, do nothing\r
+ je @SetDone\r
+ mov rdi, rcx ; rdi <- Buffer\r
+ mov al, r8b ; al <- Value\r
+ xor rcx, rcx\r
+ sub rcx, rdi\r
+ and rcx, 15 ; rcx + rdi aligns on 16-byte boundary\r
+ jz @F\r
+ cmp rcx, rdx\r
+ cmova rcx, rdx\r
+ sub rdx, rcx\r
+ rep stosb\r
+@@:\r
+ mov rcx, rdx\r
+ and rdx, 15\r
+ shr rcx, 4\r
+ jz @SetBytes\r
+ mov ah, al ; ax <- Value repeats twice\r
+ movd xmm0, eax ; xmm0[0..16] <- Value repeats twice\r
+ pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times\r
+ movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times\r
+@@:\r
+ movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
+ add rdi, 16\r
+ loop @B\r
+@SetBytes:\r
+ mov ecx, edx ; high 32 bits of rcx are always zero\r
+ rep stosb\r
+@SetDone:\r
+ ret\r
+EfiCommonLibSetMem ENDP\r
+\r
+ END\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; ZeroMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID *\r
+; EfiCommonLibZeroMem (\r
+; IN VOID *Buffer,\r
+; IN UINTN Size\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibZeroMem PROC USES rdi\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ mov r8, rdi\r
+ and edx, 7\r
+ shr rcx, 3\r
+ jz @ZeroBytes\r
+ DB 0fh, 0efh, 0c0h ; pxor mm0, mm0\r
+@@:\r
+ DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
+ add rdi, 8\r
+ loop @B\r
+@ZeroBytes:\r
+ xor eax, eax\r
+ mov ecx, edx\r
+ rep stosb\r
+ mov rax, r8\r
+ ret\r
+EfiCommonLibZeroMem ENDP\r
+\r
+ END\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiZeroMemRep1.asm\r
+;\r
+; Abstract:\r
+;\r
+; ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibZeroMem (\r
+; IN VOID *Buffer,\r
+; IN UINTN Size\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibZeroMem PROC USES rdi\r
+ xor rax, rax\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ rep stosb\r
+ ret\r
+EfiCommonLibZeroMem ENDP\r
+\r
+ END\r
+\r
--- /dev/null
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2008, Intel Corporation
+# All rights reserved. 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:
+#
+# EfiZeroMemRep4.S
+#
+# Abstract:
+#
+# ZeroMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+#include <EfiBind.h>
+
+ .code:
+
+.global ASM_PFX(EfiCommonLibZeroMem)
+#------------------------------------------------------------------------------
+# VOID
+# EfiCommonLibZeroMem (
+# IN VOID *Buffer,
+# IN UINTN Size
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(EfiCommonLibZeroMem):
+ push %rdi
+ xor %rax,%rax
+ mov %rcx,%rdi
+ mov %rdx,%rcx
+ shr $0x2,%rcx
+ and $0x3,%rdx
+ rep stos %eax,%es:(%rdi)
+ mov %rdx,%rcx
+ rep stos %al,%es:(%rdi)
+ pop %rdi
+ retq
\ No newline at end of file
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiZeroMemRep4.asm\r
+;\r
+; Abstract:\r
+;\r
+; ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibZeroMem (\r
+; IN VOID *Buffer,\r
+; IN UINTN Size\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibZeroMem PROC USES rdi\r
+ xor rax, rax\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ shr rcx, 2\r
+ and rdx, 3\r
+ rep stosd\r
+ mov rcx, rdx\r
+ rep stosb\r
+ ret\r
+EfiCommonLibZeroMem ENDP\r
+\r
+ END
\ No newline at end of file
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; EfiZeroMemRep8.asm\r
+;\r
+; Abstract:\r
+;\r
+; ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibZeroMem (\r
+; IN VOID *Buffer,\r
+; IN UINTN Size\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibZeroMem PROC USES rdi\r
+ xor rax, rax\r
+ mov rdi, rcx\r
+ mov rcx, rdx\r
+ shr rcx, 3\r
+ and rdx, 7\r
+ rep stosq\r
+ mov rcx, rdx\r
+ rep stosb\r
+ ret\r
+EfiCommonLibZeroMem ENDP\r
+\r
+ END
\ No newline at end of file
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2007, Intel Corporation\r
+; All rights reserved. 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
+; ZeroMem.asm\r
+;\r
+; Abstract:\r
+;\r
+; ZeroMem function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ .code\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EfiCommonLibZeroMem (\r
+; IN VOID *Buffer,\r
+; IN UINTN Size\r
+; );\r
+;------------------------------------------------------------------------------\r
+EfiCommonLibZeroMem PROC USES rdi\r
+ mov rdi, rcx\r
+ xor rcx, rcx\r
+ xor eax, eax\r
+ sub rcx, rdi\r
+ and rcx, 15\r
+ jz @F\r
+ cmp rcx, rdx\r
+ cmova rcx, rdx\r
+ sub rdx, rcx\r
+ rep stosb\r
+@@:\r
+ mov rcx, rdx\r
+ and edx, 15\r
+ shr rcx, 4\r
+ jz @ZeroBytes\r
+ pxor xmm0, xmm0\r
+@@:\r
+ movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
+ add rdi, 16\r
+ loop @B\r
+@ZeroBytes:\r
+ mov ecx, edx\r
+ rep stosb\r
+ ret\r
+EfiCommonLibZeroMem ENDP\r
+\r
+ END\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; CopyMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; EFIAPI\r
-; EfiCommonLibCopyMem (\r
-; OUT VOID *Destination,\r
-; IN VOID *Source,\r
-; IN UINTN Count\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibCopyMem PROC USES rsi rdi\r
- cmp rdx, rcx ; if Source == Destination, do nothing\r
- je @CopyMemDone\r
- cmp r8, 0 ; if Count == 0, do nothing\r
- je @CopyMemDone\r
- mov rsi, rdx ; rsi <- Source\r
- mov rdi, rcx ; rdi <- Destination\r
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
- cmp rsi, rdi\r
- mov rax, rdi ; rax <- Destination as return value\r
- jae @F\r
- cmp r9, rdi\r
- jae @CopyBackward ; Copy backward if overlapped\r
-@@:\r
- mov rcx, r8\r
- and r8, 7\r
- shr rcx, 3 ; rcx <- # of Qwords to copy\r
- jz @CopyBytes\r
- DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10)\r
-@@:\r
- DB 0fh, 6fh, 06h ; movd mm0, [rsi]\r
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
- add rsi, 8\r
- add rdi, 8\r
- loop @B\r
- DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0)\r
- jmp @CopyBytes\r
-@CopyBackward:\r
- mov rsi, r9 ; rsi <- End of Source\r
- lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination\r
- std ; set direction flag\r
-@CopyBytes:\r
- mov rcx, r8\r
- rep movsb ; Copy bytes backward\r
- cld\r
-@CopyMemDone: \r
- ret\r
-EfiCommonLibCopyMem ENDP\r
-\r
- END\r
+++ /dev/null
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008, Intel Corporation
-# All rights reserved. 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:
-#
-# EfiCopyMemRep1.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.global ASM_PFX(EfiCommonLibCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibCopyMem (
-# OUT VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibCopyMem):
- push %rsi
- push %rdi
- cmp %rcx,%rdx
- je CopyMemDone
- cmp $0x0,%r8
- je CopyMemDone
- mov %rdx,%rsi
- mov %rcx,%rdi
- lea -1(%r8,%rsi,1),%r9
- cmp %rdi,%rsi
- jae CopyBytes
- cmp %rdi,%r9
- jb CopyBytes
- mov %r9,%rsi
- lea -1(%r8,%rdi,1),%rdi
- std
-
-CopyBytes:
- mov %r8,%rcx
- rep movsb %ds:(%rsi),%es:(%rdi)
- cld
-
-CopyMemDone:
- pop %rdi
- pop %rsi
- retq
-
-
-
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiCopyMemRep1.asm\r
-;\r
-; Abstract:\r
-;\r
-; CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibCopyMem (\r
-; OUT VOID *Destination,\r
-; IN VOID *Source,\r
-; IN UINTN Count\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibCopyMem PROC USES rsi rdi\r
- cmp rdx, rcx ; if Source == Destination, do nothing\r
- je @CopyMemDone\r
- cmp r8, 0 ; if Count == 0, do nothing\r
- je @CopyMemDone\r
- mov rsi, rdx ; rsi <- Source\r
- mov rdi, rcx ; rdi <- Destination\r
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
- cmp rsi, rdi\r
- jae @CopyBytes\r
- cmp r9, rdi\r
- jb @CopyBytes ; Copy backward if overlapped\r
- mov rsi, r9 ; rsi <- End of Source\r
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
- std ; set direction flag\r
-@CopyBytes:\r
- mov rcx, r8\r
- rep movsb ; Copy bytes backward\r
- cld\r
-@CopyMemDone:\r
- ret\r
-EfiCommonLibCopyMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiCopyMemRep4.asm\r
-;\r
-; Abstract:\r
-;\r
-; CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibCopyMem (\r
-; OUT VOID *Destination,\r
-; IN VOID *Source,\r
-; IN UINTN Count\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibCopyMem PROC USES rsi rdi\r
- cmp rdx, rcx ; if Source == Destination, do nothing\r
- je @CopyMemDone\r
- cmp r8, 0 ; if Count == 0, do nothing\r
- je @CopyMemDone\r
- mov rsi, rdx ; rsi <- Source\r
- mov rdi, rcx ; rdi <- Destination\r
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
- cmp rsi, rdi\r
- jae @F\r
- cmp r9, rdi\r
- jae @CopyBackward ; Copy backward if overlapped\r
-@@:\r
- mov rcx, r8\r
- and r8, 3\r
- shr rcx, 2\r
- rep movsd ; Copy as many Dwords as possible\r
- jmp @CopyBytes\r
-@CopyBackward:\r
- mov rsi, r9 ; rsi <- End of Source\r
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
- std ; set direction flag\r
-@CopyBytes:\r
- mov rcx, r8\r
- rep movsb ; Copy bytes backward\r
- cld\r
-@CopyMemDone:\r
- ret\r
-EfiCommonLibCopyMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiCopyMemRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-; CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibCopyMem (\r
-; OUT VOID *Destination,\r
-; IN VOID *Source,\r
-; IN UINTN Count\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibCopyMem PROC USES rsi rdi\r
- cmp rdx, rcx ; if Source == Destination, do nothing\r
- je @CopyMemDone\r
- cmp r8, 0 ; if Count == 0, do nothing\r
- je @CopyMemDone\r
- mov rsi, rdx ; rsi <- Source\r
- mov rdi, rcx ; rdi <- Destination\r
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
- cmp rsi, rdi\r
- jae @F\r
- cmp r9, rdi\r
- jae @CopyBackward ; Copy backward if overlapped\r
-@@:\r
- mov rcx, r8\r
- and r8, 7\r
- shr rcx, 3\r
- rep movsq ; Copy as many Qwords as possible\r
- jmp @CopyBytes\r
-@CopyBackward:\r
- mov rsi, r9 ; rsi <- End of Source\r
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination\r
- std ; set direction flag\r
-@CopyBytes:\r
- mov rcx, r8\r
- rep movsb ; Copy bytes backward\r
- cld\r
-@CopyMemDone:\r
- ret\r
-EfiCommonLibCopyMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; CopyMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; CopyMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibCopyMem (\r
-; OUT VOID *Destination,\r
-; IN VOID *Source,\r
-; IN UINTN Count\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibCopyMem PROC USES rsi rdi\r
- cmp rdx, rcx ; if Source == Destination, do nothing\r
- je @CopyMemDone\r
- cmp r8, 0 ; if Count == 0, do nothing\r
- je @CopyMemDone\r
- mov rsi, rdx ; rsi <- Source\r
- mov rdi, rcx ; rdi <- Destination\r
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source\r
- cmp rsi, rdi\r
- mov rax, rdi ; rax <- Destination as return value\r
- jae @F ; Copy forward if Source > Destination\r
- cmp r9, rdi ; Overlapped?\r
- jae @CopyBackward ; Copy backward if overlapped\r
-@@:\r
- xor rcx, rcx\r
- sub rcx, rdi ; rcx <- -rdi\r
- and rcx, 15 ; rcx + rsi should be 16 bytes aligned\r
- jz @F ; skip if rcx == 0\r
- cmp rcx, r8\r
- cmova rcx, r8\r
- sub r8, rcx\r
- rep movsb\r
-@@:\r
- mov rcx, r8\r
- and r8, 15\r
- shr rcx, 4 ; rcx <- # of DQwords to copy\r
- jz @CopyBytes\r
-@@:\r
- movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned\r
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
- add rsi, 16\r
- add rdi, 16\r
- loop @B\r
- jmp @CopyBytes ; copy remaining bytes\r
-@CopyBackward:\r
- mov rsi, r9 ; rsi <- Last byte of Source\r
- lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination\r
- std\r
-@CopyBytes:\r
- mov rcx, r8\r
- rep movsb\r
- cld\r
-@CopyMemDone: \r
- ret\r
-EfiCommonLibCopyMem ENDP\r
-\r
- END\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; SetMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; EFIAPI\r
-; EfiCommonLibSetMem (\r
-; OUT VOID *Buffer,\r
-; IN UINTN Size,\r
-; IN UINT8 Value\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibSetMem PROC USES rdi\r
- cmp rdx, 0 ; if Size == 0, do nothing\r
- je @SetDone\r
- mov rax, r8\r
- mov ah, al\r
- DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax\r
- mov r8, rcx\r
- mov rdi, r8 ; rdi <- Buffer\r
- mov rcx, rdx\r
- and edx, 7\r
- shr rcx, 3\r
- jz @SetBytes\r
- DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h\r
-@@:\r
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
- add rdi, 8\r
- loop @B\r
-@SetBytes:\r
- mov ecx, edx\r
- rep stosb\r
- mov rax, r8\r
-@SetDone:\r
- ret\r
-EfiCommonLibSetMem ENDP\r
-\r
- END\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiSetMemRep1.asm\r
-;\r
-; Abstract:\r
-;\r
-; SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibSetMem (\r
-; OUT VOID *Buffer,\r
-; IN UINTN Size,\r
-; IN UINT8 Value\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibSetMem PROC USES rdi\r
- cmp rdx, 0 ; if Size == 0, do nothing\r
- je @SetDone\r
- mov rax, r8\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- rep stosb\r
-@SetDone:\r
- ret\r
-EfiCommonLibSetMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008, Intel Corporation
-# All rights reserved. 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:
-#
-# EfiSetMemRep4.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.global ASM_PFX(EfiCommonLibCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibSetMem (
-# OUT VOID *Buffer,
-# IN UINTN Size,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibSetMem):
- push %rdi
- cmp $0x0,%rdx
- je SetDone
- mov %rcx,%rdi
- mov %r8b,%al
- mov %al,%ah
- shrd $0x10,%eax,%ecx
- shld $0x10,%ecx,%eax
- mov %rdx,%rcx
- shr $0x2,%rcx
- rep stos %eax,%es:(%rdi)
- mov %rdx,%rcx
- and $0x3,%rcx
- rep stos %al,%es:(%rdi)
-SetDone:
- pop %rdi
- retq
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiSetMemRep4.asm\r
-;\r
-; Abstract:\r
-;\r
-; SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibSetMem (\r
-; OUT VOID *Buffer,\r
-; IN UINTN Size,\r
-; IN UINT8 Value\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibSetMem PROC USES rdi\r
- cmp rdx, 0 ; if Size == 0, do nothing\r
- je @SetDone\r
- mov rdi, rcx\r
- mov al, r8b\r
- mov ah, al\r
- shrd ecx, eax, 16\r
- shld eax, ecx, 16\r
- mov rcx, rdx\r
- shr rcx, 2\r
- rep stosd\r
- mov rcx, rdx\r
- and rcx, 3\r
- rep stosb\r
-@SetDone:\r
- ret\r
-EfiCommonLibSetMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiSetMemRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-; SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibSetMem (\r
-; OUT VOID *Buffer,\r
-; IN UINTN Size,\r
-; IN UINT8 Value\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibSetMem PROC USES rdi rbx\r
- cmp rdx, 0 ; if Size == 0, do nothing\r
- je @SetDone\r
- mov rax, r8\r
- mov bl, al\r
- mov bh, bl\r
- mov ax, bx\r
- shl rax, 10h\r
- mov ax, bx\r
- mov ebx, eax \r
- shl rax, 20h\r
- mov eax, ebx\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- shr rcx, 3\r
- rep stosq\r
- mov rcx, rdx\r
- and rcx, 7\r
- rep stosb\r
-@SetDone:\r
- ret\r
-EfiCommonLibSetMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; SetMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; SetMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibSetMem (\r
-; OUT VOID *Buffer,\r
-; IN UINTN Size,\r
-; IN UINT8 Value\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibSetMem PROC USES rdi\r
- cmp rdx, 0 ; if Size == 0, do nothing\r
- je @SetDone\r
- mov rdi, rcx ; rdi <- Buffer\r
- mov al, r8b ; al <- Value\r
- xor rcx, rcx\r
- sub rcx, rdi\r
- and rcx, 15 ; rcx + rdi aligns on 16-byte boundary\r
- jz @F\r
- cmp rcx, rdx\r
- cmova rcx, rdx\r
- sub rdx, rcx\r
- rep stosb\r
-@@:\r
- mov rcx, rdx\r
- and rdx, 15\r
- shr rcx, 4\r
- jz @SetBytes\r
- mov ah, al ; ax <- Value repeats twice\r
- movd xmm0, eax ; xmm0[0..16] <- Value repeats twice\r
- pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times\r
- movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times\r
-@@:\r
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
- add rdi, 16\r
- loop @B\r
-@SetBytes:\r
- mov ecx, edx ; high 32 bits of rcx are always zero\r
- rep stosb\r
-@SetDone:\r
- ret\r
-EfiCommonLibSetMem ENDP\r
-\r
- END\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; ZeroMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; ZeroMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID *\r
-; EfiCommonLibZeroMem (\r
-; IN VOID *Buffer,\r
-; IN UINTN Size\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibZeroMem PROC USES rdi\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- mov r8, rdi\r
- and edx, 7\r
- shr rcx, 3\r
- jz @ZeroBytes\r
- DB 0fh, 0efh, 0c0h ; pxor mm0, mm0\r
-@@:\r
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0\r
- add rdi, 8\r
- loop @B\r
-@ZeroBytes:\r
- xor eax, eax\r
- mov ecx, edx\r
- rep stosb\r
- mov rax, r8\r
- ret\r
-EfiCommonLibZeroMem ENDP\r
-\r
- END\r
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiZeroMemRep1.asm\r
-;\r
-; Abstract:\r
-;\r
-; ZeroMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibZeroMem (\r
-; IN VOID *Buffer,\r
-; IN UINTN Size\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibZeroMem PROC USES rdi\r
- xor rax, rax\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- rep stosb\r
- ret\r
-EfiCommonLibZeroMem ENDP\r
-\r
- END\r
-\r
+++ /dev/null
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008, Intel Corporation
-# All rights reserved. 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:
-#
-# EfiZeroMemRep4.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.global ASM_PFX(EfiCommonLibZeroMem)
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Size
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibZeroMem):
- push %rdi
- xor %rax,%rax
- mov %rcx,%rdi
- mov %rdx,%rcx
- shr $0x2,%rcx
- and $0x3,%rdx
- rep stos %eax,%es:(%rdi)
- mov %rdx,%rcx
- rep stos %al,%es:(%rdi)
- pop %rdi
- retq
\ No newline at end of file
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiZeroMemRep4.asm\r
-;\r
-; Abstract:\r
-;\r
-; ZeroMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibZeroMem (\r
-; IN VOID *Buffer,\r
-; IN UINTN Size\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibZeroMem PROC USES rdi\r
- xor rax, rax\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- shr rcx, 2\r
- and rdx, 3\r
- rep stosd\r
- mov rcx, rdx\r
- rep stosb\r
- ret\r
-EfiCommonLibZeroMem ENDP\r
-\r
- END
\ No newline at end of file
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; EfiZeroMemRep8.asm\r
-;\r
-; Abstract:\r
-;\r
-; ZeroMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibZeroMem (\r
-; IN VOID *Buffer,\r
-; IN UINTN Size\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibZeroMem PROC USES rdi\r
- xor rax, rax\r
- mov rdi, rcx\r
- mov rcx, rdx\r
- shr rcx, 3\r
- and rdx, 7\r
- rep stosq\r
- mov rcx, rdx\r
- rep stosb\r
- ret\r
-EfiCommonLibZeroMem ENDP\r
-\r
- END
\ No newline at end of file
+++ /dev/null
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2007, Intel Corporation\r
-; All rights reserved. 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
-; ZeroMem.asm\r
-;\r
-; Abstract:\r
-;\r
-; ZeroMem function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EfiCommonLibZeroMem (\r
-; IN VOID *Buffer,\r
-; IN UINTN Size\r
-; );\r
-;------------------------------------------------------------------------------\r
-EfiCommonLibZeroMem PROC USES rdi\r
- mov rdi, rcx\r
- xor rcx, rcx\r
- xor eax, eax\r
- sub rcx, rdi\r
- and rcx, 15\r
- jz @F\r
- cmp rcx, rdx\r
- cmova rcx, rdx\r
- sub rdx, rcx\r
- rep stosb\r
-@@:\r
- mov rcx, rdx\r
- and edx, 15\r
- shr rcx, 4\r
- jz @ZeroBytes\r
- pxor xmm0, xmm0\r
-@@:\r
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned\r
- add rdi, 16\r
- loop @B\r
-@ZeroBytes:\r
- mov ecx, edx\r
- rep stosb\r
- ret\r
-EfiCommonLibZeroMem ENDP\r
-\r
- END\r