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
>
15
#include <
Library/XenPlatformLib.h
>
16
22
EFI_XEN_INFO
*
23
EFIAPI
24
XenGetInfoHOB
(
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
57
BOOLEAN
58
EFIAPI
59
XenDetected
(
60
VOID
61
)
62
{
63
return
(
XenGetInfoHOB
() !=
NULL
);
64
}
65
72
BOOLEAN
73
EFIAPI
74
XenPvhDetected
(
75
VOID
76
)
77
{
78
EFI_XEN_INFO
*XenInfo;
79
80
XenInfo =
XenGetInfoHOB
();
81
return
(XenInfo !=
NULL
&& XenInfo->
RsdpPvh
!=
NULL
);
82
}
GetFirstGuidHob
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition:
HobLib.c:215
HobLib.h
NULL
#define NULL
Definition:
Base.h:319
STATIC
#define STATIC
Definition:
Base.h:264
TRUE
#define TRUE
Definition:
Base.h:301
FALSE
#define FALSE
Definition:
Base.h:307
PiDxe.h
XenDetected
BOOLEAN EFIAPI XenDetected(VOID)
Definition:
XenPlatformLib.c:59
XenPvhDetected
BOOLEAN EFIAPI XenPvhDetected(VOID)
Definition:
XenPlatformLib.c:74
XenGetInfoHOB
EFI_XEN_INFO *EFIAPI XenGetInfoHOB(VOID)
Definition:
XenPlatformLib.c:24
XenPlatformLib.h
EFI_HOB_GUID_TYPE
Definition:
PiHob.h:339
EFI_XEN_INFO
Definition:
XenInfo.h:15
EFI_XEN_INFO::RsdpPvh
VOID * RsdpPvh
Definition:
XenInfo.h:27
OvmfPkg
Library
XenPlatformLib
XenPlatformLib.c
Generated on Fri Nov 15 2024 18:01:21 for TianoCore EDK2 by
1.9.6