[edk2-devel] [PATCH 39/43] OvmfPkg/SmbiosPlatformDxe: split GetXenSmbiosTables() decl. to new header

Laszlo Ersek lersek at redhat.com
Wed May 26 20:14:42 UTC 2021


Move the declaration of the GetXenSmbiosTables() function to a new header
file called "XenSmbiosPlatformDxe.h". (The only declaration that remains
in "SmbiosPlatformDxe.h" for now is that of GetQemuSmbiosTables().)

Modify the pattern in "Maintainers.txt" so that the new file be covered in
the "OvmfPkg: Xen-related modules" section.

This patch is best viewed with "git show --no-renames".

Cc: Andrew Fish <afish at apple.com>
Cc: Anthony Perard <anthony.perard at citrix.com>
Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Jordan Justen <jordan.l.justen at intel.com>
Cc: Julien Grall <julien at xen.org>
Cc: Leif Lindholm <leif at nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney at intel.com>
Cc: Philippe Mathieu-Daudé <philmd at redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122
Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf                |  1 +
 Maintainers.txt                                                |  2 +-
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h                  | 14 --------------
 OvmfPkg/SmbiosPlatformDxe/{ArmXen.c => XenSmbiosPlatformDxe.h} | 20 ++++++++++----------
 OvmfPkg/SmbiosPlatformDxe/ArmXen.c                             |  2 +-
 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c                  |  1 +
 OvmfPkg/SmbiosPlatformDxe/X86Xen.c                             |  2 +-
 7 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
index 6063c0c9f609..140fa16ac135 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
@@ -24,12 +24,13 @@ [Defines]
 #
 
 [Sources]
   Qemu.c
   SmbiosPlatformDxe.c
   SmbiosPlatformDxe.h
+  XenSmbiosPlatformDxe.h
 
 [Sources.IA32, Sources.X64]
   X86Xen.c
 
 [Sources.ARM, Sources.AARCH64]
   ArmXen.c
diff --git a/Maintainers.txt b/Maintainers.txt
index e5f419e67f0c..751477e8e62a 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -499,13 +499,13 @@ F: OvmfPkg/Library/XenConsoleSerialPortLib/
 F: OvmfPkg/Library/XenHypercallLib/
 F: OvmfPkg/Library/XenIoMmioLib/
 F: OvmfPkg/Library/XenPlatformLib/
 F: OvmfPkg/Library/XenRealTimeClockLib/
 F: OvmfPkg/OvmfXen.*
 F: OvmfPkg/OvmfXenElfHeaderGenerator.c
-F: OvmfPkg/SmbiosPlatformDxe/*Xen.c
+F: OvmfPkg/SmbiosPlatformDxe/*Xen*
 F: OvmfPkg/XenAcpiPlatformDxe/
 F: OvmfPkg/XenBusDxe/
 F: OvmfPkg/XenIoPciDxe/
 F: OvmfPkg/XenIoPvhDxe/
 F: OvmfPkg/XenPlatformPei/
 F: OvmfPkg/XenPvBlkDxe/
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
index ad42a326418c..7a0bdbb2911f 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h
@@ -8,26 +8,12 @@
 
 **/
 
 #ifndef SMBIOS_PLATFORM_DXE_H_
 #define SMBIOS_PLATFORM_DXE_H_
 
-#include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_ENTRY_POINT
-
-/**
-  Locates the Xen SMBIOS data if it exists
-
-  @return SMBIOS_TABLE_ENTRY_POINT   Address of Xen SMBIOS data
-
-**/
-SMBIOS_TABLE_ENTRY_POINT *
-GetXenSmbiosTables (
-  VOID
-  );
-
-
 /**
   Locates and extracts the QEMU SMBIOS table data if present in fw_cfg
 
   @return             Address of extracted QEMU SMBIOS data
 
 **/
diff --git a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h
similarity index 56%
copy from OvmfPkg/SmbiosPlatformDxe/ArmXen.c
copy to OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h
index c2847f905303..850a8b662cd5 100644
--- a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c
+++ b/OvmfPkg/SmbiosPlatformDxe/XenSmbiosPlatformDxe.h
@@ -1,28 +1,28 @@
 /** @file
-  Detect Xen SMBIOS data on ARM / AARCH64.
+  This driver installs SMBIOS information for OVMF on Xen
 
-  Copyright (C) 2015, Red Hat, Inc.
+  Copyright (C) 2021, Red Hat, Inc.
   Copyright (c) 2011, Bei Guan <gbtju85 at gmail.com>
   Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
+
 **/
 
-#include "SmbiosPlatformDxe.h"
+#ifndef XEN_SMBIOS_PLATFORM_DXE_H_
+#define XEN_SMBIOS_PLATFORM_DXE_H_
+
+#include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_ENTRY_POINT
 
 /**
   Locates the Xen SMBIOS data if it exists
 
   @return SMBIOS_TABLE_ENTRY_POINT   Address of Xen SMBIOS data
 
 **/
 SMBIOS_TABLE_ENTRY_POINT *
 GetXenSmbiosTables (
   VOID
-  )
-{
-  //
-  // Not implemented yet.
-  //
-  return NULL;
-}
+  );
+
+#endif
diff --git a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c b/OvmfPkg/SmbiosPlatformDxe/ArmXen.c
index c2847f905303..3dd849bbc0b4 100644
--- a/OvmfPkg/SmbiosPlatformDxe/ArmXen.c
+++ b/OvmfPkg/SmbiosPlatformDxe/ArmXen.c
@@ -5,13 +5,13 @@
   Copyright (c) 2011, Bei Guan <gbtju85 at gmail.com>
   Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
 
-#include "SmbiosPlatformDxe.h"
+#include "XenSmbiosPlatformDxe.h"
 
 /**
   Locates the Xen SMBIOS data if it exists
 
   @return SMBIOS_TABLE_ENTRY_POINT   Address of Xen SMBIOS data
 
diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
index 757bec879e4a..f280a1852ddd 100644
--- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
+++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c
@@ -12,12 +12,13 @@
 #include <Library/DebugLib.h>                 // ASSERT_EFI_ERROR()
 #include <Library/MemoryAllocationLib.h>      // FreePool()
 #include <Library/UefiBootServicesTableLib.h> // gBS
 #include <Protocol/Smbios.h>                  // EFI_SMBIOS_PROTOCOL
 
 #include "SmbiosPlatformDxe.h"
+#include "XenSmbiosPlatformDxe.h"
 
 #define TYPE0_STRINGS \
   "EFI Development Kit II / OVMF\0"     /* Vendor */ \
   "0.0.0\0"                             /* BiosVersion */ \
   "02/06/2015\0"                        /* BiosReleaseDate */
 //
diff --git a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c b/OvmfPkg/SmbiosPlatformDxe/X86Xen.c
index e0b1b29f80db..0acedf8995da 100644
--- a/OvmfPkg/SmbiosPlatformDxe/X86Xen.c
+++ b/OvmfPkg/SmbiosPlatformDxe/X86Xen.c
@@ -9,13 +9,13 @@
 **/
 
 #include <Library/BaseLib.h> // AsciiStrnCmp()
 #include <Library/HobLib.h>  // GetFirstGuidHob()
 #include <Pi/PiHob.h>        // EFI_HOB_GUID_TYPE
 
-#include "SmbiosPlatformDxe.h"
+#include "XenSmbiosPlatformDxe.h"
 
 #define XEN_SMBIOS_PHYSICAL_ADDRESS       0x000EB000
 #define XEN_SMBIOS_PHYSICAL_END           0x000F0000
 
 /**
   Validates the SMBIOS entry point structure
-- 
2.19.1.3.g30247aa5d201




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75710): https://edk2.groups.io/g/devel/message/75710
Mute This Topic: https://groups.io/mt/83111160/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list