Update SmmBase Communicate Thunk behaivor to be compatible with Framework implemenation.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Mar 2010 02:01:32 +0000 (02:01 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Mar 2010 02:01:32 +0000 (02:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@10271 6f19259b-4bc3-4df7-8a09-765794883524

edk2/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c

index 1c52fa8..a30058b 100644 (file)
@@ -42,6 +42,8 @@ typedef struct {
   EFI_HANDLE                    DispatchHandle;\r
   EFI_HANDLE                    SmmImageHandle;\r
   EFI_SMM_CALLBACK_ENTRY_POINT  CallbackAddress;\r
+  VOID                          *CommunicationBuffer;\r
+  UINTN                         *SourceSize;\r
 } CALLBACK_INFO;\r
 \r
 typedef struct {\r
@@ -410,8 +412,8 @@ CallbackThunk (
   ///\r
   Status = (CallbackInfo->CallbackAddress) (\r
                             CallbackInfo->SmmImageHandle,\r
-                            CommBuffer,\r
-                            CommBufferSize\r
+                            CallbackInfo->CommunicationBuffer,\r
+                            CallbackInfo->SourceSize\r
                             );\r
   ///\r
   /// Save CPU Save States in case any of them was modified\r
@@ -466,7 +468,7 @@ RegisterCallback (
   ///\r
   /// Allocate buffer for callback thunk information\r
   ///\r
-  Buffer = (CALLBACK_INFO *)AllocatePool (sizeof (CALLBACK_INFO));\r
+  Buffer = (CALLBACK_INFO *)AllocateZeroPool (sizeof (CALLBACK_INFO));\r
   if (Buffer == NULL) {\r
     FunctionData->Status = EFI_OUT_OF_RESOURCES;\r
     return;\r
@@ -552,14 +554,9 @@ HelperCommunicate (
     CallbackInfo = (CALLBACK_INFO *)Node;\r
 \r
     if (FunctionData->Args.Communicate.ImageHandle == CallbackInfo->SmmImageHandle) {\r
-      ///\r
-      /// Thunk into original Framwork SMI handler\r
-      ///\r
-      (CallbackInfo->CallbackAddress) (\r
-                       CallbackInfo->SmmImageHandle,\r
-                       FunctionData->Args.Communicate.CommunicationBuffer,\r
-                       FunctionData->Args.Communicate.SourceSize\r
-                       );\r
+      CallbackInfo->CommunicationBuffer = FunctionData->Args.Communicate.CommunicationBuffer;\r
+      CallbackInfo->SourceSize          = FunctionData->Args.Communicate.SourceSize;\r
+\r
       ///\r
       /// The message was successfully posted.\r
       ///\r