]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c
MdeModulePkg Variable: Add some missing changes for 9b18845
[mirror_edk2.git] / MdeModulePkg / Universal / Variable / RuntimeDxe / VariableDxe.c
index 23186176be756fce424cd7165f06e5672444e6dd..f7185df3a7eb5bf06e0ffd9a5010bb8a6fd7efe8 100644 (file)
@@ -3,7 +3,7 @@
   and volatile storage space and install variable architecture protocol.\r
 \r
 Copyright (C) 2013, Red Hat, Inc.\r
   and volatile storage space and install variable architecture protocol.\r
 \r
 Copyright (C) 2013, Red Hat, Inc.\r
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -402,8 +402,8 @@ FtwNotificationEvent (
   //\r
   // Mark the variable storage region of the FLASH as RUNTIME.\r
   //\r
   //\r
   // Mark the variable storage region of the FLASH as RUNTIME.\r
   //\r
-  VariableStoreBase   = NvStorageVariableBase + (((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)(NvStorageVariableBase))->HeaderLength);\r
-  VariableStoreLength = ((VARIABLE_STORE_HEADER *)(UINTN)VariableStoreBase)->Size;\r
+  VariableStoreBase   = NvStorageVariableBase + mNvFvHeaderCache->HeaderLength;\r
+  VariableStoreLength = mNvVariableCache->Size;\r
   BaseAddress = VariableStoreBase & (~EFI_PAGE_MASK);\r
   Length      = VariableStoreLength + (VariableStoreBase - BaseAddress);\r
   Length      = (Length + EFI_PAGE_SIZE - 1) & (~EFI_PAGE_MASK);\r
   BaseAddress = VariableStoreBase & (~EFI_PAGE_MASK);\r
   Length      = VariableStoreLength + (VariableStoreBase - BaseAddress);\r
   Length      = (Length + EFI_PAGE_SIZE - 1) & (~EFI_PAGE_MASK);\r