summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorYao, Jiewen <jiewen.yao@intel.com>2015-12-07 02:21:29 +0000
committervanjeff <vanjeff@Edk2>2015-12-07 02:21:29 +0000
commita1395ce447423d0d3aa74fce5e790081caebb6c4 (patch)
tree480e1a6c826be4bfc3cb47c848743e85e0727312 /MdeModulePkg/Core
parent174448723f38513b798ea63241de9d4332528c62 (diff)
downloadedk2-platforms-a1395ce447423d0d3aa74fce5e790081caebb6c4.tar.xz
Move CommunicationBuffer from stack to global variable.
We had put communication buffer to Runtime memory, so that SMI handler can know it is not used by OS. (Sync patch r18949 from main trunk.) 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/branches/UDK2015@19126 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
index c534ee3701..50c3b34dfd 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -246,6 +246,8 @@ BOOLEAN mSmmLocked = FALSE;
EFI_PHYSICAL_ADDRESS mSmramCacheBase;
UINT64 mSmramCacheSize;
+EFI_SMM_COMMUNICATE_HEADER mCommunicateHeader;
+
//
// Table of Protocol notification and GUIDed Event notifications that the SMM IPL requires
//
@@ -538,21 +540,20 @@ SmmIplGuidedEventNotify (
IN VOID *Context
)
{
- EFI_SMM_COMMUNICATE_HEADER CommunicateHeader;
UINTN Size;
//
// Use Guid to initialize EFI_SMM_COMMUNICATE_HEADER structure
//
- CopyGuid (&CommunicateHeader.HeaderGuid, (EFI_GUID *)Context);
- CommunicateHeader.MessageLength = 1;
- CommunicateHeader.Data[0] = 0;
+ CopyGuid (&mCommunicateHeader.HeaderGuid, (EFI_GUID *)Context);
+ mCommunicateHeader.MessageLength = 1;
+ mCommunicateHeader.Data[0] = 0;
//
// Generate the Software SMI and return the result
//
- Size = sizeof (CommunicateHeader);
- SmmCommunicationCommunicate (&mSmmCommunication, &CommunicateHeader, &Size);
+ Size = sizeof (mCommunicateHeader);
+ SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);
}
/**
@@ -569,7 +570,6 @@ SmmIplDxeDispatchEventNotify (
IN VOID *Context
)
{
- EFI_SMM_COMMUNICATE_HEADER CommunicateHeader;
UINTN Size;
EFI_STATUS Status;
@@ -582,20 +582,20 @@ SmmIplDxeDispatchEventNotify (
// Clear the buffer passed into the Software SMI. This buffer will return
// the status of the SMM Core Dispatcher.
//
- CopyGuid (&CommunicateHeader.HeaderGuid, (EFI_GUID *)Context);
- CommunicateHeader.MessageLength = 1;
- CommunicateHeader.Data[0] = 0;
+ CopyGuid (&mCommunicateHeader.HeaderGuid, (EFI_GUID *)Context);
+ mCommunicateHeader.MessageLength = 1;
+ mCommunicateHeader.Data[0] = 0;
//
// Generate the Software SMI and return the result
//
- Size = sizeof (CommunicateHeader);
- SmmCommunicationCommunicate (&mSmmCommunication, &CommunicateHeader, &Size);
+ Size = sizeof (mCommunicateHeader);
+ SmmCommunicationCommunicate (&mSmmCommunication, &mCommunicateHeader, &Size);
//
// Return if there is no request to restart the SMM Core Dispatcher
//
- if (CommunicateHeader.Data[0] != COMM_BUFFER_SMM_DISPATCH_RESTART) {
+ if (mCommunicateHeader.Data[0] != COMM_BUFFER_SMM_DISPATCH_RESTART) {
return;
}