MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses

In preparation of providing a standalone MM based FTW driver, move
the existing SMM driver to the new MM services table, and factor out
some pieces that are specific to the traditional driver, mainly
related to the use of UEFI boot services, which are not accessible
to standalone MM drivers.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ard Biesheuvel
2019-01-03 19:28:22 +01:00
parent e2f0d814c1
commit 22cedf5bbd
7 changed files with 233 additions and 48 deletions

View File

@@ -29,8 +29,6 @@ InitializeLocalWorkSpaceHeader (
VOID
)
{
EFI_STATUS Status;
//
// Check signature with gEdkiiWorkingBlockSignatureGuid.
//
@@ -64,12 +62,8 @@ InitializeLocalWorkSpaceHeader (
//
// Calculate the Crc of woking block header
//
Status = gBS->CalculateCrc32 (
&mWorkingBlockHeader,
sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER),
&mWorkingBlockHeader.Crc
);
ASSERT_EFI_ERROR (Status);
mWorkingBlockHeader.Crc = FtwCalculateCrc32 (&mWorkingBlockHeader,
sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER));
mWorkingBlockHeader.WorkingBlockValid = FTW_VALID_STATE;
mWorkingBlockHeader.WorkingBlockInvalid = FTW_INVALID_STATE;