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()
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 (
35 "etc/smbios/smbios-tables",
39 ASSERT_EFI_ERROR (Status
);
40 ASSERT (TablesSize
> 0);
42 QemuTables
= AllocatePool (TablesSize
);
43 if (QemuTables
== NULL
) {
47 QemuFwCfgSelectItem (Tables
);
48 QemuFwCfgReadBytes (TablesSize
, QemuTables
);