OvmfPkg/AcpiPlatformDxe: save fw_cfg boot script with QemuFwCfgS3Lib

Drop the explicit S3SaveState protocol and opcode management; instead,
create ACPI S3 Boot Script opcodes for the WRITE_POINTER commands with
QemuFwCfgS3Lib functions.

In this case, we have a dynamically allocated Context structure, hence the
patch demonstrates how the FW_CFG_BOOT_SCRIPT_CALLBACK_FUNCTION takes
ownership of Context.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=394
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Laszlo Ersek
2017-02-23 00:22:17 +01:00
parent 36a6aa6c64
commit 8057622527
5 changed files with 72 additions and 217 deletions

View File

@@ -848,6 +848,13 @@ InstallQemuFwCfgTables (
//
if (S3Context != NULL) {
Status = TransferS3ContextToBootScript (S3Context);
if (EFI_ERROR (Status)) {
goto UninstallAcpiTables;
}
//
// Ownership of S3Context has been transfered.
//
S3Context = NULL;
}
UninstallAcpiTables: