OvmfPkg/SmbiosPlatformDxe: split Xen entry point from QEMU entry point
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 <anthony.perard@citrix.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Julien Grall <julien@xen.org> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2122 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210526201446.12554-43-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
d4a8aaee73
commit
ce270905bf
49
OvmfPkg/SmbiosPlatformDxe/Xen.c
Normal file
49
OvmfPkg/SmbiosPlatformDxe/Xen.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/** @file
|
||||
This driver installs SMBIOS information for OVMF on Xen
|
||||
|
||||
Copyright (C) 2021, Red Hat, Inc.
|
||||
Copyright (c) 2011, Bei Guan <gbtju85@gmail.com>
|
||||
Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include "SmbiosPlatformDxe.h"
|
||||
#include "XenSmbiosPlatformDxe.h"
|
||||
|
||||
/**
|
||||
Installs SMBIOS information for OVMF on Xen
|
||||
|
||||
@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
|
||||
XenSmbiosTablePublishEntry (
|
||||
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 SMBIOS data if found
|
||||
//
|
||||
EntryPointStructure = GetXenSmbiosTables ();
|
||||
if (EntryPointStructure != NULL) {
|
||||
SmbiosTables = (UINT8*)(UINTN)EntryPointStructure->TableAddress;
|
||||
if (SmbiosTables != NULL) {
|
||||
Status = InstallAllStructures (SmbiosTables);
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
Reference in New Issue
Block a user