EmuVariableFvbRuntimeDxe now uses a 4KB (EFI_PAGE_SIZE) block size.
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
{\r
EFI_PHYSICAL_ADDRESS VariableStore;\r
RETURN_STATUS PcdStatus;\r
{\r
EFI_PHYSICAL_ADDRESS VariableStore;\r
RETURN_STATUS PcdStatus;\r
\r
//\r
// Allocate storage for NV variables early on so it will be\r
\r
//\r
// Allocate storage for NV variables early on so it will be\r
// across reboots, this allows the NV variable storage to survive\r
// a VM reboot.\r
//\r
// across reboots, this allows the NV variable storage to survive\r
// a VM reboot.\r
//\r
- Alignment = PcdGet32 (PcdFlashNvStorageFtwSpareSize);\r
- if ((Alignment & (Alignment - 1)) != 0) {\r
- //\r
- // Round up Alignment to the next power of two.\r
- //\r
- Alignment = GetPowerOfTwo32 (Alignment) << 1;\r
- }\r
-\r
VariableStore =\r
(EFI_PHYSICAL_ADDRESS)(UINTN)\r
VariableStore =\r
(EFI_PHYSICAL_ADDRESS)(UINTN)\r
- AllocateAlignedRuntimePages (\r
- EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)),\r
- Alignment\r
+ AllocateRuntimePages (\r
+ EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize))\r
);\r
DEBUG ((EFI_D_INFO,\r
);\r
DEBUG ((EFI_D_INFO,\r
- "Reserved variable store memory: 0x%lX; size: %dkb, "\r
- "alignment: 0x%x\n",\r
+ "Reserved variable store memory: 0x%lX; size: %dkb\n",\r
- (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024,\r
- Alignment\r
+ (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024\r
));\r
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);\r
ASSERT_RETURN_ERROR (PcdStatus);\r
));\r
PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore);\r
ASSERT_RETURN_ERROR (PcdStatus);\r