]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/XenHypercallLib/X86XenHypercall.c
OvmfPkg: XenHypercallLib: introduce XenHypercallIsAvailable()
[mirror_edk2.git] / OvmfPkg / Library / XenHypercallLib / X86XenHypercall.c
index 7ee1f2f38d831f67f00f7de83bd141aa2eaa8ad5..67892bcf37e48b8b95756e0a94b8dff29d17bb62 100644 (file)
@@ -19,6 +19,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 STATIC VOID    *HyperPage;\r
 \r
+/**\r
+  Check if the Xen Hypercall library is able to make calls to the Xen\r
+  hypervisor.\r
+\r
+  Client code should call further functions in this library only if, and after,\r
+  this function returns TRUE.\r
+\r
+  @retval TRUE   Hypercalls are available.\r
+  @retval FALSE  Hypercalls are not available.\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+XenHypercallIsAvailable (\r
+  VOID\r
+  )\r
+{\r
+  return HyperPage != NULL;\r
+}\r
+\r
 //\r
 // Interface exposed by the ASM implementation of the core hypercall\r
 //\r