]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/XenPlatformLib/XenPlatformLib.c
2 Get information about Xen
4 This library simply allow to find out if OVMF is running under Xen and
5 allow to get more information when it is the case.
7 Copyright (c) 2019, Citrix Systems, Inc.
9 SPDX-License-Identifier: BSD-2-Clause-Patent
14 #include <Library/HobLib.h>
15 #include <Library/XenPlatformLib.h>
18 This function return a pointer to the XenInfo HOB.
20 @return XenInfo pointer or NULL if not available
28 EFI_HOB_GUID_TYPE
*GuidHob
;
30 GuidHob
= GetFirstGuidHob (&gEfiXenInfoGuid
);
31 if (GuidHob
== NULL
) {
35 return (EFI_XEN_INFO
*) GET_GUID_HOB_DATA (GuidHob
);
39 This function detects if OVMF is running on Xen.
41 @retval TRUE OVMF is running on Xen
42 @retval FALSE Xen has not been detected
50 return (XenGetInfoHOB () != NULL
);
54 This function detect if OVMF have started via the PVH entry point.
56 @retval TRUE PVH entry point as been used
57 @retval FALSE OVMF have started via the HVM route
65 EFI_XEN_INFO
*XenInfo
;
67 XenInfo
= XenGetInfoHOB ();
68 return (XenInfo
!= NULL
&& XenInfo
->RsdpPvh
!= NULL
);