1) Fix GCC version EBC interpreter bug.

Add missing EFIPAI for EbcInterpret and ExecuteEbcImageEntryPoint().
	Get return value in EbcLLCALLEXNative(), remove EbcLLGetReturnValue().

2) Fix IA32 EBC interpreter bug on MOVsnw and MOVsnd.

3) Some cleanup
	Add missing ReturnEBCStack() for IA32 build.
	Remove unnecessary EbcLLGetStackPointer() for X64 and IPF build.
	Remove deadcode EbcLLGetStackPointer() and EbcLLGetReturnValue() in IA32/X64/IPF ASM code.
	Dump more info in CommonEbcExceptionHandler().

Signed-off-by: jyao1
Reviewed-by: Elvinli

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12745 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jyao1
2011-11-21 08:35:14 +00:00
parent ea71453f72
commit fa97cbf4ef
11 changed files with 96 additions and 241 deletions

View File

@@ -2,7 +2,7 @@
This module contains EBC support routines that are customized based on
the target x64 processor.
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
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
@@ -81,6 +81,7 @@ PushU64 (
**/
UINT64
EFIAPI
EbcInterpret (
IN OUT UINTN Arg1,
IN OUT UINTN Arg2,
@@ -129,7 +130,6 @@ EbcInterpret (
// Initialize the stack pointer for the EBC. Get the current system stack
// pointer and adjust it down by the max needed for the interpreter.
//
Addr = EbcLLGetStackPointer ();
//
// Adjust the VM's stack pointer down.
@@ -233,6 +233,7 @@ EbcInterpret (
**/
UINT64
EFIAPI
ExecuteEbcImageEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
@@ -273,7 +274,6 @@ ExecuteEbcImageEntryPoint (
// Initialize the stack pointer for the EBC. Get the current system stack
// pointer and adjust it down by the max needed for the interpreter.
//
Addr = EbcLLGetStackPointer ();
Status = GetEBCStack(ImageHandle, &VmContext.StackPool, &StackIndex);
if (EFI_ERROR(Status)) {
@@ -586,14 +586,14 @@ Action:
VmPtr->Ip = (VMIP) (UINTN) TargetEbcAddr;
} else {
//
// The callee is not a thunk to EBC, call native code.
// The callee is not a thunk to EBC, call native code,
// and get return value.
//
EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);
VmPtr->Gpr[7] = EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);
//
// Get return value and advance the IP.
// Advance the IP.
//
VmPtr->Gpr[7] = EbcLLGetReturnValue ();
VmPtr->Ip += Size;
}
}