/** @file\r
This driver produces XenBus Protocol instances for each Xen PV devices.\r
\r
- This XenBus bus driver will first initialize differente services in order to\r
+ This XenBus bus driver will first initialize different services in order to\r
enumerate the ParaVirtualized devices available.\r
\r
Those services are:\r
\r
Copyright (C) 2014, Citrix Ltd.\r
\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
@param SystemTable A pointer to the EFI System Table.\r
\r
@retval EFI_SUCCESS The operation completed successfully.\r
+ @retval EFI_ABORTED Xen hypercalls are not available.\r
@retval Others An unexpected error occurred.\r
**/\r
EFI_STATUS\r
{\r
EFI_STATUS Status;\r
\r
+ if (! XenHypercallIsAvailable ()) {\r
+ return EFI_ABORTED;\r
+ }\r
+\r
//\r
// Install UEFI Driver Model protocol(s).\r
//\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
+ prevent to start the device.\r
+ @retval Others The driver failed to start the device.\r
\r
**/\r
EFI_STATUS\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
+ DEBUG ((DEBUG_ERROR, "XenBus: Unable to get the shared info page.\n"));\r
Status = EFI_UNSUPPORTED;\r
goto ErrorAllocated;\r
}\r
ControllerHandle,\r
EFI_OPEN_PROTOCOL_GET_PROTOCOL);\r
if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "XenBusDxe: get children protocol failed: %r\n", Status));\r
+ DEBUG ((DEBUG_ERROR, "XenBusDxe: get children protocol failed: %r\n", Status));\r
continue;\r
}\r
ChildData = XENBUS_PRIVATE_DATA_FROM_THIS (XenBusIo);\r
- Status = gBS->DisconnectController (ChildData->Handle, NULL, NULL);\r
- if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "XenBusDxe: error disconnecting child: %r\n",\r
- Status));\r
- continue;\r
- }\r
+\r
+ Status = gBS->CloseProtocol (Dev->ControllerHandle, &gXenIoProtocolGuid,\r
+ Dev->This->DriverBindingHandle, ChildData->Handle);\r
+ ASSERT_EFI_ERROR (Status);\r
\r
Status = gBS->UninstallMultipleProtocolInterfaces (\r
ChildData->Handle,\r