Add a fallback on the SMBIOS code to find the SMBIOS table for Cloud Hypervisor if it couldn't be found for Qemu through fw_cfg. Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Rob Bradford <robert.bradford@intel.com> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
34 lines
859 B
C
34 lines
859 B
C
/** @file
|
|
Find Cloud Hypervisor SMBIOS data.
|
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
**/
|
|
|
|
#include <IndustryStandard/CloudHv.h> // CLOUDHV_SMBIOS_ADDRESS
|
|
#include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_3_0_ENTRY_POINT
|
|
|
|
/**
|
|
Locates and extracts Cloud Hypervisor SMBIOS data
|
|
|
|
@return Address of extracted Cloud Hypervisor SMBIOS data
|
|
|
|
**/
|
|
UINT8 *
|
|
GetCloudHvSmbiosTables (
|
|
VOID
|
|
)
|
|
{
|
|
SMBIOS_TABLE_3_0_ENTRY_POINT *CloudHvTables = (VOID *)CLOUDHV_SMBIOS_ADDRESS;
|
|
|
|
if ((CloudHvTables->AnchorString[0] == '_') &&
|
|
(CloudHvTables->AnchorString[1] == 'S') &&
|
|
(CloudHvTables->AnchorString[2] == 'M') &&
|
|
(CloudHvTables->AnchorString[3] == '3') &&
|
|
(CloudHvTables->AnchorString[4] == '_'))
|
|
{
|
|
return (UINT8 *)(UINTN)CloudHvTables->TableAddress;
|
|
}
|
|
|
|
return NULL;
|
|
}
|