From 620f289162b08d319fe1e73b3c7e2baff6b388e4 Mon Sep 17 00:00:00 2001 From: Tim He Date: Thu, 11 Jun 2015 02:50:20 +0000 Subject: Sync the branch changes to trunk. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the FCE tool to remove “runtime access” . and recovery "Setup" variable in case of “Setup” variable size is incorrect somehow. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tim He Reviewed-by: David Wei git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17620 6f19259b-4bc3-4df7-8a09-765794883524 --- Vlv2TbltDevicePkg/PlatformSmm/Platform.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'Vlv2TbltDevicePkg/PlatformSmm') diff --git a/Vlv2TbltDevicePkg/PlatformSmm/Platform.c b/Vlv2TbltDevicePkg/PlatformSmm/Platform.c index d8bfeb437..3a5b20a98 100644 --- a/Vlv2TbltDevicePkg/PlatformSmm/Platform.c +++ b/Vlv2TbltDevicePkg/PlatformSmm/Platform.c @@ -170,6 +170,18 @@ InitializePlatformSmm ( &VarSize, &mSystemConfiguration ); + if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) { + //The setup variable is corrupted + VarSize = sizeof(SYSTEM_CONFIGURATION); + Status = SystemTable->RuntimeServices->GetVariable( + L"SetupRecovery", + &gEfiSetupVariableGuid, + NULL, + &VarSize, + &mSystemConfiguration + ); + ASSERT_EFI_ERROR (Status); + } if (!EFI_ERROR(Status)) { mAcLossVariable = mSystemConfiguration.StateAfterG3; @@ -848,7 +860,20 @@ EnableS5WakeOnRtc() &VarSize, &mSystemConfiguration ); - if (EFI_ERROR(Status) || (!mSystemConfiguration.WakeOnRtcS5)) { + if (EFI_ERROR(Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) { + //The setup variable is corrupted + VarSize = sizeof(SYSTEM_CONFIGURATION); + Status = mSmmVariable->SmmGetVariable( + L"SetupRecovery", + &gEfiSetupVariableGuid, + NULL, + &VarSize, + &mSystemConfiguration + ); + ASSERT_EFI_ERROR (Status); + } + + if (!mSystemConfiguration.WakeOnRtcS5) { return; } mWakeupDay = HexToBcd((UINT8)mSystemConfiguration.RTCWakeupDate); -- cgit v1.2.3