OvmfPkg: Create global entry point for SMBIOS parsing
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>
This commit is contained in:
parent
9afcd48a94
commit
2ccefa32a6
42
OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
Normal file
42
OvmfPkg/SmbiosPlatformDxe/EntryPoint.c
Normal file
@ -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;
|
||||||
|
}
|
@ -11,8 +11,6 @@
|
|||||||
#include <Library/PcdLib.h> // PcdGetBool()
|
#include <Library/PcdLib.h> // PcdGetBool()
|
||||||
#include <Library/QemuFwCfgLib.h> // QemuFwCfgFindFile()
|
#include <Library/QemuFwCfgLib.h> // QemuFwCfgFindFile()
|
||||||
|
|
||||||
#include "SmbiosPlatformDxe.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Locates and extracts the QEMU SMBIOS data if present in fw_cfg
|
Locates and extracts the QEMU SMBIOS data if present in fw_cfg
|
||||||
|
|
||||||
@ -51,36 +49,3 @@ GetQemuSmbiosTables (
|
|||||||
|
|
||||||
return QemuTables;
|
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;
|
|
||||||
}
|
|
||||||
|
@ -22,4 +22,15 @@ InstallAllStructures (
|
|||||||
IN UINT8 *TableAddress
|
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
|
#endif
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
|
EntryPoint.c
|
||||||
Qemu.c
|
Qemu.c
|
||||||
SmbiosPlatformDxe.c
|
SmbiosPlatformDxe.c
|
||||||
SmbiosPlatformDxe.h
|
SmbiosPlatformDxe.h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user