]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Move CommunicationBuffer from stack to global variable.
authorYao, Jiewen <jiewen.yao@intel.com>
Wed, 25 Nov 2015 13:14:27 +0000 (13:14 +0000)
committerjyao1 <jyao1@Edk2>
Wed, 25 Nov 2015 13:14:27 +0000 (13:14 +0000)
We had put communication buffer to Runtime memory,
so that SMI handler can know it is not used by OS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zeng, Star" <star.zeng@intel.com>
Reviewed-by: "Kinney, Michael D" <michael.d.kinney@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18949 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c

index c534ee37011a879ff0991d250f5732e89ebfffdd..50c3b34dfd34d65819ea6a5e6eaf47b55ace8784 100644 (file)
@@ -246,6 +246,8 @@ BOOLEAN                    mSmmLocked = FALSE;
 EFI_PHYSICAL_ADDRESS       mSmramCacheBase;\r
 UINT64                     mSmramCacheSize;\r
 \r
+EFI_SMM_COMMUNICATE_HEADER mCommunicateHeader;\r
+\r
 //\r
 // Table of Protocol notification and GUIDed Event notifications that the SMM IPL requires\r
 //\r
@@ -538,21 +540,20 @@ SmmIplGuidedEventNotify (
   IN VOID       *Context\r
   )\r
 {\r
-  EFI_SMM_COMMUNICATE_HEADER  CommunicateHeader;\r
   UINTN                       Size;\r
 \r
   //\r
   // Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure \r
   //\r
-  CopyGuid (&CommunicateHeader.HeaderGuid, (EFI_GUID *)Context);\r
-  CommunicateHeader.MessageLength = 1;\r
-  CommunicateHeader.Data[0] = 0;\r
+  CopyGuid (&mCommunicateHeader.HeaderGuid, (EFI_GUID *)Context);\r
+  mCommunicateHeader.MessageLength = 1;\r
+  mCommunicateHeader.Data[0] = 0;\r
 \r
   //\r
   // Generate the Software SMI and return the result\r
   //\r
-  Size = sizeof (CommunicateHeader);\r
-  SmmCommunicationCommunicate (&mSmmCommunication, &CommunicateHeader, &Size);\r
+  Size = sizeof (mCommunicateHeader);\r
+  SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);\r
 }\r
 \r
 /**\r
@@ -569,7 +570,6 @@ SmmIplDxeDispatchEventNotify (
   IN VOID       *Context\r
   )\r
 {\r
-  EFI_SMM_COMMUNICATE_HEADER  CommunicateHeader;\r
   UINTN                       Size;\r
   EFI_STATUS                  Status;\r
 \r
@@ -582,20 +582,20 @@ SmmIplDxeDispatchEventNotify (
     // Clear the buffer passed into the Software SMI.  This buffer will return\r
     // the status of the SMM Core Dispatcher.\r
     //\r
-    CopyGuid (&CommunicateHeader.HeaderGuid, (EFI_GUID *)Context);\r
-    CommunicateHeader.MessageLength = 1;\r
-    CommunicateHeader.Data[0] = 0;\r
+    CopyGuid (&mCommunicateHeader.HeaderGuid, (EFI_GUID *)Context);\r
+    mCommunicateHeader.MessageLength = 1;\r
+    mCommunicateHeader.Data[0] = 0;\r
 \r
     //\r
     // Generate the Software SMI and return the result\r
     //\r
-    Size = sizeof (CommunicateHeader);\r
-    SmmCommunicationCommunicate (&mSmmCommunication, &CommunicateHeader, &Size);\r
+    Size = sizeof (mCommunicateHeader);\r
+    SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);\r
     \r
     //\r
     // Return if there is no request to restart the SMM Core Dispatcher\r
     //\r
-    if (CommunicateHeader.Data[0] != COMM_BUFFER_SMM_DISPATCH_RESTART) {\r
+    if (mCommunicateHeader.Data[0] != COMM_BUFFER_SMM_DISPATCH_RESTART) {\r
       return;\r
     }\r
       \r