2 Find and extract QEMU SMBIOS data from fw_cfg.
4 Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>
6 This program and the accompanying materials are licensed and made
7 available under the terms and conditions of the BSD License which
8 accompanies this distribution. The full text of the license may
9 be found at http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "SmbiosPlatformDxe.h"
16 #include <Library/QemuFwCfgLib.h>
17 #include <Library/MemoryAllocationLib.h>
18 #include <Library/PcdLib.h>
21 Locates and extracts the QEMU SMBIOS data if present in fw_cfg
23 @return Address of extracted QEMU SMBIOS data
32 FIRMWARE_CONFIG_ITEM Tables
;
36 if (!PcdGetBool (PcdQemuSmbiosValidated
)) {
40 Status
= QemuFwCfgFindFile ("etc/smbios/smbios-tables", &Tables
,
42 ASSERT_EFI_ERROR (Status
);
43 ASSERT (TablesSize
> 0);
45 QemuTables
= AllocatePool (TablesSize
);
46 if (QemuTables
== NULL
) {
50 QemuFwCfgSelectItem (Tables
);
51 QemuFwCfgReadBytes (TablesSize
, QemuTables
);