本文整理汇总了C++中EFI_BLOCK_IO_PROTOCOL::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_BLOCK_IO_PROTOCOL::Reset方法的具体用法?C++ EFI_BLOCK_IO_PROTOCOL::Reset怎么用?C++ EFI_BLOCK_IO_PROTOCOL::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFI_BLOCK_IO_PROTOCOL
的用法示例。
在下文中一共展示了EFI_BLOCK_IO_PROTOCOL::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AllocatePool
EFI_STATUS
BootMonFsDiscoverNextImage (
IN BOOTMON_FS_INSTANCE *Instance,
IN EFI_LBA *LbaStart,
OUT HW_IMAGE_DESCRIPTION *Image
)
{
EFI_BLOCK_IO_PROTOCOL *Blocks;
EFI_LBA CurrentLba;
VOID *Out;
Blocks = Instance->BlockIo;
// Allocate an output buffer
Out = AllocatePool (Instance->Media->BlockSize);
if (Out == NULL) {
return EFI_OUT_OF_RESOURCES;
}
Blocks->Reset (Blocks, FALSE);
CurrentLba = *LbaStart;
// Look for images in the rest of this block
while (CurrentLba <= Instance->Media->LastBlock) {
// Read in the next block
Blocks->ReadBlocks (Blocks, Instance->Media->MediaId, CurrentLba, Instance->Media->BlockSize, Out);
// Check for an image in the current block
if (BootMonFsImageInThisBlock (Out, Instance->Media->BlockSize, (CurrentLba - Instance->Media->LowestAlignedLba), Image)) {
DEBUG ((EFI_D_ERROR, "Found image: %a in block %d.\n", &(Image->Footer.Filename), (UINTN)(CurrentLba - Instance->Media->LowestAlignedLba)));
FreePool (Out);
*LbaStart = Image->BlockEnd + 1;
return EFI_SUCCESS;
} else {
CurrentLba++;
}
}
*LbaStart = CurrentLba;
FreePool (Out);
return EFI_NOT_FOUND;
}
示例2: Print
//
// TDS 5.1
//
EFI_STATUS
BBTestResetFunctionAutoTest (
IN EFI_BB_TEST_PROTOCOL *This,
IN VOID *ClientInterface,
IN EFI_TEST_LEVEL TestLevel,
IN EFI_HANDLE SupportHandle
)
{
EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;
EFI_STATUS Status;
EFI_BLOCK_IO_PROTOCOL *BlockIo;
EFI_TEST_ASSERTION AssertionType;
//
// Get the Standard Library Interface
//
Status = gtBS->HandleProtocol (
SupportHandle,
&gEfiStandardTestLibraryGuid,
&StandardLib
);
if (EFI_ERROR(Status)) {
StandardLib->RecordAssertion (
StandardLib,
EFI_TEST_ASSERTION_FAILED,
gTestGenericFailureGuid,
L"BS.HandleProtocol - Handle standard test library",
L"%a:%d:Status - %r",
__FILE__,
__LINE__,
Status
);
return Status;
}
BlockIo = (EFI_BLOCK_IO_PROTOCOL *)ClientInterface;
//
// Assertion Point 5.1.2.1
// Reset must succeed to reset the block device hardware with extended verification
//
Status = BlockIo->Reset (BlockIo, TRUE);
if (EFI_ERROR(Status)) {
AssertionType = EFI_TEST_ASSERTION_FAILED;
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
//
// Sometimes the file system will be destroied from this point. Just add a
// stall to avoid it. (Need investigation, I don't know it is useful or not!)
//
Print (L"Wait 5 seconds for the block device resetting...");
gtBS->Stall (5000000);
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gBlockIoFunctionTestAssertionGuid001,
L"EFI_BLOCK_IO_PROTOCOL.Reset - Reset the block device with extended verification",
L"%a:%d:Status=%r",
__FILE__,
__LINE__,
Status
);
//
// Assertion Point 5.1.2.2
// Reset must succeed to reset the block device hardware without extended verification
//
Status = BlockIo->Reset (BlockIo, FALSE);
if (EFI_ERROR(Status)) {
AssertionType = EFI_TEST_ASSERTION_FAILED;
} else {
AssertionType = EFI_TEST_ASSERTION_PASSED;
}
//
// Sometimes the file system will be destroied from this point. Just add a
// stall to avoid it. (Need investigation, I don't know it is useful or not!)
//
Print (L"Wait 5 seconds for the block device resetting...");
gtBS->Stall (5000000);
StandardLib->RecordAssertion (
StandardLib,
AssertionType,
gBlockIoFunctionTestAssertionGuid002,
L"EFI_BLOCK_IO_PROTOCOL.Reset - Reset the block device without extended verification",
L"%a:%d:Status=%r",
__FILE__,
__LINE__,
Status
);
return EFI_SUCCESS;
//.........这里部分代码省略.........