Gcc cleanup for baselib & basememorylib in mdepkg/library/

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5587 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian
2008-07-31 06:23:32 +00:00
parent 5f87392966
commit 85c25283ed
104 changed files with 285 additions and 290 deletions

View File

@@ -21,7 +21,7 @@
#
#------------------------------------------------------------------------------
.globl _InternalMemCopyMem
.globl ASM_PFX(InternalMemCopyMem)
#------------------------------------------------------------------------------
# VOID *
@@ -32,30 +32,30 @@
# IN UINTN Count
# );
#------------------------------------------------------------------------------
_InternalMemCopyMem:
ASM_PFX(InternalMemCopyMem):
push %esi
push %edi
movl 16(%esp), %esi # esi <- Source
movl 12(%esp), %edi # edi <- Destination
movl 20(%esp), %edx # edx <- Count
cmpl %esi, %edi
je L_CopyDone
cmpl %esi, %edi
je L_CopyDone
cmpl $0, %edx
je L_CopyDone
je L_CopyDone
leal -1(%esi, %edx), %eax # eax <- End of Source
cmpl %esi, %edi
jae L_CopyBytes
cmpl %eax, %edi
jb L_CopyBytes # Copy backward if overlapped
movl %esi, %eax # esi <- End of Source
cmpl %edi, %esi
jae L_CopyBytes
cmpl %edi, %eax
jb L_CopyBytes # Copy backward if overlapped
movl %eax, %esi # esi <- End of Source
leal -1(%edi, %edx), %edi # edi <- End of Destination
std
L_CopyBytes:
movl %ecx, %edx
std
L_CopyBytes:
movl %edx, %ecx
rep
movsb # Copy bytes backward
cld
L_CopyDone:
L_CopyDone:
movl 12(%esp), %eax # eax <- Destination as return value
pop %edi
pop %esi