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 <Library/DebugLib.h> // ASSERT_EFI_ERROR()
10 #include <Library/MemoryAllocationLib.h> // AllocatePool()
11 #include <Library/PcdLib.h> // PcdGetBool()
12 #include <Library/QemuFwCfgLib.h> // QemuFwCfgFindFile()
14 #include "SmbiosPlatformDxe.h"
17 Locates and extracts the QEMU SMBIOS data if present in fw_cfg
19 @return Address of extracted QEMU SMBIOS data
28 FIRMWARE_CONFIG_ITEM Tables
;
32 if (!PcdGetBool (PcdQemuSmbiosValidated
)) {
36 Status
= QemuFwCfgFindFile ("etc/smbios/smbios-tables", &Tables
,
38 ASSERT_EFI_ERROR (Status
);
39 ASSERT (TablesSize
> 0);
41 QemuTables
= AllocatePool (TablesSize
);
42 if (QemuTables
== NULL
) {
46 QemuFwCfgSelectItem (Tables
);
47 QemuFwCfgReadBytes (TablesSize
, QemuTables
);