]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
in Recovery path, doesn't warm reset even if MemoryTypeInfo data is changed.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GenericBdsLib / BdsMisc.c
index 1e88922630889d81e312f272349d542148d10174..cc86908530c18d71c4d3144907da2c2e05f90f1b 100644 (file)
@@ -1116,16 +1116,26 @@ BdsSetMemoryTypeInformationVariable (
   EFI_HOB_GUID_TYPE            *GuidHob;\r
   BOOLEAN                      MemoryTypeInformationModified;\r
   BOOLEAN                      MemoryTypeInformationVariableExists;\r
+  EFI_BOOT_MODE                BootMode;\r
 \r
   MemoryTypeInformationModified       = FALSE;\r
   MemoryTypeInformationVariableExists = FALSE;\r
 \r
+\r
+  BootMode = GetBootModeHob ();\r
+  //\r
+  // In BOOT_IN_RECOVERY_MODE, Variable region is not reliable.\r
+  //\r
+  if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
+    return;\r
+  }\r
+\r
   //\r
   // Only get the the Memory Type Information variable in the boot mode \r
   // other than BOOT_WITH_DEFAULT_SETTINGS because the Memory Type\r
   // Information is not valid in this boot mode.\r
   //\r
-  if (GetBootModeHob () != BOOT_WITH_DEFAULT_SETTINGS) {\r
+  if (BootMode != BOOT_WITH_DEFAULT_SETTINGS) {\r
     VariableSize = 0;\r
     Status = gRT->GetVariable (\r
                     EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,\r