diff options
author | Star Zeng <star.zeng@intel.com> | 2015-05-19 01:32:52 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2015-05-19 01:32:52 +0000 |
commit | d3460bcbdce5fddbbc64ae6fa9d80b2c55cdee14 (patch) | |
tree | 282bda0da01a0b94d054cc7c2d6dce6b52f42d7d | |
parent | 54ae9c08e8e78089ce186d0a632731943b8f436c (diff) | |
download | edk2-platforms-d3460bcbdce5fddbbc64ae6fa9d80b2c55cdee14.tar.xz |
MdeModulePkg Variable: Prevent BS variable update in legacy OS runtime.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17467 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c index 3a87298160..0e0a7c5c3b 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c @@ -997,6 +997,7 @@ VariableSmmRuntimeInitialize ( VOID *SmmVariableWriteRegistration;
EFI_EVENT OnReadyToBootEvent;
EFI_EVENT ExitBootServiceEvent;
+ EFI_EVENT LegacyBootEvent;
EfiInitializeLock (&mVariableServicesLock, TPL_NOTIFY);
@@ -1065,6 +1066,17 @@ VariableSmmRuntimeInitialize ( );
//
+ // Register the event to inform SMM variable that it is at runtime for legacy boot.
+ // Reuse OnExitBootServices() here.
+ //
+ EfiCreateEventLegacyBootEx(
+ TPL_NOTIFY,
+ OnExitBootServices,
+ NULL,
+ &LegacyBootEvent
+ );
+
+ //
// Register the event to convert the pointer for runtime.
//
gBS->CreateEventEx (
|