]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add S assembler file for BaseMemoryLibOptDxe driver.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Oct 2008 01:49:11 +0000 (01:49 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 24 Oct 2008 01:49:11 +0000 (01:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6201 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S [new file with mode: 0644]
MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S [new file with mode: 0644]

diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/CompareMem.S
new file mode 100644 (file)
index 0000000..5580d62
--- /dev/null
@@ -0,0 +1,60 @@
+#
+# ConvertAsm.py: Automatically generated from CompareMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   CompareMem.S
+#
+# Abstract:
+#
+#   CompareMem function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances contain the same copy of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#       BaseMemoryLibOptDxe
+#       BaseMemoryLibOptPei
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# INTN
+# EFIAPI
+# InternalMemCompareMem (
+#   IN      CONST VOID                *DestinationBuffer,
+#   IN      CONST VOID                *SourceBuffer,
+#   IN      UINTN                     Length
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemCompareMem)
+ASM_PFX(InternalMemCompareMem):
+    push    rsi
+    push    rdi
+    mov     rsi, rcx
+    mov     rdi, rdx
+    mov     rcx, r8
+    repe    cmpsb
+    movzx   rax, byte ptr [rsi - 1]
+    movzx   rdx, byte ptr [rdi - 1]
+    sub     rax, rdx
+    pop     rdi
+    pop     rsi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/CopyMem.S
new file mode 100644 (file)
index 0000000..426a602
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# ConvertAsm.py: Automatically generated from CopyMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   CopyMem.S
+#
+# Abstract:
+#
+#   CopyMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemCopyMem (
+#    IN VOID   *Destination,
+#    IN VOID   *Source,
+#    IN UINTN  Count
+#    )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemCopyMem)
+ASM_PFX(InternalMemCopyMem):
+    push    rsi
+    push    rdi
+    mov     rsi, rdx                    # rsi <- Source
+    mov     rdi, rcx                    # rdi <- Destination
+    lea     r9, [rsi + r8 - 1]          # r9 <- End of Source
+    cmp     rsi, rdi
+    mov     rax, rdi                    # rax <- Destination as return value
+    jae     L0
+    cmp     r9, rdi
+    jae     L_CopyBackward              # Copy backward if overlapped
+L0:
+    mov     rcx, r8
+    and     r8, 7
+    shr     rcx, 3                      # rcx <- # of Qwords to copy
+    jz      L_CopyBytes
+    movd    r10, mm0                    # (Save mm0 in r10)
+L1:
+    movq    mm0, [rsi]
+    movntq  [rdi], mm0
+    add     rsi, 8
+    add     rdi, 8
+    loop    L1
+    mfence
+    movd    mm0, r10                    # (Restore mm0)
+    jmp     L_CopyBytes
+L_CopyBackward:
+    mov     rsi, r9                     # rsi <- End of Source
+    lea     rdi, [rdi + r8 - 1]         # rdi <- End of Destination
+    std                                 # set direction flag
+L_CopyBytes:
+    mov     rcx, r8
+    rep     movsb                       # Copy bytes backward
+    cld
+    pop     rdi
+    pop     rsi
+    ret
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem16.S
new file mode 100644 (file)
index 0000000..9a94f5d
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# ConvertAsm.py: Automatically generated from ScanMem16.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   ScanMem16.S
+#
+# Abstract:
+#
+#   ScanMem16 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances contain the same copy of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#       BaseMemoryLibOptDxe
+#       BaseMemoryLibOptPei
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem16 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT16                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem16)
+ASM_PFX(InternalMemScanMem16):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    mov     rcx, rdx
+    repne   scasw
+    lea     rax, [rdi - 2]
+    cmovnz  rax, rcx
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem32.S
new file mode 100644 (file)
index 0000000..86a6503
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# ConvertAsm.py: Automatically generated from ScanMem32.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   ScanMem32.S
+#
+# Abstract:
+#
+#   ScanMem32 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances contain the same copy of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#       BaseMemoryLibOptDxe
+#       BaseMemoryLibOptPei
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem32 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT32                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem32)
+ASM_PFX(InternalMemScanMem32):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    mov     rcx, rdx
+    repne   scasd
+    lea     rax, [rdi - 4]
+    cmovnz  rax, rcx
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem64.S
new file mode 100644 (file)
index 0000000..bd1eee7
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# ConvertAsm.py: Automatically generated from ScanMem64.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   ScanMem64.S
+#
+# Abstract:
+#
+#   ScanMem64 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances contain the same copy of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#       BaseMemoryLibOptDxe
+#       BaseMemoryLibOptPei
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem64 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT64                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem64)
+ASM_PFX(InternalMemScanMem64):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    mov     rcx, rdx
+    repne   scasq
+    lea     rax, [rdi - 8]
+    cmovnz  rax, rcx
+    pop     rdi
+    ret
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ScanMem8.S
new file mode 100644 (file)
index 0000000..1d8b4e1
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# ConvertAsm.py: Automatically generated from ScanMem8.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   ScanMem8.S
+#
+# Abstract:
+#
+#   ScanMem8 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances contain the same copy of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#       BaseMemoryLibOptDxe
+#       BaseMemoryLibOptPei
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem8 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT8                     Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemScanMem8)
+ASM_PFX(InternalMemScanMem8):
+    push    rdi
+    mov     rdi, rcx
+    mov     rcx, rdx
+    mov     rax, r8
+    repne   scasb
+    lea     rax, [rdi - 1]
+    cmovnz  rax, rcx                    # set rax to 0 if not found
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem.S
new file mode 100644 (file)
index 0000000..3453431
--- /dev/null
@@ -0,0 +1,65 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006, 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
+;  InternalMemSetMem (\r
+;    IN VOID   *Buffer,\r
+;    IN UINTN  Count,\r
+;    IN UINT8  Value\r
+;    )\r
+;------------------------------------------------------------------------------\r
+.intel_syntax noprefix\r
+.globl ASM_PFX(InternalMemSetMem)\r
+ASM_PFX(InternalMemZeroMem):\r
+InternalMemSetMem   PROC    USES    rdi rbx\r
+    push    rdi\r
+    push    rbx\r
+    push    rcx       ; push Buffer\r
+    mov     rax, r8   ; rax = Value\r
+    and     rax, 0ffh ; rax = lower 8 bits of r8, upper 56 bits are 0\r
+    mov     ah,  al   ; ah  = al\r
+    mov     bx,  ax   ; bx  = ax\r
+    shl     rax, 10h  ; rax = ax << 16\r
+    mov     ax,  bx   ; ax  = bx\r
+    mov     rbx, rax  ; ebx = eax\r
+    shl     rax, 20h  ; rax = rax << 32\r
+    or      rax, rbx  ; eax = ebx\r
+    mov     rdi, rcx  ; rdi = Buffer\r
+    mov     rcx, rdx  ; rcx = Count\r
+    shr     rcx, 3    ; rcx = rcx / 8\r
+    cld\r
+    rep     stosq      \r
+    mov     rcx, rdx  ; rcx = rdx\r
+    and     rcx, 7    ; rcx = rcx & 7\r
+    rep     stosb      \r
+    pop     rax       ; rax = Buffer\r
+    pop     rbx\r
+    pop     rdi\r
+    ret\r
+InternalMemSetMem   ENDP\r
+\r
+    END\r
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem16.S
new file mode 100644 (file)
index 0000000..0fb9dee
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# ConvertAsm.py: Automatically generated from SetMem16.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   SetMem16.S
+#
+# Abstract:
+#
+#   SetMem16 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemSetMem16 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT16 Value
+#    )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem16)
+ASM_PFX(InternalMemSetMem16):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosw
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem32.S
new file mode 100644 (file)
index 0000000..00fec5c
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# ConvertAsm.py: Automatically generated from SetMem32.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   SetMem32.S
+#
+# Abstract:
+#
+#   SetMem32 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemSetMem32 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT32 Value
+#    );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem32)
+ASM_PFX(InternalMemSetMem32):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosd
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/SetMem64.S
new file mode 100644 (file)
index 0000000..359cbb1
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# ConvertAsm.py: Automatically generated from SetMem64.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   SetMem64.S
+#
+# Abstract:
+#
+#   SetMem64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem64 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT64 Value
+#    )
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemSetMem64)
+ASM_PFX(InternalMemSetMem64):
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosq
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/X64/ZeroMem.S
new file mode 100644 (file)
index 0000000..97c3130
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# ConvertAsm.py: Automatically generated from ZeroMem.asm
+#
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2006, 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:
+#
+#   ZeroMem.S
+#
+# Abstract:
+#
+#   ZeroMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemZeroMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+.intel_syntax noprefix
+.globl ASM_PFX(InternalMemZeroMem)
+ASM_PFX(InternalMemZeroMem):
+    push    rdi
+    push    rcx
+    xor     rax, rax
+    mov     rdi, rcx
+    mov     rcx, rdx
+    shr     rcx, 3
+    and     rdx, 7
+    rep     stosq
+    mov     ecx, edx
+    rep     stosb
+    pop     rax
+    pop     rdi
+    ret
+