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 v3 5/6] OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib
Date: Tue, 20 Jun 2023 14:53:39 +0200	[thread overview]
Message-ID: <20230620125407.516697-6-corvink@FreeBSD.org> (raw)
In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org>

This makes the InstallQemuFwcfgTables function reusable by bhyve.

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                 | 3 ---
 OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf      | 5 +++++
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h                      | 6 ------
 OvmfPkg/Include/Library/AcpiPlatformLib.h                   | 6 ++++++
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c                      | 3 +++
 .../AcpiPlatformLib}/QemuFwCfgAcpi.c                        | 2 --
 6 files changed, 14 insertions(+), 11 deletions(-)
 rename OvmfPkg/{AcpiPlatformDxe => Library/AcpiPlatformLib}/QemuFwCfgAcpi.c (96%)

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index 6001b9626970..622589e607e9 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -25,7 +25,6 @@ [Sources]
   AcpiPlatform.h
   CloudHvAcpi.c
   EntryPoint.c
-  QemuFwCfgAcpi.c
 
 [Packages]
   MdeModulePkg/MdeModulePkg.dec
@@ -41,12 +40,10 @@ [LibraryClasses]
   QemuFwCfgLib
   UefiDriverEntryPoint
   HobLib
-  TpmMeasurementLib
 
 [Protocols]
   gEfiAcpiTableProtocolGuid                     # PROTOCOL ALWAYS_CONSUMED
   gEfiPciIoProtocolGuid                         # PROTOCOL SOMETIMES_CONSUMED
-  gQemuAcpiTableNotifyProtocolGuid              # PROTOCOL PRODUCES
 
 [Guids]
   gRootBridgesConnectedEventGroupGuid
diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
index b6e55b618cbb..59fcb957d059 100644
--- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
+++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
@@ -18,6 +18,7 @@ [Sources]
   BootScript.c
   DxeAcpiPlatformLib.c
   PciDecoding.c
+  QemuFwCfgAcpi.c
 
 [Packages]
   MdeModulePkg/MdeModulePkg.dec
@@ -30,6 +31,10 @@ [LibraryClasses]
   PcdLib
   QemuFwCfgS3Lib
   UefiBootServicesTableLib
+  TpmMeasurementLib
+
+[Protocols]
+  gQemuAcpiTableNotifyProtocolGuid              # PROTOCOL PRODUCES
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
index c9f2755014a1..f4ae84b5a194 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
@@ -23,12 +23,6 @@ InstallCloudHvTables (
   IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol
   );
 
-EFI_STATUS
-EFIAPI
-InstallQemuFwCfgTables (
-  IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol
-  );
-
 EFI_STATUS
 EFIAPI
 InstallAcpiTables (
diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/Library/AcpiPlatformLib.h
index 70c974dce05e..277be93a50bc 100644
--- a/OvmfPkg/Include/Library/AcpiPlatformLib.h
+++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h
@@ -59,6 +59,12 @@ InstallAcpiTablesFromRsdp (
   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,
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
index b446bb487234..20c98bb67fa3 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
@@ -9,6 +9,9 @@
 
 #include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
 #include <ConfidentialComputingGuestAttr.h>
+
+#include <Library/AcpiPlatformLib.h>
+
 #include "AcpiPlatform.h"
 
 /**
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c
similarity index 96%
rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
rename to OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c
index 3de039d57414..d9d0163ffd9f 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c
@@ -22,8 +22,6 @@
 #include <Library/UefiBootServicesTableLib.h> // gBS
 #include <Library/TpmMeasurementLib.h>
 
-#include "AcpiPlatform.h"
-
 //
 // The user structure for the ordered collection that will track the fw_cfg
 // blobs under processing.
-- 
2.41.0


  parent reply	other threads:[~2023-06-20 12:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 12:53 [PATCH v3 0/6] OvmfPkg/Bhyve: install Acpi tables by FwCfg Corvin Köhne
2023-06-20 12:53 ` [PATCH v3 1/6] OvmfPkg/Library: fix definition of GetAcpiRsdpFromMemory Corvin Köhne
2023-06-21  1:31   ` [edk2-devel] " Peter Grehan
2023-06-20 12:53 ` [PATCH v3 2/6] OvmfPkg: avoid including AcpiPlatformLib twice Corvin Köhne
2023-06-20 12:53 ` [PATCH v3 3/6] OvmfPkg: move PciEncoding into AcpiPlatformLib Corvin Köhne
2023-06-20 12:53 ` [PATCH v3 4/6] OvmfPkg: move BootScript " Corvin Köhne
2023-06-20 12:53 ` Corvin Köhne [this message]
2023-06-20 12:53 ` [PATCH v3 6/6] 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=20230620125407.516697-6-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