2 Find and extract QEMU SMBIOS data from fw_cfg.
4 Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include "SmbiosPlatformDxe.h"
10 #include <Library/QemuFwCfgLib.h>
11 #include <Library/MemoryAllocationLib.h>
12 #include <Library/PcdLib.h>
15 Locates and extracts the QEMU SMBIOS data if present in fw_cfg
17 @return Address of extracted QEMU SMBIOS data
26 FIRMWARE_CONFIG_ITEM Tables
;
30 if (!PcdGetBool (PcdQemuSmbiosValidated
)) {
34 Status
= QemuFwCfgFindFile ("etc/smbios/smbios-tables", &Tables
,
36 ASSERT_EFI_ERROR (Status
);
37 ASSERT (TablesSize
> 0);
39 QemuTables
= AllocatePool (TablesSize
);
40 if (QemuTables
== NULL
) {
44 QemuFwCfgSelectItem (Tables
);
45 QemuFwCfgReadBytes (TablesSize
, QemuTables
);