OvmfPkg: move BootScript into AcpiPlatformLib

This is required to move InstallQemuFwCfgTables into AcpiPlatformLib.

Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
Acked-by: Peter Grehan <grehan@freebsd.org>
This commit is contained in:
Corvin Köhne 2023-06-21 09:31:14 +02:00 committed by mergify[bot]
parent ea88df6b26
commit 0f612c1443
5 changed files with 30 additions and 31 deletions

View File

@ -11,8 +11,6 @@
#include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL #include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL
typedef struct S3_CONTEXT S3_CONTEXT;
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
InstallCloudHvTablesTdx ( InstallCloudHvTablesTdx (
@ -37,29 +35,4 @@ InstallAcpiTables (
IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
); );
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
);
#endif #endif

View File

@ -23,7 +23,6 @@
[Sources] [Sources]
AcpiPlatform.c AcpiPlatform.c
AcpiPlatform.h AcpiPlatform.h
BootScript.c
CloudHvAcpi.c CloudHvAcpi.c
EntryPoint.c EntryPoint.c
QemuFwCfgAcpi.c QemuFwCfgAcpi.c
@ -40,7 +39,6 @@
MemoryAllocationLib MemoryAllocationLib
OrderedCollectionLib OrderedCollectionLib
QemuFwCfgLib QemuFwCfgLib
QemuFwCfgS3Lib
UefiDriverEntryPoint UefiDriverEntryPoint
HobLib HobLib
TpmMeasurementLib TpmMeasurementLib

View File

@ -15,6 +15,8 @@ typedef struct {
UINT64 PciAttributes; UINT64 PciAttributes;
} ORIGINAL_ATTRIBUTES; } ORIGINAL_ATTRIBUTES;
typedef struct S3_CONTEXT S3_CONTEXT;
/** /**
Searches and returns the address of the ACPI Root System Description Pointer (RSDP) in system memory. Searches and returns the address of the ACPI Root System Description Pointer (RSDP) in system memory.
@ -69,4 +71,29 @@ RestorePciDecoding (
IN UINTN Count 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
);
#endif #endif

View File

@ -7,13 +7,12 @@
SPDX-License-Identifier: BSD-2-Clause-Patent SPDX-License-Identifier: BSD-2-Clause-Patent
**/ **/
#include <Library/AcpiPlatformLib.h>
#include <Library/BaseLib.h> // CpuDeadLoop() #include <Library/BaseLib.h> // CpuDeadLoop()
#include <Library/DebugLib.h> // DEBUG() #include <Library/DebugLib.h> // DEBUG()
#include <Library/MemoryAllocationLib.h> // AllocatePool() #include <Library/MemoryAllocationLib.h> // AllocatePool()
#include <Library/QemuFwCfgS3Lib.h> // QemuFwCfgS3ScriptSkipBytes() #include <Library/QemuFwCfgS3Lib.h> // QemuFwCfgS3ScriptSkipBytes()
#include "AcpiPlatform.h"
// //
// Condensed structure for capturing the fw_cfg operations -- select, skip, // Condensed structure for capturing the fw_cfg operations -- select, skip,
// write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command. // write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command.

View File

@ -15,6 +15,7 @@
LIBRARY_CLASS = AcpiPlatformLib LIBRARY_CLASS = AcpiPlatformLib
[Sources] [Sources]
BootScript.c
DxeAcpiPlatformLib.c DxeAcpiPlatformLib.c
PciDecoding.c PciDecoding.c
@ -27,6 +28,7 @@
BaseLib BaseLib
DebugLib DebugLib
PcdLib PcdLib
QemuFwCfgS3Lib
UefiBootServicesTableLib UefiBootServicesTableLib
[Pcd] [Pcd]