27 IN BOOLEAN ExtendedVerification
34 Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This);
36 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
38 Status = Private->Io->Reset (Private->Io, ExtendedVerification);
40 gBS->RestoreTPL (OldTpl);
92 Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This);
94 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
96 Status = Private->Io->ReadBlocks (Private->Io, MediaId, LBA, Token, BufferSize, Buffer);
98 gBS->RestoreTPL (OldTpl);
148 Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This);
150 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
152 Status = Private->Io->WriteBlocks (Private->Io, MediaId, LBA, Token, BufferSize, Buffer);
154 gBS->RestoreTPL (OldTpl);
191 Private = EMU_BLOCK_IO2_PRIVATE_DATA_FROM_THIS (This);
193 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
195 Status = Private->Io->FlushBlocks (Private->Io, Token);
197 gBS->RestoreTPL (OldTpl);
216 IN BOOLEAN ExtendedVerification
223 Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);
225 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
227 Status = Private->Io->Reset (Private->Io, ExtendedVerification);
229 gBS->RestoreTPL (OldTpl);
267 Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);
269 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
272 Status = Private->Io->ReadBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer);
274 gBS->RestoreTPL (OldTpl);
313 Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);
315 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
318 Status = Private->Io->WriteBlocks (Private->Io, MediaId, Lba, &Token, BufferSize, Buffer);
320 gBS->RestoreTPL (OldTpl);
345 Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (This);
347 OldTpl =
gBS->RaiseTPL (TPL_CALLBACK);
350 Status = Private->Io->FlushBlocks (Private->Io, &Token);
352 gBS->RestoreTPL (OldTpl);
412 Status =
gBS->OpenProtocol (
414 &gEmuIoThunkProtocolGuid,
415 (VOID **)&EmuIoThunk,
416 This->DriverBindingHandle,
418 EFI_OPEN_PROTOCOL_BY_DRIVER
420 if (EFI_ERROR (Status)) {
427 Status = EFI_UNSUPPORTED;
428 if (
CompareGuid (EmuIoThunk->Protocol, &gEmuBlockIoProtocolGuid)) {
437 &gEmuIoThunkProtocolGuid,
438 This->DriverBindingHandle,
495 Status =
gBS->OpenProtocol (
497 &gEmuIoThunkProtocolGuid,
499 This->DriverBindingHandle,
501 EFI_OPEN_PROTOCOL_BY_DRIVER
503 if (EFI_ERROR (Status)) {
507 if (!
CompareGuid (EmuIoThunk->Protocol, &gEmuBlockIoProtocolGuid)) {
508 Status = EFI_UNSUPPORTED;
512 Status = EmuIoThunk->Open (EmuIoThunk);
513 if (EFI_ERROR (Status)) {
518 if (Private ==
NULL) {
522 Private->Signature = EMU_BLOCK_IO_PRIVATE_SIGNATURE;
523 Private->IoThunk = EmuIoThunk;
524 Private->Io = EmuIoThunk->Interface;
525 Private->EfiHandle = Handle;
527 Private->BlockIo.
Revision = EFI_BLOCK_IO_PROTOCOL_REVISION2;
528 Private->BlockIo.
Media = &Private->Media;
534 Private->BlockIo2.
Media = &Private->Media;
540 Private->ControllerNameTable =
NULL;
542 Status = Private->Io->CreateMapping (Private->Io, &Private->Media);
543 if (EFI_ERROR (Status)) {
550 &Private->ControllerNameTable,
558 &Private->ControllerNameTable,
563 Status =
gBS->InstallMultipleProtocolInterfaces (
565 &gEfiBlockIoProtocolGuid,
567 &gEfiBlockIo2ProtocolGuid,
573 if (EFI_ERROR (Status)) {
574 if (Private !=
NULL) {
575 if (Private->ControllerNameTable !=
NULL) {
579 gBS->FreePool (Private);
584 &gEmuIoThunkProtocolGuid,
585 This->DriverBindingHandle,
635 Status =
gBS->OpenProtocol (
637 &gEfiBlockIoProtocolGuid,
639 This->DriverBindingHandle,
641 EFI_OPEN_PROTOCOL_GET_PROTOCOL
643 if (EFI_ERROR (Status)) {
644 return EFI_UNSUPPORTED;
647 Private = EMU_BLOCK_IO_PRIVATE_DATA_FROM_THIS (BlockIo);
649 Status =
gBS->UninstallMultipleProtocolInterfaces (
651 &gEfiBlockIoProtocolGuid,
653 &gEfiBlockIo2ProtocolGuid,
657 if (!EFI_ERROR (Status)) {
658 Status =
gBS->CloseProtocol (
660 &gEmuIoThunkProtocolGuid,
661 This->DriverBindingHandle,
668 Status = Private->IoThunk->Close (Private->IoThunk);
711 &gEmuBlockIoDriverBinding,
713 &gEmuBlockIoComponentName,
714 &gEmuBlockIoComponentName2,
717 &gEmuBlockIoDriverDiagnostics,
718 &gEmuBlockIoDriverDiagnostics2
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS EFIAPI EmuBlockIo2ReadBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA LBA, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI EmuBlockIo2Reset(IN EFI_BLOCK_IO2_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI EmuBlockIoReset(IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS EFIAPI EmuBlockIo2Flush(IN EFI_BLOCK_IO2_PROTOCOL *This, IN OUT EFI_BLOCK_IO2_TOKEN *Token)
EFI_STATUS EFIAPI EmuBlockIoReadBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI EmuBlockIoDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI EmuBlockIoDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI EmuBlockIoWriteBlocks(IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI EmuBlockIo2WriteBlocksEx(IN EFI_BLOCK_IO2_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA LBA, IN OUT EFI_BLOCK_IO2_TOKEN *Token, IN UINTN BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI EmuBlockIoFlushBlocks(IN EFI_BLOCK_IO_PROTOCOL *This)
EFI_STATUS EFIAPI InitializeEmuBlockIo(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI EmuBlockIoDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Handle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
#define ASSERT_EFI_ERROR(StatusParameter)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI AddUnicodeString2(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN OUT EFI_UNICODE_STRING_TABLE **UnicodeStringTable, IN CONST CHAR16 *UnicodeString, IN BOOLEAN Iso639Language)
EFI_STATUS EFIAPI EfiLibInstallAllDriverProtocols2(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, IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2 OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL)
EFI_STATUS EFIAPI FreeUnicodeStringTable(IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable)
EFI_BLOCK_IO_MEDIA * Media
EFI_BLOCK_IO_MEDIA * Media
CHAR8 * SupportedLanguages
CHAR8 * SupportedLanguages
CHAR16 * ConfigString
Only be valid after Open() is called.