TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | ORIGINAL_ATTRIBUTES |
Typedefs | |
typedef struct S3_CONTEXT | S3_CONTEXT |
Functions | |
EFI_STATUS EFIAPI | GetAcpiRsdpFromMemory (IN UINTN StartAddress, IN UINTN EndAddress, OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER **RsdpPtr) |
EFI_STATUS EFIAPI | InstallAcpiTablesFromRsdp (IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol, IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp) |
EFI_STATUS EFIAPI | InstallQemuFwCfgTables (IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol) |
VOID | EnablePciDecoding (OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, OUT UINTN *Count) |
VOID | RestorePciDecoding (IN ORIGINAL_ATTRIBUTES *OriginalAttributes, IN UINTN Count) |
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) |
EFI_STATUS | TransferS3ContextToBootScript (IN S3_CONTEXT *S3Context) |
Copyright (c) 2023, Corvin Köhne corvi.nosp@m.nk@F.nosp@m.reeBS.nosp@m.D.or.nosp@m.g
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AcpiPlatformLib.h.
typedef struct S3_CONTEXT S3_CONTEXT |
Definition at line 18 of file AcpiPlatformLib.h.
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.
VOID EnablePciDecoding | ( | OUT ORIGINAL_ATTRIBUTES ** | OriginalAttributes, |
OUT UINTN * | Count | ||
) |
Collect all PciIo protocol instances in the system. Save their original attributes, and enable IO and MMIO decoding for each.
This is a best effort function; it doesn't return status codes. Its caller is supposed to proceed even if this function fails.
[out] | OriginalAttributes | On output, a dynamically allocated array of ORIGINAL_ATTRIBUTES elements. The array lists the PciIo protocol instances found in the system at the time of the call, plus the original PCI attributes for each. |
Before returning, the function enables IO and MMIO decoding for each PciIo instance it finds.
On error, or when no such instances are found, OriginalAttributes is set to NULL.
[out] | Count | On output, the number of elements in OriginalAttributes. On error it is set to zero. |
Definition at line 40 of file PciDecoding.c.
EFI_STATUS EFIAPI GetAcpiRsdpFromMemory | ( | IN UINTN | StartAddress, |
IN UINTN | EndAddress, | ||
OUT EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER ** | RsdpPtr | ||
) |
Searches and returns the address of the ACPI Root System Description Pointer (RSDP) in system memory.
StartAddress | Start address of search range. |
EndAddress | End address of search range. |
RsdpPtr | Return pointer to RSDP. |
EFI_SUCCESS | RSDP successfully found. |
EFI_NOT_FOUND | Couldn't find RSDP. |
EFI_ABORTED | Invalid RSDP found. |
Definition at line 18 of file DxeAcpiPlatformLib.c.
EFI_STATUS EFIAPI InstallAcpiTablesFromRsdp | ( | IN EFI_ACPI_TABLE_PROTOCOL * | AcpiProtocol, |
IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER * | Rsdp | ||
) |
Get Acpi tables from the RSDP structure. And installs ACPI tables into the RSDT/XSDT using InstallAcpiTable. Some signature of the installed ACPI tables are: FACP, APIC, HPET, WAET, SSDT, FACS, DSDT.
AcpiProtocol | Protocol instance pointer. |
Definition at line 71 of file DxeAcpiPlatformLib.c.
EFI_STATUS EFIAPI InstallQemuFwCfgTables | ( | IN EFI_ACPI_TABLE_PROTOCOL * | AcpiProtocol | ) |
Download, process, and install ACPI table data from the QEMU loader interface.
[in] | AcpiProtocol | The ACPI table protocol used to install tables. |
EFI_UNSUPPORTED | Firmware configuration is unavailable, or QEMU loader command with unsupported parameters has been found. |
EFI_NOT_FOUND | The host doesn't export the required fw_cfg files. |
EFI_OUT_OF_RESOURCES | Memory allocation failed, or more than INSTALLED_TABLES_MAX tables found. |
EFI_PROTOCOL_ERROR | Found invalid fw_cfg contents. |
Definition at line 1099 of file QemuFwCfgAcpi.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.
VOID RestorePciDecoding | ( | IN ORIGINAL_ATTRIBUTES * | OriginalAttributes, |
IN UINTN | Count | ||
) |
Restore the original PCI attributes saved with EnablePciDecoding().
[in] | OriginalAttributes | The array allocated and populated by EnablePciDecoding(). This parameter may be NULL. If OriginalAttributes is NULL, then the function is a no-op; otherwise the PciIo attributes will be restored, and the OriginalAttributes array will be freed. |
[in] | Count | The Count value stored by EnablePciDecoding(), the number of elements in OriginalAttributes. Count may be zero if and only if OriginalAttributes is NULL. |
Definition at line 211 of file PciDecoding.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.