Provides auxiliary support routines for the VM. That is, routines\r
that are not particularly related to VM execution of EBC instructions.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
All rights reserved. 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
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcUnloadImage (\r
- IN EFI_EBC_PROTOCOL *This,\r
- IN EFI_HANDLE ImageHandle\r
+ IN EFI_EBC_PROTOCOL *This,\r
+ IN EFI_HANDLE ImageHandle\r
);\r
\r
/**\r
@retval EFI_OUT_OF_RESOURCES Memory could not be allocated for the thunk.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcCreateThunk (\r
- IN EFI_EBC_PROTOCOL *This,\r
- IN EFI_HANDLE ImageHandle,\r
- IN VOID *EbcEntryPoint,\r
- OUT VOID **Thunk\r
+ IN EFI_EBC_PROTOCOL *This,\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN VOID *EbcEntryPoint,\r
+ OUT VOID **Thunk\r
);\r
\r
/**\r
@param This A pointer to the EFI_EBC_PROTOCOL instance.\r
@param Version Pointer to where to store the returned version\r
of the interpreter.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Version pointer is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcGetVersion (\r
- IN EFI_EBC_PROTOCOL *This,\r
- IN OUT UINT64 *Version\r
+ IN EFI_EBC_PROTOCOL *This,\r
+ IN OUT UINT64 *Version\r
);\r
\r
/**\r
@retval Others Some error occurs when creating periodic event.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
InitializeEbcCallback (\r
@param SystemContext EBC system context.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
CommonEbcExceptionHandler (\r
@param Context It should be the address of VM_CONTEXT pointer.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
EbcPeriodicNotifyFunction (\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugPeriodic (\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InitEbcVmTestProtocol (\r
- IN EFI_HANDLE *Handle\r
+ IN EFI_HANDLE *IHandle\r
);\r
\r
/**\r
Returns the EFI_UNSUPPORTED Status.\r
- \r
+\r
@return EFI_UNSUPPORTED This function always return EFI_UNSUPPORTED status.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EbcVmTestUnsupported (\r
VOID\r
\r
/**\r
Registers a callback function that the EBC interpreter calls to flush the\r
- processor instruction cache following creation of thunks. \r
+ processor instruction cache following creation of thunks.\r
\r
@param This A pointer to the EFI_EBC_PROTOCOL instance.\r
@param Flush Pointer to a function of type EBC_ICACH_FLUSH.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcRegisterICacheFlush (\r
- IN EFI_EBC_PROTOCOL *This,\r
- IN EBC_ICACHE_FLUSH Flush\r
+ IN EFI_EBC_PROTOCOL *This,\r
+ IN EBC_ICACHE_FLUSH Flush\r
);\r
\r
/**\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugGetMaximumProcessorIndex (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- OUT UINTN *MaxProcessorIndex\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ OUT UINTN *MaxProcessorIndex\r
);\r
\r
/**\r
callback function was previously registered.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugRegisterPeriodicCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN EFI_PERIODIC_CALLBACK PeriodicCallback\r
);\r
\r
/**\r
callback function was previously registered.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugRegisterExceptionCallback (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN EFI_EXCEPTION_CALLBACK ExceptionCallback,\r
- IN EFI_EXCEPTION_TYPE ExceptionType\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN EFI_EXCEPTION_CALLBACK ExceptionCallback,\r
+ IN EFI_EXCEPTION_TYPE ExceptionType\r
);\r
\r
/**\r
@param Start StartSpecifies the physical base of the memory\r
range to be invalidated.\r
@param Length Specifies the minimum number of bytes in the\r
- processor's instruction cache to invalidate. \r
+ processor's instruction cache to invalidate.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugInvalidateInstructionCache (\r
- IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
- IN UINTN ProcessorIndex,\r
- IN VOID *Start,\r
- IN UINT64 Length\r
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,\r
+ IN UINTN ProcessorIndex,\r
+ IN VOID *Start,\r
+ IN UINT64 Length\r
);\r
\r
//\r
// also be global since the execution of an EBC image does not provide\r
// a This pointer.\r
//\r
-STATIC EBC_IMAGE_LIST *mEbcImageList = NULL;\r
+EBC_IMAGE_LIST *mEbcImageList = NULL;\r
\r
//\r
// Callback function to flush the icache after thunk creation\r
//\r
-STATIC EBC_ICACHE_FLUSH mEbcICacheFlush;\r
+EBC_ICACHE_FLUSH mEbcICacheFlush;\r
\r
//\r
// These get set via calls by the debug agent\r
//\r
-STATIC EFI_PERIODIC_CALLBACK mDebugPeriodicCallback = NULL;\r
-STATIC EFI_EXCEPTION_CALLBACK mDebugExceptionCallback[MAX_EBC_EXCEPTION + 1] = {NULL};\r
-STATIC EFI_GUID mEfiEbcVmTestProtocolGuid = EFI_EBC_VM_TEST_PROTOCOL_GUID;\r
+EFI_PERIODIC_CALLBACK mDebugPeriodicCallback = NULL;\r
+EFI_EXCEPTION_CALLBACK mDebugExceptionCallback[MAX_EBC_EXCEPTION + 1] = {NULL};\r
+EFI_GUID mEfiEbcVmTestProtocolGuid = EFI_EBC_VM_TEST_PROTOCOL_GUID;\r
\r
-STATIC VOID* mStackBuffer[MAX_STACK_NUM];\r
-STATIC EFI_HANDLE mStackBufferIndex[MAX_STACK_NUM];\r
-STATIC UINTN mStackNum = 0;\r
+VOID *mStackBuffer[MAX_STACK_NUM];\r
+EFI_HANDLE mStackBufferIndex[MAX_STACK_NUM];\r
+UINTN mStackNum = 0;\r
\r
//\r
// Event for Periodic callback\r
//\r
-STATIC EFI_EVENT mEbcPeriodicEvent;\r
-VM_CONTEXT *mVmPtr = NULL;\r
+EFI_EVENT mEbcPeriodicEvent;\r
+VM_CONTEXT *mVmPtr = NULL;\r
\r
\r
/**\r
@retval EFI_OUT_OF_RESOURCES Memory could not be allocated for the thunk.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcCreateThunk (\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugGetMaximumProcessorIndex (\r
callback function was previously registered.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugRegisterPeriodicCallback (\r
callback function was previously registered.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugRegisterExceptionCallback (\r
@param Start StartSpecifies the physical base of the memory\r
range to be invalidated.\r
@param Length Specifies the minimum number of bytes in the\r
- processor's instruction cache to invalidate. \r
+ processor's instruction cache to invalidate.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugInvalidateInstructionCache (\r
The VM interpreter calls this function when an exception is detected.\r
\r
@param ExceptionType Specifies the processor exception detected.\r
- @param ExceptionFlags Specifies the exception context. \r
+ @param ExceptionFlags Specifies the exception context.\r
@param VmPtr Pointer to a VM context for passing info to the\r
EFI debugger.\r
\r
// If it's a fatal exception, then flag it in the VM context in case an\r
// attached debugger tries to return from it.\r
//\r
- if (ExceptionFlags & EXCEPTION_FLAG_FATAL) {\r
+ if ((ExceptionFlags & EXCEPTION_FLAG_FATAL) != 0) {\r
VmPtr->StopFlags |= STOPFLAG_APP_DONE;\r
}\r
\r
@retval Others Some error occurs when creating periodic event.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
InitializeEbcCallback (\r
@param SystemContext EBC system context.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
CommonEbcExceptionHandler (\r
@param Context It should be the address of VM_CONTEXT pointer.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
EbcPeriodicNotifyFunction (\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcDebugPeriodic (\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcUnloadImage (\r
\r
/**\r
Registers a callback function that the EBC interpreter calls to flush the\r
- processor instruction cache following creation of thunks. \r
+ processor instruction cache following creation of thunks.\r
\r
@param This A pointer to the EFI_EBC_PROTOCOL instance.\r
@param Flush Pointer to a function of type EBC_ICACH_FLUSH.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcRegisterICacheFlush (\r
@param This A pointer to the EFI_EBC_PROTOCOL instance.\r
@param Version Pointer to where to store the returned version\r
of the interpreter.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_INVALID_PARAMETER Version pointer is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EFIAPI\r
EbcGetVersion (\r
/**\r
Returns the stack index and buffer assosicated with the Handle parameter.\r
\r
- @param Handle The EFI handle as the index to the EBC stack. \r
+ @param Handle The EFI handle as the index to the EBC stack.\r
@param StackBuffer A pointer to hold the returned stack buffer.\r
@param BufferIndex A pointer to hold the returned stack index.\r
- \r
+\r
@retval EFI_OUT_OF_RESOURCES The Handle parameter does not correspond to any\r
existing EBC stack.\r
@retval EFI_SUCCESS The stack index and buffer were found and\r
}\r
\r
/**\r
- Returns from the EBC stack by stack Index. \r
- \r
+ Returns from the EBC stack by stack Index.\r
+\r
@param Index Specifies which EBC stack to return from.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
}\r
\r
/**\r
- Returns from the EBC stack associated with the Handle parameter. \r
- \r
+ Returns from the EBC stack associated with the Handle parameter.\r
+\r
@param Handle Specifies the EFI handle to find the EBC stack with.\r
- \r
+\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
/**\r
Allocates memory to hold all the EBC stacks.\r
\r
- @retval EFI_SUCCESS The EBC stacks were allocated successfully. \r
+ @retval EFI_SUCCESS The EBC stacks were allocated successfully.\r
@retval EFI_OUT_OF_RESOURCES Not enough memory available for EBC stacks.\r
\r
**/\r
@retval EFI_SUCCESS The function completed successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InitEbcVmTestProtocol (\r
IN EFI_HANDLE *IHandle\r
\r
/**\r
Returns the EFI_UNSUPPORTED Status.\r
- \r
+\r
@return EFI_UNSUPPORTED This function always return EFI_UNSUPPORTED status.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
EbcVmTestUnsupported (\r
VOID\r