]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EfiCommonLib / Ia32 / EfiCopyMem.c
index 0acfdc9e5c0c92fa5eb5b8d4075f1b3fd7e0e70b..cb6b8ffe89d993efcccb1bd7667d7deda29b7b15 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -58,20 +58,21 @@ Returns:
   ;   if (Source == Destination)           => do nothing\r
   ;   if (Source + Count <= Destination)   => regular copy\r
   ;   if (Destination + Count <= Source)   => regular copy\r
+  ;   if (Source >= Destination)           => regular copy\r
   ;   otherwise, do a reverse copy\r
   mov   eax, esi\r
   add   eax, ecx                      ; Source + Count\r
   cmp   eax, edi\r
-  jle   _StartByteCopy\r
+  jbe   _StartByteCopy\r
 \r
   mov   eax, edi\r
   add   eax, ecx                      ; Dest + Count\r
   cmp   eax, esi\r
-  jle   _StartByteCopy\r
+  jbe   _StartByteCopy\r
 \r
   cmp   esi, edi\r
   je    _CopyMemDone         \r
-  jl    _CopyOverlapped               ; too bad -- overlaps\r
+  jb    _CopyOverlapped               ; too bad -- overlaps\r
 \r
   ; Pick up misaligned start bytes to get destination pointer 4-byte aligned\r
 _StartByteCopy:\r