From: sebastien.boeuf@intel.com
To: devel@edk2.groups.io
Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com,
kraxel@redhat.com, sebastien.boeuf@intel.com
Subject: [PATCH v6 2/5] OvmfPkg: Create global entry point for SMBIOS parsing
Date: Fri, 10 Dec 2021 10:35:10 +0100 [thread overview]
Message-ID: <65795c002913b22702cf24972f8fa89881b1da1a.1639128828.git.sebastien.boeuf@intel.com> (raw)
In-Reply-To: <cover.1639128828.git.sebastien.boeuf@intel.com>
From: Sebastien Boeuf <sebastien.boeuf@intel.com>
Move the generic entry point part out of Qemu.c to anticipate the
addition of new ways of retrieving the SMBIOS table.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
---
OvmfPkg/SmbiosPlatformDxe/EntryPoint.c | 42 +++++++++++++++++++
OvmfPkg/SmbiosPlatformDxe/Qemu.c | 35 ----------------
OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 11 +++++
.../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 +
4 files changed, 54 insertions(+), 35 deletions(-)
create mode 100644 OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
new file mode 100644
index 0000000000..c72ba1d14b
--- /dev/null
+++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
@@ -0,0 +1,42 @@
+/** @file
+ Find and extract SMBIOS data.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/MemoryAllocationLib.h> // FreePool()
+
+#include "SmbiosPlatformDxe.h"
+
+/**
+ Installs SMBIOS information for OVMF
+
+ @param ImageHandle Module's image handle
+ @param SystemTable Pointer of EFI_SYSTEM_TABLE
+
+ @retval EFI_SUCCESS Smbios data successfully installed
+ @retval Other Smbios data was not installed
+
+**/
+EFI_STATUS
+EFIAPI
+SmbiosTablePublishEntry (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ UINT8 *SmbiosTables;
+
+ Status = EFI_NOT_FOUND;
+ //
+ // Add QEMU SMBIOS data if found
+ //
+ SmbiosTables = GetQemuSmbiosTables ();
+ if (SmbiosTables != NULL) {
+ Status = InstallAllStructures (SmbiosTables);
+ FreePool (SmbiosTables);
+ }
+
+ return Status;
+}
diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Qemu.c
index 4dae4b0b98..9613c090c5 100644
--- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c
+++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c
@@ -11,8 +11,6 @@
#include <Library/PcdLib.h> // PcdGetBool()
#include <Library/QemuFwCfgLib.h> // QemuFwCfgFindFile()
-#include "SmbiosPlatformDxe.h"
-
/**
Locates and extracts the QEMU SMBIOS data if present in fw_cfg
@@ -51,36 +49,3 @@ GetQemuSmbiosTables (
return QemuTables;
}
-
-/**
- Installs SMBIOS information for OVMF
-
- @param ImageHandle Module's image handle
- @param SystemTable Pointer of EFI_SYSTEM_TABLE
-
- @retval EFI_SUCCESS Smbios data successfully installed
- @retval Other Smbios data was not installed
-
-**/
-EFI_STATUS
-EFIAPI
-SmbiosTablePublishEntry (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- UINT8 *SmbiosTables;
-
- Status = EFI_NOT_FOUND;
- //
- // Add QEMU SMBIOS data if found
- //
- SmbiosTables = GetQemuSmbiosTables ();
- if (SmbiosTables != NULL) {
- Status = InstallAllStructures (SmbiosTables);
- FreePool (SmbiosTables);
- }
-
- return Status;
-}
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
index 74e314a895..b7bf004be9 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
@@ -22,4 +22,15 @@ InstallAllStructures (
IN UINT8 *TableAddress
);
+/**
+ Locates and extracts the QEMU SMBIOS data if present in fw_cfg
+
+ @return Address of extracted QEMU SMBIOS data
+
+**/
+UINT8 *
+GetQemuSmbiosTables (
+ VOID
+ );
+
#endif
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index eaee73110d..e239a631f2 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -24,6 +24,7 @@
#
[Sources]
+ EntryPoint.c
Qemu.c
SmbiosPlatformDxe.c
SmbiosPlatformDxe.h
--
2.30.2
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next prev parent reply other threads:[~2021-12-10 9:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 9:35 [PATCH v6 0/5] Add Cloud Hypervisor support for x86 sebastien.boeuf
2021-12-10 9:35 ` [PATCH v6 1/5] OvmfPkg: Handle Cloud Hypervisor host bridge sebastien.boeuf
2021-12-10 9:35 ` sebastien.boeuf [this message]
2021-12-10 9:35 ` [PATCH v6 3/5] OvmfPkg: Retrieve SMBIOS from Cloud Hypervisor sebastien.boeuf
2021-12-10 9:35 ` [PATCH v6 4/5] OvmfPkg: Generalize AcpiPlatformDxe sebastien.boeuf
2021-12-10 9:35 ` [PATCH v6 5/5] OvmfPkg: Install ACPI tables for Cloud Hypervisor sebastien.boeuf
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=65795c002913b22702cf24972f8fa89881b1da1a.1639128828.git.sebastien.boeuf@intel.com \
--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