]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/XenBusDxe/XenBusDxe.c
OvmfPkg/XenBusDxe: Add support to make Xen Hypercalls.
[mirror_edk2.git] / OvmfPkg / XenBusDxe / XenBusDxe.c
index f3c74e1fbe00337d8654408a246c5bce98073935..4c638b85f1abbe14aab3121a19da15e85035a69a 100644 (file)
@@ -29,6 +29,8 @@
 \r
 #include "XenBusDxe.h"\r
 \r
+#include "XenHypercall.h"\r
+\r
 \r
 ///\r
 /// Driver Binding Protocol instance\r
@@ -264,6 +266,8 @@ NotifyExitBoot (
   @retval EFI_SUCCESS              The device was started.\r
   @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.Currently not implemented.\r
   @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of resources.\r
+  @retval EFI_UNSUPPORTED          Something is missing on the system that\r
+                                   prevent to start the edvice.\r
   @retval Others                   The driver failded to start the device.\r
 \r
 **/\r
@@ -295,6 +299,20 @@ XenBusDxeDriverBindingStart (
   mMyDevice = Dev;\r
   EfiReleaseLock (&mMyDeviceLock);\r
 \r
+  Status = XenHyperpageInit (Dev);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((EFI_D_ERROR, "XenBus: Unable to retrieve the hyperpage.\n"));\r
+    Status = EFI_UNSUPPORTED;\r
+    goto ErrorAllocated;\r
+  }\r
+\r
+  Status = XenGetSharedInfoPage (Dev);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((EFI_D_ERROR, "XenBus: Unable to get the shared info page.\n"));\r
+    Status = EFI_UNSUPPORTED;\r
+    goto ErrorAllocated;\r
+  }\r
+\r
   Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_CALLBACK,\r
                              NotifyExitBoot,\r
                              (VOID*) Dev,\r