public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Corvin Köhne" <corvink@FreeBSD.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Peter Grehan <grehan@freebsd.org>,
	Rebecca Cran <rebecca@bsdio.com>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: [PATCH 3/5] OvmfPkg: move BootScript into AcpiPlatformLib
Date: Wed, 14 Jun 2023 09:55:45 +0200	[thread overview]
Message-ID: <20230614075915.141380-4-corvink@FreeBSD.org> (raw)
In-Reply-To: <20230614075915.141380-1-corvink@FreeBSD.org>

This is required to move InstallQemuFwCfgTables into AcpiPlatformLib.

Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
---
 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf   |  2 --
 .../AcpiPlatformLib/DxeAcpiPlatformLib.inf    |  2 ++
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h        | 27 -------------------
 OvmfPkg/Include/Library/AcpiPlatformLib.h     | 27 +++++++++++++++++++
 .../AcpiPlatformLib}/BootScript.c             |  3 +--
 5 files changed, 30 insertions(+), 31 deletions(-)
 rename OvmfPkg/{AcpiPlatformDxe => Library/AcpiPlatformLib}/BootScript.c (96%)

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index b22aad95e081..6001b9626970 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -23,7 +23,6 @@ [Defines]
 [Sources]
   AcpiPlatform.c
   AcpiPlatform.h
-  BootScript.c
   CloudHvAcpi.c
   EntryPoint.c
   QemuFwCfgAcpi.c
@@ -40,7 +39,6 @@ [LibraryClasses]
   MemoryAllocationLib
   OrderedCollectionLib
   QemuFwCfgLib
-  QemuFwCfgS3Lib
   UefiDriverEntryPoint
   HobLib
   TpmMeasurementLib
diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
index 4be501bb2c58..b6e55b618cbb 100644
--- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
+++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
@@ -15,6 +15,7 @@ [Defines]
   LIBRARY_CLASS  = AcpiPlatformLib
 
 [Sources]
+  BootScript.c
   DxeAcpiPlatformLib.c
   PciDecoding.c
 
@@ -27,6 +28,7 @@ [LibraryClasses]
   BaseLib
   DebugLib
   PcdLib
+  QemuFwCfgS3Lib
   UefiBootServicesTableLib
 
 [Pcd]
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
index 1328f6d1cba6..c9f2755014a1 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/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Library/AcpiPlatformLib.h
index 167d6c49d6e2..70c974dce05e 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
similarity index 96%
rename from OvmfPkg/AcpiPlatformDxe/BootScript.c
rename to OvmfPkg/Library/AcpiPlatformLib/BootScript.c
index ff1491de0d2d..1b1658d703b0 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.
-- 
2.41.0


  parent reply	other threads:[~2023-06-14  7:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  7:55 [PATCH 0/5] OvmfPkg/Bhyve: install Acpi tables by FwCfg Corvin Köhne
2023-06-14  7:55 ` [PATCH 1/5] OvmfPkg: avoid including AcpiPlatformLib twice Corvin Köhne
2023-06-19 10:41   ` Gerd Hoffmann
2023-06-19 11:52     ` Corvin Köhne
2023-06-19 13:04       ` Gerd Hoffmann
2023-06-19 13:11         ` Corvin Köhne
2023-06-14  7:55 ` [PATCH 2/5] OvmfPkg: move PciEncoding into AcpiPlatformLib Corvin Köhne
2023-06-14  7:55 ` Corvin Köhne [this message]
2023-06-14  7:55 ` [PATCH 4/5] OvmfPkg: move QemuFwCfgAcpi " Corvin Köhne
2023-06-14  7:55 ` [PATCH 5/5] OvmfPkg/Bhyve: install Acpi tables provided by FwCfg Corvin Köhne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230614075915.141380-4-corvink@FreeBSD.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox