VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/SmbiosPlatformDxe/Qemu.c@ 94264

Last change on this file since 94264 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1/** @file
2 Find and extract QEMU SMBIOS data from fw_cfg.
3
4 Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7**/
8
9#include "SmbiosPlatformDxe.h"
10#include <Library/QemuFwCfgLib.h>
11#include <Library/MemoryAllocationLib.h>
12#include <Library/PcdLib.h>
13
14/**
15 Locates and extracts the QEMU SMBIOS data if present in fw_cfg
16
17 @return Address of extracted QEMU SMBIOS data
18
19**/
20UINT8 *
21GetQemuSmbiosTables (
22 VOID
23 )
24{
25 EFI_STATUS Status;
26 FIRMWARE_CONFIG_ITEM Tables;
27 UINTN TablesSize;
28 UINT8 *QemuTables;
29
30 if (!PcdGetBool (PcdQemuSmbiosValidated)) {
31 return NULL;
32 }
33
34 Status = QemuFwCfgFindFile ("etc/smbios/smbios-tables", &Tables,
35 &TablesSize);
36 ASSERT_EFI_ERROR (Status);
37 ASSERT (TablesSize > 0);
38
39 QemuTables = AllocatePool (TablesSize);
40 if (QemuTables == NULL) {
41 return NULL;
42 }
43
44 QemuFwCfgSelectItem (Tables);
45 QemuFwCfgReadBytes (TablesSize, QemuTables);
46
47 return QemuTables;
48}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette