summaryrefslogtreecommitdiff
path: root/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
diff options
context:
space:
mode:
Diffstat (limited to 'Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c')
-rw-r--r--Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 824f23777..c39c36daa 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -697,7 +697,18 @@ OnReadyToBoot (
&VariableSize,
&SetupVarBuffer
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status) || VariableSize != sizeof(SYSTEM_CONFIGURATION)) {
+ //The setup variable is corrupted
+ VariableSize = sizeof(SYSTEM_CONFIGURATION);
+ Status = gRT->GetVariable(
+ L"SetupRecovery",
+ &mSystemConfigurationGuid,
+ NULL,
+ &VariableSize,
+ &SetupVarBuffer
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
//
// Find the AcpiSupport protocol.
@@ -817,7 +828,18 @@ AcpiPlatformEntryPoint (
&VarSize,
&mSystemConfiguration
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status) || VarSize != sizeof(SYSTEM_CONFIGURATION)) {
+ //The setup variable is corrupted
+ VarSize = sizeof(SYSTEM_CONFIGURATION);
+ Status = gRT->GetVariable(
+ L"SetupRecovery",
+ &mSystemConfigurationGuid,
+ NULL,
+ &VarSize,
+ &mSystemConfiguration
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
//
// Find the AcpiSupport protocol.
@@ -842,6 +864,19 @@ AcpiPlatformEntryPoint (
&SysCfgSize,
&mSystemConfig
);
+ if (EFI_ERROR (Status) || SysCfgSize != sizeof(SYSTEM_CONFIGURATION)) {
+ //The setup variable is corrupted
+ SysCfgSize = sizeof(SYSTEM_CONFIGURATION);
+ Status = gRT->GetVariable(
+ L"SetupRecovery",
+ &gEfiNormalSetupGuid,
+ NULL,
+ &SysCfgSize,
+ &mSystemConfig
+ );
+ ASSERT_EFI_ERROR (Status);
+ }
+
Status = EFI_SUCCESS;
Instance = 0;