VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/SmbiosPlatformDxe/Xen.c@ 63524

最後變更 在這個檔案從63524是 48674,由 vboxsync 提交於 12 年 前

EFI: Export newly imported tinaocore UEFI sources to OSE.

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.8 KB
 
1/** @file
2 Detect Xen hvmloader SMBIOS data for usage by OVMF.
3
4 Copyright (c) 2011, Bei Guan <[email protected]>
5 Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
6
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15**/
16
17#include "SmbiosPlatformDxe.h"
18#include <Library/HobLib.h>
19#include <Guid/XenInfo.h>
20
21#define XEN_SMBIOS_PHYSICAL_ADDRESS 0x000EB000
22#define XEN_SMBIOS_PHYSICAL_END 0x000F0000
23
24/**
25 Locates the Xen SMBIOS data if it exists
26
27 @return SMBIOS_TABLE_ENTRY_POINT Address of Xen SMBIOS data
28
29**/
30SMBIOS_TABLE_ENTRY_POINT *
31GetXenSmbiosTables (
32 VOID
33 )
34{
35 UINT8 *XenSmbiosPtr;
36 SMBIOS_TABLE_ENTRY_POINT *XenSmbiosEntryPointStructure;
37 EFI_HOB_GUID_TYPE *GuidHob;
38
39 //
40 // See if a XenInfo HOB is available
41 //
42 GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);
43 if (GuidHob == NULL) {
44 return NULL;
45 }
46
47 for (XenSmbiosPtr = (UINT8*)(UINTN) XEN_SMBIOS_PHYSICAL_ADDRESS;
48 XenSmbiosPtr < (UINT8*)(UINTN) XEN_SMBIOS_PHYSICAL_END;
49 XenSmbiosPtr += 0x10) {
50
51 XenSmbiosEntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) XenSmbiosPtr;
52
53 if (!AsciiStrnCmp ((CHAR8 *) XenSmbiosEntryPointStructure->AnchorString, "_SM_", 4) &&
54 !AsciiStrnCmp ((CHAR8 *) XenSmbiosEntryPointStructure->IntermediateAnchorString, "_DMI_", 5) &&
55 IsEntryPointStructureValid (XenSmbiosEntryPointStructure)) {
56
57 return XenSmbiosEntryPointStructure;
58
59 }
60 }
61
62 return NULL;
63}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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