EFI_PHYSICAL_ADDRESS NvStorageBase;\r
UINT8 *NvStorageData;\r
UINT32 NvStorageSize;\r
+ UINT64 NvStorageSize64;\r
FAULT_TOLERANT_WRITE_LAST_WRITE_DATA *FtwLastWriteData;\r
UINT32 BackUpOffset;\r
UINT32 BackUpSize;\r
\r
mVariableModuleGlobal->FvbInstance = NULL;\r
\r
+ Status = GetVariableFlashNvStorageInfo (&NvStorageBase, &NvStorageSize64);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ Status = SafeUint64ToUint32 (NvStorageSize64, &NvStorageSize);\r
+ // This driver currently assumes the size will be UINT32 so assert the value is safe for now.\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
+ ASSERT (NvStorageBase != 0);\r
+\r
//\r
// Allocate runtime memory used for a memory copy of the FLASH region.\r
// Keep the memory and the FLASH in sync as updates occur.\r
//\r
- NvStorageSize = PcdGet32 (PcdFlashNvStorageVariableSize);\r
NvStorageData = AllocateRuntimeZeroPool (NvStorageSize);\r
if (NvStorageData == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
- NvStorageBase = NV_STORAGE_VARIABLE_BASE;\r
- ASSERT (NvStorageBase != 0);\r
-\r
//\r
// Copy NV storage data to the memory buffer.\r
//\r