diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-25 09:23:44 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-25 09:23:44 +0000 |
commit | bade9bf5b274d379aa8ae579b9b34819102e10d4 (patch) | |
tree | 51cd4cacdcd6b1624d1bc71d5db5a382fc483661 /EdkCompatibilityPkg/Compatibility/SmmBaseHelper | |
parent | d555d90ff71366e69d91851eb176297391e93704 (diff) | |
download | edk2-platforms-bade9bf5b274d379aa8ae579b9b34819102e10d4.tar.xz |
Fix the bug that SMM Base Protocol.Communicate() does not work.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10067 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/SmmBaseHelper')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c index 8a6214afd3..2a4437b134 100644 --- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c +++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c @@ -602,6 +602,49 @@ HelperFreePool ( FunctionData->Status = EFI_SUCCESS;
}
+/**
+ Thunk service of EFI_SMM_BASE_PROTOCOL.Communicate().
+
+ @param[in, out] FunctionData Pointer to SMMBASE_FUNCTION_DATA.
+**/
+VOID
+HelperCommunicate (
+ IN OUT SMMBASE_FUNCTION_DATA *FunctionData
+ )
+{
+ LIST_ENTRY *Node;
+ CALLBACK_INFO *CallbackInfo;
+
+ if (FunctionData->Args.Communicate.CommunicationBuffer == NULL) {
+ FunctionData->Status = EFI_INVALID_PARAMETER;
+ return;
+ }
+
+ Node = GetFirstNode (&mCallbackInfoListHead);
+ while (!IsNull (&mCallbackInfoListHead, Node)) {
+ CallbackInfo = (CALLBACK_INFO *)Node;
+
+ if (FunctionData->Args.Communicate.ImageHandle == CallbackInfo->SmmImageHandle) {
+ ///
+ /// Thunk into original Framwork SMI handler
+ ///
+ (CallbackInfo->CallbackAddress) (
+ CallbackInfo->SmmImageHandle,
+ FunctionData->Args.Communicate.CommunicationBuffer,
+ FunctionData->Args.Communicate.SourceSize
+ );
+ ///
+ /// The message was successfully posted.
+ ///
+ FunctionData->Status = EFI_SUCCESS;
+ return;
+ }
+ Node = GetNextNode (&mCallbackInfoListHead, Node);
+ }
+
+ FunctionData->Status = EFI_INVALID_PARAMETER;
+}
+
/**
Communication service SMI Handler entry.
@@ -654,6 +697,9 @@ SmmHandlerEntry ( case SMMBASE_FREE_POOL:
HelperFreePool (FunctionData);
break;
+ case SMMBASE_COMMUNICATE:
+ HelperCommunicate (FunctionData);
+ break;
default:
ASSERT (FALSE);
FunctionData->Status = EFI_UNSUPPORTED;
|