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

@@ -77,4 +77,43 @@ typedef struct {
UINT8 Data[1];
} SMM_FTW_GET_LAST_WRITE_HEADER;
/**
Shared entry point of the module
@retval EFI_SUCCESS The initialization finished successfully.
@retval EFI_OUT_OF_RESOURCES Allocate memory error
@retval EFI_INVALID_PARAMETER Workspace or Spare block does not exist
**/
EFI_STATUS
MmFaultTolerantWriteInitialize (
VOID
);
/**
This function checks if the buffer is valid per processor architecture and
does not overlap with SMRAM.
@param Buffer The buffer start address to be checked.
@param Length The buffer length to be checked.
@retval TRUE This buffer is valid per processor architecture and does not
overlap with SMRAM.
@retval FALSE This buffer is not valid per processor architecture or overlaps
with SMRAM.
**/
BOOLEAN
FtwSmmIsBufferOutsideSmmValid (
IN EFI_PHYSICAL_ADDRESS Buffer,
IN UINT64 Length
);
/**
Notify the system that the SMM FTW driver is ready
**/
VOID
FtwNotifySmmReady (
VOID
);
#endif