29#include <IndustryStandard/Xen/hvm/params.h>
30#include <IndustryStandard/Xen/memory.h>
65 ASSERT (Dev->SharedInfo ==
NULL);
67 Parameter.domid = DOMID_SELF;
68 Parameter.space = XENMAPSPACE_shared_info;
77 Parameter.gpfn = (
UINTN)Dev->SharedInfo >> EFI_PAGE_SHIFT;
80 Dev->SharedInfo =
NULL;
81 return EFI_LOAD_ERROR;
111 Status =
gBS->LocateHandleBuffer (
118 if (EFI_ERROR (Status)) {
125 for (Index = 0; Index < HandleCount; Index++) {
137 Status =
gBS->UninstallMultipleProtocolInterfaces (
139 &gEfiDriverBindingProtocolGuid,
141 &gEfiComponentNameProtocolGuid,
143 &gEfiComponentName2ProtocolGuid,
147 if (EFI_ERROR (Status)) {
234 Status =
gBS->OpenProtocol (
238 This->DriverBindingHandle,
240 EFI_OPEN_PROTOCOL_BY_DRIVER
243 if (EFI_ERROR (Status)) {
250 This->DriverBindingHandle,
266 gBS->DisconnectController (
267 Dev->ControllerHandle,
323 Status =
gBS->OpenProtocol (
327 This->DriverBindingHandle,
329 EFI_OPEN_PROTOCOL_BY_DRIVER
332 if (EFI_ERROR (Status)) {
336 Status =
gBS->OpenProtocol (
338 &gEfiDevicePathProtocolGuid,
339 (VOID **)&DevicePath,
340 This->DriverBindingHandle,
342 EFI_OPEN_PROTOCOL_BY_DRIVER
345 if (EFI_ERROR (Status)) {
346 goto ErrorOpenningProtocol;
350 Dev->Signature = XENBUS_DEVICE_SIGNATURE;
352 Dev->ControllerHandle = ControllerHandle;
354 Dev->DevicePath = DevicePath;
358 if (mMyDevice !=
NULL) {
363 Status = EFI_ALREADY_STARTED;
371 if (EFI_ERROR (Status)) {
372 DEBUG ((DEBUG_ERROR,
"XenBus: Unable to get the shared info page.\n"));
373 Status = EFI_UNSUPPORTED;
384 Status =
gBS->CreateEvent (
385 EVT_SIGNAL_EXIT_BOOT_SERVICES,
399 &gEfiDevicePathProtocolGuid,
400 This->DriverBindingHandle,
403ErrorOpenningProtocol:
407 This->DriverBindingHandle,
454 for (Index = 0; Index < NumberOfChildren; Index++) {
455 Status =
gBS->OpenProtocol (
456 ChildHandleBuffer[Index],
457 &gXenBusProtocolGuid,
459 This->DriverBindingHandle,
461 EFI_OPEN_PROTOCOL_GET_PROTOCOL
463 if (EFI_ERROR (Status)) {
464 DEBUG ((DEBUG_ERROR,
"XenBusDxe: get children protocol failed: %r\n", Status));
468 ChildData = XENBUS_PRIVATE_DATA_FROM_THIS (XenBusIo);
470 Status =
gBS->CloseProtocol (
471 Dev->ControllerHandle,
478 Status =
gBS->UninstallMultipleProtocolInterfaces (
480 &gEfiDevicePathProtocolGuid,
481 ChildData->DevicePath,
482 &gXenBusProtocolGuid,
483 &ChildData->XenBusIo,
488 FreePool ((VOID *)ChildData->XenBusIo.Type);
489 FreePool ((VOID *)ChildData->XenBusIo.Node);
490 FreePool ((VOID *)ChildData->XenBusIo.Backend);
496 if (NumberOfChildren > 0) {
500 gBS->CloseEvent (Dev->ExitBootEvent);
502 XenGrantTableDeinit (Dev);
506 &gEfiDevicePathProtocolGuid,
507 This->DriverBindingHandle,
513 This->DriverBindingHandle,
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateReservedPages(IN UINTN Pages)
VOID XenGrantTableInit(IN XENBUS_DEVICE *Dev)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gXenBusDxeComponentName2
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gXenBusDxeComponentName
#define EFI_INITIALIZE_LOCK_VARIABLE(Priority)
VOID EFIAPI EfiReleaseLock(IN EFI_LOCK *Lock)
VOID EFIAPI EfiAcquireLock(IN EFI_LOCK *Lock)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
XENSTORE_STATUS XenBusEnumerateBus(XENBUS_DEVICE *Dev)
EFI_STATUS EFIAPI XenBusDxeUnload(IN EFI_HANDLE ImageHandle)
EFI_STATUS EFIAPI XenBusDxeDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI XenBusDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_DRIVER_BINDING_PROTOCOL gXenBusDxeDriverBinding
EFI_STATUS EFIAPI XenBusDxeDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI XenBusDxeDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
STATIC EFI_STATUS XenGetSharedInfoPage(IN OUT XENBUS_DEVICE *Dev)
INTN EFIAPI XenHypercallMemoryOp(IN UINTN Operation, IN OUT VOID *Arguments)
BOOLEAN EFIAPI XenHypercallIsAvailable(VOID)
EFI_STATUS XenStoreInit(XENBUS_DEVICE *Dev)
VOID XenStoreDeinit(IN XENBUS_DEVICE *Dev)
EFI_HANDLE DriverBindingHandle