TianoCore EDK2 master
|
#include <Library/AcpiPlatformLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/QemuFwCfgS3Lib.h>
Go to the source code of this file.
Data Structures | |
struct | CONDENSED_WRITE_POINTER |
struct | S3_CONTEXT |
union | SCRATCH_BUFFER |
Functions | |
EFI_STATUS | AllocateS3Context (OUT S3_CONTEXT **S3Context, IN UINTN WritePointerCount) |
VOID | ReleaseS3Context (IN S3_CONTEXT *S3Context) |
EFI_STATUS | SaveCondensedWritePointerToS3Context (IN OUT S3_CONTEXT *S3Context, IN UINT16 PointerItem, IN UINT8 PointerSize, IN UINT32 PointerOffset, IN UINT64 PointerValue) |
STATIC VOID EFIAPI | AppendFwCfgBootScript (IN OUT VOID *Context OPTIONAL, IN OUT VOID *ExternalScratchBuffer) |
EFI_STATUS | TransferS3ContextToBootScript (IN S3_CONTEXT *S3Context) |
Append an ACPI S3 Boot Script fragment from the QEMU_LOADER_WRITE_POINTER commands of QEMU's fully processed table linker/loader script.
Copyright (C) 2017, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BootScript.c.
EFI_STATUS AllocateS3Context | ( | OUT S3_CONTEXT ** | S3Context, |
IN UINTN | WritePointerCount | ||
) |
Allocate an S3_CONTEXT object.
[out] | S3Context | The allocated S3_CONTEXT object is returned through this parameter. |
[in] | WritePointerCount | Number of CONDENSED_WRITE_POINTER elements to allocate room for. WritePointerCount must be positive. |
EFI_SUCCESS | Allocation successful. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_INVALID_PARAMETER | WritePointerCount is zero. |
Definition at line 72 of file BootScript.c.
STATIC VOID EFIAPI AppendFwCfgBootScript | ( | IN OUT VOID *Context | OPTIONAL, |
IN OUT VOID * | ExternalScratchBuffer | ||
) |
FW_CFG_BOOT_SCRIPT_CALLBACK_FUNCTION provided to QemuFwCfgS3Lib.
Definition at line 194 of file BootScript.c.
VOID ReleaseS3Context | ( | IN S3_CONTEXT * | S3Context | ) |
Release an S3_CONTEXT object.
[in] | S3Context | The object to release. |
Definition at line 114 of file BootScript.c.
EFI_STATUS SaveCondensedWritePointerToS3Context | ( | IN OUT S3_CONTEXT * | S3Context, |
IN UINT16 | PointerItem, | ||
IN UINT8 | PointerSize, | ||
IN UINT32 | PointerOffset, | ||
IN UINT64 | PointerValue | ||
) |
Save the information necessary to replicate a QEMU_LOADER_WRITE_POINTER command during S3 resume, in condensed format.
This function is to be called from ProcessCmdWritePointer(), after all the sanity checks have passed, and before the fw_cfg operations are performed.
[in,out] | S3Context | The S3_CONTEXT object into which the caller wants to save the information that was derived from QEMU_LOADER_WRITE_POINTER. |
[in] | PointerItem | The FIRMWARE_CONFIG_ITEM that QEMU_LOADER_WRITE_POINTER.PointerFile was resolved to, expressed as a UINT16 value. |
[in] | PointerSize | Copied directly from QEMU_LOADER_WRITE_POINTER.PointerSize. |
[in] | PointerOffset | Copied directly from QEMU_LOADER_WRITE_POINTER.PointerOffset. |
[in] | PointerValue | The base address of the allocated / downloaded fw_cfg blob that is identified by QEMU_LOADER_WRITE_POINTER.PointeeFile, plus QEMU_LOADER_WRITE_POINTER.PointeeOffset. |
EFI_SUCCESS | The information derived from QEMU_LOADER_WRITE_POINTER has been successfully absorbed into S3Context. |
EFI_OUT_OF_RESOURCES | No room available in S3Context. |
Definition at line 155 of file BootScript.c.
EFI_STATUS TransferS3ContextToBootScript | ( | IN S3_CONTEXT * | S3Context | ) |
Translate and append the information from an S3_CONTEXT object to the ACPI S3 Boot Script.
The effects of a successful call to this function cannot be undone.
[in] | S3Context | The S3_CONTEXT object to translate to ACPI S3 Boot Script opcodes. If the function returns successfully, the caller must set the S3Context pointer – originally returned by AllocateS3Context() – immediately to NULL, because the ownership of S3Context has been transferred. |
EFI_SUCCESS | The translation of S3Context to ACPI S3 Boot Script opcodes has been successfully executed or queued. (This includes the case when S3Context was empty on input and no ACPI S3 Boot Script opcodes have been necessary to produce.) |
Definition at line 258 of file BootScript.c.