mirror of
https://github.com/acidanthera/audk.git
synced 2025-05-16 20:40:09 +02:00
ShellPkg/UefiShellCommandLib.c: Formalize EOL
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
parent
9ba25c7db7
commit
cf041fd799
@ -1,10 +1,10 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Provides interface to shell internal functions for shell commands.
|
Provides interface to shell internal functions for shell commands.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
|
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
|
||||||
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -1764,60 +1764,60 @@ DumpHex (
|
|||||||
DataSize -= Size;
|
DataSize -= Size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Dump HEX data into buffer.
|
Dump HEX data into buffer.
|
||||||
|
|
||||||
@param[in] Buffer HEX data to be dumped in Buffer.
|
@param[in] Buffer HEX data to be dumped in Buffer.
|
||||||
@param[in] Indent How many spaces to indent the output.
|
@param[in] Indent How many spaces to indent the output.
|
||||||
@param[in] Offset The offset of the printing.
|
@param[in] Offset The offset of the printing.
|
||||||
@param[in] DataSize The size in bytes of UserData.
|
@param[in] DataSize The size in bytes of UserData.
|
||||||
@param[in] UserData The data to print out.
|
@param[in] UserData The data to print out.
|
||||||
**/
|
**/
|
||||||
CHAR16*
|
CHAR16*
|
||||||
CatSDumpHex (
|
CatSDumpHex (
|
||||||
IN CHAR16 *Buffer,
|
IN CHAR16 *Buffer,
|
||||||
IN UINTN Indent,
|
IN UINTN Indent,
|
||||||
IN UINTN Offset,
|
IN UINTN Offset,
|
||||||
IN UINTN DataSize,
|
IN UINTN DataSize,
|
||||||
IN VOID *UserData
|
IN VOID *UserData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT8 *Data;
|
UINT8 *Data;
|
||||||
UINT8 TempByte;
|
UINT8 TempByte;
|
||||||
UINTN Size;
|
UINTN Size;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
CHAR8 Val[50];
|
CHAR8 Val[50];
|
||||||
CHAR8 Str[20];
|
CHAR8 Str[20];
|
||||||
CHAR16 *RetVal;
|
CHAR16 *RetVal;
|
||||||
CHAR16 *TempRetVal;
|
CHAR16 *TempRetVal;
|
||||||
|
|
||||||
Data = UserData;
|
Data = UserData;
|
||||||
RetVal = Buffer;
|
RetVal = Buffer;
|
||||||
while (DataSize != 0) {
|
while (DataSize != 0) {
|
||||||
Size = 16;
|
Size = 16;
|
||||||
if (Size > DataSize) {
|
if (Size > DataSize) {
|
||||||
Size = DataSize;
|
Size = DataSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < Size; Index += 1) {
|
for (Index = 0; Index < Size; Index += 1) {
|
||||||
TempByte = Data[Index];
|
TempByte = Data[Index];
|
||||||
Val[Index * 3 + 0] = Hex[TempByte >> 4];
|
Val[Index * 3 + 0] = Hex[TempByte >> 4];
|
||||||
Val[Index * 3 + 1] = Hex[TempByte & 0xF];
|
Val[Index * 3 + 1] = Hex[TempByte & 0xF];
|
||||||
Val[Index * 3 + 2] = (CHAR8) ((Index == 7) ? '-' : ' ');
|
Val[Index * 3 + 2] = (CHAR8) ((Index == 7) ? '-' : ' ');
|
||||||
Str[Index] = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' : TempByte);
|
Str[Index] = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' : TempByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
Val[Index * 3] = 0;
|
Val[Index * 3] = 0;
|
||||||
Str[Index] = 0;
|
Str[Index] = 0;
|
||||||
TempRetVal = CatSPrint (RetVal, L"%*a%08X: %-48a *%a*\r\n", Indent, "", Offset, Val, Str);
|
TempRetVal = CatSPrint (RetVal, L"%*a%08X: %-48a *%a*\r\n", Indent, "", Offset, Val, Str);
|
||||||
SHELL_FREE_NON_NULL (RetVal);
|
SHELL_FREE_NON_NULL (RetVal);
|
||||||
RetVal = TempRetVal;
|
RetVal = TempRetVal;
|
||||||
|
|
||||||
Data += Size;
|
Data += Size;
|
||||||
Offset += Size;
|
Offset += Size;
|
||||||
DataSize -= Size;
|
DataSize -= Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user