34 UINT8 *OriginalBuffer;
40 if (EFI_ERROR (Status)) {
44 Status =
gBS->OpenProtocol (BlockIoHandle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo,
gImageHandle,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
45 if (EFI_ERROR (Status)) {
59 OriginalBuffer =
NULL;
63 Status = BlockIo->ReadBlocks (BlockIo, BlockIo->
Media->
MediaId, Lba, BufferSize, Buffer);
64 if (!EFI_ERROR (Status) && (Buffer !=
NULL)) {
70 gShellDebug1HiiHandle,
76 DumpHex (2, 0, BufferSize, Buffer);
82 if (OriginalBuffer !=
NULL) {
105 CHAR16 *ProblemParam;
107 CONST CHAR16 *BlockName;
108 CONST CHAR16 *LbaString;
109 CONST CHAR16 *BlockCountString;
132 if (EFI_ERROR (Status)) {
133 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
155 if (LbaString ==
NULL) {
169 if (BlockCountString ==
NULL) {
178 if (BlockCount > 0x10) {
180 }
else if (BlockCount == 0) {
191 if ((BlockName ==
NULL) || (gEfiShellProtocol->GetDevicePathFromMap (BlockName) ==
NULL)) {
196 if (
gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DevPath,
NULL) == EFI_NOT_FOUND) {
200 ShellStatus =
DisplayTheBlocks (gEfiShellProtocol->GetDevicePathFromMap (BlockName), Lba, (UINT8)BlockCount);
209 return (ShellStatus);
SHELL_STATUS DisplayTheBlocks(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath, IN CONST UINT64 Lba, IN CONST UINT8 BlockCount)
SHELL_STATUS EFIAPI ShellCommandRunDblk(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ALIGN_POINTER(Pointer, Alignment)
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
EFI_STATUS EFIAPI CommandInit(VOID)
VOID EFIAPI DumpHex(IN UINTN Indent, IN UINTN Offset, IN UINTN DataSize, IN VOID *UserData)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
BOOLEAN EFIAPI ShellIsHexOrDecimalNumber(IN CONST CHAR16 *String, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellConvertStringToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)
SHELL_PARAM_ITEM EmptyParamList[]
Helper structure for no parameters (besides -? and -b)
EFI_BLOCK_IO_MEDIA * Media