]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/Pei/Variable.c
MdeModulePkg VariablePei: Don't check BOOT_IN_RECOVERY_MODE
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / Pei / Variable.c
index 77b3eaeb210ddfcf91e249d6ce1304f0638098be..148c1cfefd90c44e6e464fa7257bdec3b624e8a5 100644 (file)
@@ -2,7 +2,7 @@
   Implement ReadOnly Variable Services required by PEIM and install\r
   PEI ReadOnly Varaiable2 PPI. These services operates the non volatile storage space.\r
 \r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -584,9 +584,9 @@ GetVariableStore (
       break;\r
 \r
     case VariableStoreTypeNv:\r
-      if (GetBootModeHob () != BOOT_IN_RECOVERY_MODE) {\r
+      if (!PcdGetBool (PcdEmuVariableNvModeEnable)) {\r
         //\r
-        // The content of NV storage for variable is not reliable in recovery boot mode.\r
+        // Emulated non-volatile variable mode is not enabled.\r
         //\r
 \r
         NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);\r
@@ -594,6 +594,8 @@ GetVariableStore (
                                                 PcdGet64 (PcdFlashNvStorageVariableBase64) :\r
                                                 PcdGet32 (PcdFlashNvStorageVariableBase)\r
                                                );\r
+        ASSERT (NvStorageBase != 0);\r
+\r
         //\r
         // First let FvHeader point to NV storage base.\r
         //\r