summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorCorvin Köhne <corvink@freebsd.org>2023-06-21 09:31:14 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-23 17:26:37 +0000
commit0f612c1443975904ff9ef1b9e3b980f8ea009ab6 (patch)
tree050865a573c216a3ea43a724b354cab14f047a55 /OvmfPkg
parentea88df6b26e93bfe12cea6804631d84e871be77c (diff)
downloadedk2-0f612c1443975904ff9ef1b9e3b980f8ea009ab6.tar.gz
edk2-0f612c1443975904ff9ef1b9e3b980f8ea009ab6.tar.bz2
edk2-0f612c1443975904ff9ef1b9e3b980f8ea009ab6.zip
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>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h27
-rw-r--r--OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf2
-rw-r--r--OvmfPkg/Include/Library/AcpiPlatformLib.h27
-rw-r--r--OvmfPkg/Library/AcpiPlatformLib/BootScript.c (renamed from OvmfPkg/AcpiPlatformDxe/BootScript.c)3
-rw-r--r--OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf2
5 files changed, 30 insertions, 31 deletions
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
index 1328f6d1cb..c9f2755014 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
@@ -11,8 +11,6 @@
#include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL
-typedef struct S3_CONTEXT S3_CONTEXT;
-
EFI_STATUS
EFIAPI
InstallCloudHvTablesTdx (
@@ -37,29 +35,4 @@ InstallAcpiTables (
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
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index b22aad95e0..6001b96269 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -23,7 +23,6 @@
[Sources]
AcpiPlatform.c
AcpiPlatform.h
- BootScript.c
CloudHvAcpi.c
EntryPoint.c
QemuFwCfgAcpi.c
@@ -40,7 +39,6 @@
MemoryAllocationLib
OrderedCollectionLib
QemuFwCfgLib
- QemuFwCfgS3Lib
UefiDriverEntryPoint
HobLib
TpmMeasurementLib
diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Library/AcpiPlatformLib.h
index 167d6c49d6..70c974dce0 100644
--- a/OvmfPkg/Include/Library/AcpiPlatformLib.h
+++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h
@@ -15,6 +15,8 @@ typedef struct {
UINT64 PciAttributes;
} ORIGINAL_ATTRIBUTES;
+typedef struct S3_CONTEXT S3_CONTEXT;
+
/**
Searches and returns the address of the ACPI Root System Description Pointer (RSDP) in system memory.
@@ -69,4 +71,29 @@ RestorePciDecoding (
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
diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/Library/AcpiPlatformLib/BootScript.c
index ff1491de0d..1b1658d703 100644
--- a/OvmfPkg/AcpiPlatformDxe/BootScript.c
+++ b/OvmfPkg/Library/AcpiPlatformLib/BootScript.c
@@ -7,13 +7,12 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include <Library/AcpiPlatformLib.h>
#include <Library/BaseLib.h> // CpuDeadLoop()
#include <Library/DebugLib.h> // DEBUG()
#include <Library/MemoryAllocationLib.h> // AllocatePool()
#include <Library/QemuFwCfgS3Lib.h> // QemuFwCfgS3ScriptSkipBytes()
-#include "AcpiPlatform.h"
-
//
// Condensed structure for capturing the fw_cfg operations -- select, skip,
// write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command.
diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
index 4be501bb2c..b6e55b618c 100644
--- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
+++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
@@ -15,6 +15,7 @@
LIBRARY_CLASS = AcpiPlatformLib
[Sources]
+ BootScript.c
DxeAcpiPlatformLib.c
PciDecoding.c
@@ -27,6 +28,7 @@
BaseLib
DebugLib
PcdLib
+ QemuFwCfgS3Lib
UefiBootServicesTableLib
[Pcd]