OvmfPkg: QemuFlashFvbServicesRuntimeDxe: Abstract out SMM/DXE functions
This update refactors QemuFlashFvbServicesRuntimeDxe to abstract out direct calls to SMM and DXE specific functions. Specifically, dynamic PCD usage and gBS references have been moved to SMM specific files. The constructor functionality has been relocated to a common implementation and is invoked from their respective entry points. These changes lay the groundwork for supporting a Standalone MM-based solution in the future. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
@@ -27,9 +27,7 @@
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/DxeServicesTableLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
|
||||
#include "FwBlockService.h"
|
||||
#include "QemuFlash.h"
|
||||
@@ -976,7 +974,6 @@ FvbInitialize (
|
||||
EFI_PHYSICAL_ADDRESS BaseAddress;
|
||||
UINTN Length;
|
||||
UINTN NumOfBlocks;
|
||||
RETURN_STATUS PcdStatus;
|
||||
|
||||
if (EFI_ERROR (QemuFlashInitialize ())) {
|
||||
//
|
||||
@@ -1129,7 +1126,8 @@ FvbInitialize (
|
||||
//
|
||||
InstallVirtualAddressChangeHandler ();
|
||||
|
||||
PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
// Abstract dynamic PCD set to support Standalone MM
|
||||
UpdateQemuFlashVariablesEnable ();
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -194,4 +194,9 @@ SetPcdFlashNvStorageBaseAddresses (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
UpdateQemuFlashVariablesEnable (
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -244,3 +244,14 @@ SetPcdFlashNvStorageBaseAddresses (
|
||||
);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
}
|
||||
|
||||
VOID
|
||||
UpdateQemuFlashVariablesEnable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
RETURN_STATUS PcdStatus;
|
||||
|
||||
PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
}
|
||||
|
||||
@@ -84,3 +84,14 @@ SetPcdFlashNvStorageBaseAddresses (
|
||||
// Do nothing.
|
||||
//
|
||||
}
|
||||
|
||||
VOID
|
||||
UpdateQemuFlashVariablesEnable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
RETURN_STATUS PcdStatus;
|
||||
|
||||
PcdStatus = PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE);
|
||||
ASSERT_RETURN_ERROR (PcdStatus);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user