summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c')
-rw-r--r--OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c b/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
index 7ee1f2f38d..67892bcf37 100644
--- a/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
+++ b/OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
@@ -19,6 +19,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
STATIC VOID *HyperPage;
+/**
+ Check if the Xen Hypercall library is able to make calls to the Xen
+ hypervisor.
+
+ Client code should call further functions in this library only if, and after,
+ this function returns TRUE.
+
+ @retval TRUE Hypercalls are available.
+ @retval FALSE Hypercalls are not available.
+**/
+BOOLEAN
+EFIAPI
+XenHypercallIsAvailable (
+ VOID
+ )
+{
+ return HyperPage != NULL;
+}
+
//
// Interface exposed by the ASM implementation of the core hypercall
//