]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg VariableRuntimeDxe: Bug fix and and refine debug message.
authorDong, Guo <guo.dong@intel.com>
Wed, 3 Sep 2014 09:16:04 +0000 (09:16 +0000)
committergdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 3 Sep 2014 09:16:04 +0000 (09:16 +0000)
Correct NV variable base address for flash memory attribute set to EFI_MEMORY_RUNTIME.
Refine the debug error message.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>
Reviewed-by: Zeng, Star <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16054 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c

index c02d637699ab6aacc04ffe8ac1eaa9884ad51e93..2b7b0ecfb7ea10c948af3753300c5dd654c58fdf 100644 (file)
@@ -366,7 +366,7 @@ FtwNotificationEvent (
   //\r
   // Mark the variable storage region of the FLASH as RUNTIME.\r
   //\r
-  VariableStoreBase   = mVariableModuleGlobal->VariableGlobal.NonVolatileVariableBase;\r
+  VariableStoreBase   = NvStorageVariableBase + (((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)(NvStorageVariableBase))->HeaderLength);\r
   VariableStoreLength = ((VARIABLE_STORE_HEADER *)(UINTN)VariableStoreBase)->Size;\r
   BaseAddress = VariableStoreBase & (~EFI_PAGE_MASK);\r
   Length      = VariableStoreLength + (VariableStoreBase - BaseAddress);\r
@@ -374,7 +374,7 @@ FtwNotificationEvent (
 \r
   Status      = gDS->GetMemorySpaceDescriptor (BaseAddress, &GcdDescriptor);\r
   if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_WARN, "Variable driver failed to add EFI_MEMORY_RUNTIME attribute to Flash.\n"));\r
+    DEBUG ((DEBUG_WARN, "Variable driver failed to get flash memory attribute.\n"));\r
   } else {\r
     Status = gDS->SetMemorySpaceAttributes (\r
                     BaseAddress,\r