Remove assumption on EAX and R10 usage for IA32 compiler and X64 compiler.

Signed-off-by: jyao1
Reviewed-by: lgao4

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12760 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jyao1
2011-11-22 08:07:30 +00:00
parent db40504eae
commit 7102b19961
6 changed files with 453 additions and 121 deletions

View File

@@ -14,6 +14,8 @@
#**/
ASM_GLOBAL ASM_PFX(CopyMem)
ASM_GLOBAL ASM_PFX(EbcInterpret)
ASM_GLOBAL ASM_PFX(ExecuteEbcImageEntryPoint)
ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative)
ASM_PFX(EbcLLCALLEXNative):
@@ -42,6 +44,40 @@ ASM_PFX(EbcLLCALLEXNative):
pop %ebp
ret
ASM_GLOBAL ASM_PFX(EbcLLGetEbcEntryPoint)
ASM_PFX(EbcLLGetEbcEntryPoint):
ret
ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret)
ASM_PFX(EbcLLEbcInterpret):
# Construct new stack
push %ebp
mov %esp, %ebp
push %esi
push %edi
sub $0x40, %esp
push %eax
mov %ebp, %esi
add $0x8, %esi
mov %esp, %edi
add $0x4, %edi
mov $0x10, %ecx
rep movsd
# call C-code
call ASM_PFX(EbcInterpret)
add $0x44, %esp
pop %edi
pop %esi
pop %ebp
ret
ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint)
ASM_PFX(EbcLLExecuteEbcImageEntryPoint):
# Construct new stack
mov %eax, -0xC(%esp)
mov 0x4(%esp), %eax
mov %eax, -0x8(%esp)
mov 0x8(%esp), %eax
mov %eax, -0x4(%esp)
# call C-code
sub $0xC, %esp
call ASM_PFX(ExecuteEbcImageEntryPoint)
add $0xC, %esp
ret