TianoCore EDK2 master
Loading...
Searching...
No Matches
XenPlatformLib.c
Go to the documentation of this file.
1
13#include <PiDxe.h>
14#include <Library/HobLib.h>
16
23EFIAPI
25 VOID
26 )
27{
28 EFI_HOB_GUID_TYPE *GuidHob;
29 STATIC BOOLEAN Cached = FALSE;
30 STATIC EFI_XEN_INFO *XenInfo;
31
32 //
33 // Return the cached result for the benefit of XenDetected that can be
34 // called many times.
35 //
36 if (Cached) {
37 return XenInfo;
38 }
39
40 GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);
41 if (GuidHob == NULL) {
42 XenInfo = NULL;
43 } else {
44 XenInfo = (EFI_XEN_INFO *)GET_GUID_HOB_DATA (GuidHob);
45 }
46
47 Cached = TRUE;
48 return XenInfo;
49}
50
57BOOLEAN
58EFIAPI
60 VOID
61 )
62{
63 return (XenGetInfoHOB () != NULL);
64}
65
72BOOLEAN
73EFIAPI
75 VOID
76 )
77{
78 EFI_XEN_INFO *XenInfo;
79
80 XenInfo = XenGetInfoHOB ();
81 return (XenInfo != NULL && XenInfo->RsdpPvh != NULL);
82}
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition: HobLib.c:215
#define NULL
Definition: Base.h:319
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
BOOLEAN EFIAPI XenDetected(VOID)
BOOLEAN EFIAPI XenPvhDetected(VOID)
EFI_XEN_INFO *EFIAPI XenGetInfoHOB(VOID)
VOID * RsdpPvh
Definition: XenInfo.h:27