Clean up the private GUID definition in module Level.

0. Remove the unused private GUID from module source files.
1. Use gEfiCallerIdGuid replace of the private module GUID.
2. Add the public header files to define HII FormSet and PackageList GUID used in every HII driver.
3. Move two EBC protocols for debug purpose from EBC driver to MdeModulePkg Include directory. 

Signed-off-by: lgao4
Reviewed-by: ydong10 gdong1 tye jfan12 wli12 rsun3 jyao1



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12373 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2011-09-18 12:21:01 +00:00
parent b36d134faf
commit c8ad2d7a29
58 changed files with 755 additions and 434 deletions

View File

@@ -5,7 +5,7 @@
# platform and processor-independent mechanisms for loading and executing EFI
# device drivers.
#
# 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
@@ -54,7 +54,7 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
MemoryAllocationLib
@@ -68,6 +68,8 @@
[Protocols]
gEfiDebugSupportProtocolGuid ## PRODUCES
gEfiEbcProtocolGuid ## PRODUCES
gEfiEbcVmTestProtocolGuid ## SOMETIMES_PRODUCES
gEfiEbcSimpleDebuggerProtocolGuid ## SOMETIMES_CONSUMES
[Depex]
TRUE

View File

@@ -1,7 +1,7 @@
/** @file
Contains code that implements the virtual machine.
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
@@ -1344,12 +1344,6 @@ CONST VM_TABLE_ENTRY mVmOpcodeTable[] = {
//
CONST UINT8 mJMPLen[] = { 2, 2, 6, 10 };
//
// Simple Debugger Protocol GUID
//
EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;
/**
Given a pointer to a new VM context, execute one or more instructions. This
function is only used for test purposes via the EBC VM test protocol.
@@ -1365,6 +1359,7 @@ EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;
**/
EFI_STATUS
EFIAPI
EbcExecuteInstructions (
IN EFI_EBC_VM_TEST_PROTOCOL *This,
IN VM_CONTEXT *VmPtr,
@@ -1452,7 +1447,7 @@ EbcExecute (
//
DEBUG_CODE_BEGIN ();
Status = gBS->LocateProtocol (
&mEbcSimpleDebuggerProtocolGuid,
&gEfiEbcSimpleDebuggerProtocolGuid,
NULL,
(VOID **) &EbcSimpleDebugger
);

View File

@@ -3,7 +3,7 @@
be of use to a disassembler for the most part. Also provides function
prototypes for VM functions.
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
@@ -314,54 +314,6 @@ VmWriteMem64 (
IN UINT64 Data
);
//
// Define a protocol for an EBC VM test interface.
//
#define EFI_EBC_VM_TEST_PROTOCOL_GUID \
{ \
0xAAEACCFDL, 0xF27B, 0x4C17, { 0xB6, 0x10, 0x75, 0xCA, 0x1F, 0x2D, 0xFB, 0x52 } \
}
//
// Define for forward reference.
//
typedef struct _EFI_EBC_VM_TEST_PROTOCOL EFI_EBC_VM_TEST_PROTOCOL;
typedef
EFI_STATUS
(*EBC_VM_TEST_EXECUTE) (
IN EFI_EBC_VM_TEST_PROTOCOL * This,
IN VM_CONTEXT * VmPtr,
IN OUT UINTN *InstructionCount
);
typedef
EFI_STATUS
(*EBC_VM_TEST_ASM) (
IN EFI_EBC_VM_TEST_PROTOCOL * This,
IN CHAR16 *AsmText,
IN OUT INT8 *Buffer,
IN OUT UINTN *BufferLen
);
typedef
EFI_STATUS
(*EBC_VM_TEST_DASM) (
IN EFI_EBC_VM_TEST_PROTOCOL * This,
IN OUT CHAR16 *AsmText,
IN OUT INT8 *Buffer,
IN OUT UINTN *Len
);
//
// Prototype for the actual EBC test protocol interface
//
struct _EFI_EBC_VM_TEST_PROTOCOL {
EBC_VM_TEST_EXECUTE Execute;
EBC_VM_TEST_ASM Assemble;
EBC_VM_TEST_DASM Disassemble;
};
/**
Given a pointer to a new VM context, execute one or more instructions. This
function is only used for test purposes via the EBC VM test protocol.
@@ -377,6 +329,7 @@ struct _EFI_EBC_VM_TEST_PROTOCOL {
**/
EFI_STATUS
EFIAPI
EbcExecuteInstructions (
IN EFI_EBC_VM_TEST_PROTOCOL *This,
IN VM_CONTEXT *VmPtr,

View File

@@ -3,7 +3,7 @@
Provides auxiliary support routines for the VM. That is, routines
that are not particularly related to VM execution of EBC instructions.
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
@@ -191,6 +191,7 @@ InitEbcVmTestProtocol (
**/
EFI_STATUS
EFIAPI
EbcVmTestUnsupported (
VOID
);
@@ -336,7 +337,6 @@ EBC_ICACHE_FLUSH mEbcICacheFlush;
//
EFI_PERIODIC_CALLBACK mDebugPeriodicCallback = NULL;
EFI_EXCEPTION_CALLBACK mDebugExceptionCallback[MAX_EBC_EXCEPTION + 1] = {NULL};
EFI_GUID mEfiEbcVmTestProtocolGuid = EFI_EBC_VM_TEST_PROTOCOL_GUID;
VOID *mStackBuffer[MAX_STACK_NUM];
EFI_HANDLE mStackBufferIndex[MAX_STACK_NUM];
@@ -1328,7 +1328,7 @@ InitEbcVmTestProtocol (
// Publish the protocol
//
Handle = NULL;
Status = gBS->InstallProtocolInterface (&Handle, &mEfiEbcVmTestProtocolGuid, EFI_NATIVE_INTERFACE, EbcVmTestProtocol);
Status = gBS->InstallProtocolInterface (&Handle, &gEfiEbcVmTestProtocolGuid, EFI_NATIVE_INTERFACE, EbcVmTestProtocol);
if (EFI_ERROR (Status)) {
FreePool (EbcVmTestProtocol);
}
@@ -1343,6 +1343,7 @@ InitEbcVmTestProtocol (
**/
EFI_STATUS
EFIAPI
EbcVmTestUnsupported (
VOID
)

View File

@@ -2,7 +2,7 @@
Main routines for the EBC interpreter. Includes the initialization and
main interpreter routines.
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
@@ -21,6 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/DebugSupport.h>
#include <Protocol/Ebc.h>
#include <Protocol/EbcVmTest.h>
#include <Protocol/EbcSimpleDebugger.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
@@ -29,36 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
typedef INT64 VM_REGISTER;
typedef UINT8 *VMIP; // instruction pointer for the VM
typedef UINT32 EXCEPTION_FLAGS;
typedef struct {
VM_REGISTER Gpr[8]; // General purpose registers.
UINT64 Flags; // Flags register:
// 0 Set to 1 if the result of the last compare was true
// 1 Set to 1 if stepping
// 2..63 Reserved.
VMIP Ip; // Instruction pointer.
UINTN LastException; //
EXCEPTION_FLAGS ExceptionFlags; // to keep track of exceptions
UINT32 StopFlags;
UINT32 CompilerVersion; // via break(6)
UINTN HighStackBottom; // bottom of the upper stack
UINTN LowStackTop; // top of the lower stack
UINT64 StackRetAddr; // location of final return address on stack
UINTN *StackMagicPtr; // pointer to magic value on stack to detect corruption
EFI_HANDLE ImageHandle; // for this EBC driver
EFI_SYSTEM_TABLE *SystemTable; // for debugging only
UINTN LastAddrConverted; // for debug
UINTN LastAddrConvertedValue; // for debug
VOID *FramePtr;
VOID *EntryPoint; // entry point of EBC image
UINTN ImageBase;
VOID *StackPool;
VOID *StackTop;
} VM_CONTEXT;
extern VM_CONTEXT *mVmPtr;
//
@@ -317,65 +289,6 @@ ReturnEBCStackByHandle(
IN EFI_HANDLE Handle
);
//
// Defines for a simple EBC debugger interface
//
typedef struct _EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL;
#define EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID \
{ \
0x2a72d11e, 0x7376, 0x40f6, { 0x9c, 0x68, 0x23, 0xfa, 0x2f, 0xe3, 0x63, 0xf1 } \
}
typedef
EFI_STATUS
(*EBC_DEBUGGER_SIGNAL_EXCEPTION) (
IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
IN VM_CONTEXT *VmPtr,
IN EFI_EXCEPTION_TYPE ExceptionType
);
typedef
VOID
(*EBC_DEBUGGER_DEBUG) (
IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
IN VM_CONTEXT *VmPtr
);
typedef
UINT32
(*EBC_DEBUGGER_DASM) (
IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
IN VM_CONTEXT *VmPtr,
IN UINT16 *DasmString OPTIONAL,
IN UINT32 DasmStringSize
);
//
// This interface allows you to configure the EBC debug support
// driver. For example, turn on or off saving and printing of
// delta VM even if called. Or to even disable the entire interface,
// in which case all functions become no-ops.
//
typedef
EFI_STATUS
(*EBC_DEBUGGER_CONFIGURE) (
IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL *This,
IN UINT32 ConfigId,
IN UINTN ConfigValue
);
//
// Prototype for the actual EBC debug support protocol interface
//
struct _EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL {
EBC_DEBUGGER_DEBUG Debugger;
EBC_DEBUGGER_SIGNAL_EXCEPTION SignalException;
EBC_DEBUGGER_DASM Dasm;
EBC_DEBUGGER_CONFIGURE Configure;
};
typedef struct {
EFI_EBC_PROTOCOL *This;
VOID *EntryPoint;