VirtualBox

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

最後變更 在這個檔案從107675是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.2 KB
 
1/** @file
2 Find and extract QEMU SMBIOS data from fw_cfg.
3
4 Copyright (C) 2014, Gabriel L. Somlo <[email protected]>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7**/
8
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()
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 (
35 "etc/smbios/smbios-tables",
36 &Tables,
37 &TablesSize
38 );
39 ASSERT_EFI_ERROR (Status);
40 ASSERT (TablesSize > 0);
41
42 QemuTables = AllocatePool (TablesSize);
43 if (QemuTables == NULL) {
44 return NULL;
45 }
46
47 QemuFwCfgSelectItem (Tables);
48 QemuFwCfgReadBytes (TablesSize, QemuTables);
49
50 return QemuTables;
51}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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