OvmfPkg/QemuFlashFvbServices: factor out SetPcdFlashNvStorageBaseAddresses
Extract the dynamic setting of the - PcdFlashNvStorageVariableBase64 - PcdFlashNvStorageFtwWorkingBase - PcdFlashNvStorageFtwSpareBase addresses to a helper function. For now, the helper function is identical (duplicated) between the SMM flash driver and the runtime DXE flash driver. In subsequent patches, this will change. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=386 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200310222739.26717-3-lersek@redhat.com> Acked-by: Leif Lindholm <leif@nuviainc.com>
This commit is contained in:
committed by
mergify[bot]
parent
d6961bb47a
commit
cd99d07d53
@@ -1051,24 +1051,7 @@ FvbInitialize (
|
||||
|
||||
MarkIoMemoryRangeForRuntimeAccess (BaseAddress, Length);
|
||||
|
||||
//
|
||||
// Set several PCD values to point to flash
|
||||
//
|
||||
PcdStatus = PcdSet64S (
|
||||
PcdFlashNvStorageVariableBase64,
|
||||
(UINTN) PcdGet32 (PcdOvmfFlashNvStorageVariableBase)
|
||||
);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
PcdStatus = PcdSet32S (
|
||||
PcdFlashNvStorageFtwWorkingBase,
|
||||
PcdGet32 (PcdOvmfFlashNvStorageFtwWorkingBase)
|
||||
);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
PcdStatus = PcdSet32S (
|
||||
PcdFlashNvStorageFtwSpareBase,
|
||||
PcdGet32 (PcdOvmfFlashNvStorageFtwSpareBase)
|
||||
);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
SetPcdFlashNvStorageBaseAddresses ();
|
||||
|
||||
FwhInstance = (EFI_FW_VOL_INSTANCE *)
|
||||
(
|
||||
|
Reference in New Issue
Block a user