]> git.proxmox.com Git - mirror_edk2.git/commitdiff
edk2/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/*:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 May 2008 23:42:13 +0000 (23:42 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 May 2008 23:42:13 +0000 (23:42 +0000)
  Merge from edk2/MdePkg/Library/BaseMemoryLib and
  edk2/MdePkg/Library/BaseMemoryLibRepStr to achieve better
  support for additional compilers.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5279 6f19259b-4bc3-4df7-8a09-765794883524

25 files changed:
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLib.inf
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/MemLibGuid.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.asm
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S [new file with mode: 0644]

index a0b837835d4e3a195cc13a0f1428d976df9c6e03..186e0872a25d3d985c6419562aa73945df95c13a 100644 (file)
 BASE_NAME       = EdkIIGlueBaseMemoryLib\r
 COMPONENT_TYPE  = LIBRARY\r
 \r
 BASE_NAME       = EdkIIGlueBaseMemoryLib\r
 COMPONENT_TYPE  = LIBRARY\r
 \r
-[sources.common]\r
-  MemLibGuid.c\r
-  CopyMemWrapper.c\r
-  SetMemWrapper.c\r
-  SetMem16Wrapper.c\r
-  SetMem32Wrapper.c\r
-  SetMem64Wrapper.c\r
-  CompareMemWrapper.c\r
-  ZeroMemWrapper.c\r
-  ScanMem8Wrapper.c\r
-  ScanMem16Wrapper.c\r
-  ScanMem32Wrapper.c\r
-  ScanMem64Wrapper.c\r
+[Sources.common]\r
+  BaseMemoryLibInternal.h\r
 \r
 \r
-[sources.ia32]\r
-  Ia32/CopyMem.asm\r
-  Ia32/SetMem.asm\r
-  Ia32/SetMem16.asm\r
-  Ia32/SetMem32.asm\r
-  Ia32/SetMem64.asm\r
-  Ia32/ZeroMem.asm\r
-  Ia32/CompareMem.asm\r
-  Ia32/ScanMem8.asm\r
-  Ia32/ScanMem16.asm\r
-  Ia32/ScanMem32.asm\r
+[Sources.Ia32]\r
+  Ia32/ScanMem64.S\r
+  Ia32/ScanMem32.S\r
+  Ia32/ScanMem16.S\r
+  Ia32/ScanMem8.S\r
+  Ia32/CompareMem.S\r
+  Ia32/ZeroMem.S\r
+  Ia32/SetMem64.S\r
+  Ia32/SetMem32.S\r
+  Ia32/SetMem16.S\r
+  Ia32/SetMem.S\r
+  Ia32/CopyMem.S\r
   Ia32/ScanMem64.asm\r
   Ia32/ScanMem64.asm\r
+  Ia32/ScanMem32.asm\r
+  Ia32/ScanMem16.asm\r
+  Ia32/ScanMem8.asm\r
+  Ia32/CompareMem.asm\r
+  Ia32/ZeroMem.asm\r
+  Ia32/SetMem64.asm\r
+  Ia32/SetMem32.asm\r
+  Ia32/SetMem16.asm\r
+  Ia32/SetMem.asm\r
+  Ia32/CopyMem.asm\r
+  ScanMem64Wrapper.c\r
+  ScanMem32Wrapper.c\r
+  ScanMem16Wrapper.c\r
+  ScanMem8Wrapper.c\r
+  ZeroMemWrapper.c\r
+  CompareMemWrapper.c\r
+  SetMem64Wrapper.c\r
+  SetMem32Wrapper.c\r
+  SetMem16Wrapper.c\r
+  SetMemWrapper.c\r
+  CopyMemWrapper.c\r
+  MemLibGuid.c\r
 \r
 \r
-[sources.x64]\r
-  X64/CopyMem.asm\r
-  X64/SetMem.asm\r
-  X64/SetMem16.asm\r
-  X64/SetMem32.asm\r
-  X64/SetMem64.asm\r
-  X64/ZeroMem.asm\r
-  X64/CompareMem.asm\r
-  X64/ScanMem8.asm\r
-  X64/ScanMem16.asm\r
-  X64/ScanMem32.asm\r
-  X64/ScanMem64.asm\r
+[Sources.X64]\r
+  x64/ScanMem64.S\r
+  x64/ScanMem32.S\r
+  x64/ScanMem16.S\r
+  x64/ScanMem8.S\r
+  x64/CompareMem.S\r
+  x64/ZeroMem.S\r
+  x64/SetMem64.S\r
+  x64/SetMem32.S\r
+  x64/SetMem16.S\r
+  x64/SetMem.S\r
+  x64/CopyMem.S\r
+  x64/ScanMem64.asm\r
+  x64/ScanMem32.asm\r
+  x64/ScanMem16.asm\r
+  x64/ScanMem8.asm\r
+  x64/CompareMem.asm\r
+  x64/ZeroMem.asm\r
+  x64/SetMem64.asm\r
+  x64/SetMem32.asm\r
+  x64/SetMem16.asm\r
+  x64/SetMem.asm\r
+  x64/CopyMem.asm\r
+  ScanMem64Wrapper.c\r
+  ScanMem32Wrapper.c\r
+  ScanMem16Wrapper.c\r
+  ScanMem8Wrapper.c\r
+  ZeroMemWrapper.c\r
+  CompareMemWrapper.c\r
+  SetMem64Wrapper.c\r
+  SetMem32Wrapper.c\r
+  SetMem16Wrapper.c\r
+  SetMemWrapper.c\r
+  CopyMemWrapper.c\r
+  MemLibGuid.c\r
 \r
 [sources.ipf]\r
   Ipf/CopyMem.c\r
 \r
 [sources.ipf]\r
   Ipf/CopyMem.c\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S
new file mode 100644 (file)
index 0000000..725367b
--- /dev/null
@@ -0,0 +1,53 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   CompareMem function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCompareMem
+
+#------------------------------------------------------------------------------
+# INTN
+# EFIAPI
+# InternalMemCompareMem (
+#   IN      CONST VOID                *DestinationBuffer,
+#   IN      CONST VOID                *SourceBuffer,
+#   IN      UINTN                     Length
+#   );
+#------------------------------------------------------------------------------
+_InternalMemCompareMem:
+    push    %esi
+    push    %edi
+    movl    12(%esp), %esi
+    movl    16(%esp), %edi
+    movl    20(%esp), %ecx
+    repe    cmpsb
+    movzbl  -1(%esi), %eax
+    movzbl  -1(%edi), %edx
+    subl    %edx, %eax
+    pop     %edi
+    pop     %esi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S
new file mode 100644 (file)
index 0000000..a95b337
--- /dev/null
@@ -0,0 +1,65 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   CopyMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemCopyMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemCopyMem (
+#    IN VOID   *Destination,
+#    IN VOID   *Source,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemCopyMem:
+    push    %esi
+    push    %edi
+    movl    16(%esp), %esi              # esi <- Source
+    movl    12(%esp), %edi              # edi <- Destination
+    movl    20(%esp), %edx              # edx <- Count
+    leal    -1(%esi, %edx), %eax        # eax <- End of Source
+    cmpl    %edi, %esi
+    jae     L0
+    cmpl    %edi, %eax
+    jae     L_CopyBackward              # Copy backward if overlapped
+L0:
+    movl    %edx, %ecx
+    andl    $3, %edx
+    shrl    $2, %ecx
+    rep
+    movsl                               # Copy as many Dwords as possible
+    jmp     L_CopyBytes
+L_CopyBackward:
+    movl    %eax, %esi                  # esi <- End of Source
+    leal    -1(%edi, %edx), %edi        # edi <- End of Destination
+    std
+L_CopyBytes:
+    movl    %edx, %ecx
+    rep
+    movsb                               # Copy bytes backward
+    cld
+    movl    12(%esp), %eax              # eax <- Destination as return value
+    pop     %edi
+    pop     %esi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S
new file mode 100644 (file)
index 0000000..5e65b96
--- /dev/null
@@ -0,0 +1,50 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   ScanMem16 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem16
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem16 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT16                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem16:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasw
+    leal    -2(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S
new file mode 100644 (file)
index 0000000..5d46ed2
--- /dev/null
@@ -0,0 +1,50 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   ScanMem32 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem32
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem32 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT32                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem32:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movl    16(%esp), %eax
+    repne   scasl
+    leal    -4(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S
new file mode 100644 (file)
index 0000000..3ba6965
--- /dev/null
@@ -0,0 +1,59 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   ScanMem64 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem64
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem64 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT64                    Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem64:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    16(%esp), %eax
+    movl    20(%esp), %edx
+    movl    8(%esp), %edi
+L0:
+    cmpl    (%edi), %eax
+    leal    8(%edi), %edi
+    loopne  L0
+    jne     L1
+    cmpl    -4(%edi), %edx
+    jecxz   L1
+    jne     L0
+L1:
+    leal    -8(%edi), %eax
+    cmovne  %ecx, %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S
new file mode 100644 (file)
index 0000000..7a834a5
--- /dev/null
@@ -0,0 +1,50 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   ScanMem8 function
+#
+# Notes:
+#
+#   The following BaseMemoryLib instances share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemScanMem8
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem8 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT8                     Value
+#   );
+#------------------------------------------------------------------------------
+_InternalMemScanMem8:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    8(%esp), %edi
+    movb    16(%esp), %al
+    repne   scasb
+    leal    -1(%edi), %eax
+    cmovnz  %ecx, %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S
new file mode 100644 (file)
index 0000000..4ddf6c4
--- /dev/null
@@ -0,0 +1,46 @@
+#------------------------------------------------------------------------------
+#
+# 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:
+#
+#   SetMem.Asm
+#
+# Abstract:
+#
+#   SetMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+    .386:
+    .code:
+
+.globl _InternalMemSetMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT8  Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem:
+    push    %edi
+    movl    16(%esp),%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    rep
+    stosb
+    movl    8(%esp),%eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S
new file mode 100644 (file)
index 0000000..6e7c136
--- /dev/null
@@ -0,0 +1,43 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   SetMem16 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem16
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem16 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT16 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem16:
+    push    %edi
+    movl    16(%esp), %eax
+    movl    8(%esp), %edi
+    movl    12(%esp), %ecx
+    rep
+    stosw
+    movl    8(%esp), %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S
new file mode 100644 (file)
index 0000000..455af20
--- /dev/null
@@ -0,0 +1,43 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   SetMem32 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem32
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem32 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT32 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem32:
+    push    %edi
+    movl    16(%esp),%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    rep
+    stosl
+    movl    8(%esp),%eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S
new file mode 100644 (file)
index 0000000..b4afff0
--- /dev/null
@@ -0,0 +1,46 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   SetMem64 function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemSetMem64
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemSetMem64 (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT64 Value
+#    )
+#------------------------------------------------------------------------------
+_InternalMemSetMem64:
+    push    %edi
+    movl    12(%esp), %ecx
+    movl    16(%esp), %eax
+    movl    20(%esp), %edx
+    movl    8(%esp), %edi
+L0:
+    mov     %eax, -8(%edi, %ecx, 8)
+    mov     %edx, -4(%edi, %ecx, 8)
+    loop    L0
+    movl    %edi, %eax
+    pop     %edi
+    ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S
new file mode 100644 (file)
index 0000000..8465d7c
--- /dev/null
@@ -0,0 +1,49 @@
+#------------------------------------------------------------------------------
+#
+# 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.Asm
+#
+# Abstract:
+#
+#   ZeroMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl _InternalMemZeroMem
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  InternalMemZeroMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count
+#    );
+#------------------------------------------------------------------------------
+_InternalMemZeroMem:
+    push    %edi
+    xorl    %eax,%eax
+    movl    8(%esp),%edi
+    movl    12(%esp),%ecx
+    movl    %ecx,%edx
+    shrl    $2,%ecx
+    andl    $3,%edx
+    pushl   %edi
+    rep
+    stosl
+    movl    %edx,%ecx
+    rep
+    stosb
+    popl    %eax
+    pop     %edi
+    ret
index 0b7682c8c9117123d69cc0330435ba7abd99bbdb..6a3654c1b7dd414bc52be22c48f92b838a11994a 100644 (file)
@@ -75,12 +75,17 @@ GlueCompareGuid (
   IN CONST GUID  *Guid2\r
   )\r
 {\r
   IN CONST GUID  *Guid2\r
   )\r
 {\r
-  return (BOOLEAN)(\r
-           ReadUnaligned64 ((CONST UINT64*)Guid1)\r
-             == ReadUnaligned64 ((CONST UINT64*)Guid2) &&\r
-           ReadUnaligned64 ((CONST UINT64*)Guid1 + 1)\r
-             == ReadUnaligned64 ((CONST UINT64*)Guid2 + 1)\r
-           );\r
+  UINT64  LowPartOfGuid1;\r
+  UINT64  LowPartOfGuid2;\r
+  UINT64  HighPartOfGuid1;\r
+  UINT64  HighPartOfGuid2;\r
+\r
+  LowPartOfGuid1  = ReadUnaligned64 ((CONST UINT64*) Guid1);\r
+  LowPartOfGuid2  = ReadUnaligned64 ((CONST UINT64*) Guid2);\r
+  HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);\r
+  HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);\r
+\r
+  return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S
new file mode 100644 (file)
index 0000000..1498a5d
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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 share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# INTN
+# EFIAPI
+# InternalMemCompareMem (
+#   IN      CONST VOID                *DestinationBuffer,
+#   IN      CONST VOID                *SourceBuffer,
+#   IN      UINTN                     Length
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemCompareMem
+_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/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S
new file mode 100644 (file)
index 0000000..fe67040
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# 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
+.globl _InternalMemCopyMem
+_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     _InternalMemCopyMem_al_0000
+    cmp     r9, rdi
+    jae     _atSym_CopyBackward               # Copy backward if overlapped
+_InternalMemCopyMem_al_0000:
+    mov     rcx, r8
+    and     r8, 7
+    shr     rcx, 3
+    rep     movsq                       # Copy as many Qwords as possible
+    jmp     _atSym_CopyBytes
+_atSym_CopyBackward:
+    mov     rsi, r9                     # rsi <- End of Source
+    lea     rdi, [rdi + r8 - 1]         # esi <- End of Destination
+    std                                 # set direction flag
+_atSym_CopyBytes:
+    mov     rcx, r8
+    rep     movsb                       # Copy bytes backward
+    cld
+    pop     rdi
+    pop     rsi
+    ret
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S
new file mode 100644 (file)
index 0000000..018d298
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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 share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem16 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT16                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemScanMem16
+_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/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S
new file mode 100644 (file)
index 0000000..a253b9b
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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 share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem32 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT32                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemScanMem32
+_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/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S
new file mode 100644 (file)
index 0000000..528f813
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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 share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem64 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT64                    Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemScanMem64
+_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/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S
new file mode 100644 (file)
index 0000000..84610eb
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# 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 share the same version of this file:
+#
+#       BaseMemoryLibRepStr
+#       BaseMemoryLibMmx
+#       BaseMemoryLibSse2
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# CONST VOID *
+# EFIAPI
+# InternalMemScanMem8 (
+#   IN      CONST VOID                *Buffer,
+#   IN      UINTN                     Length,
+#   IN      UINT8                     Value
+#   );
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemScanMem8
+_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/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S
new file mode 100644 (file)
index 0000000..d9f8b06
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# ConvertAsm.py: Automatically generated from SetMem.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:
+#
+#   SetMem.S
+#
+# Abstract:
+#
+#   SetMem function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+#  VOID *
+#  EFIAPI
+#  InternalMemSetMem (
+#    IN VOID   *Buffer,
+#    IN UINTN  Count,
+#    IN UINT8  Value
+#    )
+#------------------------------------------------------------------------------
+.intel_syntax
+.globl _InternalMemSetMem
+_InternalMemSetMem:
+    push    rdi
+    mov     rax, r8    # rax = Value
+    mov     rdi, rcx   # rdi = Buffer
+    xchg    rcx, rdx   # rcx = Count, rdx = Buffer
+    rep     stosb
+    mov     rax, rdx   # rax = Buffer
+    pop     rdi
+    ret
+
index 5306520169f1ff6a3f08ee0b39db5c1207f70d69..fe1bc70f6b4b322527df671702a2f3e5ced7005e 100644 (file)
 ;    )\r
 ;------------------------------------------------------------------------------\r
 InternalMemSetMem   PROC    USES    rdi\r
 ;    )\r
 ;------------------------------------------------------------------------------\r
 InternalMemSetMem   PROC    USES    rdi\r
-    mov     rax, r8\r
-    mov     rdi, rcx\r
-    xchg    rcx, rdx\r
+    mov     rax, r8    ; rax = Value\r
+    mov     rdi, rcx   ; rdi = Buffer\r
+    xchg    rcx, rdx   ; rcx = Count, rdx = Buffer\r
     rep     stosb\r
     rep     stosb\r
-    mov     rax, rdx\r
+    mov     rax, rdx   ; rax = Buffer\r
     ret\r
 InternalMemSetMem   ENDP\r
 \r
     ret\r
 InternalMemSetMem   ENDP\r
 \r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S
new file mode 100644 (file)
index 0000000..5f19646
--- /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
+.globl _InternalMemSetMem16
+_InternalMemSetMem16:
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosw
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S
new file mode 100644 (file)
index 0000000..72243ae
--- /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
+.globl _InternalMemSetMem32
+_InternalMemSetMem32:
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosd
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S
new file mode 100644 (file)
index 0000000..a8a4a0b
--- /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
+.globl _InternalMemSetMem64
+_InternalMemSetMem64:
+    push    rdi
+    mov     rdi, rcx
+    mov     rax, r8
+    xchg    rcx, rdx
+    rep     stosq
+    mov     rax, rdx
+    pop     rdi
+    ret
+
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S
new file mode 100644 (file)
index 0000000..6233b06
--- /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
+.globl _InternalMemZeroMem
+_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
+