26 XEN_PV_BLK_DXE_VERSION,
55 Status =
gBS->LocateHandleBuffer (
62 if (EFI_ERROR (Status)) {
69 for (Index = 0; Index < HandleCount; Index++) {
81 Status =
gBS->UninstallMultipleProtocolInterfaces (
83 &gEfiDriverBindingProtocolGuid,
85 &gEfiComponentNameProtocolGuid,
87 &gEfiComponentName2ProtocolGuid,
91 if (EFI_ERROR (Status)) {
187 Status =
gBS->OpenProtocol (
189 &gXenBusProtocolGuid,
191 This->DriverBindingHandle,
193 EFI_OPEN_PROTOCOL_BY_DRIVER
195 if (EFI_ERROR (Status)) {
202 Status = EFI_UNSUPPORTED;
207 &gXenBusProtocolGuid,
208 This->DriverBindingHandle,
263 Status =
gBS->OpenProtocol (
265 &gXenBusProtocolGuid,
267 This->DriverBindingHandle,
269 EFI_OPEN_PROTOCOL_BY_DRIVER
271 if (EFI_ERROR (Status)) {
275 Status = XenPvBlockFrontInitialization (XenBusIo, XenBusIo->Node, &Dev);
276 if (EFI_ERROR (Status)) {
285 if (Dev->MediaInfo.VDiskInfo & VDISK_REMOVABLE) {
290 Media->
ReadOnly = !Dev->MediaInfo.ReadWrite;
291 if (Dev->MediaInfo.CdRom) {
299 Dev->MediaInfo.Sectors,
300 Media->
BlockSize / Dev->MediaInfo.SectorSize
303 Media->
BlockSize = Dev->MediaInfo.SectorSize;
304 Media->
LastBlock = Dev->MediaInfo.Sectors - 1;
308 Dev->BlockIo.
Media = Media;
310 Status =
gBS->InstallMultipleProtocolInterfaces (
312 &gEfiBlockIoProtocolGuid,
316 if (EFI_ERROR (Status)) {
317 DEBUG ((DEBUG_ERROR,
"XenPvBlk: install protocol fail: %r\n", Status));
318 goto UninitBlockFront;
325 XenPvBlockFrontShutdown (Dev);
329 &gXenBusProtocolGuid,
330 This->DriverBindingHandle,
376 Status =
gBS->OpenProtocol (
378 &gEfiBlockIoProtocolGuid,
380 This->DriverBindingHandle,
382 EFI_OPEN_PROTOCOL_GET_PROTOCOL
384 if (EFI_ERROR (Status)) {
388 Status =
gBS->UninstallProtocolInterface (
390 &gEfiBlockIoProtocolGuid,
393 if (EFI_ERROR (Status)) {
397 Media = BlockIo->
Media;
398 Dev = XEN_BLOCK_FRONT_FROM_BLOCK_IO (BlockIo);
399 XenPvBlockFrontShutdown (Dev);
405 &gXenBusProtocolGuid,
406 This->DriverBindingHandle,
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
INTN EFIAPI AsciiStrCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
GLOBAL_REMOVE_IF_UNREFERENCED EFI_BLOCK_IO_PROTOCOL gXenPvBlkDxeBlockIo
GLOBAL_REMOVE_IF_UNREFERENCED EFI_BLOCK_IO_MEDIA gXenPvBlkDxeBlockIoMedia
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gXenPvBlkDxeComponentName2
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gXenPvBlkDxeComponentName
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)
EFI_STATUS EFIAPI XenPvBlkDxeDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_DRIVER_BINDING_PROTOCOL gXenPvBlkDxeDriverBinding
EFI_STATUS EFIAPI XenPvBlkDxeDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI XenPvBlkDxeDriverEntryPoint(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI XenPvBlkDxeDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI XenPvBlkDxeUnload(IN EFI_HANDLE ImageHandle)
EFI_BLOCK_IO_MEDIA * Media