summaryrefslogtreecommitdiff
path: root/Vlv2TbltDevicePkg/PlatformSmm
diff options
context:
space:
mode:
Diffstat (limited to 'Vlv2TbltDevicePkg/PlatformSmm')
-rw-r--r--Vlv2TbltDevicePkg/PlatformSmm/Platform.c27
1 files changed, 26 insertions, 1 deletions
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);