From ce270905bfce961df5e14963440e58463bd46940 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 26 May 2021 22:14:45 +0200 Subject: OvmfPkg/SmbiosPlatformDxe: split Xen entry point from QEMU entry point MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the SmbiosTablePublishEntry() function from "SmbiosPlatformDxe.c". "SmbiosPlatformDxe.c" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, simplified for QEMU, to the existent file "Qemu.c". The GetQemuSmbiosTables() function no longer needs to be declared in "SmbiosPlatformDxe.h"; "SmbiosPlatformDxe.h" becomes hypervisor-agnostic. Add SmbiosTablePublishEntry() back, renamed and simplified for Xen, to the new, arch-independent file "Xen.c". (The existent Xen-specific C files are arch-dependent.) Update both INF files; remove the dependencies that are now superfluous in each. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Julien Grall Cc: Philippe Mathieu-Daudé Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek Message-Id: <20210526201446.12554-43-lersek@redhat.com> Reviewed-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daudé --- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c | 49 --------------------------- 1 file changed, 49 deletions(-) (limited to 'OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c') diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c index f280a1852d..7bcf83762e 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.c @@ -10,12 +10,10 @@ #include // SMBIOS_TABLE_TYPE0 #include // ASSERT_EFI_ERROR() -#include // FreePool() #include // gBS #include // EFI_SMBIOS_PROTOCOL #include "SmbiosPlatformDxe.h" -#include "XenSmbiosPlatformDxe.h" #define TYPE0_STRINGS \ "EFI Development Kit II / OVMF\0" /* Vendor */ \ @@ -168,50 +166,3 @@ InstallAllStructures ( return EFI_SUCCESS; } - - -/** - 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; - SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure; - UINT8 *SmbiosTables; - - Status = EFI_NOT_FOUND; - // - // Add Xen or QEMU SMBIOS data if found - // - EntryPointStructure = GetXenSmbiosTables (); - if (EntryPointStructure != NULL) { - SmbiosTables = (UINT8*)(UINTN)EntryPointStructure->TableAddress; - } else { - SmbiosTables = GetQemuSmbiosTables (); - } - - if (SmbiosTables != NULL) { - Status = InstallAllStructures (SmbiosTables); - - // - // Free SmbiosTables if allocated by Qemu (i.e., NOT by Xen): - // - if (EntryPointStructure == NULL) { - FreePool (SmbiosTables); - } - } - - return Status; -} -- cgit v1.2.3