summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c273
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c549
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h1
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c115
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c161
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c516
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c91
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c1234
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h32
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c636
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c21
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h11
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h6
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h79
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c91
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h12
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c68
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h15
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c30
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h8
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c71
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h18
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c148
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c163
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c923
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h53
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c15
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h4
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c126
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h14
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c97
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h4
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c233
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h115
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c1139
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c107
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h14
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c57
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h12
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c225
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c382
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c485
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c107
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c2829
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h22
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c288
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c85
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c269
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c296
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h54
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c78
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h42
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c3707
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h73
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c453
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h230
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c615
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h38
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c155
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h25
60 files changed, 9351 insertions, 8369 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
index 0df0b31493..e94236d0b9 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
@@ -9,11 +9,11 @@
#include "UefiShellDebug1CommandsLib.h"
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-n", TypeValue},
- {L"-s", TypeValue},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-n", TypeValue },
+ { L"-s", TypeValue },
+ { NULL, TypeMax }
+};
typedef enum {
OutOfDiffPoint,
@@ -25,10 +25,10 @@ typedef enum {
// Buffer type, for reading both file operands in chunks.
//
typedef struct {
- UINT8 *Data; // dynamically allocated buffer
- UINTN Allocated; // the allocated size of Data
- UINTN Next; // next position in Data to fetch a byte at
- UINTN Left; // number of bytes left in Data for fetching at Next
+ UINT8 *Data; // dynamically allocated buffer
+ UINTN Allocated; // the allocated size of Data
+ UINTN Next; // next position in Data to fetch a byte at
+ UINTN Left; // number of bytes left in Data for fetching at Next
} FILE_BUFFER;
/**
@@ -43,7 +43,7 @@ typedef struct {
**/
VOID
-PrintDifferentPoint(
+PrintDifferentPoint (
CONST CHAR16 *FileName,
CHAR16 *FileTag,
UINT8 *Buffer,
@@ -52,7 +52,7 @@ PrintDifferentPoint(
UINT64 DifferentBytes
)
{
- UINTN Index;
+ UINTN Index;
ShellPrintEx (-1, -1, L"%s: %s\r\n %08x:", FileTag, FileName, Address);
@@ -73,7 +73,7 @@ PrintDifferentPoint(
// Print data in char-format.
//
for (Index = 0; Index < BufferSize; Index++) {
- if (Buffer[Index] >= 0x20 && Buffer[Index] <= 0x7E) {
+ if ((Buffer[Index] >= 0x20) && (Buffer[Index] <= 0x7E)) {
ShellPrintEx (-1, -1, L"%c", Buffer[Index]);
} else {
//
@@ -97,7 +97,7 @@ PrintDifferentPoint(
STATIC
VOID
FileBufferInit (
- OUT FILE_BUFFER *FileBuffer
+ OUT FILE_BUFFER *FileBuffer
)
{
FileBuffer->Allocated = PcdGet32 (PcdShellFileOperationSize);
@@ -116,7 +116,7 @@ FileBufferInit (
STATIC
VOID
FileBufferUninit (
- IN OUT FILE_BUFFER *FileBuffer
+ IN OUT FILE_BUFFER *FileBuffer
)
{
SHELL_FREE_NON_NULL (FileBuffer->Data);
@@ -154,26 +154,31 @@ FileBufferUninit (
STATIC
EFI_STATUS
FileBufferReadByte (
- IN SHELL_FILE_HANDLE FileHandle,
- IN OUT FILE_BUFFER *FileBuffer,
- OUT UINTN *BytesRead,
- OUT UINT8 *Byte
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN OUT FILE_BUFFER *FileBuffer,
+ OUT UINTN *BytesRead,
+ OUT UINT8 *Byte
)
{
- UINTN ReadSize;
- EFI_STATUS Status;
+ UINTN ReadSize;
+ EFI_STATUS Status;
if (FileBuffer->Left == 0) {
ReadSize = FileBuffer->Allocated;
- Status = gEfiShellProtocol->ReadFile (FileHandle, &ReadSize,
- FileBuffer->Data);
+ Status = gEfiShellProtocol->ReadFile (
+ FileHandle,
+ &ReadSize,
+ FileBuffer->Data
+ );
if (EFI_ERROR (Status)) {
return Status;
}
+
if (ReadSize == 0) {
*BytesRead = 0;
return EFI_SUCCESS;
}
+
FileBuffer->Next = 0;
FileBuffer->Left = ReadSize;
}
@@ -199,112 +204,114 @@ ShellCommandRunComp (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CHAR16 *FileName1;
- CHAR16 *FileName2;
- CONST CHAR16 *TempParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE FileHandle1;
- SHELL_FILE_HANDLE FileHandle2;
- UINT64 Size1;
- UINT64 Size2;
- UINT64 DifferentBytes;
- UINT64 DifferentCount;
- UINT8 DiffPointNumber;
- UINT8 OneByteFromFile1;
- UINT8 OneByteFromFile2;
- UINT8 *DataFromFile1;
- UINT8 *DataFromFile2;
- FILE_BUFFER FileBuffer1;
- FILE_BUFFER FileBuffer2;
- UINTN InsertPosition1;
- UINTN InsertPosition2;
- UINTN DataSizeFromFile1;
- UINTN DataSizeFromFile2;
- UINTN TempAddress;
- UINTN Index;
- UINTN DiffPointAddress;
- READ_STATUS ReadStatus;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- FileName1 = NULL;
- FileName2 = NULL;
- FileHandle1 = NULL;
- FileHandle2 = NULL;
- DataFromFile1 = NULL;
- DataFromFile2 = NULL;
- ReadStatus = OutOfDiffPoint;
- DifferentCount = 10;
- DifferentBytes = 4;
- DiffPointNumber = 0;
- InsertPosition1 = 0;
- InsertPosition2 = 0;
- TempAddress = 0;
- DiffPointAddress = 0;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ CHAR16 *FileName1;
+ CHAR16 *FileName2;
+ CONST CHAR16 *TempParam;
+ SHELL_STATUS ShellStatus;
+ SHELL_FILE_HANDLE FileHandle1;
+ SHELL_FILE_HANDLE FileHandle2;
+ UINT64 Size1;
+ UINT64 Size2;
+ UINT64 DifferentBytes;
+ UINT64 DifferentCount;
+ UINT8 DiffPointNumber;
+ UINT8 OneByteFromFile1;
+ UINT8 OneByteFromFile2;
+ UINT8 *DataFromFile1;
+ UINT8 *DataFromFile2;
+ FILE_BUFFER FileBuffer1;
+ FILE_BUFFER FileBuffer2;
+ UINTN InsertPosition1;
+ UINTN InsertPosition2;
+ UINTN DataSizeFromFile1;
+ UINTN DataSizeFromFile2;
+ UINTN TempAddress;
+ UINTN Index;
+ UINTN DiffPointAddress;
+ READ_STATUS ReadStatus;
+
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ FileName1 = NULL;
+ FileName2 = NULL;
+ FileHandle1 = NULL;
+ FileHandle2 = NULL;
+ DataFromFile1 = NULL;
+ DataFromFile2 = NULL;
+ ReadStatus = OutOfDiffPoint;
+ DifferentCount = 10;
+ DifferentBytes = 4;
+ DiffPointNumber = 0;
+ InsertPosition1 = 0;
+ InsertPosition2 = 0;
+ TempAddress = 0;
+ DiffPointAddress = 0;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp");
+ if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp");
+ } else if (ShellCommandLineGetCount (Package) < 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- FileName1 = ShellFindFilePath(TempParam);
+ TempParam = ShellCommandLineGetRawValue (Package, 1);
+ ASSERT (TempParam != NULL);
+ FileName1 = ShellFindFilePath (TempParam);
if (FileName1 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
- Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
+ Status = ShellOpenFileByName (FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND;
}
}
- TempParam = ShellCommandLineGetRawValue(Package, 2);
- ASSERT(TempParam != NULL);
- FileName2 = ShellFindFilePath(TempParam);
+
+ TempParam = ShellCommandLineGetRawValue (Package, 2);
+ ASSERT (TempParam != NULL);
+ FileName2 = ShellFindFilePath (TempParam);
if (FileName2 == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
- Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
+ Status = ShellOpenFileByName (FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND;
}
}
+
if (ShellStatus == SHELL_SUCCESS) {
- Status = gEfiShellProtocol->GetFileSize(FileHandle1, &Size1);
- ASSERT_EFI_ERROR(Status);
- Status = gEfiShellProtocol->GetFileSize(FileHandle2, &Size2);
- ASSERT_EFI_ERROR(Status);
+ Status = gEfiShellProtocol->GetFileSize (FileHandle1, &Size1);
+ ASSERT_EFI_ERROR (Status);
+ Status = gEfiShellProtocol->GetFileSize (FileHandle2, &Size2);
+ ASSERT_EFI_ERROR (Status);
if (ShellCommandLineGetFlag (Package, L"-n")) {
TempParam = ShellCommandLineGetValue (Package, L"-n");
@@ -316,7 +323,7 @@ ShellCommandRunComp (
DifferentCount = MAX_UINTN;
} else {
Status = ShellConvertStringToUint64 (TempParam, &DifferentCount, FALSE, TRUE);
- if (EFI_ERROR(Status) || DifferentCount == 0) {
+ if (EFI_ERROR (Status) || (DifferentCount == 0)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"comp", TempParam, L"-n");
ShellStatus = SHELL_INVALID_PARAMETER;
}
@@ -331,7 +338,7 @@ ShellCommandRunComp (
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = ShellConvertStringToUint64 (TempParam, &DifferentBytes, FALSE, TRUE);
- if (EFI_ERROR(Status) || DifferentBytes == 0) {
+ if (EFI_ERROR (Status) || (DifferentBytes == 0)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"comp", TempParam, L"-s");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
@@ -348,8 +355,9 @@ ShellCommandRunComp (
DataFromFile2 = AllocateZeroPool ((UINTN)DifferentBytes);
FileBufferInit (&FileBuffer1);
FileBufferInit (&FileBuffer2);
- if (DataFromFile1 == NULL || DataFromFile2 == NULL ||
- FileBuffer1.Data == NULL || FileBuffer2.Data == NULL) {
+ if ((DataFromFile1 == NULL) || (DataFromFile2 == NULL) ||
+ (FileBuffer1.Data == NULL) || (FileBuffer2.Data == NULL))
+ {
ShellStatus = SHELL_OUT_OF_RESOURCES;
SHELL_FREE_NON_NULL (DataFromFile1);
SHELL_FREE_NON_NULL (DataFromFile2);
@@ -362,13 +370,21 @@ ShellCommandRunComp (
while (DiffPointNumber < DifferentCount) {
DataSizeFromFile1 = 1;
DataSizeFromFile2 = 1;
- OneByteFromFile1 = 0;
- OneByteFromFile2 = 0;
- Status = FileBufferReadByte (FileHandle1, &FileBuffer1,
- &DataSizeFromFile1, &OneByteFromFile1);
+ OneByteFromFile1 = 0;
+ OneByteFromFile2 = 0;
+ Status = FileBufferReadByte (
+ FileHandle1,
+ &FileBuffer1,
+ &DataSizeFromFile1,
+ &OneByteFromFile1
+ );
ASSERT_EFI_ERROR (Status);
- Status = FileBufferReadByte (FileHandle2, &FileBuffer2,
- &DataSizeFromFile2, &OneByteFromFile2);
+ Status = FileBufferReadByte (
+ FileHandle2,
+ &FileBuffer2,
+ &DataSizeFromFile2,
+ &OneByteFromFile2
+ );
ASSERT_EFI_ERROR (Status);
TempAddress++;
@@ -378,19 +394,21 @@ ShellCommandRunComp (
// 2.If no more char in File1 or File2, The ReadStatus is InPrevDiffPoint forever.
// So the previous different point is the last one, then break the while block.
//
- if ( (DataSizeFromFile1 == 0 && InsertPosition1 == 0 && DataSizeFromFile2 == 0 && InsertPosition2 == 0) ||
- (ReadStatus == InPrevDiffPoint && (DataSizeFromFile1 == 0 || DataSizeFromFile2 == 0))
- ) {
+ if (((DataSizeFromFile1 == 0) && (InsertPosition1 == 0) && (DataSizeFromFile2 == 0) && (InsertPosition2 == 0)) ||
+ ((ReadStatus == InPrevDiffPoint) && ((DataSizeFromFile1 == 0) || (DataSizeFromFile2 == 0)))
+ )
+ {
break;
}
if (ReadStatus == OutOfDiffPoint) {
if (OneByteFromFile1 != OneByteFromFile2) {
- ReadStatus = InDiffPoint;
+ ReadStatus = InDiffPoint;
DiffPointAddress = TempAddress;
if (DataSizeFromFile1 == 1) {
DataFromFile1[InsertPosition1++] = OneByteFromFile1;
}
+
if (DataSizeFromFile2 == 1) {
DataFromFile2[InsertPosition2++] = OneByteFromFile2;
}
@@ -399,6 +417,7 @@ ShellCommandRunComp (
if (DataSizeFromFile1 == 1) {
DataFromFile1[InsertPosition1++] = OneByteFromFile1;
}
+
if (DataSizeFromFile2 == 1) {
DataFromFile2[InsertPosition2++] = OneByteFromFile2;
}
@@ -411,11 +430,11 @@ ShellCommandRunComp (
//
// ReadStatus should be always equal InDiffPoint.
//
- if ( InsertPosition1 == DifferentBytes ||
- InsertPosition2 == DifferentBytes ||
- (DataSizeFromFile1 == 0 && DataSizeFromFile2 == 0)
- ) {
-
+ if ((InsertPosition1 == DifferentBytes) ||
+ (InsertPosition2 == DifferentBytes) ||
+ ((DataSizeFromFile1 == 0) && (DataSizeFromFile2 == 0))
+ )
+ {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_COMP_DIFFERENCE_POINT), gShellDebug1HiiHandle, ++DiffPointNumber);
PrintDifferentPoint (FileName1, L"File1", DataFromFile1, InsertPosition1, DiffPointAddress, DifferentBytes);
PrintDifferentPoint (FileName2, L"File2", DataFromFile2, InsertPosition2, DiffPointAddress, DifferentBytes);
@@ -423,7 +442,7 @@ ShellCommandRunComp (
//
// One of two buffuers is empty, it means this is the last different point.
//
- if (InsertPosition1 == 0 || InsertPosition2 == 0) {
+ if ((InsertPosition1 == 0) || (InsertPosition2 == 0)) {
break;
}
@@ -438,9 +457,9 @@ ShellCommandRunComp (
//
// Try to find a new different point in the rest of DataFromFile.
//
- for (; Index < MAX (InsertPosition1,InsertPosition2); Index++) {
+ for ( ; Index < MAX (InsertPosition1, InsertPosition2); Index++) {
if (DataFromFile1[Index] != DataFromFile2[Index]) {
- ReadStatus = InDiffPoint;
+ ReadStatus = InDiffPoint;
DiffPointAddress += Index;
break;
}
@@ -469,24 +488,26 @@ ShellCommandRunComp (
FileBufferUninit (&FileBuffer2);
if (DiffPointNumber == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_PASS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_PASS), gShellDebug1HiiHandle);
} else {
ShellStatus = SHELL_NOT_EQUAL;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_FAIL), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_FAIL), gShellDebug1HiiHandle);
}
}
}
ShellCommandLineFreeVarList (Package);
}
- SHELL_FREE_NON_NULL(FileName1);
- SHELL_FREE_NON_NULL(FileName2);
+
+ SHELL_FREE_NON_NULL (FileName1);
+ SHELL_FREE_NON_NULL (FileName2);
if (FileHandle1 != NULL) {
- gEfiShellProtocol->CloseFile(FileHandle1);
+ gEfiShellProtocol->CloseFile (FileHandle1);
}
+
if (FileHandle2 != NULL) {
- gEfiShellProtocol->CloseFile(FileHandle2);
+ gEfiShellProtocol->CloseFile (FileHandle2);
}
return (ShellStatus);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
index 4d9a6fb467..c76805ed30 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c
@@ -22,36 +22,36 @@
//
// Macro Definitions
//
-typedef INT16 NODE;
-#define UINT8_MAX 0xff
-#define UINT8_BIT 8
-#define THRESHOLD 3
-#define INIT_CRC 0
-#define WNDBIT 13
-#define WNDSIZ (1U << WNDBIT)
-#define MAXMATCH 256
-#define BLKSIZ (1U << 14) // 16 * 1024U
-#define PERC_FLAG 0x8000U
-#define CODE_BIT 16
-#define NIL 0
-#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
-#define HASH(LoopVar7, LoopVar5) ((LoopVar7) + ((LoopVar5) << (WNDBIT - 9)) + WNDSIZ * 2)
-#define CRCPOLY 0xA001
-#define UPDATE_CRC(LoopVar5) mCrc = mCrcTable[(mCrc ^ (LoopVar5)) & 0xFF] ^ (mCrc >> UINT8_BIT)
+typedef INT16 NODE;
+#define UINT8_MAX 0xff
+#define UINT8_BIT 8
+#define THRESHOLD 3
+#define INIT_CRC 0
+#define WNDBIT 13
+#define WNDSIZ (1U << WNDBIT)
+#define MAXMATCH 256
+#define BLKSIZ (1U << 14) // 16 * 1024U
+#define PERC_FLAG 0x8000U
+#define CODE_BIT 16
+#define NIL 0
+#define MAX_HASH_VAL (3 * WNDSIZ + (WNDSIZ / 512 + 1) * UINT8_MAX)
+#define HASH(LoopVar7, LoopVar5) ((LoopVar7) + ((LoopVar5) << (WNDBIT - 9)) + WNDSIZ * 2)
+#define CRCPOLY 0xA001
+#define UPDATE_CRC(LoopVar5) mCrc = mCrcTable[(mCrc ^ (LoopVar5)) & 0xFF] ^ (mCrc >> UINT8_BIT)
//
// C: the Char&Len Set; P: the Position Set; T: the exTra Set
//
-#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define NP (WNDBIT + 1)
-#define PBIT 4
-#define NT (CODE_BIT + 3)
-#define TBIT 5
+#define NC (UINT8_MAX + MAXMATCH + 2 - THRESHOLD)
+#define CBIT 9
+#define NP (WNDBIT + 1)
+#define PBIT 4
+#define NT (CODE_BIT + 3)
+#define TBIT 5
#if NT > NP
- #define NPT NT
+#define NPT NT
#else
- #define NPT NP
+#define NPT NP
#endif
//
// Function Prototypes
@@ -63,8 +63,8 @@ typedef INT16 NODE;
@param[in] Data The dword to put.
**/
VOID
-PutDword(
- IN UINT32 Data
+PutDword (
+ IN UINT32 Data
);
//
@@ -75,47 +75,47 @@ STATIC UINT8 *mDst;
STATIC UINT8 *mSrcUpperLimit;
STATIC UINT8 *mDstUpperLimit;
-STATIC UINT8 *mLevel;
-STATIC UINT8 *mText;
-STATIC UINT8 *mChildCount;
-STATIC UINT8 *mBuf;
-STATIC UINT8 mCLen[NC];
-STATIC UINT8 mPTLen[NPT];
-STATIC UINT8 *mLen;
-STATIC INT16 mHeap[NC + 1];
-STATIC INT32 mRemainder;
-STATIC INT32 mMatchLen;
-STATIC INT32 mBitCount;
-STATIC INT32 mHeapSize;
-STATIC INT32 mTempInt32;
-STATIC UINT32 mBufSiz = 0;
-STATIC UINT32 mOutputPos;
-STATIC UINT32 mOutputMask;
-STATIC UINT32 mSubBitBuf;
-STATIC UINT32 mCrc;
-STATIC UINT32 mCompSize;
-STATIC UINT32 mOrigSize;
-
-STATIC UINT16 *mFreq;
-STATIC UINT16 *mSortPtr;
-STATIC UINT16 mLenCnt[17];
-STATIC UINT16 mLeft[2 * NC - 1];
-STATIC UINT16 mRight[2 * NC - 1];
-STATIC UINT16 mCrcTable[UINT8_MAX + 1];
-STATIC UINT16 mCFreq[2 * NC - 1];
-STATIC UINT16 mCCode[NC];
-STATIC UINT16 mPFreq[2 * NP - 1];
-STATIC UINT16 mPTCode[NPT];
-STATIC UINT16 mTFreq[2 * NT - 1];
-
-STATIC NODE mPos;
-STATIC NODE mMatchPos;
-STATIC NODE mAvail;
-STATIC NODE *mPosition;
-STATIC NODE *mParent;
-STATIC NODE *mPrev;
-STATIC NODE *mNext = NULL;
-INT32 mHuffmanDepth = 0;
+STATIC UINT8 *mLevel;
+STATIC UINT8 *mText;
+STATIC UINT8 *mChildCount;
+STATIC UINT8 *mBuf;
+STATIC UINT8 mCLen[NC];
+STATIC UINT8 mPTLen[NPT];
+STATIC UINT8 *mLen;
+STATIC INT16 mHeap[NC + 1];
+STATIC INT32 mRemainder;
+STATIC INT32 mMatchLen;
+STATIC INT32 mBitCount;
+STATIC INT32 mHeapSize;
+STATIC INT32 mTempInt32;
+STATIC UINT32 mBufSiz = 0;
+STATIC UINT32 mOutputPos;
+STATIC UINT32 mOutputMask;
+STATIC UINT32 mSubBitBuf;
+STATIC UINT32 mCrc;
+STATIC UINT32 mCompSize;
+STATIC UINT32 mOrigSize;
+
+STATIC UINT16 *mFreq;
+STATIC UINT16 *mSortPtr;
+STATIC UINT16 mLenCnt[17];
+STATIC UINT16 mLeft[2 * NC - 1];
+STATIC UINT16 mRight[2 * NC - 1];
+STATIC UINT16 mCrcTable[UINT8_MAX + 1];
+STATIC UINT16 mCFreq[2 * NC - 1];
+STATIC UINT16 mCCode[NC];
+STATIC UINT16 mPFreq[2 * NP - 1];
+STATIC UINT16 mPTCode[NPT];
+STATIC UINT16 mTFreq[2 * NT - 1];
+
+STATIC NODE mPos;
+STATIC NODE mMatchPos;
+STATIC NODE mAvail;
+STATIC NODE *mPosition;
+STATIC NODE *mParent;
+STATIC NODE *mPrev;
+STATIC NODE *mNext = NULL;
+INT32 mHuffmanDepth = 0;
/**
Make a CRC table.
@@ -142,7 +142,7 @@ MakeCrcTable (
}
}
- mCrcTable[LoopVar1] = (UINT16) LoopVar4;
+ mCrcTable[LoopVar1] = (UINT16)LoopVar4;
}
}
@@ -153,23 +153,23 @@ MakeCrcTable (
**/
VOID
PutDword (
- IN UINT32 Data
+ IN UINT32 Data
)
{
if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data)) & 0xff);
+ *mDst++ = (UINT8)(((UINT8)(Data)) & 0xff);
}
if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x08)) & 0xff);
+ *mDst++ = (UINT8)(((UINT8)(Data >> 0x08)) & 0xff);
}
if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x10)) & 0xff);
+ *mDst++ = (UINT8)(((UINT8)(Data >> 0x10)) & 0xff);
}
if (mDst < mDstUpperLimit) {
- *mDst++ = (UINT8) (((UINT8) (Data >> 0x18)) & 0xff);
+ *mDst++ = (UINT8)(((UINT8)(Data >> 0x18)) & 0xff);
}
}
@@ -192,8 +192,8 @@ AllocateMemory (
mPrev = AllocateZeroPool (WNDSIZ * 2 * sizeof (*mPrev));
mNext = AllocateZeroPool ((MAX_HASH_VAL + 1) * sizeof (*mNext));
- mBufSiz = BLKSIZ;
- mBuf = AllocateZeroPool (mBufSiz);
+ mBufSiz = BLKSIZ;
+ mBuf = AllocateZeroPool (mBufSiz);
while (mBuf == NULL) {
mBufSiz = (mBufSiz / 10U) * 9U;
if (mBufSiz < 4 * 1024U) {
@@ -244,7 +244,7 @@ InitSlide (
mAvail = 1;
for (LoopVar1 = 1; LoopVar1 < WNDSIZ - 1; LoopVar1++) {
- mNext[LoopVar1] = (NODE) (LoopVar1 + 1);
+ mNext[LoopVar1] = (NODE)(LoopVar1 + 1);
}
mNext[WNDSIZ - 1] = NIL;
@@ -269,8 +269,8 @@ Child (
{
NODE LoopVar4;
- LoopVar4 = mNext[HASH (LoopVar6, LoopVar5)];
- mParent[NIL] = LoopVar6; /* sentinel */
+ LoopVar4 = mNext[HASH (LoopVar6, LoopVar5)];
+ mParent[NIL] = LoopVar6; /* sentinel */
while (mParent[LoopVar4] != LoopVar6) {
LoopVar4 = mNext[LoopVar4];
}
@@ -296,13 +296,13 @@ MakeChild (
NODE LoopVar10;
- LoopVar12 = (NODE) HASH (LoopVar6, LoopVar5);
- LoopVar10 = mNext[LoopVar12];
- mNext[LoopVar12] = LoopVar4;
- mNext[LoopVar4] = LoopVar10;
- mPrev[LoopVar10] = LoopVar4;
- mPrev[LoopVar4] = LoopVar12;
- mParent[LoopVar4] = LoopVar6;
+ LoopVar12 = (NODE)HASH (LoopVar6, LoopVar5);
+ LoopVar10 = mNext[LoopVar12];
+ mNext[LoopVar12] = LoopVar4;
+ mNext[LoopVar4] = LoopVar10;
+ mPrev[LoopVar10] = LoopVar4;
+ mPrev[LoopVar4] = LoopVar12;
+ mParent[LoopVar4] = LoopVar6;
mChildCount[LoopVar6]++;
}
@@ -313,25 +313,25 @@ MakeChild (
**/
VOID
Split (
- IN NODE Old
+ IN NODE Old
)
{
NODE New;
NODE LoopVar10;
- New = mAvail;
- mAvail = mNext[New];
- mChildCount[New] = 0;
- LoopVar10 = mPrev[Old];
- mPrev[New] = LoopVar10;
- mNext[LoopVar10] = New;
- LoopVar10 = mNext[Old];
- mNext[New] = LoopVar10;
- mPrev[LoopVar10] = New;
- mParent[New] = mParent[Old];
- mLevel[New] = (UINT8) mMatchLen;
- mPosition[New] = mPos;
+ New = mAvail;
+ mAvail = mNext[New];
+ mChildCount[New] = 0;
+ LoopVar10 = mPrev[Old];
+ mPrev[New] = LoopVar10;
+ mNext[LoopVar10] = New;
+ LoopVar10 = mNext[Old];
+ mNext[New] = LoopVar10;
+ mPrev[LoopVar10] = New;
+ mParent[New] = mParent[Old];
+ mLevel[New] = (UINT8)mMatchLen;
+ mPosition[New] = mPos;
MakeChild (New, mText[mMatchPos + mMatchLen], Old);
MakeChild (New, mText[mPos + mMatchLen], mPos);
}
@@ -351,10 +351,10 @@ InsertNode (
NODE LoopVar2;
- NODE LoopVar10;
- UINT8 LoopVar5;
- UINT8 *TempString3;
- UINT8 *TempString2;
+ NODE LoopVar10;
+ UINT8 LoopVar5;
+ UINT8 *TempString3;
+ UINT8 *TempString2;
if (mMatchLen >= 4) {
//
@@ -365,7 +365,7 @@ InsertNode (
// in DeleteNode() later.
//
mMatchLen--;
- LoopVar4 = (NODE) ((mMatchPos + 1) | WNDSIZ);
+ LoopVar4 = (NODE)((mMatchPos + 1) | WNDSIZ);
LoopVar6 = mParent[LoopVar4];
while (LoopVar6 == NIL) {
LoopVar4 = mNext[LoopVar4];
@@ -379,52 +379,53 @@ InsertNode (
LoopVar10 = LoopVar6;
while (mPosition[LoopVar10] < 0) {
- mPosition[LoopVar10] = mPos;
- LoopVar10 = mParent[LoopVar10];
+ mPosition[LoopVar10] = mPos;
+ LoopVar10 = mParent[LoopVar10];
}
if (LoopVar10 < WNDSIZ) {
- mPosition[LoopVar10] = (NODE) (mPos | PERC_FLAG);
+ mPosition[LoopVar10] = (NODE)(mPos | PERC_FLAG);
}
} else {
//
// Locate the target tree
//
- LoopVar6 = (NODE) (mText[mPos] + WNDSIZ);
+ LoopVar6 = (NODE)(mText[mPos] + WNDSIZ);
LoopVar5 = mText[mPos + 1];
LoopVar4 = Child (LoopVar6, LoopVar5);
if (LoopVar4 == NIL) {
MakeChild (LoopVar6, LoopVar5, mPos);
mMatchLen = 1;
- return ;
+ return;
}
mMatchLen = 2;
}
+
//
// Traverse down the tree to find a match.
// Update Position value along the route.
// Node split or creation is involved.
//
- for (;;) {
+ for ( ; ;) {
if (LoopVar4 >= WNDSIZ) {
- LoopVar2 = MAXMATCH;
+ LoopVar2 = MAXMATCH;
mMatchPos = LoopVar4;
} else {
- LoopVar2 = mLevel[LoopVar4];
- mMatchPos = (NODE) (mPosition[LoopVar4] & ~PERC_FLAG);
+ LoopVar2 = mLevel[LoopVar4];
+ mMatchPos = (NODE)(mPosition[LoopVar4] & ~PERC_FLAG);
}
if (mMatchPos >= mPos) {
mMatchPos -= WNDSIZ;
}
- TempString3 = &mText[mPos + mMatchLen];
- TempString2 = &mText[mMatchPos + mMatchLen];
+ TempString3 = &mText[mPos + mMatchLen];
+ TempString2 = &mText[mMatchPos + mMatchLen];
while (mMatchLen < LoopVar2) {
if (*TempString3 != *TempString2) {
Split (LoopVar4);
- return ;
+ return;
}
mMatchLen++;
@@ -436,31 +437,30 @@ InsertNode (
break;
}
- mPosition[LoopVar4] = mPos;
- LoopVar6 = LoopVar4;
- LoopVar4 = Child (LoopVar6, *TempString3);
+ mPosition[LoopVar4] = mPos;
+ LoopVar6 = LoopVar4;
+ LoopVar4 = Child (LoopVar6, *TempString3);
if (LoopVar4 == NIL) {
MakeChild (LoopVar6, *TempString3, mPos);
- return ;
+ return;
}
mMatchLen++;
}
- LoopVar10 = mPrev[LoopVar4];
- mPrev[mPos] = LoopVar10;
- mNext[LoopVar10] = mPos;
- LoopVar10 = mNext[LoopVar4];
- mNext[mPos] = LoopVar10;
- mPrev[LoopVar10] = mPos;
- mParent[mPos] = LoopVar6;
- mParent[LoopVar4] = NIL;
+ LoopVar10 = mPrev[LoopVar4];
+ mPrev[mPos] = LoopVar10;
+ mNext[LoopVar10] = mPos;
+ LoopVar10 = mNext[LoopVar4];
+ mNext[mPos] = LoopVar10;
+ mPrev[LoopVar10] = mPos;
+ mParent[mPos] = LoopVar6;
+ mParent[LoopVar4] = NIL;
//
// Special usage of 'next'
//
mNext[LoopVar4] = mPos;
-
}
/**
@@ -484,33 +484,33 @@ DeleteNode (
NODE LoopVar9;
if (mParent[mPos] == NIL) {
- return ;
+ return;
}
- LoopVar4 = mPrev[mPos];
- LoopVar11 = mNext[mPos];
- mNext[LoopVar4] = LoopVar11;
- mPrev[LoopVar11] = LoopVar4;
- LoopVar4 = mParent[mPos];
- mParent[mPos] = NIL;
+ LoopVar4 = mPrev[mPos];
+ LoopVar11 = mNext[mPos];
+ mNext[LoopVar4] = LoopVar11;
+ mPrev[LoopVar11] = LoopVar4;
+ LoopVar4 = mParent[mPos];
+ mParent[mPos] = NIL;
if (LoopVar4 >= WNDSIZ) {
- return ;
+ return;
}
mChildCount[LoopVar4]--;
if (mChildCount[LoopVar4] > 1) {
- return ;
+ return;
}
- LoopVar10 = (NODE) (mPosition[LoopVar4] & ~PERC_FLAG);
+ LoopVar10 = (NODE)(mPosition[LoopVar4] & ~PERC_FLAG);
if (LoopVar10 >= mPos) {
LoopVar10 -= WNDSIZ;
}
LoopVar11 = LoopVar10;
- LoopVar6 = mParent[LoopVar4];
- LoopVar9 = mPosition[LoopVar6];
- while ((LoopVar9 & PERC_FLAG) != 0){
+ LoopVar6 = mParent[LoopVar4];
+ LoopVar9 = mPosition[LoopVar6];
+ while ((LoopVar9 & PERC_FLAG) != 0) {
LoopVar9 &= ~PERC_FLAG;
if (LoopVar9 >= mPos) {
LoopVar9 -= WNDSIZ;
@@ -520,9 +520,9 @@ DeleteNode (
LoopVar11 = LoopVar9;
}
- mPosition[LoopVar6] = (NODE) (LoopVar11 | WNDSIZ);
- LoopVar6 = mParent[LoopVar6];
- LoopVar9 = mPosition[LoopVar6];
+ mPosition[LoopVar6] = (NODE)(LoopVar11 | WNDSIZ);
+ LoopVar6 = mParent[LoopVar6];
+ LoopVar9 = mPosition[LoopVar6];
}
if (LoopVar6 < WNDSIZ) {
@@ -534,24 +534,24 @@ DeleteNode (
LoopVar11 = LoopVar9;
}
- mPosition[LoopVar6] = (NODE) (LoopVar11 | WNDSIZ | PERC_FLAG);
+ mPosition[LoopVar6] = (NODE)(LoopVar11 | WNDSIZ | PERC_FLAG);
}
- LoopVar11 = Child (LoopVar4, mText[LoopVar10 + mLevel[LoopVar4]]);
- LoopVar10 = mPrev[LoopVar11];
+ LoopVar11 = Child (LoopVar4, mText[LoopVar10 + mLevel[LoopVar4]]);
+ LoopVar10 = mPrev[LoopVar11];
LoopVar9 = mNext[LoopVar11];
- mNext[LoopVar10] = LoopVar9;
+ mNext[LoopVar10] = LoopVar9;
mPrev[LoopVar9] = LoopVar10;
- LoopVar10 = mPrev[LoopVar4];
- mNext[LoopVar10] = LoopVar11;
- mPrev[LoopVar11] = LoopVar10;
- LoopVar10 = mNext[LoopVar4];
- mPrev[LoopVar10] = LoopVar11;
- mNext[LoopVar11] = LoopVar10;
- mParent[LoopVar11] = mParent[LoopVar4];
+ LoopVar10 = mPrev[LoopVar4];
+ mNext[LoopVar10] = LoopVar11;
+ mPrev[LoopVar11] = LoopVar10;
+ LoopVar10 = mNext[LoopVar4];
+ mPrev[LoopVar10] = LoopVar11;
+ mNext[LoopVar11] = LoopVar10;
+ mParent[LoopVar11] = mParent[LoopVar4];
mParent[LoopVar4] = NIL;
mNext[LoopVar4] = mAvail;
- mAvail = LoopVar4;
+ mAvail = LoopVar4;
}
/**
@@ -564,11 +564,11 @@ DeleteNode (
**/
INT32
FreadCrc (
- OUT UINT8 *LoopVar7,
- IN INT32 LoopVar8
+ OUT UINT8 *LoopVar7,
+ IN INT32 LoopVar8
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
for (LoopVar1 = 0; mSrc < mSrcUpperLimit && LoopVar1 < LoopVar8; LoopVar1++) {
*LoopVar7++ = *mSrc++;
@@ -576,7 +576,7 @@ FreadCrc (
LoopVar8 = LoopVar1;
- LoopVar7 -= LoopVar8;
+ LoopVar7 -= LoopVar8;
mOrigSize += LoopVar8;
LoopVar1--;
while (LoopVar1 >= 0) {
@@ -599,8 +599,8 @@ GetNextMatch (
VOID
)
{
- INT32 LoopVar8;
- VOID *Temp;
+ INT32 LoopVar8;
+ VOID *Temp;
mRemainder--;
mPos++;
@@ -609,12 +609,13 @@ GetNextMatch (
if (Temp == NULL) {
return (FALSE);
}
+
CopyMem (Temp, &mText[WNDSIZ], WNDSIZ + MAXMATCH);
CopyMem (&mText[0], Temp, WNDSIZ + MAXMATCH);
FreePool (Temp);
- LoopVar8 = FreadCrc (&mText[WNDSIZ + MAXMATCH], WNDSIZ);
+ LoopVar8 = FreadCrc (&mText[WNDSIZ + MAXMATCH], WNDSIZ);
mRemainder += LoopVar8;
- mPos = WNDSIZ;
+ mPos = WNDSIZ;
}
DeleteNode ();
@@ -630,12 +631,12 @@ GetNextMatch (
**/
VOID
DownHeap (
- IN INT32 i
+ IN INT32 i
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
- INT32 LoopVar2;
+ INT32 LoopVar2;
//
// priority queue: send i-th entry down heap
@@ -643,7 +644,7 @@ DownHeap (
LoopVar2 = mHeap[i];
LoopVar1 = 2 * i;
while (LoopVar1 <= mHeapSize) {
- if (LoopVar1 < mHeapSize && mFreq[mHeap[LoopVar1]] > mFreq[mHeap[LoopVar1 + 1]]) {
+ if ((LoopVar1 < mHeapSize) && (mFreq[mHeap[LoopVar1]] > mFreq[mHeap[LoopVar1 + 1]])) {
LoopVar1++;
}
@@ -651,12 +652,12 @@ DownHeap (
break;
}
- mHeap[i] = mHeap[LoopVar1];
- i = LoopVar1;
- LoopVar1 = 2 * i;
+ mHeap[i] = mHeap[LoopVar1];
+ i = LoopVar1;
+ LoopVar1 = 2 * i;
}
- mHeap[i] = (INT16) LoopVar2;
+ mHeap[i] = (INT16)LoopVar2;
}
/**
@@ -666,7 +667,7 @@ DownHeap (
**/
VOID
CountLen (
- IN INT32 LoopVar1
+ IN INT32 LoopVar1
)
{
if (LoopVar1 < mTempInt32) {
@@ -686,10 +687,10 @@ CountLen (
**/
VOID
MakeLen (
- IN INT32 Root
+ IN INT32 Root
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
INT32 LoopVar2;
UINT32 Cum;
@@ -726,7 +727,7 @@ MakeLen (
LoopVar2 = mLenCnt[LoopVar1];
LoopVar2--;
while (LoopVar2 >= 0) {
- mLen[*mSortPtr++] = (UINT8) LoopVar1;
+ mLen[*mSortPtr++] = (UINT8)LoopVar1;
LoopVar2--;
}
}
@@ -741,9 +742,9 @@ MakeLen (
**/
VOID
MakeCode (
- IN INT32 LoopVar8,
- IN UINT8 Len[ ],
- OUT UINT16 Code[ ]
+ IN INT32 LoopVar8,
+ IN UINT8 Len[],
+ OUT UINT16 Code[]
)
{
INT32 LoopVar1;
@@ -751,7 +752,7 @@ MakeCode (
Start[1] = 0;
for (LoopVar1 = 1; LoopVar1 <= 16; LoopVar1++) {
- Start[LoopVar1 + 1] = (UINT16) ((Start[LoopVar1] + mLenCnt[LoopVar1]) << 1);
+ Start[LoopVar1 + 1] = (UINT16)((Start[LoopVar1] + mLenCnt[LoopVar1]) << 1);
}
for (LoopVar1 = 0; LoopVar1 < LoopVar8; LoopVar1++) {
@@ -771,34 +772,34 @@ MakeCode (
**/
INT32
MakeTree (
- IN INT32 NParm,
- IN UINT16 FreqParm[ ],
- OUT UINT8 LenParm[ ],
- OUT UINT16 CodeParm[ ]
+ IN INT32 NParm,
+ IN UINT16 FreqParm[],
+ OUT UINT8 LenParm[],
+ OUT UINT16 CodeParm[]
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
- INT32 LoopVar2;
+ INT32 LoopVar2;
- INT32 LoopVar3;
+ INT32 LoopVar3;
- INT32 Avail;
+ INT32 Avail;
//
// make tree, calculate len[], return root
//
- mTempInt32 = NParm;
- mFreq = FreqParm;
- mLen = LenParm;
- Avail = mTempInt32;
- mHeapSize = 0;
- mHeap[1] = 0;
+ mTempInt32 = NParm;
+ mFreq = FreqParm;
+ mLen = LenParm;
+ Avail = mTempInt32;
+ mHeapSize = 0;
+ mHeap[1] = 0;
for (LoopVar1 = 0; LoopVar1 < mTempInt32; LoopVar1++) {
mLen[LoopVar1] = 0;
if ((mFreq[LoopVar1]) != 0) {
mHeapSize++;
- mHeap[mHeapSize] = (INT16) LoopVar1;
+ mHeap[mHeapSize] = (INT16)LoopVar1;
}
}
@@ -818,22 +819,22 @@ MakeTree (
do {
LoopVar1 = mHeap[1];
if (LoopVar1 < mTempInt32) {
- *mSortPtr++ = (UINT16) LoopVar1;
+ *mSortPtr++ = (UINT16)LoopVar1;
}
mHeap[1] = mHeap[mHeapSize--];
DownHeap (1);
LoopVar2 = mHeap[1];
if (LoopVar2 < mTempInt32) {
- *mSortPtr++ = (UINT16) LoopVar2;
+ *mSortPtr++ = (UINT16)LoopVar2;
}
- LoopVar3 = Avail++;
- mFreq[LoopVar3] = (UINT16) (mFreq[LoopVar1] + mFreq[LoopVar2]);
- mHeap[1] = (INT16) LoopVar3;
+ LoopVar3 = Avail++;
+ mFreq[LoopVar3] = (UINT16)(mFreq[LoopVar1] + mFreq[LoopVar2]);
+ mHeap[1] = (INT16)LoopVar3;
DownHeap (1);
- mLeft[LoopVar3] = (UINT16) LoopVar1;
- mRight[LoopVar3] = (UINT16) LoopVar2;
+ mLeft[LoopVar3] = (UINT16)LoopVar1;
+ mRight[LoopVar3] = (UINT16)LoopVar2;
} while (mHeapSize > 1);
mSortPtr = CodeParm;
@@ -854,30 +855,30 @@ MakeTree (
**/
VOID
PutBits (
- IN INT32 LoopVar8,
- IN UINT32 x
+ IN INT32 LoopVar8,
+ IN UINT32 x
)
{
- UINT8 Temp;
+ UINT8 Temp;
if (LoopVar8 < mBitCount) {
mSubBitBuf |= x << (mBitCount -= LoopVar8);
} else {
-
Temp = (UINT8)(mSubBitBuf | (x >> (LoopVar8 -= mBitCount)));
if (mDst < mDstUpperLimit) {
*mDst++ = Temp;
}
+
mCompSize++;
if (LoopVar8 < UINT8_BIT) {
mSubBitBuf = x << (mBitCount = UINT8_BIT - LoopVar8);
} else {
-
Temp = (UINT8)(x >> (LoopVar8 - UINT8_BIT));
if (mDst < mDstUpperLimit) {
*mDst++ = Temp;
}
+
mCompSize++;
mSubBitBuf = x << (mBitCount = 2 * UINT8_BIT - LoopVar8);
@@ -892,7 +893,7 @@ PutBits (
**/
VOID
EncodeC (
- IN INT32 LoopVar5
+ IN INT32 LoopVar5
)
{
PutBits (mCLen[LoopVar5], mCCode[LoopVar5]);
@@ -905,7 +906,7 @@ EncodeC (
**/
VOID
EncodeP (
- IN UINT32 LoopVar7
+ IN UINT32 LoopVar7
)
{
UINT32 LoopVar5;
@@ -921,7 +922,7 @@ EncodeP (
PutBits (mPTLen[LoopVar5], mPTCode[LoopVar5]);
if (LoopVar5 > 1) {
- PutBits(LoopVar5 - 1, LoopVar7 & (0xFFFFU >> (17 - LoopVar5)));
+ PutBits (LoopVar5 - 1, LoopVar7 & (0xFFFFU >> (17 - LoopVar5)));
}
}
@@ -934,13 +935,13 @@ CountTFreq (
VOID
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
- INT32 LoopVar3;
+ INT32 LoopVar3;
- INT32 LoopVar8;
+ INT32 LoopVar8;
- INT32 Count;
+ INT32 Count;
for (LoopVar1 = 0; LoopVar1 < NT; LoopVar1++) {
mTFreq[LoopVar1] = 0;
@@ -962,7 +963,7 @@ CountTFreq (
}
if (Count <= 2) {
- mTFreq[0] = (UINT16) (mTFreq[0] + Count);
+ mTFreq[0] = (UINT16)(mTFreq[0] + Count);
} else if (Count <= 18) {
mTFreq[1]++;
} else if (Count == 19) {
@@ -972,7 +973,7 @@ CountTFreq (
mTFreq[2]++;
}
} else {
- ASSERT((LoopVar3+2)<(2 * NT - 1));
+ ASSERT ((LoopVar3+2) < (2 * NT - 1));
mTFreq[LoopVar3 + 2]++;
}
}
@@ -988,14 +989,14 @@ CountTFreq (
**/
VOID
WritePTLen (
- IN INT32 LoopVar8,
- IN INT32 nbit,
- IN INT32 Special
+ IN INT32 LoopVar8,
+ IN INT32 nbit,
+ IN INT32 Special
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
- INT32 LoopVar3;
+ INT32 LoopVar3;
while (LoopVar8 > 0 && mPTLen[LoopVar8 - 1] == 0) {
LoopVar8--;
@@ -1029,13 +1030,13 @@ WriteCLen (
VOID
)
{
- INT32 LoopVar1;
+ INT32 LoopVar1;
- INT32 LoopVar3;
+ INT32 LoopVar3;
- INT32 LoopVar8;
+ INT32 LoopVar8;
- INT32 Count;
+ INT32 Count;
LoopVar8 = NC;
while (LoopVar8 > 0 && mCLen[LoopVar8 - 1] == 0) {
@@ -1069,7 +1070,7 @@ WriteCLen (
PutBits (CBIT, Count - 20);
}
} else {
- ASSERT((LoopVar3+2)<NPT);
+ ASSERT ((LoopVar3+2) < NPT);
PutBits (mPTLen[LoopVar3 + 2], mPTCode[LoopVar3 + 2]);
}
}
@@ -1095,10 +1096,11 @@ SendBlock (
UINT32 Pos;
UINT32 Size;
+
Flags = 0;
- Root = MakeTree (NC, mCFreq, mCLen, mCCode);
- Size = mCFreq[Root];
+ Root = MakeTree (NC, mCFreq, mCLen, mCCode);
+ Size = mCFreq[Root];
PutBits (16, Size);
if (Root >= NC) {
CountTFreq ();
@@ -1133,9 +1135,10 @@ SendBlock (
} else {
Flags <<= 1;
}
- if ((Flags & (1U << (UINT8_BIT - 1))) != 0){
- EncodeC(mBuf[Pos++] + (1U << UINT8_BIT));
- LoopVar3 = mBuf[Pos++] << UINT8_BIT;
+
+ if ((Flags & (1U << (UINT8_BIT - 1))) != 0) {
+ EncodeC (mBuf[Pos++] + (1U << UINT8_BIT));
+ LoopVar3 = mBuf[Pos++] << UINT8_BIT;
LoopVar3 += mBuf[Pos++];
EncodeP (LoopVar3);
@@ -1162,8 +1165,8 @@ HufEncodeStart (
mOutputPos = mOutputMask = 0;
- mBitCount = UINT8_BIT;
- mSubBitBuf = 0;
+ mBitCount = UINT8_BIT;
+ mSubBitBuf = 0;
}
/**
@@ -1175,11 +1178,11 @@ HufEncodeStart (
**/
VOID
CompressOutput (
- IN UINT32 LoopVar5,
- IN UINT32 LoopVar7
+ IN UINT32 LoopVar5,
+ IN UINT32 LoopVar7
)
{
- STATIC UINT32 CPos;
+ STATIC UINT32 CPos;
if ((mOutputMask >>= 1) == 0) {
mOutputMask = 1U << (UINT8_BIT - 1);
@@ -1188,20 +1191,22 @@ CompressOutput (
mOutputPos = 0;
}
- CPos = mOutputPos++;
- mBuf[CPos] = 0;
+ CPos = mOutputPos++;
+ mBuf[CPos] = 0;
}
- mBuf[mOutputPos++] = (UINT8) LoopVar5;
+
+ mBuf[mOutputPos++] = (UINT8)LoopVar5;
mCFreq[LoopVar5]++;
if (LoopVar5 >= (1U << UINT8_BIT)) {
- mBuf[CPos] = (UINT8)(mBuf[CPos]|mOutputMask);
+ mBuf[CPos] = (UINT8)(mBuf[CPos]|mOutputMask);
mBuf[mOutputPos++] = (UINT8)(LoopVar7 >> UINT8_BIT);
- mBuf[mOutputPos++] = (UINT8) LoopVar7;
- LoopVar5 = 0;
- while (LoopVar7!=0) {
+ mBuf[mOutputPos++] = (UINT8)LoopVar7;
+ LoopVar5 = 0;
+ while (LoopVar7 != 0) {
LoopVar7 >>= 1;
LoopVar5++;
}
+
mPFreq[LoopVar5]++;
}
}
@@ -1248,43 +1253,47 @@ Encode (
HufEncodeStart ();
- mRemainder = FreadCrc (&mText[WNDSIZ], WNDSIZ + MAXMATCH);
+ mRemainder = FreadCrc (&mText[WNDSIZ], WNDSIZ + MAXMATCH);
- mMatchLen = 0;
- mPos = WNDSIZ;
+ mMatchLen = 0;
+ mPos = WNDSIZ;
InsertNode ();
if (mMatchLen > mRemainder) {
mMatchLen = mRemainder;
}
while (mRemainder > 0) {
- LastMatchLen = mMatchLen;
- LastMatchPos = mMatchPos;
+ LastMatchLen = mMatchLen;
+ LastMatchPos = mMatchPos;
if (!GetNextMatch ()) {
Status = EFI_OUT_OF_RESOURCES;
}
+
if (mMatchLen > mRemainder) {
mMatchLen = mRemainder;
}
- if (mMatchLen > LastMatchLen || LastMatchLen < THRESHOLD) {
+ if ((mMatchLen > LastMatchLen) || (LastMatchLen < THRESHOLD)) {
//
// Not enough benefits are gained by outputting a pointer,
// so just output the original character
//
- CompressOutput(mText[mPos - 1], 0);
+ CompressOutput (mText[mPos - 1], 0);
} else {
//
// Outputting a pointer is beneficial enough, do it.
//
- CompressOutput(LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
- (mPos - LastMatchPos - 2) & (WNDSIZ - 1));
+ CompressOutput (
+ LastMatchLen + (UINT8_MAX + 1 - THRESHOLD),
+ (mPos - LastMatchPos - 2) & (WNDSIZ - 1)
+ );
LastMatchLen--;
while (LastMatchLen > 0) {
if (!GetNextMatch ()) {
Status = EFI_OUT_OF_RESOURCES;
}
+
LastMatchLen--;
}
@@ -1324,28 +1333,28 @@ Compress (
//
// Initializations
//
- mBufSiz = 0;
- mBuf = NULL;
- mText = NULL;
- mLevel = NULL;
- mChildCount = NULL;
- mPosition = NULL;
- mParent = NULL;
- mPrev = NULL;
- mNext = NULL;
-
- mSrc = SrcBuffer;
- mSrcUpperLimit = mSrc + SrcSize;
- mDst = DstBuffer;
- mDstUpperLimit = mDst +*DstSize;
+ mBufSiz = 0;
+ mBuf = NULL;
+ mText = NULL;
+ mLevel = NULL;
+ mChildCount = NULL;
+ mPosition = NULL;
+ mParent = NULL;
+ mPrev = NULL;
+ mNext = NULL;
+
+ mSrc = SrcBuffer;
+ mSrcUpperLimit = mSrc + SrcSize;
+ mDst = DstBuffer;
+ mDstUpperLimit = mDst +*DstSize;
PutDword (0L);
PutDword (0L);
MakeCrcTable ();
- mOrigSize = mCompSize = 0;
- mCrc = INIT_CRC;
+ mOrigSize = mCompSize = 0;
+ mCrc = INIT_CRC;
//
// Compress it
@@ -1354,12 +1363,14 @@ Compress (
if (EFI_ERROR (Status)) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// Null terminate the compressed data
//
if (mDst < mDstUpperLimit) {
*mDst++ = 0;
}
+
//
// Fill in compressed size and original size
//
@@ -1377,6 +1388,4 @@ Compress (
*DstSize = mCompSize + 1 + 8;
return EFI_SUCCESS;
}
-
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h
index d38b155cf4..dad3201c60 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h
@@ -30,4 +30,3 @@ Compress (
);
#endif
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c
index 143ea7f154..97a4b57a93 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c
@@ -20,49 +20,49 @@
@retval SHELL_SUCCESS The display was successful.
**/
SHELL_STATUS
-DisplayTheBlocks(
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath,
- IN CONST UINT64 Lba,
- IN CONST UINT8 BlockCount
+DisplayTheBlocks (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevPath,
+ IN CONST UINT64 Lba,
+ IN CONST UINT8 BlockCount
)
{
- EFI_BLOCK_IO_PROTOCOL *BlockIo;
- EFI_HANDLE BlockIoHandle;
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- UINT8 *Buffer;
- UINT8 *OriginalBuffer;
- UINTN BufferSize;
+ EFI_BLOCK_IO_PROTOCOL *BlockIo;
+ EFI_HANDLE BlockIoHandle;
+ EFI_STATUS Status;
+ SHELL_STATUS ShellStatus;
+ UINT8 *Buffer;
+ UINT8 *OriginalBuffer;
+ UINTN BufferSize;
ShellStatus = SHELL_SUCCESS;
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **)&DevPath, &BlockIoHandle);
- if (EFI_ERROR(Status)) {
+ Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **)&DevPath, &BlockIoHandle);
+ if (EFI_ERROR (Status)) {
return (SHELL_NOT_FOUND);
}
- Status = gBS->OpenProtocol(BlockIoHandle, &gEfiBlockIoProtocolGuid, (VOID**)&BlockIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(Status)) {
+ Status = gBS->OpenProtocol (BlockIoHandle, &gEfiBlockIoProtocolGuid, (VOID **)&BlockIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+ if (EFI_ERROR (Status)) {
return (SHELL_NOT_FOUND);
}
BufferSize = BlockIo->Media->BlockSize * BlockCount;
- if(BlockIo->Media->IoAlign == 0) {
+ if (BlockIo->Media->IoAlign == 0) {
BlockIo->Media->IoAlign = 1;
}
if (BufferSize > 0) {
- OriginalBuffer = AllocateZeroPool(BufferSize + BlockIo->Media->IoAlign);
- Buffer = ALIGN_POINTER (OriginalBuffer,BlockIo->Media->IoAlign);
+ OriginalBuffer = AllocateZeroPool (BufferSize + BlockIo->Media->IoAlign);
+ Buffer = ALIGN_POINTER (OriginalBuffer, BlockIo->Media->IoAlign);
} else {
- ShellPrintEx(-1,-1,L" BlockSize: 0x%08x, BlockCount: 0x%08x\r\n", BlockIo->Media->BlockSize, BlockCount);
+ ShellPrintEx (-1, -1, L" BlockSize: 0x%08x, BlockCount: 0x%08x\r\n", BlockIo->Media->BlockSize, BlockCount);
OriginalBuffer = NULL;
Buffer = NULL;
}
- Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer);
- if (!EFI_ERROR(Status) && Buffer != NULL) {
- ShellPrintHiiEx(
+ Status = BlockIo->ReadBlocks (BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer);
+ if (!EFI_ERROR (Status) && (Buffer != NULL)) {
+ ShellPrintHiiEx (
-1,
-1,
NULL,
@@ -73,9 +73,9 @@ DisplayTheBlocks(
BlockIo
);
- DumpHex(2,0,BufferSize,Buffer);
+ DumpHex (2, 0, BufferSize, Buffer);
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo");
ShellStatus = SHELL_DEVICE_ERROR;
}
@@ -83,7 +83,7 @@ DisplayTheBlocks(
FreePool (OriginalBuffer);
}
- gBS->CloseProtocol(BlockIoHandle, &gEfiBlockIoProtocolGuid, gImageHandle, NULL);
+ gBS->CloseProtocol (BlockIoHandle, &gEfiBlockIoProtocolGuid, gImageHandle, NULL);
return (ShellStatus);
}
@@ -111,67 +111,69 @@ ShellCommandRunDblk (
UINT64 BlockCount;
EFI_DEVICE_PATH_PROTOCOL *DevPath;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk");
+ if (ShellCommandLineGetCount (Package) > 4) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk");
+ } else if (ShellCommandLineGetCount (Package) < 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
//
// Parse the params
//
- BlockName = ShellCommandLineGetRawValue(Package, 1);
- LbaString = ShellCommandLineGetRawValue(Package, 2);
- BlockCountString = ShellCommandLineGetRawValue(Package, 3);
+ BlockName = ShellCommandLineGetRawValue (Package, 1);
+ LbaString = ShellCommandLineGetRawValue (Package, 2);
+ BlockCountString = ShellCommandLineGetRawValue (Package, 3);
if (LbaString == NULL) {
Lba = 0;
} else {
- if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString);
+ if (!ShellIsHexOrDecimalNumber (LbaString, TRUE, FALSE)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE);
+
+ ShellConvertStringToUint64 (LbaString, &Lba, TRUE, FALSE);
}
if (BlockCountString == NULL) {
BlockCount = 1;
} else {
- if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
+ if (!ShellIsHexOrDecimalNumber (BlockCountString, TRUE, FALSE)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE);
+
+ ShellConvertStringToUint64 (BlockCountString, &BlockCount, TRUE, FALSE);
if (BlockCount > 0x10) {
BlockCount = 0x10;
} else if (BlockCount == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
@@ -180,16 +182,16 @@ ShellCommandRunDblk (
//
// do the work if we have a valid block identifier
//
- if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName);
+ if (gEfiShellProtocol->GetDevicePathFromMap (BlockName) == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName);
- if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo");
+ DevPath = (EFI_DEVICE_PATH_PROTOCOL *)gEfiShellProtocol->GetDevicePathFromMap (BlockName);
+ if (gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount);
+ ShellStatus = DisplayTheBlocks (gEfiShellProtocol->GetDevicePathFromMap (BlockName), Lba, (UINT8)BlockCount);
}
}
}
@@ -197,5 +199,6 @@ ShellCommandRunDblk (
ShellCommandLineFreeVarList (Package);
}
+
return (ShellStatus);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
index e6aec2e37c..c52c212a56 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
@@ -24,13 +24,14 @@
@return A printable character representing Char.
**/
CHAR16
-MakePrintable(
- IN CONST CHAR16 Char
+MakePrintable (
+ IN CONST CHAR16 Char
)
{
- if ((Char < 0x20 && Char > 0)||(Char > 126)) {
+ if (((Char < 0x20) && (Char > 0)) || (Char > 126)) {
return (L'?');
}
+
return (Char);
}
@@ -41,45 +42,46 @@ MakePrintable(
@param[in] Size The length of memory to display.
**/
SHELL_STATUS
-DisplayMmioMemory(
+DisplayMmioMemory (
IN CONST VOID *Address,
IN CONST UINTN Size
)
{
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRbIo;
- EFI_STATUS Status;
- VOID *Buffer;
- SHELL_STATUS ShellStatus;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRbIo;
+ EFI_STATUS Status;
+ VOID *Buffer;
+ SHELL_STATUS ShellStatus;
ShellStatus = SHELL_SUCCESS;
- Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem");
+ Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID **)&PciRbIo);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem");
return (SHELL_NOT_FOUND);
}
- Buffer = AllocateZeroPool(Size);
+
+ Buffer = AllocateZeroPool (Size);
if (Buffer == NULL) {
return SHELL_OUT_OF_RESOURCES;
}
- Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");
+ Status = PciRbIo->Mem.Read (PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");
ShellStatus = SHELL_NOT_FOUND;
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
- DumpHex(2, (UINTN)Address, Size, Buffer);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
+ DumpHex (2, (UINTN)Address, Size, Buffer);
}
- FreePool(Buffer);
+ FreePool (Buffer);
return (ShellStatus);
}
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-mmio", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-mmio", TypeFlag },
+ { NULL, TypeMax }
+};
/**
Function for 'dmem' command.
@@ -94,66 +96,67 @@ ShellCommandRunDmem (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- VOID *Address;
- UINT64 Size;
- CONST CHAR16 *Temp1;
- UINT64 AcpiTableAddress;
- UINT64 Acpi20TableAddress;
- UINT64 SalTableAddress;
- UINT64 SmbiosTableAddress;
- UINT64 MpsTableAddress;
- UINTN TableWalker;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Address = NULL;
- Size = 0;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ VOID *Address;
+ UINT64 Size;
+ CONST CHAR16 *Temp1;
+ UINT64 AcpiTableAddress;
+ UINT64 Acpi20TableAddress;
+ UINT64 SalTableAddress;
+ UINT64 SmbiosTableAddress;
+ UINT64 MpsTableAddress;
+ UINTN TableWalker;
+
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ Address = NULL;
+ Size = 0;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem");
+ if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Temp1 = ShellCommandLineGetRawValue(Package, 1);
+ Temp1 = ShellCommandLineGetRawValue (Package, 1);
if (Temp1 == NULL) {
Address = gST;
Size = sizeof (*gST);
} else {
- if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
+ if (!ShellIsHexOrDecimalNumber (Temp1, TRUE, FALSE) || EFI_ERROR (ShellConvertStringToUint64 (Temp1, (UINT64 *)&Address, TRUE, FALSE))) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- Temp1 = ShellCommandLineGetRawValue(Package, 2);
+
+ Temp1 = ShellCommandLineGetRawValue (Package, 2);
if (Temp1 == NULL) {
Size = 512;
} else {
- if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
+ if (!ShellIsHexOrDecimalNumber (Temp1, FALSE, FALSE) || EFI_ERROR (ShellConvertStringToUint64 (Temp1, &Size, TRUE, FALSE))) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
@@ -161,39 +164,48 @@ ShellCommandRunDmem (
}
if (ShellStatus == SHELL_SUCCESS) {
- if (!ShellCommandLineGetFlag(Package, L"-mmio")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
- DumpHex(2, (UINTN)Address, (UINTN)Size, Address);
- if (Address == (VOID*)gST) {
- Acpi20TableAddress = 0;
- AcpiTableAddress = 0;
- SalTableAddress = 0;
- SmbiosTableAddress = 0;
- MpsTableAddress = 0;
- for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) {
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
+ if (!ShellCommandLineGetFlag (Package, L"-mmio")) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
+ DumpHex (2, (UINTN)Address, (UINTN)Size, Address);
+ if (Address == (VOID *)gST) {
+ Acpi20TableAddress = 0;
+ AcpiTableAddress = 0;
+ SalTableAddress = 0;
+ SmbiosTableAddress = 0;
+ MpsTableAddress = 0;
+ for (TableWalker = 0; TableWalker < gST->NumberOfTableEntries; TableWalker++) {
+ if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
Acpi20TableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
}
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
+
+ if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
}
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
+
+ if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
}
+
if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbios3TableGuid)) {
- SmbiosTableAddress = (UINT64) (UINTN) gST->ConfigurationTable[TableWalker].VendorTable;
+ SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
}
- if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
+
+ if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
MpsTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
}
}
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMEM_SYSTEM_TABLE),
+ gShellDebug1HiiHandle,
(UINT64)(UINTN)Address,
gST->Hdr.HeaderSize,
gST->Hdr.Revision,
@@ -210,11 +222,10 @@ ShellCommandRunDmem (
);
}
} else {
- ShellStatus = DisplayMmioMemory(Address, (UINTN)Size);
+ ShellStatus = DisplayMmioMemory (Address, (UINTN)Size);
}
}
-
ShellCommandLineFreeVarList (Package);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
index 105ebfbeae..975db0a620 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -17,13 +17,13 @@ typedef enum {
} DMP_STORE_TYPE;
typedef struct {
- UINT32 Signature;
- CHAR16 *Name;
- EFI_GUID Guid;
- UINT32 Attributes;
- UINT32 DataSize;
- UINT8 *Data;
- LIST_ENTRY Link;
+ UINT32 Signature;
+ CHAR16 *Name;
+ EFI_GUID Guid;
+ UINT32 Attributes;
+ UINT32 DataSize;
+ UINT8 *Data;
+ LIST_ENTRY Link;
} DMP_STORE_VARIABLE;
#define DMP_STORE_VARIABLE_SIGNATURE SIGNATURE_32 ('_', 'd', 's', 's')
@@ -37,39 +37,43 @@ typedef struct {
**/
CHAR16 *
GetAttrType (
- IN CONST UINT32 Atts
+ IN CONST UINT32 Atts
)
{
- UINTN BufLen;
- CHAR16 *RetString;
+ UINTN BufLen;
+ CHAR16 *RetString;
- BufLen = 0;
- RetString = NULL;
+ BufLen = 0;
+ RetString = NULL;
if ((Atts & EFI_VARIABLE_NON_VOLATILE) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+NV", 0);
}
+
if ((Atts & EFI_VARIABLE_RUNTIME_ACCESS) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+RT+BS", 0);
} else if ((Atts & EFI_VARIABLE_BOOTSERVICE_ACCESS) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+BS", 0);
}
+
if ((Atts & EFI_VARIABLE_HARDWARE_ERROR_RECORD) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+HR", 0);
}
+
if ((Atts & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+AW", 0);
}
+
if ((Atts & EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+AT", 0);
}
if (RetString == NULL) {
- RetString = StrnCatGrow(&RetString, &BufLen, L"Invalid", 0);
+ RetString = StrnCatGrow (&RetString, &BufLen, L"Invalid", 0);
}
if ((RetString != NULL) && (RetString[0] == L'+')) {
- CopyMem(RetString, RetString + 1, StrSize(RetString + 1));
+ CopyMem (RetString, RetString + 1, StrSize (RetString + 1));
}
return RetString;
@@ -85,7 +89,7 @@ GetAttrType (
@return The hex format string.
**/
-CHAR16*
+CHAR16 *
BinaryToHexString (
IN VOID *Buffer,
IN UINTN BufferSize,
@@ -93,8 +97,8 @@ BinaryToHexString (
IN UINTN HexStringSize
)
{
- UINTN Index;
- UINTN StringIndex;
+ UINTN Index;
+ UINTN StringIndex;
ASSERT (Buffer != NULL);
ASSERT ((BufferSize * 2 + 1) * sizeof (CHAR16) <= HexStringSize);
@@ -105,9 +109,10 @@ BinaryToHexString (
&HexString[StringIndex],
HexStringSize - StringIndex * sizeof (CHAR16),
L"%02x",
- ((UINT8 *) Buffer)[Index]
+ ((UINT8 *)Buffer)[Index]
);
}
+
return HexString;
}
@@ -126,26 +131,26 @@ BinaryToHexString (
**/
SHELL_STATUS
LoadVariablesFromFile (
- IN SHELL_FILE_HANDLE FileHandle,
- IN CONST CHAR16 *Name,
- IN CONST EFI_GUID *Guid,
- OUT BOOLEAN *Found
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST CHAR16 *Name,
+ IN CONST EFI_GUID *Guid,
+ OUT BOOLEAN *Found
)
{
- EFI_STATUS Status;
- SHELL_STATUS ShellStatus;
- UINT32 NameSize;
- UINT32 DataSize;
- UINTN BufferSize;
- UINTN RemainingSize;
- UINT64 Position;
- UINT64 FileSize;
- LIST_ENTRY List;
- DMP_STORE_VARIABLE *Variable;
- LIST_ENTRY *Link;
- CHAR16 *Attributes;
- UINT8 *Buffer;
- UINT32 Crc32;
+ EFI_STATUS Status;
+ SHELL_STATUS ShellStatus;
+ UINT32 NameSize;
+ UINT32 DataSize;
+ UINTN BufferSize;
+ UINTN RemainingSize;
+ UINT64 Position;
+ UINT64 FileSize;
+ LIST_ENTRY List;
+ DMP_STORE_VARIABLE *Variable;
+ LIST_ENTRY *Link;
+ CHAR16 *Attributes;
+ UINT8 *Buffer;
+ UINT32 Crc32;
Status = ShellGetFileSize (FileHandle, &FileSize);
if (EFI_ERROR (Status)) {
@@ -162,7 +167,7 @@ LoadVariablesFromFile (
// NameSize
//
BufferSize = sizeof (NameSize);
- Status = ShellReadFile (FileHandle, &BufferSize, &NameSize);
+ Status = ShellReadFile (FileHandle, &BufferSize, &NameSize);
if (EFI_ERROR (Status) || (BufferSize != sizeof (NameSize))) {
ShellStatus = SHELL_VOLUME_CORRUPTED;
break;
@@ -172,7 +177,7 @@ LoadVariablesFromFile (
// DataSize
//
BufferSize = sizeof (DataSize);
- Status = ShellReadFile (FileHandle, &BufferSize, &DataSize);
+ Status = ShellReadFile (FileHandle, &BufferSize, &DataSize);
if (EFI_ERROR (Status) || (BufferSize != sizeof (DataSize))) {
ShellStatus = SHELL_VOLUME_CORRUPTED;
break;
@@ -188,8 +193,9 @@ LoadVariablesFromFile (
ShellStatus = SHELL_OUT_OF_RESOURCES;
break;
}
- BufferSize = RemainingSize;
- Status = ShellReadFile (FileHandle, &BufferSize, (UINT32 *) Buffer + 2);
+
+ BufferSize = RemainingSize;
+ Status = ShellReadFile (FileHandle, &BufferSize, (UINT32 *)Buffer + 2);
if (EFI_ERROR (Status) || (BufferSize != RemainingSize)) {
ShellStatus = SHELL_VOLUME_CORRUPTED;
FreePool (Buffer);
@@ -199,15 +205,15 @@ LoadVariablesFromFile (
//
// Check Crc32
//
- * (UINT32 *) Buffer = NameSize;
- * ((UINT32 *) Buffer + 1) = DataSize;
- BufferSize = RemainingSize + sizeof (NameSize) + sizeof (DataSize) - sizeof (Crc32);
+ *(UINT32 *)Buffer = NameSize;
+ *((UINT32 *)Buffer + 1) = DataSize;
+ BufferSize = RemainingSize + sizeof (NameSize) + sizeof (DataSize) - sizeof (Crc32);
gBS->CalculateCrc32 (
Buffer,
BufferSize,
&Crc32
);
- if (Crc32 != * (UINT32 *) (Buffer + BufferSize)) {
+ if (Crc32 != *(UINT32 *)(Buffer + BufferSize)) {
FreePool (Buffer);
ShellStatus = SHELL_VOLUME_CORRUPTED;
break;
@@ -221,41 +227,51 @@ LoadVariablesFromFile (
ShellStatus = SHELL_OUT_OF_RESOURCES;
break;
}
+
Variable->Signature = DMP_STORE_VARIABLE_SIGNATURE;
- Variable->Name = (CHAR16 *) (Variable + 1);
+ Variable->Name = (CHAR16 *)(Variable + 1);
Variable->DataSize = DataSize;
- Variable->Data = (UINT8 *) Variable->Name + NameSize;
- CopyMem (Variable->Name, Buffer + sizeof (NameSize) + sizeof (DataSize), NameSize);
- CopyMem (&Variable->Guid, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize, sizeof (EFI_GUID));
- CopyMem (&Variable->Attributes, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID), sizeof (UINT32));
- CopyMem (Variable->Data, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID) + sizeof (UINT32), DataSize);
+ Variable->Data = (UINT8 *)Variable->Name + NameSize;
+ CopyMem (Variable->Name, Buffer + sizeof (NameSize) + sizeof (DataSize), NameSize);
+ CopyMem (&Variable->Guid, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize, sizeof (EFI_GUID));
+ CopyMem (&Variable->Attributes, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID), sizeof (UINT32));
+ CopyMem (Variable->Data, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID) + sizeof (UINT32), DataSize);
InsertTailList (&List, &Variable->Link);
FreePool (Buffer);
}
if ((Position != FileSize) || (ShellStatus != SHELL_SUCCESS)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore");
if (Position != FileSize) {
ShellStatus = SHELL_VOLUME_CORRUPTED;
}
}
for ( Link = GetFirstNode (&List)
- ; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS)
- ; Link = GetNextNode (&List, Link)
- ) {
+ ; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS)
+ ; Link = GetNextNode (&List, Link)
+ )
+ {
Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE);
- if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *) Name)) &&
+ if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *)Name)) &&
((Guid == NULL) || CompareGuid (&Variable->Guid, Guid))
- ) {
+ )
+ {
Attributes = GetAttrType (Variable->Attributes);
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN(STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
- Attributes, &Variable->Guid, Variable->Name, Variable->DataSize
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_HEADER_LINE),
+ gShellDebug1HiiHandle,
+ Attributes,
+ &Variable->Guid,
+ Variable->Name,
+ Variable->DataSize
);
- SHELL_FREE_NON_NULL(Attributes);
+ SHELL_FREE_NON_NULL (Attributes);
*Found = TRUE;
Status = gRT->SetVariable (
@@ -266,14 +282,14 @@ LoadVariablesFromFile (
Variable->Data
);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status);
}
}
}
for (Link = GetFirstNode (&List); !IsNull (&List, Link); ) {
Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE);
- Link = RemoveEntryList (&Variable->Link);
+ Link = RemoveEntryList (&Variable->Link);
FreePool (Variable);
}
@@ -296,26 +312,26 @@ LoadVariablesFromFile (
**/
EFI_STATUS
AppendSingleVariableToFile (
- IN SHELL_FILE_HANDLE FileHandle,
- IN CONST CHAR16 *Name,
- IN CONST EFI_GUID *Guid,
- IN UINT32 Attributes,
- IN UINT32 DataSize,
- IN CONST UINT8 *Data
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST CHAR16 *Name,
+ IN CONST EFI_GUID *Guid,
+ IN UINT32 Attributes,
+ IN UINT32 DataSize,
+ IN CONST UINT8 *Data
)
{
- UINT32 NameSize;
- UINT8 *Buffer;
- UINT8 *Ptr;
- UINTN BufferSize;
- EFI_STATUS Status;
+ UINT32 NameSize;
+ UINT8 *Buffer;
+ UINT8 *Ptr;
+ UINTN BufferSize;
+ EFI_STATUS Status;
- NameSize = (UINT32) StrSize (Name);
+ NameSize = (UINT32)StrSize (Name);
BufferSize = sizeof (NameSize) + sizeof (DataSize)
- + sizeof (*Guid)
- + sizeof (Attributes)
- + NameSize + DataSize
- + sizeof (UINT32);
+ + sizeof (*Guid)
+ + sizeof (Attributes)
+ + NameSize + DataSize
+ + sizeof (UINT32);
Buffer = AllocatePool (BufferSize);
if (Buffer == NULL) {
@@ -326,10 +342,10 @@ AppendSingleVariableToFile (
//
// NameSize and DataSize
//
- * (UINT32 *) Ptr = NameSize;
- Ptr += sizeof (NameSize);
- *(UINT32 *) Ptr = DataSize;
- Ptr += sizeof (DataSize);
+ *(UINT32 *)Ptr = NameSize;
+ Ptr += sizeof (NameSize);
+ *(UINT32 *)Ptr = DataSize;
+ Ptr += sizeof (DataSize);
//
// Name
@@ -346,8 +362,8 @@ AppendSingleVariableToFile (
//
// Attributes
//
- * (UINT32 *) Ptr = Attributes;
- Ptr += sizeof (Attributes);
+ *(UINT32 *)Ptr = Attributes;
+ Ptr += sizeof (Attributes);
//
// Data
@@ -358,14 +374,15 @@ AppendSingleVariableToFile (
//
// Crc32
//
- gBS->CalculateCrc32 (Buffer, (UINTN) Ptr - (UINTN) Buffer, (UINT32 *) Ptr);
+ gBS->CalculateCrc32 (Buffer, (UINTN)Ptr - (UINTN)Buffer, (UINT32 *)Ptr);
Status = ShellWriteFile (FileHandle, &BufferSize, Buffer);
FreePool (Buffer);
if (!EFI_ERROR (Status) &&
(BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize + sizeof (UINT32))
- ) {
+ )
+ {
Status = EFI_DEVICE_ERROR;
}
@@ -398,49 +415,49 @@ AppendSingleVariableToFile (
**/
SHELL_STATUS
CascadeProcessVariables (
- IN CONST CHAR16 *Name OPTIONAL,
- IN CONST EFI_GUID *Guid OPTIONAL,
- IN DMP_STORE_TYPE Type,
- IN EFI_FILE_PROTOCOL *FileHandle OPTIONAL,
- IN CONST CHAR16 * CONST PrevName,
- IN EFI_GUID FoundVarGuid,
- IN BOOLEAN *FoundOne,
- IN BOOLEAN StandardFormatOutput
+ IN CONST CHAR16 *Name OPTIONAL,
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN DMP_STORE_TYPE Type,
+ IN EFI_FILE_PROTOCOL *FileHandle OPTIONAL,
+ IN CONST CHAR16 *CONST PrevName,
+ IN EFI_GUID FoundVarGuid,
+ IN BOOLEAN *FoundOne,
+ IN BOOLEAN StandardFormatOutput
)
{
- EFI_STATUS Status;
- CHAR16 *FoundVarName;
- UINT8 *DataBuffer;
- UINTN DataSize;
- UINT32 Atts;
- SHELL_STATUS ShellStatus;
- UINTN NameSize;
- CHAR16 *AttrString;
- CHAR16 *HexString;
- EFI_STATUS SetStatus;
- CONST CHAR16 *GuidName;
-
- if (ShellGetExecutionBreakFlag()) {
+ EFI_STATUS Status;
+ CHAR16 *FoundVarName;
+ UINT8 *DataBuffer;
+ UINTN DataSize;
+ UINT32 Atts;
+ SHELL_STATUS ShellStatus;
+ UINTN NameSize;
+ CHAR16 *AttrString;
+ CHAR16 *HexString;
+ EFI_STATUS SetStatus;
+ CONST CHAR16 *GuidName;
+
+ if (ShellGetExecutionBreakFlag ()) {
return (SHELL_ABORTED);
}
- NameSize = 0;
- FoundVarName = NULL;
+ NameSize = 0;
+ FoundVarName = NULL;
- if (PrevName!=NULL) {
- StrnCatGrow(&FoundVarName, &NameSize, PrevName, 0);
+ if (PrevName != NULL) {
+ StrnCatGrow (&FoundVarName, &NameSize, PrevName, 0);
} else {
- FoundVarName = AllocateZeroPool(sizeof(CHAR16));
- NameSize = sizeof(CHAR16);
+ FoundVarName = AllocateZeroPool (sizeof (CHAR16));
+ NameSize = sizeof (CHAR16);
}
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
if (Status == EFI_BUFFER_TOO_SMALL) {
- SHELL_FREE_NON_NULL(FoundVarName);
+ SHELL_FREE_NON_NULL (FoundVarName);
FoundVarName = AllocateZeroPool (NameSize);
if (FoundVarName != NULL) {
if (PrevName != NULL) {
- StrnCpyS(FoundVarName, NameSize/sizeof(CHAR16), PrevName, NameSize/sizeof(CHAR16) - 1);
+ StrnCpyS (FoundVarName, NameSize/sizeof (CHAR16), PrevName, NameSize/sizeof (CHAR16) - 1);
}
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
@@ -453,10 +470,10 @@ CascadeProcessVariables (
// No more is fine.
//
if (Status == EFI_NOT_FOUND) {
- SHELL_FREE_NON_NULL(FoundVarName);
+ SHELL_FREE_NON_NULL (FoundVarName);
return (SHELL_SUCCESS);
- } else if (EFI_ERROR(Status)) {
- SHELL_FREE_NON_NULL(FoundVarName);
+ } else if (EFI_ERROR (Status)) {
+ SHELL_FREE_NON_NULL (FoundVarName);
return (SHELL_DEVICE_ERROR);
}
@@ -465,8 +482,8 @@ CascadeProcessVariables (
//
ShellStatus = CascadeProcessVariables (Name, Guid, Type, FileHandle, FoundVarName, FoundVarGuid, FoundOne, StandardFormatOutput);
- if (ShellGetExecutionBreakFlag() || (ShellStatus == SHELL_ABORTED)) {
- SHELL_FREE_NON_NULL(FoundVarName);
+ if (ShellGetExecutionBreakFlag () || (ShellStatus == SHELL_ABORTED)) {
+ SHELL_FREE_NON_NULL (FoundVarName);
return (SHELL_ABORTED);
}
@@ -474,18 +491,19 @@ CascadeProcessVariables (
// No matter what happened we process our own variable
// Only continue if Guid and VariableName are each either NULL or a match
//
- if ( ( Name == NULL
- || gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*) Name) )
- && ( Guid == NULL
- || CompareGuid(&FoundVarGuid, Guid) )
- ) {
- DataSize = 0;
- DataBuffer = NULL;
+ if ( ( (Name == NULL)
+ || gUnicodeCollation->MetaiMatch (gUnicodeCollation, FoundVarName, (CHAR16 *)Name))
+ && ( (Guid == NULL)
+ || CompareGuid (&FoundVarGuid, Guid))
+ )
+ {
+ DataSize = 0;
+ DataBuffer = NULL;
//
// do the print or delete
//
*FoundOne = TRUE;
- Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
+ Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
SHELL_FREE_NON_NULL (DataBuffer);
DataBuffer = AllocatePool (DataSize);
@@ -495,20 +513,31 @@ CascadeProcessVariables (
Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
}
}
- //
- // Last error check then print this variable out.
- //
+
+ //
+ // Last error check then print this variable out.
+ //
if (Type == DmpStoreDisplay) {
- if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
- AttrString = GetAttrType(Atts);
+ if (!EFI_ERROR (Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
+ AttrString = GetAttrType (Atts);
if (StandardFormatOutput) {
HexString = AllocatePool ((DataSize * 2 + 1) * sizeof (CHAR16));
if (HexString != NULL) {
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_VAR_SFO), gShellDebug1HiiHandle,
- FoundVarName, &FoundVarGuid, Atts, DataSize,
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_VAR_SFO),
+ gShellDebug1HiiHandle,
+ FoundVarName,
+ &FoundVarGuid,
+ Atts,
+ DataSize,
BinaryToHexString (
- DataBuffer, DataSize, HexString, (DataSize * 2 + 1) * sizeof (CHAR16)
+ DataBuffer,
+ DataSize,
+ HexString,
+ (DataSize * 2 + 1) * sizeof (CHAR16)
)
);
FreePool (HexString);
@@ -516,35 +545,58 @@ CascadeProcessVariables (
Status = EFI_OUT_OF_RESOURCES;
}
} else {
- Status = gEfiShellProtocol->GetGuidName(&FoundVarGuid, &GuidName);
+ Status = gEfiShellProtocol->GetGuidName (&FoundVarGuid, &GuidName);
if (EFI_ERROR (Status)) {
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
- AttrString, &FoundVarGuid, FoundVarName, DataSize
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_HEADER_LINE),
+ gShellDebug1HiiHandle,
+ AttrString,
+ &FoundVarGuid,
+ FoundVarName,
+ DataSize
);
} else {
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE2), gShellDebug1HiiHandle,
- AttrString, GuidName, FoundVarName, DataSize
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_HEADER_LINE2),
+ gShellDebug1HiiHandle,
+ AttrString,
+ GuidName,
+ FoundVarName,
+ DataSize
);
}
+
DumpHex (2, 0, DataSize, DataBuffer);
}
+
SHELL_FREE_NON_NULL (AttrString);
}
} else if (Type == DmpStoreSave) {
- if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
+ if (!EFI_ERROR (Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
AttrString = GetAttrType (Atts);
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
- AttrString, &FoundVarGuid, FoundVarName, DataSize
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_HEADER_LINE),
+ gShellDebug1HiiHandle,
+ AttrString,
+ &FoundVarGuid,
+ FoundVarName,
+ DataSize
);
Status = AppendSingleVariableToFile (
FileHandle,
FoundVarName,
&FoundVarGuid,
Atts,
- (UINT32) DataSize,
+ (UINT32)DataSize,
DataBuffer
);
SHELL_FREE_NON_NULL (AttrString);
@@ -557,27 +609,39 @@ CascadeProcessVariables (
if (StandardFormatOutput) {
if (SetStatus == EFI_SUCCESS) {
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_NG_SFO), gShellDebug1HiiHandle,
- FoundVarName, &FoundVarGuid
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_NG_SFO),
+ gShellDebug1HiiHandle,
+ FoundVarName,
+ &FoundVarGuid
);
}
} else {
ShellPrintHiiEx (
- -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_DELETE_LINE), gShellDebug1HiiHandle,
- &FoundVarGuid, FoundVarName, SetStatus
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_DMPSTORE_DELETE_LINE),
+ gShellDebug1HiiHandle,
+ &FoundVarGuid,
+ FoundVarName,
+ SetStatus
);
}
}
- SHELL_FREE_NON_NULL(DataBuffer);
+
+ SHELL_FREE_NON_NULL (DataBuffer);
}
- SHELL_FREE_NON_NULL(FoundVarName);
+ SHELL_FREE_NON_NULL (FoundVarName);
if (Status == EFI_DEVICE_ERROR) {
ShellStatus = SHELL_DEVICE_ERROR;
} else if (Status == EFI_SECURITY_VIOLATION) {
ShellStatus = SHELL_SECURITY_VIOLATION;
- } else if (EFI_ERROR(Status)) {
+ } else if (EFI_ERROR (Status)) {
ShellStatus = SHELL_NOT_READY;
}
@@ -601,23 +665,23 @@ CascadeProcessVariables (
**/
SHELL_STATUS
ProcessVariables (
- IN CONST CHAR16 *Name OPTIONAL,
- IN CONST EFI_GUID *Guid OPTIONAL,
- IN DMP_STORE_TYPE Type,
- IN SHELL_FILE_HANDLE FileHandle OPTIONAL,
- IN BOOLEAN StandardFormatOutput
+ IN CONST CHAR16 *Name OPTIONAL,
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN DMP_STORE_TYPE Type,
+ IN SHELL_FILE_HANDLE FileHandle OPTIONAL,
+ IN BOOLEAN StandardFormatOutput
)
{
- SHELL_STATUS ShellStatus;
- BOOLEAN Found;
- EFI_GUID FoundVarGuid;
+ SHELL_STATUS ShellStatus;
+ BOOLEAN Found;
+ EFI_GUID FoundVarGuid;
- Found = FALSE;
- ShellStatus = SHELL_SUCCESS;
- ZeroMem (&FoundVarGuid, sizeof(EFI_GUID));
+ Found = FALSE;
+ ShellStatus = SHELL_SUCCESS;
+ ZeroMem (&FoundVarGuid, sizeof (EFI_GUID));
if (StandardFormatOutput) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_SFO_HEADER), gShellDebug1HiiHandle, L"dmpstore");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_SFO_HEADER), gShellDebug1HiiHandle, L"dmpstore");
}
if (Type == DmpStoreLoad) {
@@ -628,43 +692,45 @@ ProcessVariables (
if (!Found) {
if (ShellStatus == SHELL_OUT_OF_RESOURCES) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore");
return (ShellStatus);
- } else if (Name != NULL && Guid == NULL) {
+ } else if ((Name != NULL) && (Guid == NULL)) {
if (StandardFormatOutput) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N_SFO), gShellDebug1HiiHandle, Name);
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, L"dmpstore", Name);
}
- } else if (Name != NULL && Guid != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name);
- } else if (Name == NULL && Guid == NULL) {
+ } else if ((Name != NULL) && (Guid != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name);
+ } else if ((Name == NULL) && (Guid == NULL)) {
if (StandardFormatOutput) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_SFO), gShellDebug1HiiHandle);
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND), gShellDebug1HiiHandle, L"dmpstore");
}
- } else if (Name == NULL && Guid != NULL) {
+ } else if ((Name == NULL) && (Guid != NULL)) {
if (StandardFormatOutput) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G_SFO), gShellDebug1HiiHandle, Guid);
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, L"dmpstore", Guid);
}
}
+
return (SHELL_NOT_FOUND);
}
+
return (ShellStatus);
}
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-d", TypeFlag},
- {L"-l", TypeValue},
- {L"-s", TypeValue},
- {L"-all", TypeFlag},
- {L"-guid", TypeValue},
- {L"-sfo", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-d", TypeFlag },
+ { L"-l", TypeValue },
+ { L"-s", TypeValue },
+ { L"-all", TypeFlag },
+ { L"-guid", TypeValue },
+ { L"-sfo", TypeFlag },
+ { NULL, TypeMax }
+};
/**
Function for 'dmpstore' command.
@@ -679,20 +745,20 @@ ShellCommandRunDmpStore (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- RETURN_STATUS RStatus;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *GuidStr;
- CONST CHAR16 *File;
- EFI_GUID *Guid;
- EFI_GUID GuidData;
- CONST CHAR16 *Name;
- DMP_STORE_TYPE Type;
- SHELL_FILE_HANDLE FileHandle;
- EFI_FILE_INFO *FileInfo;
- BOOLEAN StandardFormatOutput;
+ EFI_STATUS Status;
+ RETURN_STATUS RStatus;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *GuidStr;
+ CONST CHAR16 *File;
+ EFI_GUID *Guid;
+ EFI_GUID GuidData;
+ CONST CHAR16 *Name;
+ DMP_STORE_TYPE Type;
+ SHELL_FILE_HANDLE FileHandle;
+ EFI_FILE_INFO *FileInfo;
+ BOOLEAN StandardFormatOutput;
ShellStatus = SHELL_SUCCESS;
Package = NULL;
@@ -702,61 +768,62 @@ ShellCommandRunDmpStore (
StandardFormatOutput = FALSE;
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore");
+ if (ShellCommandLineGetCount (Package) > 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid");
+ } else if (ShellCommandLineGetFlag (Package, L"-all") && ShellCommandLineGetFlag (Package, L"-guid")) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-l")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s");
+ } else if (ShellCommandLineGetFlag (Package, L"-s") && ShellCommandLineGetFlag (Package, L"-l")) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d");
+ } else if ((ShellCommandLineGetFlag (Package, L"-s") || ShellCommandLineGetFlag (Package, L"-l")) && ShellCommandLineGetFlag (Package, L"-d")) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-sfo")) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo");
+ } else if ((ShellCommandLineGetFlag (Package, L"-s") || ShellCommandLineGetFlag (Package, L"-l")) && ShellCommandLineGetFlag (Package, L"-sfo")) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
//
// Determine the GUID to search for based on -all and -guid parameters
//
- if (!ShellCommandLineGetFlag(Package, L"-all")) {
- GuidStr = ShellCommandLineGetValue(Package, L"-guid");
+ if (!ShellCommandLineGetFlag (Package, L"-all")) {
+ GuidStr = ShellCommandLineGetValue (Package, L"-guid");
if (GuidStr != NULL) {
RStatus = StrToGuid (GuidStr, &GuidData);
if (RETURN_ERROR (RStatus) || (GuidStr[GUID_STRING_LENGTH] != L'\0')) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr);
ShellStatus = SHELL_INVALID_PARAMETER;
}
+
Guid = &GuidData;
- } else {
+ } else {
Guid = &gEfiGlobalVariableGuid;
}
} else {
- Guid = NULL;
+ Guid = NULL;
}
//
// Get the Name of the variable to find
//
- Name = ShellCommandLineGetRawValue(Package, 1);
+ Name = ShellCommandLineGetRawValue (Package, 1);
if (ShellStatus == SHELL_SUCCESS) {
- if (ShellCommandLineGetFlag(Package, L"-s")) {
+ if (ShellCommandLineGetFlag (Package, L"-s")) {
Type = DmpStoreSave;
- File = ShellCommandLineGetValue(Package, L"-s");
+ File = ShellCommandLineGetValue (Package, L"-s");
if (File == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
@@ -778,6 +845,7 @@ ShellCommandRunDmpStore (
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
}
}
+
FreePool (FileInfo);
}
} else if (Status == EFI_NOT_FOUND) {
@@ -803,16 +871,16 @@ ShellCommandRunDmpStore (
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
- } else if (ShellCommandLineGetFlag(Package, L"-l")) {
+ } else if (ShellCommandLineGetFlag (Package, L"-l")) {
Type = DmpStoreLoad;
- File = ShellCommandLineGetValue(Package, L"-l");
+ File = ShellCommandLineGetValue (Package, L"-l");
if (File == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
FileInfo = ShellGetFileInfo (FileHandle);
@@ -824,15 +892,16 @@ ShellCommandRunDmpStore (
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File);
ShellStatus = SHELL_INVALID_PARAMETER;
}
+
FreePool (FileInfo);
}
}
}
- } else if (ShellCommandLineGetFlag(Package, L"-d")) {
+ } else if (ShellCommandLineGetFlag (Package, L"-d")) {
Type = DmpStoreDelete;
}
- if (ShellCommandLineGetFlag (Package,L"-sfo")) {
+ if (ShellCommandLineGetFlag (Package, L"-sfo")) {
StandardFormatOutput = TRUE;
}
}
@@ -843,6 +912,7 @@ ShellCommandRunDmpStore (
} else if (Type == DmpStoreLoad) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD), gShellDebug1HiiHandle, File);
}
+
ShellStatus = ProcessVariables (Name, Guid, Type, FileHandle, StandardFormatOutput);
if ((Type == DmpStoreLoad) || (Type == DmpStoreSave)) {
ShellCloseFile (&FileHandle);
@@ -854,6 +924,6 @@ ShellCommandRunDmpStore (
if (Package != NULL) {
ShellCommandLineFreeVarList (Package);
}
+
return ShellStatus;
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
index 1160efaa7f..f5edc1bdbb 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
@@ -23,16 +23,17 @@ ShellCommandRunEdit (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- CHAR16 *Buffer;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- LIST_ENTRY *Package;
- CONST CHAR16 *Cwd;
- CHAR16 *Nfs;
- CHAR16 *Spot;
- CONST CHAR16 *TempParam;
-// SHELL_FILE_HANDLE TempHandle;
+ EFI_STATUS Status;
+ CHAR16 *Buffer;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ LIST_ENTRY *Package;
+ CONST CHAR16 *Cwd;
+ CHAR16 *Nfs;
+ CHAR16 *Spot;
+ CONST CHAR16 *TempParam;
+
+ // SHELL_FILE_HANDLE TempHandle;
Buffer = NULL;
ShellStatus = SHELL_SUCCESS;
@@ -41,45 +42,47 @@ ShellCommandRunEdit (
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit");
+ if (ShellCommandLineGetCount (Package) > 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Cwd = gEfiShellProtocol->GetCurDir(NULL);
+ Cwd = gEfiShellProtocol->GetCurDir (NULL);
if (Cwd == NULL) {
- Cwd = ShellGetEnvironmentVariable(L"path");
+ Cwd = ShellGetEnvironmentVariable (L"path");
if (Cwd != NULL) {
- Nfs = StrnCatGrow(&Nfs, NULL, Cwd+3, 0);
+ Nfs = StrnCatGrow (&Nfs, NULL, Cwd+3, 0);
if (Nfs != NULL) {
- Spot = StrStr(Nfs, L";");
+ Spot = StrStr (Nfs, L";");
if (Spot != NULL) {
*Spot = CHAR_NULL;
}
- Spot = StrStr(Nfs, L"\\");
+
+ Spot = StrStr (Nfs, L"\\");
if (Spot != NULL) {
Spot[1] = CHAR_NULL;
}
- gEfiShellProtocol->SetCurDir(NULL, Nfs);
- FreePool(Nfs);
+
+ gEfiShellProtocol->SetCurDir (NULL, Nfs);
+ FreePool (Nfs);
}
}
}
@@ -89,23 +92,23 @@ ShellCommandRunEdit (
if (EFI_ERROR (Status)) {
gST->ConOut->ClearScreen (gST->ConOut);
gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_INIT_FAILED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_MAIN_INIT_FAILED), gShellDebug1HiiHandle);
} else {
MainEditorBackup ();
//
// if editor launched with file named
//
- if (ShellCommandLineGetCount(Package) == 2) {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
+ if (ShellCommandLineGetCount (Package) == 2) {
+ TempParam = ShellCommandLineGetRawValue (Package, 1);
+ ASSERT (TempParam != NULL);
FileBufferSetFileName (TempParam);
-// if (EFI_ERROR(ShellFileExists(MainEditor.FileBuffer->FileName))) {
-// Status = ShellOpenFileByName(MainEditor.FileBuffer->FileName, &TempHandle, EFI_FILE_MODE_CREATE|EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
-// if (!EFI_ERROR(Status)) {
-// ShellCloseFile(&TempHandle);
-// }
-// }
+ // if (EFI_ERROR(ShellFileExists(MainEditor.FileBuffer->FileName))) {
+ // Status = ShellOpenFileByName(MainEditor.FileBuffer->FileName, &TempHandle, EFI_FILE_MODE_CREATE|EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
+ // if (!EFI_ERROR(Status)) {
+ // ShellCloseFile(&TempHandle);
+ // }
+ // }
}
Status = FileBufferRead (MainEditor.FileBuffer->FileName, FALSE);
@@ -119,7 +122,7 @@ ShellCommandRunEdit (
//
// back up the status string
//
- Buffer = CatSPrint (NULL, L"%s", StatusBarGetString());
+ Buffer = CatSPrint (NULL, L"%s", StatusBarGetString ());
}
MainEditorCleanup ();
@@ -129,19 +132,19 @@ ShellCommandRunEdit (
//
if (Status == EFI_SUCCESS) {
} else if (Status == EFI_OUT_OF_RESOURCES) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit");
} else {
if (Buffer != NULL) {
if (StrCmp (Buffer, L"") != 0) {
//
// print out the status string
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_BUFFER), gShellDebug1HiiHandle, Buffer);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_MAIN_BUFFER), gShellDebug1HiiHandle, Buffer);
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
}
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gShellDebug1HiiHandle);
}
}
@@ -150,7 +153,9 @@ ShellCommandRunEdit (
}
}
}
+
ShellCommandLineFreeVarList (Package);
}
+
return ShellStatus;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
index 925d910ae2..088030d29f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c
@@ -47,16 +47,16 @@ EFI_EDITOR_FILE_BUFFER FileBufferConst = {
//
// the whole edit area needs to be refreshed
//
-BOOLEAN FileBufferNeedRefresh;
+BOOLEAN FileBufferNeedRefresh;
//
// only the current line in edit area needs to be refresh
//
-BOOLEAN FileBufferOnlyLineNeedRefresh;
+BOOLEAN FileBufferOnlyLineNeedRefresh;
-BOOLEAN FileBufferMouseNeedRefresh;
+BOOLEAN FileBufferMouseNeedRefresh;
-extern BOOLEAN EditorMouseAction;
+extern BOOLEAN EditorMouseAction;
/**
Initialization function for FileBuffer.
@@ -73,7 +73,7 @@ FileBufferInit (
//
// basically initialize the FileBuffer
//
- CopyMem (&FileBuffer , &FileBufferConst, sizeof (EFI_EDITOR_FILE_BUFFER));
+ CopyMem (&FileBuffer, &FileBufferConst, sizeof (EFI_EDITOR_FILE_BUFFER));
CopyMem (&FileBufferBackupVar, &FileBufferConst, sizeof (EFI_EDITOR_FILE_BUFFER));
//
@@ -96,9 +96,9 @@ FileBufferInit (
FileBuffer.LowVisibleRange.Row = 2;
FileBuffer.LowVisibleRange.Column = 1;
- FileBufferNeedRefresh = FALSE;
- FileBufferMouseNeedRefresh = FALSE;
- FileBufferOnlyLineNeedRefresh = FALSE;
+ FileBufferNeedRefresh = FALSE;
+ FileBufferMouseNeedRefresh = FALSE;
+ FileBufferOnlyLineNeedRefresh = FALSE;
return EFI_SUCCESS;
}
@@ -121,17 +121,17 @@ FileBufferBackup (
FileBufferBackupVar.MousePosition = FileBuffer.MousePosition;
SHELL_FREE_NON_NULL (FileBufferBackupVar.FileName);
- FileBufferBackupVar.FileName = NULL;
- FileBufferBackupVar.FileName = StrnCatGrow (&FileBufferBackupVar.FileName, NULL, FileBuffer.FileName, 0);
+ FileBufferBackupVar.FileName = NULL;
+ FileBufferBackupVar.FileName = StrnCatGrow (&FileBufferBackupVar.FileName, NULL, FileBuffer.FileName, 0);
- FileBufferBackupVar.ModeInsert = FileBuffer.ModeInsert;
- FileBufferBackupVar.FileType = FileBuffer.FileType;
+ FileBufferBackupVar.ModeInsert = FileBuffer.ModeInsert;
+ FileBufferBackupVar.FileType = FileBuffer.FileType;
FileBufferBackupVar.FilePosition = FileBuffer.FilePosition;
FileBufferBackupVar.LowVisibleRange = FileBuffer.LowVisibleRange;
- FileBufferBackupVar.FileModified = FileBuffer.FileModified;
- FileBufferBackupVar.ReadOnly = FileBuffer.ReadOnly;
+ FileBufferBackupVar.FileModified = FileBuffer.FileModified;
+ FileBufferBackupVar.ReadOnly = FileBuffer.ReadOnly;
return EFI_SUCCESS;
}
@@ -154,10 +154,10 @@ InternalEditorMiscLineAdvance (
)
{
- UINTN Index;
- CONST EFI_EDITOR_LINE *Line;
+ UINTN Index;
+ CONST EFI_EDITOR_LINE *Line;
- if (CurrentLine == NULL || LineList == NULL) {
+ if ((CurrentLine == NULL) || (LineList == NULL)) {
return NULL;
}
@@ -193,10 +193,10 @@ InternalEditorMiscLineRetreat (
)
{
- UINTN Index;
- CONST EFI_EDITOR_LINE *Line;
+ UINTN Index;
+ CONST EFI_EDITOR_LINE *Line;
- if (CurrentLine == NULL || LineList == NULL) {
+ if ((CurrentLine == NULL) || (LineList == NULL)) {
return NULL;
}
@@ -226,21 +226,21 @@ InternalEditorMiscLineRetreat (
**/
EFI_EDITOR_LINE *
MoveLine (
- IN CONST INTN Count
+ IN CONST INTN Count
)
{
- EFI_EDITOR_LINE *Line;
- UINTN AbsCount;
+ EFI_EDITOR_LINE *Line;
+ UINTN AbsCount;
//
// if < 0, then retreat
// if > 0, the advance
//
if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = InternalEditorMiscLineRetreat (AbsCount,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
+ AbsCount = (UINTN)ABS (Count);
+ Line = InternalEditorMiscLineRetreat (AbsCount, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead);
} else {
- Line = InternalEditorMiscLineAdvance ((UINTN)Count,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
+ Line = InternalEditorMiscLineAdvance ((UINTN)Count, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead);
}
return Line;
@@ -271,20 +271,20 @@ FileBufferRestoreMousePosition (
Line = NULL;
if (MainEditor.MouseSupported) {
-
if (FileBufferMouseNeedRefresh) {
-
FileBufferMouseNeedRefresh = FALSE;
//
// if mouse position not moved and only mouse action
// so do not need to refresh mouse position
//
- if ((FileBuffer.MousePosition.Row == FileBufferBackupVar.MousePosition.Row &&
- FileBuffer.MousePosition.Column == FileBufferBackupVar.MousePosition.Column)
- && EditorMouseAction) {
+ if ( ((FileBuffer.MousePosition.Row == FileBufferBackupVar.MousePosition.Row) &&
+ (FileBuffer.MousePosition.Column == FileBufferBackupVar.MousePosition.Column))
+ && EditorMouseAction)
+ {
return EFI_SUCCESS;
}
+
//
// backup the old screen attributes
//
@@ -296,18 +296,18 @@ FileBufferRestoreMousePosition (
//
// clear the old mouse position
//
- FRow = FileBuffer.LowVisibleRange.Row + FileBufferBackupVar.MousePosition.Row - 2;
+ FRow = FileBuffer.LowVisibleRange.Row + FileBufferBackupVar.MousePosition.Row - 2;
- FColumn = FileBuffer.LowVisibleRange.Column + FileBufferBackupVar.MousePosition.Column - 1;
+ FColumn = FileBuffer.LowVisibleRange.Column + FileBufferBackupVar.MousePosition.Column - 1;
- HasCharacter = TRUE;
+ HasCharacter = TRUE;
if (FRow > FileBuffer.NumLines) {
HasCharacter = FALSE;
} else {
CurrentLine = FileBuffer.CurrentLine;
Line = MoveLine (FRow - FileBuffer.FilePosition.Row);
- if (Line == NULL || FColumn > Line->Size) {
+ if ((Line == NULL) || (FColumn > Line->Size)) {
HasCharacter = FALSE;
}
@@ -329,6 +329,7 @@ FileBufferRestoreMousePosition (
Value
);
}
+
//
// set the new mouse position
//
@@ -337,17 +338,17 @@ FileBufferRestoreMousePosition (
//
// clear the old mouse position
//
- FRow = FileBuffer.LowVisibleRange.Row + FileBuffer.MousePosition.Row - 2;
- FColumn = FileBuffer.LowVisibleRange.Column + FileBuffer.MousePosition.Column - 1;
+ FRow = FileBuffer.LowVisibleRange.Row + FileBuffer.MousePosition.Row - 2;
+ FColumn = FileBuffer.LowVisibleRange.Column + FileBuffer.MousePosition.Column - 1;
- HasCharacter = TRUE;
+ HasCharacter = TRUE;
if (FRow > FileBuffer.NumLines) {
HasCharacter = FALSE;
} else {
CurrentLine = FileBuffer.CurrentLine;
Line = MoveLine (FRow - FileBuffer.FilePosition.Row);
- if (Line == NULL || FColumn > Line->Size) {
+ if ((Line == NULL) || (FColumn > Line->Size)) {
HasCharacter = FALSE;
}
@@ -369,15 +370,18 @@ FileBufferRestoreMousePosition (
Value
);
}
+
//
// end of HasCharacter
//
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
}
+
//
// end of MouseNeedRefresh
//
}
+
//
// end of MouseSupported
//
@@ -399,19 +403,18 @@ FileBufferFreeLines (
VOID
)
{
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
+ LIST_ENTRY *Link;
+ EFI_EDITOR_LINE *Line;
//
// free all the lines
//
if (FileBuffer.Lines != NULL) {
-
- Line = FileBuffer.Lines;
- Link = &(Line->Link);
+ Line = FileBuffer.Lines;
+ Link = &(Line->Link);
do {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- Link = Link->ForwardLink;
+ Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ Link = Link->ForwardLink;
//
// free line's buffer and line itself
@@ -419,15 +422,16 @@ FileBufferFreeLines (
LineFree (Line);
} while (Link != FileBuffer.ListHead);
}
+
//
// clean the line list related structure
//
- FileBuffer.Lines = NULL;
- FileBuffer.CurrentLine = NULL;
- FileBuffer.NumLines = 0;
+ FileBuffer.Lines = NULL;
+ FileBuffer.CurrentLine = NULL;
+ FileBuffer.NumLines = 0;
- FileBuffer.ListHead->ForwardLink = FileBuffer.ListHead;
- FileBuffer.ListHead->BackLink = FileBuffer.ListHead;
+ FileBuffer.ListHead->ForwardLink = FileBuffer.ListHead;
+ FileBuffer.ListHead->BackLink = FileBuffer.ListHead;
return EFI_SUCCESS;
}
@@ -456,7 +460,6 @@ FileBufferCleanup (
SHELL_FREE_NON_NULL (FileBufferBackupVar.FileName);
return Status;
-
}
/**
@@ -473,7 +476,6 @@ FileBufferPrintLine (
IN CONST UINTN Row
)
{
-
CHAR16 *Buffer;
UINTN Limit;
CHAR16 *PrintLine;
@@ -483,17 +485,17 @@ FileBufferPrintLine (
//
// print start from correct character
//
- Buffer = Line->Buffer + FileBuffer.LowVisibleRange.Column - 1;
+ Buffer = Line->Buffer + FileBuffer.LowVisibleRange.Column - 1;
- Limit = Line->Size - FileBuffer.LowVisibleRange.Column + 1;
+ Limit = Line->Size - FileBuffer.LowVisibleRange.Column + 1;
if (Limit > Line->Size) {
Limit = 0;
}
- BufLen = (MainEditor.ScreenSize.Column + 1) * sizeof (CHAR16);
+ BufLen = (MainEditor.ScreenSize.Column + 1) * sizeof (CHAR16);
PrintLine = AllocatePool (BufLen);
if (PrintLine != NULL) {
- StrnCpyS (PrintLine, BufLen/sizeof(CHAR16), Buffer, MIN(Limit, MainEditor.ScreenSize.Column));
+ StrnCpyS (PrintLine, BufLen/sizeof (CHAR16), Buffer, MIN (Limit, MainEditor.ScreenSize.Column));
for (Limit = StrLen (PrintLine); Limit < MainEditor.ScreenSize.Column; Limit++) {
PrintLine[Limit] = L' ';
}
@@ -502,7 +504,7 @@ FileBufferPrintLine (
PrintLine2 = AllocatePool (BufLen * 2);
if (PrintLine2 != NULL) {
- ShellCopySearchAndReplace(PrintLine, PrintLine2, BufLen * 2, L"%", L"^%", FALSE, FALSE);
+ ShellCopySearchAndReplace (PrintLine, PrintLine2, BufLen * 2, L"%", L"^%", FALSE, FALSE);
ShellPrintEx (
0,
@@ -512,6 +514,7 @@ FileBufferPrintLine (
);
FreePool (PrintLine2);
}
+
FreePool (PrintLine);
}
@@ -532,10 +535,10 @@ FileBufferRestorePosition (
// set cursor position
//
return (gST->ConOut->SetCursorPosition (
- gST->ConOut,
- FileBuffer.DisplayPosition.Column - 1,
- FileBuffer.DisplayPosition.Row - 1
- ));
+ gST->ConOut,
+ FileBuffer.DisplayPosition.Column - 1,
+ FileBuffer.DisplayPosition.Row - 1
+ ));
}
/**
@@ -549,9 +552,9 @@ FileBufferRefresh (
VOID
)
{
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
- UINTN Row;
+ LIST_ENTRY *Link;
+ EFI_EDITOR_LINE *Line;
+ UINTN Row;
//
// if it's the first time after editor launch, so should refresh
@@ -563,10 +566,10 @@ FileBufferRefresh (
//
if (!FileBufferNeedRefresh &&
!FileBufferOnlyLineNeedRefresh &&
- FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row &&
- FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column
- ) {
-
+ (FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row) &&
+ (FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column)
+ )
+ {
FileBufferRestoreMousePosition ();
FileBufferRestorePosition ();
@@ -580,10 +583,10 @@ FileBufferRefresh (
// only need to refresh current line
//
if (FileBufferOnlyLineNeedRefresh &&
- FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row &&
- FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column
- ) {
-
+ (FileBufferBackupVar.LowVisibleRange.Row == FileBuffer.LowVisibleRange.Row) &&
+ (FileBufferBackupVar.LowVisibleRange.Column == FileBuffer.LowVisibleRange.Column)
+ )
+ {
EditorClearLine (FileBuffer.DisplayPosition.Row, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row);
FileBufferPrintLine (
FileBuffer.CurrentLine,
@@ -604,6 +607,7 @@ FileBufferRefresh (
return EFI_SUCCESS;
}
+
//
// get the first line that will be displayed
//
@@ -614,8 +618,8 @@ FileBufferRefresh (
return EFI_LOAD_ERROR;
}
- Link = &(Line->Link);
- Row = 2;
+ Link = &(Line->Link);
+ Row = 2;
do {
Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
@@ -627,6 +631,7 @@ FileBufferRefresh (
Link = Link->ForwardLink;
Row++;
} while (Link != FileBuffer.ListHead && Row <= (MainEditor.ScreenSize.Row - 1));
+
//
// while not file end and not screen full
//
@@ -660,7 +665,7 @@ FileBufferCreateLine (
VOID
)
{
- EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *Line;
//
// allocate a line structure
@@ -669,6 +674,7 @@ FileBufferCreateLine (
if (Line == NULL) {
return NULL;
}
+
//
// initialize the structure
//
@@ -680,7 +686,7 @@ FileBufferCreateLine (
//
// initial buffer of the line is "\0"
//
- ASSERT(CHAR_NULL == CHAR_NULL);
+ ASSERT (CHAR_NULL == CHAR_NULL);
Line->Buffer = CatSPrint (NULL, L"\0");
if (Line->Buffer == NULL) {
return NULL;
@@ -711,15 +717,16 @@ FileBufferCreateLine (
**/
EFI_STATUS
FileBufferSetFileName (
- IN CONST CHAR16 *Str
+ IN CONST CHAR16 *Str
)
{
//
// Verify the parameters
//
- if (!IsValidFileName(Str)) {
+ if (!IsValidFileName (Str)) {
return (EFI_INVALID_PARAMETER);
}
+
//
// free the old file name
//
@@ -735,6 +742,7 @@ FileBufferSetFileName (
return EFI_SUCCESS;
}
+
/**
Free the existing file lines and reset the modified flag.
@@ -754,7 +762,6 @@ FileBufferFree (
return EFI_SUCCESS;
}
-
/**
Read a file from disk into the FileBuffer.
@@ -768,24 +775,24 @@ FileBufferFree (
**/
EFI_STATUS
FileBufferRead (
- IN CONST CHAR16 *FileName,
- IN CONST BOOLEAN Recover
+ IN CONST CHAR16 *FileName,
+ IN CONST BOOLEAN Recover
)
{
- EFI_EDITOR_LINE *Line;
- EE_NEWLINE_TYPE Type;
- UINTN LoopVar1;
- UINTN LoopVar2;
- UINTN LineSize;
- VOID *Buffer;
- CHAR16 *UnicodeBuffer;
- UINT8 *AsciiBuffer;
- UINTN FileSize;
- SHELL_FILE_HANDLE FileHandle;
- BOOLEAN CreateFile;
- EFI_STATUS Status;
- UINTN LineSizeBackup;
- EFI_FILE_INFO *Info;
+ EFI_EDITOR_LINE *Line;
+ EE_NEWLINE_TYPE Type;
+ UINTN LoopVar1;
+ UINTN LoopVar2;
+ UINTN LineSize;
+ VOID *Buffer;
+ CHAR16 *UnicodeBuffer;
+ UINT8 *AsciiBuffer;
+ UINTN FileSize;
+ SHELL_FILE_HANDLE FileHandle;
+ BOOLEAN CreateFile;
+ EFI_STATUS Status;
+ UINTN LineSizeBackup;
+ EFI_FILE_INFO *Info;
Line = NULL;
LoopVar1 = 0;
@@ -809,14 +816,14 @@ FileBufferRead (
//
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)) {
+ if (!EFI_ERROR (Status)) {
CreateFile = FALSE;
if (FileHandle == NULL) {
StatusBarSetStatusString (L"Disk Error");
return EFI_LOAD_ERROR;
}
- Info = ShellGetFileInfo(FileHandle);
+ Info = ShellGetFileInfo (FileHandle);
if (Info->Attribute & EFI_FILE_DIRECTORY) {
StatusBarSetStatusString (L"Directory Can Not Be Edited");
@@ -829,10 +836,11 @@ FileBufferRead (
} else {
FileBuffer.ReadOnly = FALSE;
}
+
//
// get file size
//
- FileSize = (UINTN) Info->FileSize;
+ FileSize = (UINTN)Info->FileSize;
FreePool (Info);
} else if (Status == EFI_NOT_FOUND) {
@@ -841,13 +849,14 @@ FileBufferRead (
//
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
if (EFI_ERROR (Status)) {
- if (Status == EFI_WRITE_PROTECTED ||
- Status == EFI_ACCESS_DENIED ||
- Status == EFI_NO_MEDIA ||
- Status == EFI_MEDIA_CHANGED
- ) {
+ if ((Status == EFI_WRITE_PROTECTED) ||
+ (Status == EFI_ACCESS_DENIED) ||
+ (Status == EFI_NO_MEDIA) ||
+ (Status == EFI_MEDIA_CHANGED)
+ )
+ {
StatusBarSetStatusString (L"Access Denied");
- } else if (Status == EFI_DEVICE_ERROR || Status == EFI_VOLUME_CORRUPTED || Status == EFI_VOLUME_FULL) {
+ } else if ((Status == EFI_DEVICE_ERROR) || (Status == EFI_VOLUME_CORRUPTED) || (Status == EFI_VOLUME_FULL)) {
StatusBarSetStatusString (L"Disk Error");
} else {
StatusBarSetStatusString (L"Invalid File Name or Current-working-directory");
@@ -862,12 +871,14 @@ FileBufferRead (
if (Status == EFI_WARN_DELETE_FAILURE) {
Status = EFI_ACCESS_DENIED;
}
+
FileHandle = NULL;
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Access Denied");
return Status;
}
}
+
//
// file doesn't exist, so set CreateFile to TRUE
//
@@ -881,12 +892,13 @@ FileBufferRead (
if (StrCmp (FileName, FileBuffer.FileName) != 0) {
FileBufferSetFileName (FileName);
}
+
//
// free the old lines
//
FileBufferFree ();
-
}
+
//
// the file exists
//
@@ -898,17 +910,19 @@ FileBufferRead (
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// read file into Buffer
//
Status = ShellReadFile (FileHandle, &FileSize, Buffer);
- ShellCloseFile(&FileHandle);
+ ShellCloseFile (&FileHandle);
FileHandle = NULL;
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read File Failed");
SHELL_FREE_NON_NULL (Buffer);
return EFI_LOAD_ERROR;
}
+
//
// nothing in this file
//
@@ -933,7 +947,7 @@ FileBufferRead (
//
// Unicode file
//
- if (*(UINT16 *) Buffer == EFI_UNICODE_BYTE_ORDER_MARK) {
+ if (*(UINT16 *)Buffer == EFI_UNICODE_BYTE_ORDER_MARK) {
//
// Unicode file's size should be even
//
@@ -956,10 +970,12 @@ FileBufferRead (
} else {
FileBuffer.FileType = FileTypeAscii;
}
+
//
// end of AsciiBuffer ==
//
}
+
//
// end of FileSize < 2
// all the check ends
@@ -1038,10 +1054,12 @@ FileBufferRead (
break;
}
}
+
//
// endif == ASCII
//
}
+
//
// end of for LineSize
//
@@ -1064,6 +1082,7 @@ FileBufferRead (
SHELL_FREE_NON_NULL (Buffer);
return EFI_OUT_OF_RESOURCES;
}
+
//
// calculate file length
//
@@ -1079,53 +1098,58 @@ FileBufferRead (
RemoveEntryList (&Line->Link);
return EFI_OUT_OF_RESOURCES;
}
+
//
// copy this line to Line->Buffer
//
for (LoopVar2 = 0; LoopVar2 < LineSize; LoopVar2++) {
if (FileBuffer.FileType == FileTypeAscii) {
- Line->Buffer[LoopVar2] = (CHAR16) AsciiBuffer[LoopVar1];
+ Line->Buffer[LoopVar2] = (CHAR16)AsciiBuffer[LoopVar1];
} else {
Line->Buffer[LoopVar2] = UnicodeBuffer[LoopVar1];
}
LoopVar1++;
}
+
//
// LoopVar1 now points to where CHAR_CARRIAGE_RETURN or CHAR_LINEFEED;
//
- Line->Buffer[LineSize] = 0;
+ Line->Buffer[LineSize] = 0;
- Line->Size = LineSize;
- Line->TotalSize = LineSize;
- Line->Type = Type;
+ Line->Size = LineSize;
+ Line->TotalSize = LineSize;
+ Line->Type = Type;
- if (Type == NewLineTypeCarriageReturnLineFeed || Type == NewLineTypeLineFeedCarriageReturn) {
+ if ((Type == NewLineTypeCarriageReturnLineFeed) || (Type == NewLineTypeLineFeedCarriageReturn)) {
LoopVar1++;
}
//
// last character is a return, SO create a new line
//
- if (((Type == NewLineTypeCarriageReturnLineFeed || Type == NewLineTypeLineFeedCarriageReturn) && LineSizeBackup == FileSize - 2) ||
- ((Type == NewLineTypeLineFeed || Type == NewLineTypeCarriageReturn) && LineSizeBackup == FileSize - 1)
- ) {
+ if ((((Type == NewLineTypeCarriageReturnLineFeed) || (Type == NewLineTypeLineFeedCarriageReturn)) && (LineSizeBackup == FileSize - 2)) ||
+ (((Type == NewLineTypeLineFeed) || (Type == NewLineTypeCarriageReturn)) && (LineSizeBackup == FileSize - 1))
+ )
+ {
Line = FileBufferCreateLine ();
if (Line == NULL) {
SHELL_FREE_NON_NULL (Buffer);
return EFI_OUT_OF_RESOURCES;
}
}
+
//
// end of if
//
}
+
//
// end of LoopVar1
//
SHELL_FREE_NON_NULL (Buffer);
-
}
+
//
// end of if CreateFile
//
@@ -1149,83 +1173,84 @@ Done:
StatusBarSetStatusString (UnicodeBuffer);
FreePool (UnicodeBuffer);
}
-/*
- //
- // check whether we have fs?: in filename
- //
- LoopVar1 = 0;
- FSMappingPtr = NULL;
- while (FileName[LoopVar1] != 0) {
- if (FileName[LoopVar1] == L':') {
- FSMappingPtr = &FileName[LoopVar1];
- break;
- }
-
- LoopVar1++;
- }
- if (FSMappingPtr == NULL) {
- CurDir = ShellGetCurrentDir (NULL);
- } else {
- LoopVar1 = 0;
- LoopVar2 = 0;
+ /*
+ //
+ // check whether we have fs?: in filename
+ //
+ LoopVar1 = 0;
+ FSMappingPtr = NULL;
while (FileName[LoopVar1] != 0) {
if (FileName[LoopVar1] == L':') {
+ FSMappingPtr = &FileName[LoopVar1];
break;
}
- FSMapping[LoopVar2++] = FileName[LoopVar1];
-
LoopVar1++;
}
- FSMapping[LoopVar2] = 0;
- CurDir = ShellGetCurrentDir (FSMapping);
- }
+ if (FSMappingPtr == NULL) {
+ CurDir = ShellGetCurrentDir (NULL);
+ } else {
+ LoopVar1 = 0;
+ LoopVar2 = 0;
+ while (FileName[LoopVar1] != 0) {
+ if (FileName[LoopVar1] == L':') {
+ break;
+ }
- if (CurDir != NULL) {
- for (LoopVar1 = 0; LoopVar1 < StrLen (CurDir) && CurDir[LoopVar1] != ':'; LoopVar1++);
+ FSMapping[LoopVar2++] = FileName[LoopVar1];
- CurDir[LoopVar1] = 0;
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ShellGetMap (CurDir);
- FreePool (CurDir);
- } else {
- return EFI_LOAD_ERROR;
- }
+ LoopVar1++;
+ }
- Status = LibDevicePathToInterface (
- &gEfiSimpleFileSystemProtocolGuid,
- DevicePath,
- (VOID **) &Vol
- );
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
+ FSMapping[LoopVar2] = 0;
+ CurDir = ShellGetCurrentDir (FSMapping);
+ }
- Status = Vol->OpenVolume (Vol, &RootFs);
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
- //
- // Get volume information of file system
- //
- Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + 100;
- VolumeInfo = (EFI_FILE_SYSTEM_INFO *) AllocateZeroPool (Size);
- Status = RootFs->GetInfo (RootFs, &gEfiFileSystemInfoGuid, &Size, VolumeInfo);
- if (EFI_ERROR (Status)) {
- RootFs->Close (RootFs);
- return EFI_LOAD_ERROR;
- }
+ if (CurDir != NULL) {
+ for (LoopVar1 = 0; LoopVar1 < StrLen (CurDir) && CurDir[LoopVar1] != ':'; LoopVar1++);
- if (VolumeInfo->ReadOnly) {
- StatusBarSetStatusString (L"WARNING: Volume Read Only");
- }
+ CurDir[LoopVar1] = 0;
+ DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ShellGetMap (CurDir);
+ FreePool (CurDir);
+ } else {
+ return EFI_LOAD_ERROR;
+ }
- FreePool (VolumeInfo);
- RootFs->Close (RootFs);
- }
-//
-*/
+ Status = LibDevicePathToInterface (
+ &gEfiSimpleFileSystemProtocolGuid,
+ DevicePath,
+ (VOID **) &Vol
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_LOAD_ERROR;
+ }
+
+ Status = Vol->OpenVolume (Vol, &RootFs);
+ if (EFI_ERROR (Status)) {
+ return EFI_LOAD_ERROR;
+ }
+ //
+ // Get volume information of file system
+ //
+ Size = SIZE_OF_EFI_FILE_SYSTEM_INFO + 100;
+ VolumeInfo = (EFI_FILE_SYSTEM_INFO *) AllocateZeroPool (Size);
+ Status = RootFs->GetInfo (RootFs, &gEfiFileSystemInfoGuid, &Size, VolumeInfo);
+ if (EFI_ERROR (Status)) {
+ RootFs->Close (RootFs);
+ return EFI_LOAD_ERROR;
+ }
+
+ if (VolumeInfo->ReadOnly) {
+ StatusBarSetStatusString (L"WARNING: Volume Read Only");
+ }
+
+ FreePool (VolumeInfo);
+ RootFs->Close (RootFs);
+ }
+ //
+ */
//
// has line
//
@@ -1248,7 +1273,6 @@ Done:
FileBufferOnlyLineNeedRefresh = FALSE;
FileBufferMouseNeedRefresh = TRUE;
-
return EFI_SUCCESS;
}
@@ -1262,12 +1286,12 @@ Done:
**/
VOID
GetNewLine (
- IN CONST EE_NEWLINE_TYPE Type,
- OUT CHAR8 *Buffer,
- OUT UINT8 *Size
+ IN CONST EE_NEWLINE_TYPE Type,
+ OUT CHAR8 *Buffer,
+ OUT UINT8 *Size
)
{
- UINT8 NewLineSize;
+ UINT8 NewLineSize;
//
// give new line buffer,
@@ -1278,10 +1302,11 @@ GetNewLine (
//
// not legal new line type
//
- if (Type != NewLineTypeLineFeed && Type != NewLineTypeCarriageReturn && Type != NewLineTypeCarriageReturnLineFeed && Type != NewLineTypeLineFeedCarriageReturn) {
+ if ((Type != NewLineTypeLineFeed) && (Type != NewLineTypeCarriageReturn) && (Type != NewLineTypeCarriageReturnLineFeed) && (Type != NewLineTypeLineFeedCarriageReturn)) {
*Size = 0;
- return ;
+ return;
}
+
//
// use_cr: give 0x0d
//
@@ -1296,8 +1321,9 @@ GetNewLine (
}
*Size = NewLineSize;
- return ;
+ return;
}
+
//
// use_lf: give 0x0a
//
@@ -1312,17 +1338,18 @@ GetNewLine (
}
*Size = NewLineSize;
- return ;
+ return;
}
+
//
// use_crlf: give 0x0d 0x0a
//
if (Type == NewLineTypeCarriageReturnLineFeed) {
if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0d;
- Buffer[1] = 0;
- Buffer[2] = 0x0a;
- Buffer[3] = 0;
+ Buffer[0] = 0x0d;
+ Buffer[1] = 0;
+ Buffer[2] = 0x0a;
+ Buffer[3] = 0;
NewLineSize = 4;
} else {
@@ -1332,17 +1359,18 @@ GetNewLine (
}
*Size = NewLineSize;
- return ;
+ return;
}
+
//
// use_lfcr: give 0x0a 0x0d
//
if (Type == NewLineTypeLineFeedCarriageReturn) {
if (MainEditor.FileBuffer->FileType == FileTypeUnicode) {
- Buffer[0] = 0x0a;
- Buffer[1] = 0;
- Buffer[2] = 0x0d;
- Buffer[3] = 0;
+ Buffer[0] = 0x0a;
+ Buffer[1] = 0;
+ Buffer[2] = 0x0d;
+ Buffer[3] = 0;
NewLineSize = 4;
} else {
@@ -1352,9 +1380,8 @@ GetNewLine (
}
*Size = NewLineSize;
- return ;
+ return;
}
-
}
/**
@@ -1368,18 +1395,18 @@ GetNewLine (
**/
UINTN
UnicodeToAscii (
- IN CONST CHAR16 *UStr,
- IN CONST UINTN Length,
- OUT CHAR8 *AStr
+ IN CONST CHAR16 *UStr,
+ IN CONST UINTN Length,
+ OUT CHAR8 *AStr
)
{
- UINTN Index;
+ UINTN Index;
//
// just buffer copy, not character copy
//
for (Index = 0; Index < Length; Index++) {
- *AStr++ = (CHAR8) *UStr++;
+ *AStr++ = (CHAR8)*UStr++;
}
return Index;
@@ -1396,36 +1423,36 @@ UnicodeToAscii (
**/
EFI_STATUS
FileBufferSave (
- IN CONST CHAR16 *FileName
+ IN CONST CHAR16 *FileName
)
{
- SHELL_FILE_HANDLE FileHandle;
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
- CHAR16 *Str;
+ SHELL_FILE_HANDLE FileHandle;
+ LIST_ENTRY *Link;
+ EFI_EDITOR_LINE *Line;
+ CHAR16 *Str;
- EFI_STATUS Status;
- UINTN Length;
- UINTN NumLines;
- CHAR8 NewLineBuffer[4];
- UINT8 NewLineSize;
+ EFI_STATUS Status;
+ UINTN Length;
+ UINTN NumLines;
+ CHAR8 NewLineBuffer[4];
+ UINT8 NewLineSize;
- EFI_FILE_INFO *Info;
+ EFI_FILE_INFO *Info;
- UINT64 Attribute;
+ UINT64 Attribute;
- EE_NEWLINE_TYPE Type;
+ EE_NEWLINE_TYPE Type;
- UINTN TotalSize;
+ UINTN TotalSize;
//
// 2M
//
- CHAR8 *Cache;
- UINTN LeftSize;
- UINTN Size;
- CHAR8 *Ptr;
+ CHAR8 *Cache;
+ UINTN LeftSize;
+ UINTN Size;
+ CHAR8 *Ptr;
- Length = 0;
+ Length = 0;
//
// 2M
//
@@ -1433,12 +1460,10 @@ FileBufferSave (
Attribute = 0;
-
-
//
// if is the old file
//
- if (FileBuffer.FileName != NULL && StrCmp (FileName, FileBuffer.FileName) == 0) {
+ if ((FileBuffer.FileName != NULL) && (StrCmp (FileName, FileBuffer.FileName) == 0)) {
//
// file has not been modified
//
@@ -1458,29 +1483,29 @@ FileBufferSave (
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
if (!EFI_ERROR (Status)) {
- Info = ShellGetFileInfo(FileHandle);
+ Info = ShellGetFileInfo (FileHandle);
- if (Info != NULL && Info->Attribute & EFI_FILE_DIRECTORY) {
+ if ((Info != NULL) && Info->Attribute & EFI_FILE_DIRECTORY) {
StatusBarSetStatusString (L"Directory Can Not Be Saved");
ShellCloseFile (&FileHandle);
- FreePool(Info);
+ FreePool (Info);
return EFI_LOAD_ERROR;
}
if (Info != NULL) {
Attribute = Info->Attribute & ~EFI_FILE_READ_ONLY;
- FreePool(Info);
+ FreePool (Info);
}
//
// if file exits, so delete it
//
Status = ShellDeleteFile (&FileHandle);
- if (EFI_ERROR (Status) || Status == EFI_WARN_DELETE_FAILURE) {
+ if (EFI_ERROR (Status) || (Status == EFI_WARN_DELETE_FAILURE)) {
StatusBarSetStatusString (L"Write File Failed");
return EFI_LOAD_ERROR;
}
- }
+ }
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, Attribute);
@@ -1493,8 +1518,8 @@ FileBufferSave (
// if file is Unicode file, write Unicode header to it.
//
if (FileBuffer.FileType == FileTypeUnicode) {
- Length = 2;
- Status = ShellWriteFile (FileHandle, &Length, (VOID*)&gUnicodeFileTag);
+ Length = 2;
+ Status = ShellWriteFile (FileHandle, &Length, (VOID *)&gUnicodeFileTag);
if (EFI_ERROR (Status)) {
ShellDeleteFile (&FileHandle);
return EFI_LOAD_ERROR;
@@ -1510,11 +1535,11 @@ FileBufferSave (
//
// write all the lines back to disk
//
- NumLines = 0;
- Type = NewLineTypeCarriageReturnLineFeed;
+ NumLines = 0;
+ Type = NewLineTypeCarriageReturnLineFeed;
- Ptr = Cache;
- LeftSize = TotalSize;
+ Ptr = Cache;
+ LeftSize = TotalSize;
for (Link = FileBuffer.ListHead->ForwardLink; Link != FileBuffer.ListHead; Link = Link->ForwardLink) {
Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
@@ -1522,16 +1547,18 @@ FileBufferSave (
if (Line->Type != NewLineTypeDefault) {
Type = Line->Type;
}
+
//
// newline character is at most 4 bytes ( two Unicode characters )
//
Length = 4;
- if (Line->Buffer != NULL && Line->Size != 0) {
+ if ((Line->Buffer != NULL) && (Line->Size != 0)) {
if (FileBuffer.FileType == FileTypeAscii) {
Length += Line->Size;
} else {
Length += (Line->Size * 2);
}
+
//
// end if FileTypeAscii
//
@@ -1541,32 +1568,34 @@ FileBufferSave (
// no cache room left, so write cache to disk
//
if (LeftSize < Length) {
- Size = TotalSize - LeftSize;
- Status = ShellWriteFile (FileHandle, &Size, Cache);
+ Size = TotalSize - LeftSize;
+ Status = ShellWriteFile (FileHandle, &Size, Cache);
if (EFI_ERROR (Status)) {
ShellDeleteFile (&FileHandle);
FreePool (Cache);
return EFI_LOAD_ERROR;
}
- Ptr = Cache;
- LeftSize = TotalSize;
+
+ Ptr = Cache;
+ LeftSize = TotalSize;
}
- if (Line->Buffer != NULL && Line->Size != 0) {
+ if ((Line->Buffer != NULL) && (Line->Size != 0)) {
if (FileBuffer.FileType == FileTypeAscii) {
UnicodeToAscii (Line->Buffer, Line->Size, Ptr);
Length = Line->Size;
} else {
Length = (Line->Size * 2);
- CopyMem (Ptr, (CHAR8 *) Line->Buffer, Length);
+ CopyMem (Ptr, (CHAR8 *)Line->Buffer, Length);
}
+
//
// end if FileTypeAscii
//
- Ptr += Length;
+ Ptr += Length;
LeftSize -= Length;
-
}
+
//
// end of if Line -> Buffer != NULL && Line -> Size != 0
//
@@ -1574,9 +1603,9 @@ FileBufferSave (
//
if (Link->ForwardLink != FileBuffer.ListHead) {
GetNewLine (Type, NewLineBuffer, &NewLineSize);
- CopyMem (Ptr, (CHAR8 *) NewLineBuffer, NewLineSize);
+ CopyMem (Ptr, (CHAR8 *)NewLineBuffer, NewLineSize);
- Ptr += NewLineSize;
+ Ptr += NewLineSize;
LeftSize -= NewLineSize;
}
@@ -1584,8 +1613,8 @@ FileBufferSave (
}
if (TotalSize != LeftSize) {
- Size = TotalSize - LeftSize;
- Status = ShellWriteFile (FileHandle, &Size, Cache);
+ Size = TotalSize - LeftSize;
+ Status = ShellWriteFile (FileHandle, &Size, Cache);
if (EFI_ERROR (Status)) {
ShellDeleteFile (&FileHandle);
FreePool (Cache);
@@ -1595,7 +1624,7 @@ FileBufferSave (
FreePool (Cache);
- ShellCloseFile(&FileHandle);
+ ShellCloseFile (&FileHandle);
FileBuffer.FileModified = FALSE;
@@ -1613,7 +1642,7 @@ FileBufferSave (
//
// now everything is ready , you can set the new file name to filebuffer
//
- if (FileName != NULL && FileBuffer.FileName != NULL && StrCmp (FileName, FileBuffer.FileName) != 0) {
+ if ((FileName != NULL) && (FileBuffer.FileName != NULL) && (StrCmp (FileName, FileBuffer.FileName) != 0)) {
//
// not the same
//
@@ -1638,14 +1667,14 @@ FileBufferScrollLeft (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// if already at start of this line, so move to the end of previous line
@@ -1656,8 +1685,8 @@ FileBufferScrollLeft (
//
if (Line->Link.BackLink != FileBuffer.ListHead) {
FRow--;
- Line = CR (Line->Link.BackLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- FCol = Line->Size + 1;
+ Line = CR (Line->Link.BackLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ FCol = Line->Size + 1;
} else {
return EFI_SUCCESS;
}
@@ -1681,11 +1710,11 @@ FileBufferScrollLeft (
**/
VOID
LineDeleteAt (
- IN OUT EFI_EDITOR_LINE *Line,
- IN UINTN Pos
+ IN OUT EFI_EDITOR_LINE *Line,
+ IN UINTN Pos
)
{
- UINTN Index;
+ UINTN Index;
//
// move the latter characters front
@@ -1705,16 +1734,16 @@ LineDeleteAt (
**/
VOID
LineCat (
- IN OUT EFI_EDITOR_LINE *Dest,
- IN EFI_EDITOR_LINE *Src
+ IN OUT EFI_EDITOR_LINE *Dest,
+ IN EFI_EDITOR_LINE *Src
)
{
CHAR16 *Str;
UINTN Size;
- Size = Dest->Size;
+ Size = Dest->Size;
- Dest->Buffer[Size] = 0;
+ Dest->Buffer[Size] = 0;
//
// concatenate the two strings
@@ -1722,7 +1751,7 @@ LineCat (
Str = CatSPrint (NULL, L"%s%s", Dest->Buffer, Src->Buffer);
if (Str == NULL) {
Dest->Buffer = NULL;
- return ;
+ return;
}
Dest->Size = Size + Src->Size;
@@ -1748,14 +1777,14 @@ FileBufferDoBackspace (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *End;
- LIST_ENTRY *Link;
- UINTN FileColumn;
+ EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *End;
+ LIST_ENTRY *Link;
+ UINTN FileColumn;
- FileColumn = FileBuffer.FilePosition.Column;
+ FileColumn = FileBuffer.FilePosition.Column;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
//
// the first column
@@ -1770,9 +1799,9 @@ FileBufferDoBackspace (
FileBufferScrollLeft ();
- Line = FileBuffer.CurrentLine;
- Link = Line->Link.ForwardLink;
- End = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ Line = FileBuffer.CurrentLine;
+ Link = Line->Link.ForwardLink;
+ End = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
//
// concatenate this line with previous line
@@ -1781,6 +1810,7 @@ FileBufferDoBackspace (
if (Line->Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// remove End from line list
//
@@ -1791,7 +1821,6 @@ FileBufferDoBackspace (
FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE;
-
} else {
//
// just delete the previous character
@@ -1819,30 +1848,30 @@ FileBufferDoReturn (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN FileColumn;
- UINTN Index;
- CHAR16 *Buffer;
- UINTN Row;
- UINTN Col;
+ EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *NewLine;
+ UINTN FileColumn;
+ UINTN Index;
+ CHAR16 *Buffer;
+ UINTN Row;
+ UINTN Col;
FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FileColumn = FileBuffer.FilePosition.Column;
+ FileColumn = FileBuffer.FilePosition.Column;
- NewLine = AllocateZeroPool (sizeof (EFI_EDITOR_LINE));
+ NewLine = AllocateZeroPool (sizeof (EFI_EDITOR_LINE));
if (NewLine == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- NewLine->Signature = LINE_LIST_SIGNATURE;
- NewLine->Size = Line->Size - FileColumn + 1;
- NewLine->TotalSize = NewLine->Size;
- NewLine->Buffer = CatSPrint (NULL, L"\0");
+ NewLine->Signature = LINE_LIST_SIGNATURE;
+ NewLine->Size = Line->Size - FileColumn + 1;
+ NewLine->TotalSize = NewLine->Size;
+ NewLine->Buffer = CatSPrint (NULL, L"\0");
if (NewLine->Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -1868,11 +1897,12 @@ FileBufferDoReturn (
NewLine->Buffer[Index] = Line->Buffer[Index + FileColumn - 1];
}
- NewLine->Buffer[NewLine->Size] = CHAR_NULL;
+ NewLine->Buffer[NewLine->Size] = CHAR_NULL;
- Line->Buffer[FileColumn - 1] = CHAR_NULL;
- Line->Size = FileColumn - 1;
+ Line->Buffer[FileColumn - 1] = CHAR_NULL;
+ Line->Size = FileColumn - 1;
}
+
//
// increase NumLines
//
@@ -1881,10 +1911,10 @@ FileBufferDoReturn (
//
// insert it into the correct position of line list
//
- NewLine->Link.BackLink = &(Line->Link);
- NewLine->Link.ForwardLink = Line->Link.ForwardLink;
+ NewLine->Link.BackLink = &(Line->Link);
+ NewLine->Link.ForwardLink = Line->Link.ForwardLink;
Line->Link.ForwardLink->BackLink = &(NewLine->Link);
- Line->Link.ForwardLink = &(NewLine->Link);
+ Line->Link.ForwardLink = &(NewLine->Link);
//
// move cursor to the start of next line
@@ -1915,13 +1945,13 @@ FileBufferDoDelete (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *Next;
- LIST_ENTRY *Link;
- UINTN FileColumn;
+ EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *Next;
+ LIST_ENTRY *Link;
+ UINTN FileColumn;
- Line = FileBuffer.CurrentLine;
- FileColumn = FileBuffer.FilePosition.Column;
+ Line = FileBuffer.CurrentLine;
+ FileColumn = FileBuffer.FilePosition.Column;
//
// the last column
@@ -1933,12 +1963,13 @@ FileBufferDoDelete (
if (Line->Link.ForwardLink == FileBuffer.ListHead) {
return EFI_SUCCESS;
}
+
//
// since last character,
// so will add the next line to this line
//
- Link = Line->Link.ForwardLink;
- Next = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ Link = Line->Link.ForwardLink;
+ Next = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
LineCat (Line, Next);
if (Line->Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -1951,7 +1982,6 @@ FileBufferDoDelete (
FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE;
-
} else {
//
// just delete current character
@@ -1977,17 +2007,17 @@ FileBufferScrollRight (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
Line = FileBuffer.CurrentLine;
if (Line->Buffer == NULL) {
return EFI_SUCCESS;
}
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// if already at end of this line, scroll it to the start of next line
@@ -2039,7 +2069,7 @@ LineStrInsert (
Index = (StrSize) * 2;
- Str = Line->Buffer;
+ Str = Line->Buffer;
//
// do not have free space
@@ -2052,6 +2082,7 @@ LineStrInsert (
Line->TotalSize += 8;
}
+
//
// move the later part of the string one character right
//
@@ -2059,12 +2090,13 @@ LineStrInsert (
for (Index = StrSize; Index > Pos; Index--) {
TempStringPtr[Index] = TempStringPtr[Index - 1];
}
+
//
// insert char into it.
//
- TempStringPtr[Index] = Char;
+ TempStringPtr[Index] = Char;
- Line->Buffer = Str;
+ Line->Buffer = Str;
Line->Size++;
return StrSize + 1;
@@ -2082,8 +2114,8 @@ FileBufferAddChar (
IN CHAR16 Char
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FilePos;
+ EFI_EDITOR_LINE *Line;
+ UINTN FilePos;
Line = FileBuffer.CurrentLine;
@@ -2098,11 +2130,12 @@ FileBufferAddChar (
// or replace the character.
//
FilePos = FileBuffer.FilePosition.Column - 1;
- if (FileBuffer.ModeInsert || FilePos + 1 > Line->Size) {
+ if (FileBuffer.ModeInsert || (FilePos + 1 > Line->Size)) {
LineStrInsert (Line, Char, FilePos, Line->Size + 1);
} else {
Line->Buffer[FilePos] = Char;
}
+
//
// move cursor to right
//
@@ -2126,7 +2159,7 @@ FileBufferAddChar (
**/
EFI_STATUS
FileBufferDoCharInput (
- IN CONST CHAR16 Char
+ IN CONST CHAR16 Char
)
{
EFI_STATUS Status;
@@ -2134,36 +2167,35 @@ FileBufferDoCharInput (
Status = EFI_SUCCESS;
switch (Char) {
- case CHAR_NULL:
- break;
+ case CHAR_NULL:
+ break;
- case CHAR_BACKSPACE:
- Status = FileBufferDoBackspace ();
- break;
+ case CHAR_BACKSPACE:
+ Status = FileBufferDoBackspace ();
+ break;
- case CHAR_TAB:
- //
- // Tabs are ignored
- //
- break;
-
- case CHAR_LINEFEED:
- case CHAR_CARRIAGE_RETURN:
- Status = FileBufferDoReturn ();
- break;
+ case CHAR_TAB:
+ //
+ // Tabs are ignored
+ //
+ break;
- default:
- //
- // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
- //
- if (Char > 127 || Char < 32) {
- Status = StatusBarSetStatusString (L"Unknown Command");
- } else {
- Status = FileBufferAddChar (Char);
- }
+ case CHAR_LINEFEED:
+ case CHAR_CARRIAGE_RETURN:
+ Status = FileBufferDoReturn ();
+ break;
- break;
+ default:
+ //
+ // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
+ //
+ if ((Char > 127) || (Char < 32)) {
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ } else {
+ Status = FileBufferAddChar (Char);
+ }
+ break;
}
return Status;
@@ -2179,17 +2211,17 @@ FileBufferScrollDown (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
Line = FileBuffer.CurrentLine;
if (Line->Buffer == NULL) {
return EFI_SUCCESS;
}
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// has next line
@@ -2204,7 +2236,6 @@ FileBufferScrollDown (
if (FCol > Line->Size) {
FCol = Line->Size + 1;
}
-
} else {
return EFI_SUCCESS;
}
@@ -2224,14 +2255,14 @@ FileBufferScrollUp (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// has previous line
@@ -2246,7 +2277,6 @@ FileBufferScrollUp (
if (FCol > Line->Size) {
FCol = Line->Size + 1;
}
-
} else {
return EFI_SUCCESS;
}
@@ -2266,15 +2296,15 @@ FileBufferPageDown (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
+ UINTN Gap;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// has next page
@@ -2287,6 +2317,7 @@ FileBufferPageDown (
//
Gap = FileBuffer.NumLines - FRow;
}
+
//
// get correct line
//
@@ -2295,7 +2326,7 @@ FileBufferPageDown (
//
// if that line, is not that long, so move to the end of that line
//
- if (Line != NULL && FCol > Line->Size) {
+ if ((Line != NULL) && (FCol > Line->Size)) {
FCol = Line->Size + 1;
}
@@ -2316,16 +2347,16 @@ FileBufferPageUp (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
- INTN Retreat;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
+ UINTN Gap;
+ INTN Retreat;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FRow = FileBuffer.FilePosition.Row;
- FCol = FileBuffer.FilePosition.Column;
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = FileBuffer.FilePosition.Column;
//
// has previous page
@@ -2350,7 +2381,7 @@ FileBufferPageUp (
//
// if that line is not that long, so move to the end of that line
//
- if (Line != NULL && FCol > Line->Size) {
+ if ((Line != NULL) && (FCol > Line->Size)) {
FCol = Line->Size + 1;
}
@@ -2371,13 +2402,13 @@ FileBufferEnd (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
+ EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
- Line = FileBuffer.CurrentLine;
+ Line = FileBuffer.CurrentLine;
- FRow = FileBuffer.FilePosition.Row;
+ FRow = FileBuffer.FilePosition.Row;
//
// goto the last column of the line
@@ -2405,7 +2436,7 @@ FileBufferEnd (
**/
EFI_STATUS
FileBufferHandleInput (
- IN CONST EFI_INPUT_KEY *Key
+ IN CONST EFI_INPUT_KEY *Key
)
{
EFI_STATUS Status;
@@ -2413,98 +2444,98 @@ FileBufferHandleInput (
Status = EFI_SUCCESS;
switch (Key->ScanCode) {
- //
- // ordinary key input
- //
- case SCAN_NULL:
- if (!FileBuffer.ReadOnly) {
- Status = FileBufferDoCharInput (Key->UnicodeChar);
- } else {
- Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- }
+ //
+ // ordinary key input
+ //
+ case SCAN_NULL:
+ if (!FileBuffer.ReadOnly) {
+ Status = FileBufferDoCharInput (Key->UnicodeChar);
+ } else {
+ Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
+ }
- break;
+ break;
- //
- // up arrow
- //
- case SCAN_UP:
- Status = FileBufferScrollUp ();
- break;
+ //
+ // up arrow
+ //
+ case SCAN_UP:
+ Status = FileBufferScrollUp ();
+ break;
- //
- // down arrow
- //
- case SCAN_DOWN:
- Status = FileBufferScrollDown ();
- break;
+ //
+ // down arrow
+ //
+ case SCAN_DOWN:
+ Status = FileBufferScrollDown ();
+ break;
- //
- // right arrow
- //
- case SCAN_RIGHT:
- Status = FileBufferScrollRight ();
- break;
+ //
+ // right arrow
+ //
+ case SCAN_RIGHT:
+ Status = FileBufferScrollRight ();
+ break;
- //
- // left arrow
- //
- case SCAN_LEFT:
- Status = FileBufferScrollLeft ();
- break;
+ //
+ // left arrow
+ //
+ case SCAN_LEFT:
+ Status = FileBufferScrollLeft ();
+ break;
- //
- // page up
- //
- case SCAN_PAGE_UP:
- Status = FileBufferPageUp ();
- break;
+ //
+ // page up
+ //
+ case SCAN_PAGE_UP:
+ Status = FileBufferPageUp ();
+ break;
- //
- // page down
- //
- case SCAN_PAGE_DOWN:
- Status = FileBufferPageDown ();
- break;
+ //
+ // page down
+ //
+ case SCAN_PAGE_DOWN:
+ Status = FileBufferPageDown ();
+ break;
- //
- // delete
- //
- case SCAN_DELETE:
- if (!FileBuffer.ReadOnly) {
- Status = FileBufferDoDelete ();
- } else {
- Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
- }
+ //
+ // delete
+ //
+ case SCAN_DELETE:
+ if (!FileBuffer.ReadOnly) {
+ Status = FileBufferDoDelete ();
+ } else {
+ Status = StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
+ }
- break;
+ break;
- //
- // home
- //
- case SCAN_HOME:
- FileBufferMovePosition (FileBuffer.FilePosition.Row, 1);
- Status = EFI_SUCCESS;
- break;
+ //
+ // home
+ //
+ case SCAN_HOME:
+ FileBufferMovePosition (FileBuffer.FilePosition.Row, 1);
+ Status = EFI_SUCCESS;
+ break;
- //
- // end
- //
- case SCAN_END:
- Status = FileBufferEnd ();
- break;
+ //
+ // end
+ //
+ case SCAN_END:
+ Status = FileBufferEnd ();
+ break;
- //
- // insert
- //
- case SCAN_INSERT:
- FileBuffer.ModeInsert = (BOOLEAN)!FileBuffer.ModeInsert;
- Status = EFI_SUCCESS;
- break;
+ //
+ // insert
+ //
+ case SCAN_INSERT:
+ FileBuffer.ModeInsert = (BOOLEAN) !FileBuffer.ModeInsert;
+ Status = EFI_SUCCESS;
+ break;
- default:
- Status = StatusBarSetStatusString (L"Unknown Command");
- break;
+ default:
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ break;
}
return Status;
@@ -2520,7 +2551,7 @@ FileBufferHandleInput (
**/
BOOLEAN
AboveCurrentScreen (
- IN UINTN FileRow
+ IN UINTN FileRow
)
{
//
@@ -2543,7 +2574,7 @@ AboveCurrentScreen (
**/
BOOLEAN
UnderCurrentScreen (
- IN UINTN FileRow
+ IN UINTN FileRow
)
{
//
@@ -2566,7 +2597,7 @@ UnderCurrentScreen (
**/
BOOLEAN
LeftCurrentScreen (
- IN UINTN FileCol
+ IN UINTN FileCol
)
{
//
@@ -2589,7 +2620,7 @@ LeftCurrentScreen (
**/
BOOLEAN
RightCurrentScreen (
- IN UINTN FileCol
+ IN UINTN FileCol
)
{
//
@@ -2614,17 +2645,17 @@ RightCurrentScreen (
**/
EFI_EDITOR_LINE *
MoveCurrentLine (
- IN INTN Count
+ IN INTN Count
)
{
- EFI_EDITOR_LINE *Line;
- UINTN AbsCount;
+ EFI_EDITOR_LINE *Line;
+ UINTN AbsCount;
if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = InternalEditorMiscLineRetreat (AbsCount,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
+ AbsCount = (UINTN)ABS (Count);
+ Line = InternalEditorMiscLineRetreat (AbsCount, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead);
} else {
- Line = InternalEditorMiscLineAdvance ((UINTN)Count,MainEditor.FileBuffer->CurrentLine,MainEditor.FileBuffer->ListHead);
+ Line = InternalEditorMiscLineAdvance ((UINTN)Count, MainEditor.FileBuffer->CurrentLine, MainEditor.FileBuffer->ListHead);
}
if (Line == NULL) {
@@ -2644,26 +2675,26 @@ MoveCurrentLine (
**/
VOID
FileBufferMovePosition (
- IN CONST UINTN NewFilePosRow,
- IN CONST UINTN NewFilePosCol
+ IN CONST UINTN NewFilePosRow,
+ IN CONST UINTN NewFilePosCol
)
{
- INTN RowGap;
- INTN ColGap;
- UINTN Abs;
- BOOLEAN Above;
- BOOLEAN Under;
- BOOLEAN Right;
- BOOLEAN Left;
+ INTN RowGap;
+ INTN ColGap;
+ UINTN Abs;
+ BOOLEAN Above;
+ BOOLEAN Under;
+ BOOLEAN Right;
+ BOOLEAN Left;
//
// CALCULATE gap between current file position and new file position
//
- RowGap = NewFilePosRow - FileBuffer.FilePosition.Row;
- ColGap = NewFilePosCol - FileBuffer.FilePosition.Column;
+ RowGap = NewFilePosRow - FileBuffer.FilePosition.Row;
+ ColGap = NewFilePosCol - FileBuffer.FilePosition.Column;
- Under = UnderCurrentScreen (NewFilePosRow);
- Above = AboveCurrentScreen (NewFilePosRow);
+ Under = UnderCurrentScreen (NewFilePosRow);
+ Above = AboveCurrentScreen (NewFilePosRow);
//
// if is below current screen
//
@@ -2690,7 +2721,7 @@ FileBufferMovePosition (
//
FileBuffer.FilePosition.Row = NewFilePosRow;
if (RowGap < 0) {
- Abs = (UINTN)ABS(RowGap);
+ Abs = (UINTN)ABS (RowGap);
FileBuffer.DisplayPosition.Row -= Abs;
} else {
FileBuffer.DisplayPosition.Row += RowGap;
@@ -2698,10 +2729,10 @@ FileBufferMovePosition (
}
}
- FileBuffer.LowVisibleRange.Row = FileBuffer.FilePosition.Row - (FileBuffer.DisplayPosition.Row - 2);
+ FileBuffer.LowVisibleRange.Row = FileBuffer.FilePosition.Row - (FileBuffer.DisplayPosition.Row - 2);
Right = RightCurrentScreen (NewFilePosCol);
- Left = LeftCurrentScreen (NewFilePosCol);
+ Left = LeftCurrentScreen (NewFilePosCol);
//
// if right to current screen
@@ -2730,7 +2761,7 @@ FileBufferMovePosition (
//
FileBuffer.FilePosition.Column = NewFilePosCol;
if (ColGap < 0) {
- Abs = (UINTN)(-ColGap);
+ Abs = (UINTN)(-ColGap);
FileBuffer.DisplayPosition.Column -= Abs;
} else {
FileBuffer.DisplayPosition.Column += ColGap;
@@ -2744,7 +2775,6 @@ FileBufferMovePosition (
// let CurrentLine point to correct line;
//
FileBuffer.CurrentLine = MoveCurrentLine (RowGap);
-
}
/**
@@ -2759,15 +2789,15 @@ FileBufferMovePosition (
**/
EFI_STATUS
FileBufferCutLine (
- OUT EFI_EDITOR_LINE **CutLine
+ OUT EFI_EDITOR_LINE **CutLine
)
{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN Row;
- UINTN Col;
+ EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *NewLine;
+ UINTN Row;
+ UINTN Col;
- *CutLine = NULL;
+ *CutLine = NULL;
if (FileBuffer.ReadOnly) {
StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
@@ -2779,17 +2809,19 @@ FileBufferCutLine (
//
// if is the last dummy line, SO CAN not cut
//
- if (StrCmp (Line->Buffer, L"\0") == 0 && Line->Link.ForwardLink == FileBuffer.ListHead
- //
- // last line
- //
- ) {
+ if ((StrCmp (Line->Buffer, L"\0") == 0) && (Line->Link.ForwardLink == FileBuffer.ListHead)
+ //
+ // last line
+ //
+ )
+ {
//
// LAST LINE AND NOTHING ON THIS LINE, SO CUT NOTHING
//
StatusBarSetStatusString (L"Nothing to Cut");
return EFI_NOT_FOUND;
}
+
//
// if is the last line, so create a dummy line
//
@@ -2811,11 +2843,11 @@ FileBufferCutLine (
// move home
//
FileBuffer.CurrentLine = CR (
- FileBuffer.CurrentLine->Link.ForwardLink,
- EFI_EDITOR_LINE,
- Link,
- LINE_LIST_SIGNATURE
- );
+ FileBuffer.CurrentLine->Link.ForwardLink,
+ EFI_EDITOR_LINE,
+ Link,
+ LINE_LIST_SIGNATURE
+ );
RemoveEntryList (&Line->Link);
@@ -2827,7 +2859,7 @@ FileBufferCutLine (
FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE;
- *CutLine = Line;
+ *CutLine = Line;
return EFI_SUCCESS;
}
@@ -2843,10 +2875,10 @@ FileBufferPasteLine (
VOID
)
{
- EFI_EDITOR_LINE *Line;
- EFI_EDITOR_LINE *NewLine;
- UINTN Row;
- UINTN Col;
+ EFI_EDITOR_LINE *Line;
+ EFI_EDITOR_LINE *NewLine;
+ UINTN Row;
+ UINTN Col;
//
// if nothing is on clip board
@@ -2855,6 +2887,7 @@ FileBufferPasteLine (
if (MainEditor.CutLine == NULL) {
return EFI_SUCCESS;
}
+
//
// read only file can not be pasted on
//
@@ -2867,22 +2900,23 @@ FileBufferPasteLine (
if (NewLine == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// insert it above current line
//
- Line = FileBuffer.CurrentLine;
- NewLine->Link.BackLink = Line->Link.BackLink;
- NewLine->Link.ForwardLink = &Line->Link;
+ Line = FileBuffer.CurrentLine;
+ NewLine->Link.BackLink = Line->Link.BackLink;
+ NewLine->Link.ForwardLink = &Line->Link;
Line->Link.BackLink->ForwardLink = &NewLine->Link;
- Line->Link.BackLink = &NewLine->Link;
+ Line->Link.BackLink = &NewLine->Link;
FileBuffer.NumLines++;
- FileBuffer.CurrentLine = NewLine;
+ FileBuffer.CurrentLine = NewLine;
- FileBuffer.Lines = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ FileBuffer.Lines = CR (FileBuffer.ListHead->ForwardLink, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- Col = 1;
+ Col = 1;
//
// move home
//
@@ -2912,19 +2946,19 @@ FileBufferPasteLine (
EFI_STATUS
FileBufferSearch (
IN CONST CHAR16 *Str,
- IN CONST UINTN Offset
+ IN CONST UINTN Offset
)
{
- CHAR16 *Current;
- UINTN Position;
- UINTN Row;
- UINTN Column;
- EFI_EDITOR_LINE *Line;
- CHAR16 *CharPos;
- LIST_ENTRY *Link;
- BOOLEAN Found;
-
- Column = 0;
+ CHAR16 *Current;
+ UINTN Position;
+ UINTN Row;
+ UINTN Column;
+ EFI_EDITOR_LINE *Line;
+ CHAR16 *CharPos;
+ LIST_ENTRY *Link;
+ BOOLEAN Found;
+
+ Column = 0;
Position = 0;
//
@@ -2941,32 +2975,32 @@ FileBufferSearch (
Found = FALSE;
- CharPos = StrStr (Current, Str);
+ CharPos = StrStr (Current, Str);
if (CharPos != NULL) {
Position = CharPos - Current + 1;
- Found = TRUE;
+ Found = TRUE;
}
//
// found
//
if (Found) {
- Column = (Position - 1) + FileBuffer.FilePosition.Column + Offset;
- Row = FileBuffer.FilePosition.Row;
+ Column = (Position - 1) + FileBuffer.FilePosition.Column + Offset;
+ Row = FileBuffer.FilePosition.Row;
} else {
//
// not found so find through next lines
//
- Link = FileBuffer.CurrentLine->Link.ForwardLink;
+ Link = FileBuffer.CurrentLine->Link.ForwardLink;
- Row = FileBuffer.FilePosition.Row + 1;
+ Row = FileBuffer.FilePosition.Row + 1;
while (Link != FileBuffer.ListHead) {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
-// Position = StrStr (Line->Buffer, Str);
- CharPos = StrStr (Line->Buffer, Str);
+ Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ // Position = StrStr (Line->Buffer, Str);
+ CharPos = StrStr (Line->Buffer, Str);
if (CharPos != NULL) {
Position = CharPos - Line->Buffer + 1;
- Found = TRUE;
+ Found = TRUE;
}
if (Found) {
@@ -3016,8 +3050,8 @@ FileBufferSearch (
**/
EFI_STATUS
FileBufferReplace (
- IN CONST CHAR16 *Replace,
- IN CONST UINTN SearchLen
+ IN CONST CHAR16 *Replace,
+ IN CONST UINTN SearchLen
)
{
UINTN ReplaceLen;
@@ -3027,9 +3061,9 @@ FileBufferReplace (
UINTN OldSize;
UINTN Gap;
- ReplaceLen = StrLen (Replace);
+ ReplaceLen = StrLen (Replace);
- OldSize = FileBuffer.CurrentLine->Size + 1;
+ OldSize = FileBuffer.CurrentLine->Size + 1;
//
// include CHAR_NULL
//
@@ -3041,21 +3075,22 @@ FileBufferReplace (
//
if (FileBuffer.CurrentLine->TotalSize + 1 <= NewSize) {
FileBuffer.CurrentLine->Buffer = ReallocatePool (
- 2 * OldSize,
- 2 * NewSize,
- FileBuffer.CurrentLine->Buffer
- );
+ 2 * OldSize,
+ 2 * NewSize,
+ FileBuffer.CurrentLine->Buffer
+ );
FileBuffer.CurrentLine->TotalSize = NewSize - 1;
}
if (FileBuffer.CurrentLine->Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// the end CHAR_NULL character;
//
- Buffer = FileBuffer.CurrentLine->Buffer + (NewSize - 1);
- Gap = ReplaceLen - SearchLen;
+ Buffer = FileBuffer.CurrentLine->Buffer + (NewSize - 1);
+ Gap = ReplaceLen - SearchLen;
//
// keep the latter part
@@ -3064,6 +3099,7 @@ FileBufferReplace (
*Buffer = *(Buffer - Gap);
Buffer--;
}
+
//
// set replace into it
//
@@ -3081,7 +3117,7 @@ FileBufferReplace (
}
Buffer += ReplaceLen;
- Gap = SearchLen - ReplaceLen;
+ Gap = SearchLen - ReplaceLen;
//
// set replace into it
@@ -3103,7 +3139,7 @@ FileBufferReplace (
FileBufferOnlyLineNeedRefresh = TRUE;
- FileBuffer.FileModified = TRUE;
+ FileBuffer.FileModified = TRUE;
MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
FileBufferRestorePosition ();
@@ -3120,14 +3156,14 @@ FileBufferReplace (
**/
VOID
FileBufferAdjustMousePosition (
- IN CONST INT32 TextX,
- IN CONST INT32 TextY
+ IN CONST INT32 TextX,
+ IN CONST INT32 TextY
)
{
- UINTN CoordinateX;
- UINTN CoordinateY;
- UINTN AbsX;
- UINTN AbsY;
+ UINTN CoordinateX;
+ UINTN CoordinateY;
+ UINTN AbsX;
+ UINTN AbsY;
//
// TextX and TextY is mouse movement data returned by mouse driver
@@ -3137,8 +3173,8 @@ FileBufferAdjustMousePosition (
// get absolute value
//
- AbsX = ABS(TextX);
- AbsY = ABS(TextY);
+ AbsX = ABS (TextX);
+ AbsY = ABS (TextY);
CoordinateX = FileBuffer.MousePosition.Column;
CoordinateY = FileBuffer.MousePosition.Row;
@@ -3162,29 +3198,30 @@ FileBufferAdjustMousePosition (
CoordinateY = 0;
}
}
+
//
// check whether new mouse column position is beyond screen
// if not, adjust it
//
- if (CoordinateX >= 1 && CoordinateX <= MainEditor.ScreenSize.Column) {
+ if ((CoordinateX >= 1) && (CoordinateX <= MainEditor.ScreenSize.Column)) {
FileBuffer.MousePosition.Column = CoordinateX;
} else if (CoordinateX < 1) {
FileBuffer.MousePosition.Column = 1;
} else if (CoordinateX > MainEditor.ScreenSize.Column) {
FileBuffer.MousePosition.Column = MainEditor.ScreenSize.Column;
}
+
//
// check whether new mouse row position is beyond screen
// if not, adjust it
//
- if (CoordinateY >= 2 && CoordinateY <= (MainEditor.ScreenSize.Row - 1)) {
+ if ((CoordinateY >= 2) && (CoordinateY <= (MainEditor.ScreenSize.Row - 1))) {
FileBuffer.MousePosition.Row = CoordinateY;
} else if (CoordinateY < 2) {
FileBuffer.MousePosition.Row = 2;
} else if (CoordinateY > (MainEditor.ScreenSize.Row - 1)) {
FileBuffer.MousePosition.Row = (MainEditor.ScreenSize.Row - 1);
}
-
}
/**
@@ -3196,28 +3233,28 @@ FileBufferAdjustMousePosition (
**/
EFI_STATUS
FileBufferReplaceAll (
- IN CHAR16 *SearchStr,
- IN CHAR16 *ReplaceStr,
- IN UINTN Offset
+ IN CHAR16 *SearchStr,
+ IN CHAR16 *ReplaceStr,
+ IN UINTN Offset
)
{
- CHAR16 *Buffer;
- UINTN Position;
- UINTN Column;
- UINTN ReplaceLen;
- UINTN SearchLen;
- UINTN Index;
- UINTN NewSize;
- UINTN OldSize;
- UINTN Gap;
- EFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
- CHAR16 *CharPos;
-
- SearchLen = StrLen (SearchStr);
- ReplaceLen = StrLen (ReplaceStr);
-
- Column = FileBuffer.FilePosition.Column + Offset - 1;
+ CHAR16 *Buffer;
+ UINTN Position;
+ UINTN Column;
+ UINTN ReplaceLen;
+ UINTN SearchLen;
+ UINTN Index;
+ UINTN NewSize;
+ UINTN OldSize;
+ UINTN Gap;
+ EFI_EDITOR_LINE *Line;
+ LIST_ENTRY *Link;
+ CHAR16 *CharPos;
+
+ SearchLen = StrLen (SearchStr);
+ ReplaceLen = StrLen (ReplaceStr);
+
+ Column = FileBuffer.FilePosition.Column + Offset - 1;
if (Column > FileBuffer.CurrentLine->Size) {
Column = FileBuffer.CurrentLine->Size;
@@ -3226,8 +3263,8 @@ FileBufferReplaceAll (
Link = &(FileBuffer.CurrentLine->Link);
while (Link != FileBuffer.ListHead) {
- Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
- CharPos = StrStr (Line->Buffer + Column, SearchStr);
+ Line = CR (Link, EFI_EDITOR_LINE, Link, LINE_LIST_SIGNATURE);
+ CharPos = StrStr (Line->Buffer + Column, SearchStr);
if (CharPos != NULL) {
Position = CharPos - Line->Buffer;// + Column;
//
@@ -3245,21 +3282,22 @@ FileBufferReplaceAll (
//
if (Line->TotalSize + 1 <= NewSize) {
Line->Buffer = ReallocatePool (
- 2 * OldSize,
- 2 * NewSize,
- Line->Buffer
- );
+ 2 * OldSize,
+ 2 * NewSize,
+ Line->Buffer
+ );
Line->TotalSize = NewSize - 1;
}
if (Line->Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// the end CHAR_NULL character;
//
- Buffer = Line->Buffer + (NewSize - 1);
- Gap = ReplaceLen - SearchLen;
+ Buffer = Line->Buffer + (NewSize - 1);
+ Gap = ReplaceLen - SearchLen;
//
// keep the latter part
@@ -3268,18 +3306,18 @@ FileBufferReplaceAll (
*Buffer = *(Buffer - Gap);
Buffer--;
}
-
- } else if (ReplaceLen < SearchLen){
- Buffer = Line->Buffer + Position + ReplaceLen;
- Gap = SearchLen - ReplaceLen;
+ } else if (ReplaceLen < SearchLen) {
+ Buffer = Line->Buffer + Position + ReplaceLen;
+ Gap = SearchLen - ReplaceLen;
for (Index = 0; Index < (Line->Size - Position - ReplaceLen + 1); Index++) {
*Buffer = *(Buffer + Gap);
Buffer++;
}
} else {
- ASSERT(ReplaceLen == SearchLen);
+ ASSERT (ReplaceLen == SearchLen);
}
+
//
// set replace into it
//
@@ -3289,15 +3327,16 @@ FileBufferReplaceAll (
}
Line->Size += (ReplaceLen - SearchLen);
- Column += ReplaceLen;
+ Column += ReplaceLen;
} else {
//
// not found
//
- Column = 0;
- Link = Link->ForwardLink;
+ Column = 0;
+ Link = Link->ForwardLink;
}
}
+
//
// call refresh to fresh edit area
//
@@ -3318,4 +3357,3 @@ FileBufferSetModified (
{
FileBuffer.FileModified = TRUE;
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h
index 6800e4be3d..7a33269eee 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.h
@@ -60,7 +60,7 @@ FileBufferRefresh (
**/
EFI_STATUS
FileBufferHandleInput (
- IN CONST EFI_INPUT_KEY * Key
+ IN CONST EFI_INPUT_KEY *Key
);
/**
@@ -99,7 +99,7 @@ FileBufferRestorePosition (
**/
EFI_STATUS
FileBufferSetFileName (
- IN CONST CHAR16 *Str
+ IN CONST CHAR16 *Str
);
/**
@@ -115,8 +115,8 @@ FileBufferSetFileName (
**/
EFI_STATUS
FileBufferRead (
- IN CONST CHAR16 *FileName,
- IN CONST BOOLEAN Recover
+ IN CONST CHAR16 *FileName,
+ IN CONST BOOLEAN Recover
);
/**
@@ -130,7 +130,7 @@ FileBufferRead (
**/
EFI_STATUS
FileBufferSave (
- CONST CHAR16 *FileName
+ CONST CHAR16 *FileName
);
/**
@@ -141,8 +141,8 @@ FileBufferSave (
**/
VOID
FileBufferMovePosition (
- IN CONST UINTN NewFilePosRow,
- IN CONST UINTN NewFilePosCol
+ IN CONST UINTN NewFilePosRow,
+ IN CONST UINTN NewFilePosCol
);
/**
@@ -157,7 +157,7 @@ FileBufferMovePosition (
**/
EFI_STATUS
FileBufferCutLine (
- OUT EFI_EDITOR_LINE **CutLine
+ OUT EFI_EDITOR_LINE **CutLine
);
/**
@@ -183,7 +183,7 @@ FileBufferPasteLine (
EFI_STATUS
FileBufferSearch (
IN CONST CHAR16 *Str,
- IN CONST UINTN Offset
+ IN CONST UINTN Offset
);
/**
@@ -199,8 +199,8 @@ FileBufferSearch (
**/
EFI_STATUS
FileBufferReplace (
- IN CONST CHAR16 *Replace,
- IN CONST UINTN SearchLen
+ IN CONST CHAR16 *Replace,
+ IN CONST UINTN SearchLen
);
/**
@@ -212,9 +212,9 @@ FileBufferReplace (
**/
EFI_STATUS
FileBufferReplaceAll (
- IN CHAR16 *SearchStr,
- IN CHAR16 *ReplaceStr,
- IN UINTN Offset
+ IN CHAR16 *SearchStr,
+ IN CHAR16 *ReplaceStr,
+ IN UINTN Offset
);
/**
@@ -225,8 +225,8 @@ FileBufferReplaceAll (
**/
VOID
FileBufferAdjustMousePosition (
- IN CONST INT32 TextX,
- IN CONST INT32 TextY
+ IN CONST INT32 TextX,
+ IN CONST INT32 TextY
);
/**
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
index a9423e0d10..58beaaf9c5 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
@@ -14,27 +14,26 @@
//
// the first time editor launch
//
-BOOLEAN EditorFirst;
+BOOLEAN EditorFirst;
//
// it's time editor should exit
//
-BOOLEAN EditorExit;
+BOOLEAN EditorExit;
-BOOLEAN EditorMouseAction;
+BOOLEAN EditorMouseAction;
-extern EFI_EDITOR_FILE_BUFFER FileBuffer;
+extern EFI_EDITOR_FILE_BUFFER FileBuffer;
-extern BOOLEAN FileBufferNeedRefresh;
+extern BOOLEAN FileBufferNeedRefresh;
-extern BOOLEAN FileBufferOnlyLineNeedRefresh;
+extern BOOLEAN FileBufferOnlyLineNeedRefresh;
-extern BOOLEAN FileBufferMouseNeedRefresh;
+extern BOOLEAN FileBufferMouseNeedRefresh;
-extern EFI_EDITOR_FILE_BUFFER FileBufferBackupVar;
-
-EFI_EDITOR_GLOBAL_EDITOR MainEditor;
+extern EFI_EDITOR_FILE_BUFFER FileBufferBackupVar;
+EFI_EDITOR_GLOBAL_EDITOR MainEditor;
/**
Load a file from disk to editor
@@ -155,33 +154,33 @@ MainCommandPasteLine (
Help info that will be displayed.
**/
EFI_STRING_ID MainMenuHelpInfo[] = {
- STRING_TOKEN(STR_EDIT_HELP_TITLE),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_LIST_TITLE),
- STRING_TOKEN(STR_EDIT_HELP_DIV),
- STRING_TOKEN(STR_EDIT_HELP_GO_TO_LINE),
- STRING_TOKEN(STR_EDIT_HELP_SAVE_FILE),
- STRING_TOKEN(STR_EDIT_HELP_EXIT),
- STRING_TOKEN(STR_EDIT_HELP_SEARCH),
- STRING_TOKEN(STR_EDIT_HELP_SEARCH_REPLACE),
- STRING_TOKEN(STR_EDIT_HELP_CUT_LINE),
- STRING_TOKEN(STR_EDIT_HELP_PASTE_LINE),
- STRING_TOKEN(STR_EDIT_HELP_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_HELP_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_EXIT_HELP),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_BLANK),
- STRING_TOKEN(STR_EDIT_HELP_DIV),
-0
+ STRING_TOKEN (STR_EDIT_HELP_TITLE),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_LIST_TITLE),
+ STRING_TOKEN (STR_EDIT_HELP_DIV),
+ STRING_TOKEN (STR_EDIT_HELP_GO_TO_LINE),
+ STRING_TOKEN (STR_EDIT_HELP_SAVE_FILE),
+ STRING_TOKEN (STR_EDIT_HELP_EXIT),
+ STRING_TOKEN (STR_EDIT_HELP_SEARCH),
+ STRING_TOKEN (STR_EDIT_HELP_SEARCH_REPLACE),
+ STRING_TOKEN (STR_EDIT_HELP_CUT_LINE),
+ STRING_TOKEN (STR_EDIT_HELP_PASTE_LINE),
+ STRING_TOKEN (STR_EDIT_HELP_OPEN_FILE),
+ STRING_TOKEN (STR_EDIT_HELP_FILE_TYPE),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_EXIT_HELP),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_BLANK),
+ STRING_TOKEN (STR_EDIT_HELP_DIV),
+ 0
};
-MENU_ITEM_FUNCTION MainControlBasedMenuFunctions[] = {
+MENU_ITEM_FUNCTION MainControlBasedMenuFunctions[] = {
NULL,
NULL, /* Ctrl - A */
NULL, /* Ctrl - B */
@@ -213,55 +212,55 @@ MENU_ITEM_FUNCTION MainControlBasedMenuFunctions[] = {
EDITOR_MENU_ITEM MainMenuItems[] = {
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_GO_TO_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F1),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_GO_TO_LINE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F1),
MainCommandGotoLine
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SAVE_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F2),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_SAVE_FILE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F2),
MainCommandSaveFile
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_EXIT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F3),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_EXIT),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F3),
MainCommandExit
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SEARCH),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F4),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_SEARCH),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F4),
MainCommandSearch
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_SEARCH_REPLACE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F5),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_SEARCH_REPLACE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F5),
MainCommandSearchReplace
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_CUT_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F6),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_CUT_LINE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F6),
MainCommandCutLine
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_PASTE_LINE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F7),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_PASTE_LINE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F7),
MainCommandPasteLine
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F8),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_OPEN_FILE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F8),
MainCommandOpenFile
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F9),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_FILE_TYPE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F9),
MainCommandSwitchFileType
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_FILE_TYPE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F11),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_FILE_TYPE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F11),
MainCommandSwitchFileType
},
@@ -272,7 +271,6 @@ EDITOR_MENU_ITEM MainMenuItems[] = {
}
};
-
/**
Load a file from disk to editor
@@ -317,11 +315,11 @@ MainCommandOpenFile (
// whether to save it first.
//
if (MainEditor.FileBuffer->FileModified) {
-
Status = InputBarSetPrompt (L"File modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// the answer is just one character
//
@@ -329,6 +327,7 @@ MainCommandOpenFile (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// loop for user's answer
// valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
@@ -336,7 +335,7 @@ MainCommandOpenFile (
Done = FALSE;
while (!Done) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -345,36 +344,37 @@ MainCommandOpenFile (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this file first
- //
- Status = FileBufferSave (MainEditor.FileBuffer->FileName);
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // want to save this file first
+ //
+ Status = FileBufferSave (MainEditor.FileBuffer->FileName);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
- FileBufferRestorePosition ();
- Done = TRUE;
- break;
+ MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
+ FileBufferRestorePosition ();
+ Done = TRUE;
+ break;
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
+ case L'n':
+ case L'N':
+ //
+ // the file won't be saved
+ //
+ Done = TRUE;
+ break;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
+
//
// TO get the open file name
//
@@ -392,7 +392,7 @@ MainCommandOpenFile (
while (1) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -400,14 +400,15 @@ MainCommandOpenFile (
if (Status == EFI_NOT_READY) {
return EFI_SUCCESS;
}
+
//
// The input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
+ if (StrLen (InputBarGetString ()) > 0) {
//
// CHECK if filename is valid
//
- if (!IsValidFileName (InputBarGetString())) {
+ if (!IsValidFileName (InputBarGetString ())) {
FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
StatusBarSetStatusString (L"Invalid File Name");
return EFI_SUCCESS;
@@ -416,10 +417,11 @@ MainCommandOpenFile (
break;
}
}
+
//
// read from disk
//
- Status = FileBufferRead (InputBarGetString(), FALSE);
+ Status = FileBufferRead (InputBarGetString (), FALSE);
if (EFI_ERROR (Status)) {
FileBufferRead (MainEditor.FileBuffer->FileName, TRUE);
@@ -472,8 +474,8 @@ MainCommandCutLine (
VOID
)
{
- EFI_STATUS Status;
- EFI_EDITOR_LINE *Line;
+ EFI_STATUS Status;
+ EFI_EDITOR_LINE *Line;
//
// This command will cut current line ( where cursor is on ) to clip board.
@@ -483,7 +485,7 @@ MainCommandCutLine (
// IF cursor is not on valid line, an Status String will be prompted :
// "Nothing to Cut".
//
- Line = NULL;
+ Line = NULL;
Status = FileBufferCutLine (&Line);
if (Status == EFI_NOT_FOUND) {
return EFI_SUCCESS;
@@ -529,7 +531,6 @@ MainCommandPasteLine (
return Status;
}
-
/**
search string in file buffer
@@ -576,7 +577,7 @@ MainCommandSearch (
}
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC
@@ -584,17 +585,19 @@ MainCommandSearch (
if (Status == EFI_NOT_READY) {
return EFI_SUCCESS;
}
+
//
// just enter pressed
//
- if (StrLen (InputBarGetString()) == 0) {
+ if (StrLen (InputBarGetString ()) == 0) {
return EFI_SUCCESS;
}
- Buffer = CatSPrint (NULL, L"%s", InputBarGetString());
+ Buffer = CatSPrint (NULL, L"%s", InputBarGetString ());
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// the first time , search from current position
//
@@ -611,6 +614,7 @@ MainCommandSearch (
if (Status == EFI_NOT_FOUND) {
break;
}
+
//
// Find next
//
@@ -629,7 +633,7 @@ MainCommandSearch (
Done = FALSE;
while (!Done) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -639,29 +643,30 @@ MainCommandSearch (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- FreePool (Buffer);
- return EFI_SUCCESS;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ Done = TRUE;
+ break;
+ case L'n':
+ case L'N':
+ FreePool (Buffer);
+ return EFI_SUCCESS;
}
+
//
// end of which
//
}
+
//
// end of while !Done
// for search second, third time, search from current position + strlen
//
Offset = StrLen (Buffer);
-
} while (1);
+
//
// end of do
//
@@ -736,7 +741,7 @@ MainCommandSearchReplace (
}
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC
@@ -744,14 +749,15 @@ MainCommandSearchReplace (
if (Status == EFI_NOT_READY) {
return EFI_SUCCESS;
}
+
//
// if just pressed enter
//
- if (StrLen (InputBarGetString()) == 0) {
+ if (StrLen (InputBarGetString ()) == 0) {
return EFI_SUCCESS;
}
- Search = CatSPrint (NULL, L"%s", InputBarGetString());
+ Search = CatSPrint (NULL, L"%s", InputBarGetString ());
if (Search == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -772,7 +778,7 @@ MainCommandSearchReplace (
}
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC
@@ -781,16 +787,16 @@ MainCommandSearchReplace (
return EFI_SUCCESS;
}
- Replace = CatSPrint (NULL, L"%s", InputBarGetString());
+ Replace = CatSPrint (NULL, L"%s", InputBarGetString ());
if (Replace == NULL) {
FreePool (Search);
return EFI_OUT_OF_RESOURCES;
}
- ReplaceLen = StrLen (Replace);
+ ReplaceLen = StrLen (Replace);
- First = TRUE;
- ReplaceAll = FALSE;
+ First = TRUE;
+ ReplaceAll = FALSE;
do {
//
// since search may be continued to search multiple times
@@ -815,6 +821,7 @@ MainCommandSearchReplace (
if (Status == EFI_NOT_FOUND) {
break;
}
+
//
// replace or not?
//
@@ -836,7 +843,7 @@ MainCommandSearchReplace (
Done = FALSE;
while (!Done) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -847,37 +854,38 @@ MainCommandSearchReplace (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- ReplaceOption = TRUE;
- break;
-
- case L'n':
- case L'N':
- Done = TRUE;
- ReplaceOption = FALSE;
- break;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ Done = TRUE;
+ ReplaceOption = TRUE;
+ break;
- case L'a':
- case L'A':
- Done = TRUE;
- ReplaceOption = TRUE;
- ReplaceAll = TRUE;
- break;
+ case L'n':
+ case L'N':
+ Done = TRUE;
+ ReplaceOption = FALSE;
+ break;
- case L'c':
- case L'C':
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
+ case L'a':
+ case L'A':
+ Done = TRUE;
+ ReplaceOption = TRUE;
+ ReplaceAll = TRUE;
+ break;
+ case L'c':
+ case L'C':
+ FreePool (Search);
+ FreePool (Replace);
+ return EFI_SUCCESS;
}
+
//
// end of which
//
}
+
//
// end of while !Done
// Decide to Replace
@@ -890,6 +898,7 @@ MainCommandSearchReplace (
StatusBarSetStatusString (L"Read Only File Can Not Be Modified");
return EFI_SUCCESS;
}
+
//
// replace all
//
@@ -899,6 +908,7 @@ MainCommandSearchReplace (
FreePool (Replace);
return Status;
}
+
//
// replace
//
@@ -909,6 +919,7 @@ MainCommandSearchReplace (
return Status;
}
}
+
//
// Find next
//
@@ -929,7 +940,7 @@ MainCommandSearchReplace (
Done = FALSE;
while (!Done) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -940,29 +951,30 @@ MainCommandSearchReplace (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
-
- case L'n':
- case L'N':
- FreePool (Search);
- FreePool (Replace);
- return EFI_SUCCESS;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ Done = TRUE;
+ break;
+ case L'n':
+ case L'N':
+ FreePool (Search);
+ FreePool (Replace);
+ return EFI_SUCCESS;
}
+
//
// end of which
//
}
+
//
// end of while !Done
//
First = FALSE;
-
} while (1);
+
//
// end of do
//
@@ -1004,7 +1016,6 @@ MainCommandExit (
// if file has been modified, so will prompt user whether to save the changes
//
if (MainEditor.FileBuffer->FileModified) {
-
Status = InputBarSetPrompt (L"File modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
@@ -1017,7 +1028,7 @@ MainCommandExit (
while (1) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -1026,35 +1037,33 @@ MainCommandExit (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // write file back to disk
- //
- Status = FileBufferSave (MainEditor.FileBuffer->FileName);
- if (!EFI_ERROR (Status)) {
- EditorExit = TRUE;
- }
-
- return Status;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // write file back to disk
+ //
+ Status = FileBufferSave (MainEditor.FileBuffer->FileName);
+ if (!EFI_ERROR (Status)) {
+ EditorExit = TRUE;
+ }
- case L'n':
- case L'N':
- EditorExit = TRUE;
- return EFI_SUCCESS;
+ return Status;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'n':
+ case L'N':
+ EditorExit = TRUE;
+ return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
EditorExit = TRUE;
return EFI_SUCCESS;
-
}
/**
@@ -1086,6 +1095,7 @@ MainCommandGotoLine (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// line number's digit <= 6
//
@@ -1095,7 +1105,7 @@ MainCommandGotoLine (
}
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// press ESC
@@ -1103,22 +1113,24 @@ MainCommandGotoLine (
if (Status == EFI_NOT_READY) {
return EFI_SUCCESS;
}
+
//
// if JUST press enter
//
- if (StrLen (InputBarGetString()) == 0) {
+ if (StrLen (InputBarGetString ()) == 0) {
return EFI_SUCCESS;
}
- Row = ShellStrToUintn (InputBarGetString());
+ Row = ShellStrToUintn (InputBarGetString ());
//
// invalid line number
//
- if (Row > MainEditor.FileBuffer->NumLines || Row <= 0) {
+ if ((Row > MainEditor.FileBuffer->NumLines) || (Row <= 0)) {
StatusBarSetStatusString (L"No Such Line");
return EFI_SUCCESS;
}
+
//
// move cursor to that line's start
//
@@ -1140,12 +1152,12 @@ MainCommandSaveFile (
VOID
)
{
- EFI_STATUS Status;
- CHAR16 *FileName;
- BOOLEAN OldFile;
- CHAR16 *Str;
- SHELL_FILE_HANDLE FileHandle;
- EFI_FILE_INFO *Info;
+ EFI_STATUS Status;
+ CHAR16 *FileName;
+ BOOLEAN OldFile;
+ CHAR16 *Str;
+ SHELL_FILE_HANDLE FileHandle;
+ EFI_FILE_INFO *Info;
//
// This command will save currently opened file to disk.
@@ -1200,22 +1212,22 @@ MainCommandSaveFile (
}
Status = InputBarSetPrompt (Str);
- FreePool(Str);
+ FreePool (Str);
if (EFI_ERROR (Status)) {
return Status;
}
-
Status = InputBarSetStringSize (100);
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// get new file name
//
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// if user pressed ESC
@@ -1227,10 +1239,10 @@ MainCommandSaveFile (
//
// if just enter pressed, so think save to current file name
//
- if (StrLen (InputBarGetString()) == 0) {
+ if (StrLen (InputBarGetString ()) == 0) {
FileName = CatSPrint (NULL, L"%s", MainEditor.FileBuffer->FileName);
} else {
- FileName = CatSPrint (NULL, L"%s", InputBarGetString());
+ FileName = CatSPrint (NULL, L"%s", InputBarGetString ());
}
if (FileName == NULL) {
@@ -1265,18 +1277,18 @@ MainCommandSaveFile (
//
// if the file exists
//
- if (ShellFileExists(FileName) != EFI_NOT_FOUND) {
+ if (ShellFileExists (FileName) != EFI_NOT_FOUND) {
//
// check for read only
//
- Status = ShellOpenFileByName(FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
+ Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Open Failed");
FreePool (FileName);
return EFI_SUCCESS;
}
- Info = ShellGetFileInfo(FileHandle);
+ Info = ShellGetFileInfo (FileHandle);
if (Info == NULL) {
StatusBarSetStatusString (L"Access Denied");
FreePool (FileName);
@@ -1289,6 +1301,7 @@ MainCommandSaveFile (
FreePool (FileName);
return (EFI_SUCCESS);
}
+
FreePool (Info);
//
@@ -1308,7 +1321,7 @@ MainCommandSaveFile (
while (TRUE) {
Status = InputBarRefresh (MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column);
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// ESC pressed
@@ -1318,17 +1331,17 @@ MainCommandSaveFile (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- break;
-
- case L'n':
- case L'N':
- case L'c':
- case L'C':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ break;
+
+ case L'n':
+ case L'N':
+ case L'c':
+ case L'C':
+ SHELL_FREE_NON_NULL (FileName);
+ return EFI_SUCCESS;
} // end switch
} // while (!done)
} // file does exist
@@ -1337,7 +1350,7 @@ MainCommandSaveFile (
//
// save file to disk with specified name
//
- FileBufferSetModified();
+ FileBufferSetModified ();
Status = FileBufferSave (FileName);
SHELL_FREE_NON_NULL (FileName);
@@ -1354,17 +1367,17 @@ MainCommandDisplayHelp (
VOID
)
{
- INT32 CurrentLine;
- CHAR16 *InfoString;
- EFI_KEY_DATA KeyData;
- EFI_STATUS Status;
- UINTN EventIndex;
+ INT32 CurrentLine;
+ CHAR16 *InfoString;
+ EFI_KEY_DATA KeyData;
+ EFI_STATUS Status;
+ UINTN EventIndex;
//
// print helpInfo
//
for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) {
- InfoString = HiiGetString(gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL);
+ InfoString = HiiGetString (gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL);
ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
}
@@ -1376,13 +1389,15 @@ MainCommandDisplayHelp (
if (EFI_ERROR (Status) || (EventIndex != 0)) {
continue;
}
+
Status = MainEditor.TextInputEx->ReadKeyStrokeEx (MainEditor.TextInputEx, &KeyData);
if (EFI_ERROR (Status)) {
continue;
}
if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||
- (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {
+ (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID))
+ {
//
// For consoles that don't support/report shift state,
// CTRL+W is translated to L'W' - L'A' + 1.
@@ -1392,7 +1407,8 @@ MainCommandDisplayHelp (
}
} else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&
- ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0)) {
+ ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0))
+ {
//
// For consoles that supports/reports shift state,
// make sure that only CONTROL shift key is pressed.
@@ -1402,28 +1418,28 @@ MainCommandDisplayHelp (
}
}
}
+
//
// update screen with file buffer's info
//
FileBufferRestorePosition ();
- FileBufferNeedRefresh = TRUE;
+ FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE;
FileBufferRefresh ();
return EFI_SUCCESS;
}
-EFI_EDITOR_COLOR_ATTRIBUTES OriginalColors;
-INTN OriginalMode;
-
+EFI_EDITOR_COLOR_ATTRIBUTES OriginalColors;
+INTN OriginalMode;
//
// basic initialization for MainEditor
//
-EFI_EDITOR_GLOBAL_EDITOR MainEditorConst = {
+EFI_EDITOR_GLOBAL_EDITOR MainEditorConst = {
&FileBuffer,
{
- {0, 0}
+ { 0, 0}
},
{
0,
@@ -1459,10 +1475,10 @@ MainEditorInit (
//
// set screen attributes
//
- MainEditor.ColorAttributes.Colors.Foreground = gST->ConOut->Mode->Attribute & 0x000000ff;
+ MainEditor.ColorAttributes.Colors.Foreground = gST->ConOut->Mode->Attribute & 0x000000ff;
- MainEditor.ColorAttributes.Colors.Background = (UINT8) (gST->ConOut->Mode->Attribute >> 4);
- OriginalColors = MainEditor.ColorAttributes.Colors;
+ MainEditor.ColorAttributes.Colors.Background = (UINT8)(gST->ConOut->Mode->Attribute >> 4);
+ OriginalColors = MainEditor.ColorAttributes.Colors;
OriginalMode = gST->ConOut->Mode->Mode;
@@ -1470,21 +1486,21 @@ MainEditorInit (
// query screen size
//
gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &(MainEditor.ScreenSize.Column),
- &(MainEditor.ScreenSize.Row)
- );
+ gST->ConOut,
+ gST->ConOut->Mode->Mode,
+ &(MainEditor.ScreenSize.Column),
+ &(MainEditor.ScreenSize.Row)
+ );
//
// Find TextInEx in System Table ConsoleInHandle
// Per UEFI Spec, TextInEx is required for a console capable platform.
//
Status = gBS->HandleProtocol (
- gST->ConsoleInHandle,
- &gEfiSimpleTextInputExProtocolGuid,
- (VOID**)&MainEditor.TextInputEx
- );
+ gST->ConsoleInHandle,
+ &gEfiSimpleTextInputExProtocolGuid,
+ (VOID **)&MainEditor.TextInputEx
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1493,47 +1509,48 @@ MainEditorInit (
// Find mouse in System Table ConsoleInHandle
//
Status = gBS->HandleProtocol (
- gST->ConsoleInHandle,
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&MainEditor.MouseInterface
- );
+ gST->ConsoleInHandle,
+ &gEfiSimplePointerProtocolGuid,
+ (VOID **)&MainEditor.MouseInterface
+ );
if (EFI_ERROR (Status)) {
//
// If there is no Simple Pointer Protocol on System Table
//
- HandleBuffer = NULL;
+ HandleBuffer = NULL;
MainEditor.MouseInterface = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimplePointerProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status) && HandleCount > 0) {
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiSimplePointerProtocolGuid,
+ NULL,
+ &HandleCount,
+ &HandleBuffer
+ );
+ if (!EFI_ERROR (Status) && (HandleCount > 0)) {
//
// Try to find the first available mouse device
//
for (Index = 0; Index < HandleCount; Index++) {
Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&MainEditor.MouseInterface
- );
+ HandleBuffer[Index],
+ &gEfiSimplePointerProtocolGuid,
+ (VOID **)&MainEditor.MouseInterface
+ );
if (!EFI_ERROR (Status)) {
break;
}
}
}
+
if (HandleBuffer != NULL) {
FreePool (HandleBuffer);
}
}
- if (!EFI_ERROR (Status) && MainEditor.MouseInterface != NULL) {
- MainEditor.MouseAccumulatorX = 0;
- MainEditor.MouseAccumulatorY = 0;
- MainEditor.MouseSupported = TRUE;
+ if (!EFI_ERROR (Status) && (MainEditor.MouseInterface != NULL)) {
+ MainEditor.MouseAccumulatorX = 0;
+ MainEditor.MouseAccumulatorY = 0;
+ MainEditor.MouseSupported = TRUE;
}
//
@@ -1541,20 +1558,20 @@ MainEditorInit (
//
Status = MainTitleBarInit (L"UEFI EDIT");
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_TITLEBAR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBEDITOR_TITLEBAR), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
Status = ControlHotKeyInit (MainControlBasedMenuFunctions);
Status = MenuBarInit (MainMenuItems);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_MAINMENU), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBEDITOR_MAINMENU), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
Status = StatusBarInit ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_STATUSBAR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
@@ -1562,9 +1579,10 @@ MainEditorInit (
Status = FileBufferInit ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_FILEBUFFER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
+
//
// clear whole screen and enable cursor
//
@@ -1599,28 +1617,30 @@ MainEditorCleanup (
// if error, do not exit
// just print some warning
//
- MainTitleBarCleanup();
- StatusBarCleanup();
- InputBarCleanup();
+ MainTitleBarCleanup ();
+ StatusBarCleanup ();
+ InputBarCleanup ();
MenuBarCleanup ();
Status = FileBufferCleanup ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), gShellDebug1HiiHandle);
}
+
//
// restore old mode
//
if (OriginalMode != gST->ConOut->Mode->Mode) {
gST->ConOut->SetMode (gST->ConOut, OriginalMode);
}
+
//
// restore old screen color
//
gST->ConOut->SetAttribute (
- gST->ConOut,
- EFI_TEXT_ATTR (OriginalColors.Foreground, OriginalColors.Background)
- );
+ gST->ConOut,
+ EFI_TEXT_ATTR (OriginalColors.Foreground, OriginalColors.Background)
+ );
gST->ConOut->ClearScreen (gST->ConOut);
@@ -1643,22 +1663,22 @@ MainEditorRefresh (
//
// call the components refresh function
//
- if (EditorFirst
- || StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0
- || FileBufferBackupVar.FileType != FileBuffer.FileType
- || FileBufferBackupVar.FileModified != FileBuffer.FileModified
- || FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly) {
-
+ if ( EditorFirst
+ || (StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0)
+ || (FileBufferBackupVar.FileType != FileBuffer.FileType)
+ || (FileBufferBackupVar.FileModified != FileBuffer.FileModified)
+ || (FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly))
+ {
MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
FileBufferRestorePosition ();
}
- if (EditorFirst
- || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row
- || FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column
- || FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert
- || StatusBarGetRefresh()) {
-
+ if ( EditorFirst
+ || (FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row)
+ || (FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column)
+ || (FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert)
+ || StatusBarGetRefresh ())
+ {
StatusBarRefresh (EditorFirst, MainEditor.ScreenSize.Row, MainEditor.ScreenSize.Column, MainEditor.FileBuffer->FilePosition.Row, MainEditor.FileBuffer->FilePosition.Column, MainEditor.FileBuffer->ModeInsert);
FileBufferRestorePosition ();
}
@@ -1684,15 +1704,15 @@ MainEditorRefresh (
**/
INT32
GetTextX (
- IN INT32 GuidX
+ IN INT32 GuidX
)
{
- INT32 Gap;
+ INT32 Gap;
MainEditor.MouseAccumulatorX += GuidX;
- Gap = (MainEditor.MouseAccumulatorX * (INT32) MainEditor.ScreenSize.Column) / (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionX);
- MainEditor.MouseAccumulatorX = (MainEditor.MouseAccumulatorX * (INT32) MainEditor.ScreenSize.Column) % (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionX);
- MainEditor.MouseAccumulatorX = MainEditor.MouseAccumulatorX / (INT32) MainEditor.ScreenSize.Column;
+ Gap = (MainEditor.MouseAccumulatorX * (INT32)MainEditor.ScreenSize.Column) / (INT32)(50 * (INT32)MainEditor.MouseInterface->Mode->ResolutionX);
+ MainEditor.MouseAccumulatorX = (MainEditor.MouseAccumulatorX * (INT32)MainEditor.ScreenSize.Column) % (INT32)(50 * (INT32)MainEditor.MouseInterface->Mode->ResolutionX);
+ MainEditor.MouseAccumulatorX = MainEditor.MouseAccumulatorX / (INT32)MainEditor.ScreenSize.Column;
return Gap;
}
@@ -1705,15 +1725,15 @@ GetTextX (
**/
INT32
GetTextY (
- IN INT32 GuidY
+ IN INT32 GuidY
)
{
- INT32 Gap;
+ INT32 Gap;
MainEditor.MouseAccumulatorY += GuidY;
- Gap = (MainEditor.MouseAccumulatorY * (INT32) MainEditor.ScreenSize.Row) / (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionY);
- MainEditor.MouseAccumulatorY = (MainEditor.MouseAccumulatorY * (INT32) MainEditor.ScreenSize.Row) % (INT32) (50 * (INT32) MainEditor.MouseInterface->Mode->ResolutionY);
- MainEditor.MouseAccumulatorY = MainEditor.MouseAccumulatorY / (INT32) MainEditor.ScreenSize.Row;
+ Gap = (MainEditor.MouseAccumulatorY * (INT32)MainEditor.ScreenSize.Row) / (INT32)(50 * (INT32)MainEditor.MouseInterface->Mode->ResolutionY);
+ MainEditor.MouseAccumulatorY = (MainEditor.MouseAccumulatorY * (INT32)MainEditor.ScreenSize.Row) % (INT32)(50 * (INT32)MainEditor.MouseInterface->Mode->ResolutionY);
+ MainEditor.MouseAccumulatorY = MainEditor.MouseAccumulatorY / (INT32)MainEditor.ScreenSize.Row;
return Gap;
}
@@ -1728,20 +1748,19 @@ GetTextY (
**/
EFI_STATUS
MainEditorHandleMouseInput (
- IN EFI_SIMPLE_POINTER_STATE MouseState
+ IN EFI_SIMPLE_POINTER_STATE MouseState
)
{
+ INT32 TextX;
+ INT32 TextY;
+ UINTN FRow;
+ UINTN FCol;
- INT32 TextX;
- INT32 TextY;
- UINTN FRow;
- UINTN FCol;
-
- LIST_ENTRY *Link;
- EFI_EDITOR_LINE *Line;
+ LIST_ENTRY *Link;
+ EFI_EDITOR_LINE *Line;
- UINTN Index;
- BOOLEAN Action;
+ UINTN Index;
+ BOOLEAN Action;
//
// mouse action means:
@@ -1763,19 +1782,17 @@ MainEditorHandleMouseInput (
FileBufferAdjustMousePosition (TextX, TextY);
Action = TRUE;
-
}
//
// if left button pushed down
//
if (MouseState.LeftButton) {
-
FCol = MainEditor.FileBuffer->MousePosition.Column - 1 + 1;
FRow = MainEditor.FileBuffer->FilePosition.Row +
- MainEditor.FileBuffer->MousePosition.Row -
- MainEditor.FileBuffer->DisplayPosition.Row;
+ MainEditor.FileBuffer->MousePosition.Row -
+ MainEditor.FileBuffer->DisplayPosition.Row;
//
// beyond the file line length
@@ -1800,12 +1817,13 @@ MainEditorHandleMouseInput (
FileBufferMovePosition (FRow, FCol);
- MainEditor.FileBuffer->MousePosition.Row = MainEditor.FileBuffer->DisplayPosition.Row;
+ MainEditor.FileBuffer->MousePosition.Row = MainEditor.FileBuffer->DisplayPosition.Row;
MainEditor.FileBuffer->MousePosition.Column = MainEditor.FileBuffer->DisplayPosition.Column;
Action = TRUE;
}
+
//
// mouse has action
//
@@ -1837,7 +1855,6 @@ MainEditorKeyInput (
BOOLEAN NoShiftState;
do {
-
Status = EFI_SUCCESS;
EditorMouseAction = FALSE;
@@ -1857,12 +1874,11 @@ MainEditorKeyInput (
&MouseState
);
if (!EFI_ERROR (Status)) {
-
Status = MainEditorHandleMouseInput (MouseState);
if (!EFI_ERROR (Status)) {
- EditorMouseAction = TRUE;
- FileBufferMouseNeedRefresh = TRUE;
+ EditorMouseAction = TRUE;
+ FileBufferMouseNeedRefresh = TRUE;
} else if (Status == EFI_LOAD_ERROR) {
StatusBarSetStatusString (L"Invalid Mouse Movement ");
}
@@ -1884,7 +1900,7 @@ MainEditorKeyInput (
//
// clear previous status string
//
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// NoShiftState: TRUE when no shift key is pressed.
//
@@ -1892,7 +1908,7 @@ MainEditorKeyInput (
//
// dispatch to different components' key handling function
//
- if (EFI_NOT_FOUND != MenuBarDispatchControlHotKey(&KeyData)) {
+ if (EFI_NOT_FOUND != MenuBarDispatchControlHotKey (&KeyData)) {
Status = EFI_SUCCESS;
} else if (NoShiftState && ((KeyData.Key.ScanCode == SCAN_NULL) || ((KeyData.Key.ScanCode >= SCAN_UP) && (KeyData.Key.ScanCode <= SCAN_PAGE_DOWN)))) {
Status = FileBufferHandleInput (&KeyData.Key);
@@ -1903,22 +1919,21 @@ MainEditorKeyInput (
FileBufferMouseNeedRefresh = FALSE;
}
- if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) {
+ if ((Status != EFI_SUCCESS) && (Status != EFI_OUT_OF_RESOURCES)) {
//
// not already has some error status
//
- if (StatusBarGetString() != NULL && StrCmp (L"", StatusBarGetString()) == 0) {
+ if ((StatusBarGetString () != NULL) && (StrCmp (L"", StatusBarGetString ()) == 0)) {
StatusBarSetStatusString (L"Disk Error. Try Again");
}
}
-
}
}
+
//
// after handling, refresh editor
//
MainEditorRefresh ();
-
} while (Status != EFI_OUT_OF_RESOURCES && !EditorExit);
return Status;
@@ -1934,7 +1949,7 @@ MainEditorKeyInput (
**/
EFI_STATUS
MainEditorSetCutLine (
- EFI_EDITOR_LINE *Line
+ EFI_EDITOR_LINE *Line
)
{
if (Line == NULL) {
@@ -1947,6 +1962,7 @@ MainEditorSetCutLine (
//
LineFree (MainEditor.CutLine);
}
+
//
// duplicate the line to clipboard
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c
index db18010e45..fc77fe4068 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.c
@@ -19,10 +19,10 @@
**/
EFI_EDITOR_LINE *
LineDup (
- IN EFI_EDITOR_LINE *Src
+ IN EFI_EDITOR_LINE *Src
)
{
- EFI_EDITOR_LINE *Dest;
+ EFI_EDITOR_LINE *Dest;
//
// allocate for the line structure
@@ -31,6 +31,7 @@ LineDup (
if (Dest == NULL) {
return NULL;
}
+
//
// allocate and set the line buffer
//
@@ -59,26 +60,16 @@ LineDup (
**/
VOID
LineFree (
- IN EFI_EDITOR_LINE *Src
+ IN EFI_EDITOR_LINE *Src
)
{
if (Src == NULL) {
- return ;
+ return;
}
+
//
// free the line buffer and then the line structure itself
//
SHELL_FREE_NON_NULL (Src->Buffer);
SHELL_FREE_NON_NULL (Src);
-
}
-
-
-
-
-
-
-
-
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h
index 1a4cdd7b18..c3abb47576 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Misc.h
@@ -11,8 +11,6 @@
#include "TextEditorTypes.h"
-
-
/**
Free a EFI_EDITOR_LINE structure.
@@ -20,7 +18,7 @@
**/
VOID
LineFree (
- IN EFI_EDITOR_LINE *Src
+ IN EFI_EDITOR_LINE *Src
);
/**
@@ -33,12 +31,7 @@ LineFree (
**/
EFI_EDITOR_LINE *
LineDup (
- IN EFI_EDITOR_LINE *Src
+ IN EFI_EDITOR_LINE *Src
);
-
-
-
-
-
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h
index 0807f80cc0..4ffc6faad3 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditor.h
@@ -19,8 +19,8 @@
#include "EditMenuBar.h"
#include "Misc.h"
-extern EFI_EDITOR_GLOBAL_EDITOR MainEditor;
-extern BOOLEAN EditorFirst;
-extern BOOLEAN EditorExit;
+extern EFI_EDITOR_GLOBAL_EDITOR MainEditor;
+extern BOOLEAN EditorFirst;
+extern BOOLEAN EditorExit;
#endif // _EFI_EDIT_H_
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
index 327ecd2257..a4dd09a7ce 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditorTypes.h
@@ -13,12 +13,12 @@
#include "EditTitleBar.h"
#include "EditMenuBar.h"
-#define MIN_POOL_SIZE 125
-#define MAX_STRING_LENGTH 127
+#define MIN_POOL_SIZE 125
+#define MAX_STRING_LENGTH 127
typedef struct {
- UINTN Row;
- UINTN Column;
+ UINTN Row;
+ UINTN Column;
} EFI_EDITOR_POSITION;
typedef
@@ -38,60 +38,59 @@ typedef enum {
#define LINE_LIST_SIGNATURE SIGNATURE_32 ('e', 'e', 'l', 'l')
typedef struct _EFI_EDITOR_LINE {
- UINTN Signature;
- CHAR16 *Buffer;
- UINTN Size; // unit is Unicode
- UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL
- EE_NEWLINE_TYPE Type;
- LIST_ENTRY Link;
+ UINTN Signature;
+ CHAR16 *Buffer;
+ UINTN Size; // unit is Unicode
+ UINTN TotalSize; // unit is Unicode, exclude CHAR_NULL
+ EE_NEWLINE_TYPE Type;
+ LIST_ENTRY Link;
} EFI_EDITOR_LINE;
typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
+ UINT32 Foreground : 4;
+ UINT32 Background : 4;
} EFI_EDITOR_COLOR_ATTRIBUTES;
typedef union {
- EFI_EDITOR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
+ EFI_EDITOR_COLOR_ATTRIBUTES Colors;
+ UINTN Data;
} EFI_EDITOR_COLOR_UNION;
typedef struct {
- UINTN Columns;
- UINTN Rows;
+ UINTN Columns;
+ UINTN Rows;
} EFI_EDITOR_TEXT_MODE;
typedef struct {
- CHAR16 *FileName; // file name current edited in editor
- EDIT_FILE_TYPE FileType; // Unicode file or ASCII file
- LIST_ENTRY *ListHead; // list head of lines
- EFI_EDITOR_LINE *Lines; // lines of current file
- UINTN NumLines; // total line numbers
- EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
- EFI_EDITOR_POSITION FilePosition; // cursor position in file
- EFI_EDITOR_POSITION MousePosition; // mouse position in screen
+ CHAR16 *FileName; // file name current edited in editor
+ EDIT_FILE_TYPE FileType; // Unicode file or ASCII file
+ LIST_ENTRY *ListHead; // list head of lines
+ EFI_EDITOR_LINE *Lines; // lines of current file
+ UINTN NumLines; // total line numbers
+ EFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
+ EFI_EDITOR_POSITION FilePosition; // cursor position in file
+ EFI_EDITOR_POSITION MousePosition; // mouse position in screen
// file position of first byte displayed on screen
//
- EFI_EDITOR_POSITION LowVisibleRange;
+ EFI_EDITOR_POSITION LowVisibleRange;
- BOOLEAN FileModified; // file is modified or not
- BOOLEAN ModeInsert; // input mode INS or OVR
- BOOLEAN ReadOnly; // file is read-only or not
- EFI_EDITOR_LINE *CurrentLine; // current line cursor is at
+ BOOLEAN FileModified; // file is modified or not
+ BOOLEAN ModeInsert; // input mode INS or OVR
+ BOOLEAN ReadOnly; // file is read-only or not
+ EFI_EDITOR_LINE *CurrentLine; // current line cursor is at
} EFI_EDITOR_FILE_BUFFER;
typedef struct {
- EFI_EDITOR_FILE_BUFFER *FileBuffer;
-
- EFI_EDITOR_COLOR_UNION ColorAttributes;
- EFI_EDITOR_POSITION ScreenSize; // row number and column number
- EFI_EDITOR_LINE *CutLine; // clip board
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;
- BOOLEAN MouseSupported;
- EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
- INT32 MouseAccumulatorX;
- INT32 MouseAccumulatorY;
-
+ EFI_EDITOR_FILE_BUFFER *FileBuffer;
+
+ EFI_EDITOR_COLOR_UNION ColorAttributes;
+ EFI_EDITOR_POSITION ScreenSize; // row number and column number
+ EFI_EDITOR_LINE *CutLine; // clip board
+ EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;
+ BOOLEAN MouseSupported;
+ EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
+ INT32 MouseAccumulatorX;
+ INT32 MouseAccumulatorY;
} EFI_EDITOR_GLOBAL_EDITOR;
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
index 35b0b701e8..0b25965427 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.c
@@ -9,10 +9,10 @@
#include "EditInputBar.h"
#include "UefiShellDebug1CommandsLib.h"
-CHAR16 *mPrompt; // Input bar mPrompt string.
-CHAR16 *mReturnString; // The returned string.
-UINTN StringSize; // Size of mReturnString space size.
-EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *mTextInEx;
+CHAR16 *mPrompt; // Input bar mPrompt string.
+CHAR16 *mReturnString; // The returned string.
+UINTN StringSize; // Size of mReturnString space size.
+EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *mTextInEx;
/**
Initialize the input bar.
@@ -21,7 +21,7 @@ EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *mTextInEx;
**/
VOID
InputBarInit (
- IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx
)
{
mPrompt = NULL;
@@ -56,8 +56,8 @@ InputBarCleanup (
**/
VOID
InputBarPrintInput (
- IN UINTN LastColumn,
- IN UINTN LastRow
+ IN UINTN LastColumn,
+ IN UINTN LastRow
)
{
UINTN Limit;
@@ -67,8 +67,8 @@ InputBarPrintInput (
UINTN mPromptLen;
mPromptLen = StrLen (mPrompt);
- Limit = LastColumn - mPromptLen - 1;
- Size = StrLen (mReturnString);
+ Limit = LastColumn - mPromptLen - 1;
+ Size = StrLen (mReturnString);
//
// check whether the mPrompt length and input length will
@@ -97,16 +97,15 @@ InputBarPrintInput (
}
typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 3;
+ UINT32 Foreground : 4;
+ UINT32 Background : 3;
} INPUT_BAR_COLOR_ATTRIBUTES;
typedef union {
- INPUT_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
+ INPUT_BAR_COLOR_ATTRIBUTES Colors;
+ UINTN Data;
} INPUT_BAR_COLOR_UNION;
-
/**
The refresh function for InputBar, it will wait for user input
@@ -117,25 +116,25 @@ typedef union {
**/
EFI_STATUS
InputBarRefresh (
- UINTN LastRow,
- UINTN LastColumn
+ UINTN LastRow,
+ UINTN LastColumn
)
{
- INPUT_BAR_COLOR_UNION Orig;
- INPUT_BAR_COLOR_UNION New;
- EFI_KEY_DATA KeyData;
- UINTN Size;
- EFI_STATUS Status;
- BOOLEAN NoDisplay;
- UINTN EventIndex;
- UINTN CursorRow;
- UINTN CursorCol;
+ INPUT_BAR_COLOR_UNION Orig;
+ INPUT_BAR_COLOR_UNION New;
+ EFI_KEY_DATA KeyData;
+ UINTN Size;
+ EFI_STATUS Status;
+ BOOLEAN NoDisplay;
+ UINTN EventIndex;
+ UINTN CursorRow;
+ UINTN CursorCol;
//
// variable initialization
//
- Size = 0;
- Status = EFI_SUCCESS;
+ Size = 0;
+ Status = EFI_SUCCESS;
//
// back up the old screen attributes
@@ -152,10 +151,10 @@ InputBarRefresh (
//
// clear input bar
//
- EditorClearLine (LastRow , LastColumn, LastRow);
+ EditorClearLine (LastRow, LastColumn, LastRow);
gST->ConOut->SetCursorPosition (gST->ConOut, 0, LastRow - 1);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gShellDebug1HiiHandle, mPrompt);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gShellDebug1HiiHandle, mPrompt);
//
// this is a selection mPrompt, cursor will stay in edit area
@@ -168,37 +167,43 @@ InputBarRefresh (
} else {
NoDisplay = FALSE;
}
+
//
// wait for user input
//
- for (;;) {
+ for ( ; ;) {
Status = gBS->WaitForEvent (1, &mTextInEx->WaitForKeyEx, &EventIndex);
if (EFI_ERROR (Status) || (EventIndex != 0)) {
continue;
}
+
Status = mTextInEx->ReadKeyStrokeEx (mTextInEx, &KeyData);
if (EFI_ERROR (Status)) {
continue;
}
+
if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
- (KeyData.KeyState.KeyShiftState != EFI_SHIFT_STATE_VALID)) {
+ (KeyData.KeyState.KeyShiftState != EFI_SHIFT_STATE_VALID))
+ {
//
// Shift key pressed.
//
continue;
}
+
//
// pressed ESC
//
if (KeyData.Key.ScanCode == SCAN_ESC) {
- Size = 0;
- Status = EFI_NOT_READY;
+ Size = 0;
+ Status = EFI_NOT_READY;
break;
}
+
//
// return pressed
//
- if (KeyData.Key.UnicodeChar == CHAR_LINEFEED || KeyData.Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
+ if ((KeyData.Key.UnicodeChar == CHAR_LINEFEED) || (KeyData.Key.UnicodeChar == CHAR_CARRIAGE_RETURN)) {
break;
} else if (KeyData.Key.UnicodeChar == CHAR_BACKSPACE) {
//
@@ -208,12 +213,10 @@ InputBarRefresh (
Size--;
mReturnString[Size] = CHAR_NULL;
if (!NoDisplay) {
-
InputBarPrintInput (LastColumn, LastRow);
-
}
}
- } else if (KeyData.Key.UnicodeChar <= 127 && KeyData.Key.UnicodeChar >= 32) {
+ } else if ((KeyData.Key.UnicodeChar <= 127) && (KeyData.Key.UnicodeChar >= 32)) {
//
// VALID ASCII char pressed
//
@@ -231,22 +234,18 @@ InputBarRefresh (
mReturnString[Size] = CHAR_NULL;
if (!NoDisplay) {
-
InputBarPrintInput (LastColumn, LastRow);
-
} else {
//
// if just choose yes/no
//
break;
}
-
}
}
mReturnString[Size] = CHAR_NULL;
-
//
// restore screen attributes
//
@@ -266,7 +265,7 @@ InputBarRefresh (
**/
EFI_STATUS
InputBarSetPrompt (
- IN CONST CHAR16 *Str
+ IN CONST CHAR16 *Str
)
{
//
@@ -292,7 +291,7 @@ InputBarSetPrompt (
**/
EFI_STATUS
InputBarSetStringSize (
- UINTN Size
+ UINTN Size
)
{
//
@@ -300,8 +299,8 @@ InputBarSetStringSize (
//
SHELL_FREE_NON_NULL (mReturnString);
- StringSize = Size;
- mReturnString = AllocateZeroPool ((StringSize + 1) * sizeof(mReturnString[0]));
+ StringSize = Size;
+ mReturnString = AllocateZeroPool ((StringSize + 1) * sizeof (mReturnString[0]));
if (mReturnString == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -315,7 +314,7 @@ InputBarSetStringSize (
@retval NULL No input has been received.
@return The string that was input.
**/
-CONST CHAR16*
+CONST CHAR16 *
InputBarGetString (
VOID
)
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h
index a6db2cdd70..b408f6ea28 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditInputBar.h
@@ -16,7 +16,7 @@
**/
VOID
InputBarInit (
- IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInEx
);
/**
@@ -37,8 +37,8 @@ InputBarCleanup (
**/
EFI_STATUS
InputBarRefresh (
- UINTN LastRow,
- UINTN LastColumn
+ UINTN LastRow,
+ UINTN LastColumn
);
/**
@@ -51,7 +51,7 @@ InputBarRefresh (
**/
EFI_STATUS
InputBarSetPrompt (
- IN CONST CHAR16 *Str
+ IN CONST CHAR16 *Str
);
/**
@@ -64,7 +64,7 @@ InputBarSetPrompt (
**/
EFI_STATUS
InputBarSetStringSize (
- UINTN Size
+ UINTN Size
);
/**
@@ -73,7 +73,7 @@ InputBarSetStringSize (
@retval NULL No input has been received.
@return The string that was input.
**/
-CONST CHAR16*
+CONST CHAR16 *
InputBarGetString (
VOID
);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
index ca8bc506d9..3284f0c1e2 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c
@@ -10,9 +10,9 @@
#include "UefiShellDebug1CommandsLib.h"
#include "EditStatusBar.h"
-EDITOR_MENU_ITEM *MenuItems;
-MENU_ITEM_FUNCTION *ControlBasedMenuFunctions;
-UINTN NumItems;
+EDITOR_MENU_ITEM *MenuItems;
+MENU_ITEM_FUNCTION *ControlBasedMenuFunctions;
+UINTN NumItems;
/**
Cleanup function for a menu bar. frees all allocated memory.
@@ -22,7 +22,7 @@ MenuBarCleanup (
VOID
)
{
- SHELL_FREE_NON_NULL(MenuItems);
+ SHELL_FREE_NON_NULL (MenuItems);
}
/**
@@ -40,13 +40,15 @@ MenuBarInit (
{
CONST EDITOR_MENU_ITEM *ItemsWalker;
- for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++);
+ for (NumItems = 0, ItemsWalker = Items; ItemsWalker != NULL && ItemsWalker->Function != NULL; ItemsWalker++, NumItems++) {
+ }
- MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM));
+ MenuItems = AllocateZeroPool ((NumItems+1) * sizeof (EDITOR_MENU_ITEM));
if (MenuItems == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- CopyMem(MenuItems, Items, (NumItems+1) * sizeof(EDITOR_MENU_ITEM));
+
+ CopyMem (MenuItems, Items, (NumItems+1) * sizeof (EDITOR_MENU_ITEM));
return EFI_SUCCESS;
}
@@ -65,6 +67,7 @@ ControlHotKeyInit (
ControlBasedMenuFunctions = Items;
return EFI_SUCCESS;
}
+
/**
Refresh function for the menu bar.
@@ -75,16 +78,16 @@ ControlHotKeyInit (
**/
EFI_STATUS
MenuBarRefresh (
- IN CONST UINTN LastRow,
- IN CONST UINTN LastCol
+ IN CONST UINTN LastRow,
+ IN CONST UINTN LastCol
)
{
EDITOR_MENU_ITEM *Item;
- UINTN Col;
- UINTN Row;
- UINTN Width;
- CHAR16 *NameString;
- CHAR16 *FunctionKeyString;
+ UINTN Col;
+ UINTN Row;
+ UINTN Width;
+ CHAR16 *NameString;
+ CHAR16 *FunctionKeyString;
//
// variable initialization
@@ -97,25 +100,21 @@ MenuBarRefresh (
//
EditorClearLine (LastRow - 2, LastCol, LastRow);
EditorClearLine (LastRow - 1, LastCol, LastRow);
- EditorClearLine (LastRow , LastCol, LastRow);
-
+ EditorClearLine (LastRow, LastCol, LastRow);
//
// print out the menu items
//
for (Item = MenuItems; Item != NULL && Item->Function != NULL; Item++) {
+ NameString = HiiGetString (gShellDebug1HiiHandle, Item->NameToken, NULL);
-
- NameString = HiiGetString(gShellDebug1HiiHandle, Item->NameToken, NULL);
-
-
- Width = MAX ((StrLen (NameString) + 6), 20);
+ Width = MAX ((StrLen (NameString) + 6), 20);
if (((Col + Width) > LastCol)) {
Row++;
Col = 1;
}
- FunctionKeyString = HiiGetString(gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
+ FunctionKeyString = HiiGetString (gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
ShellPrintEx ((INT32)(Col) - 1, (INT32)(Row) - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
@@ -138,12 +137,12 @@ MenuBarRefresh (
**/
EFI_STATUS
MenuBarDispatchFunctionKey (
- IN CONST EFI_INPUT_KEY *Key
+ IN CONST EFI_INPUT_KEY *Key
)
{
- UINTN Index;
+ UINTN Index;
- Index = Key->ScanCode - SCAN_F1;
+ Index = Key->ScanCode - SCAN_F1;
//
// check whether in range
@@ -167,10 +166,10 @@ MenuBarDispatchFunctionKey (
**/
EFI_STATUS
MenuBarDispatchControlHotKey (
- IN CONST EFI_KEY_DATA *KeyData
+ IN CONST EFI_KEY_DATA *KeyData
)
{
- UINT16 ControlIndex;
+ UINT16 ControlIndex;
//
// Set to invalid value first.
@@ -178,7 +177,8 @@ MenuBarDispatchControlHotKey (
ControlIndex = MAX_UINT16;
if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||
- (KeyData->KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {
+ (KeyData->KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID))
+ {
//
// For consoles that don't support/report shift state,
// Ctrl+A is translated to 1 (UnicodeChar).
@@ -186,7 +186,8 @@ MenuBarDispatchControlHotKey (
ControlIndex = KeyData->Key.UnicodeChar;
} else if (((KeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
((KeyData->KeyState.KeyShiftState & (EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) != 0) &&
- ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) == 0)) {
+ ((KeyData->KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED | EFI_LEFT_CONTROL_PRESSED)) == 0))
+ {
//
// For consoles that supports/reports shift state,
// make sure only CONTROL is pressed.
@@ -197,14 +198,13 @@ MenuBarDispatchControlHotKey (
ControlIndex = KeyData->Key.UnicodeChar - L'a' + 1;
}
}
- if ((SCAN_CONTROL_Z < ControlIndex)
- ||(NULL == ControlBasedMenuFunctions[ControlIndex]))
+
+ if ( (SCAN_CONTROL_Z < ControlIndex)
+ || (NULL == ControlBasedMenuFunctions[ControlIndex]))
{
- return EFI_NOT_FOUND;
+ return EFI_NOT_FOUND;
}
ControlBasedMenuFunctions[ControlIndex]();
return EFI_SUCCESS;
}
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h
index b246c4920d..92c5610d66 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.h
@@ -22,7 +22,6 @@
#define SCAN_CONTROL_W 23
#define SCAN_CONTROL_Z 26
-
typedef
EFI_STATUS
(*MENU_ITEM_FUNCTION) (
@@ -30,9 +29,9 @@ EFI_STATUS
);
typedef struct _EDITOR_MENU_ITEM {
- EFI_STRING_ID NameToken;
- CHAR16 FunctionKeyToken;
- MENU_ITEM_FUNCTION Function;
+ EFI_STRING_ID NameToken;
+ CHAR16 FunctionKeyToken;
+ MENU_ITEM_FUNCTION Function;
} EDITOR_MENU_ITEM;
/**
@@ -78,8 +77,8 @@ MenuBarCleanup (
**/
EFI_STATUS
MenuBarRefresh (
- IN CONST UINTN LastRow,
- IN CONST UINTN LastCol
+ IN CONST UINTN LastRow,
+ IN CONST UINTN LastCol
);
/**
@@ -93,7 +92,7 @@ MenuBarRefresh (
**/
EFI_STATUS
MenuBarDispatchFunctionKey (
- IN CONST EFI_INPUT_KEY *Key
+ IN CONST EFI_INPUT_KEY *Key
);
/**
@@ -107,7 +106,7 @@ MenuBarDispatchFunctionKey (
**/
EFI_STATUS
MenuBarDispatchControlHotKey (
- IN CONST EFI_KEY_DATA *KeyData
+ IN CONST EFI_KEY_DATA *KeyData
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c
index 400a0b05bd..06a60ebc5e 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.c
@@ -9,9 +9,9 @@
#include "EditStatusBar.h"
#include "UefiShellDebug1CommandsLib.h"
-CHAR16 *StatusString;
-BOOLEAN StatusBarNeedRefresh;
-BOOLEAN StatusStringChanged;
+CHAR16 *StatusString;
+BOOLEAN StatusBarNeedRefresh;
+BOOLEAN StatusStringChanged;
/**
Initialization function for Status Bar.
@@ -53,13 +53,13 @@ StatusBarCleanup (
}
typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 3;
+ UINT32 Foreground : 4;
+ UINT32 Background : 3;
} STATUS_BAR_COLOR_ATTRIBUTES;
typedef union {
- STATUS_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
+ STATUS_BAR_COLOR_ATTRIBUTES Colors;
+ UINTN Data;
} STATUS_BAR_COLOR_UNION;
/**
@@ -91,6 +91,7 @@ StatusBarRefresh (
if (!StatusStringChanged && StatusBarNeedRefresh) {
StatusBarSetStatusString (L"\0");
}
+
//
// when it's called first time after editor launch, so refresh is mandatory
//
@@ -117,7 +118,7 @@ StatusBarRefresh (
//
// print row, column fields
//
- if (FileRow != (UINTN)(-1) && FileCol != (UINTN)(-1)) {
+ if ((FileRow != (UINTN)(-1)) && (FileCol != (UINTN)(-1))) {
ShellPrintEx (
0,
(INT32)(LastRow) - 1,
@@ -143,6 +144,7 @@ StatusBarRefresh (
} else {
ShellPrintEx ((INT32)(LastCol) - 21, (INT32)(LastRow) - 1, L"|%s| Help: Ctrl-E", L"OVR");
}
+
//
// restore the old screen attributes
//
@@ -153,8 +155,8 @@ StatusBarRefresh (
//
gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- StatusBarNeedRefresh = FALSE;
- StatusStringChanged = FALSE;
+ StatusBarNeedRefresh = FALSE;
+ StatusStringChanged = FALSE;
return EFI_SUCCESS;
}
@@ -169,7 +171,7 @@ StatusBarRefresh (
**/
EFI_STATUS
StatusBarSetStatusString (
- IN CHAR16 *Str
+ IN CHAR16 *Str
)
{
StatusStringChanged = TRUE;
@@ -191,7 +193,7 @@ StatusBarSetStatusString (
@return The string that is used.
**/
-CONST CHAR16*
+CONST CHAR16 *
StatusBarGetString (
VOID
)
@@ -203,7 +205,7 @@ StatusBarGetString (
Function to set the need refresh boolean to TRUE.
**/
VOID
-StatusBarSetRefresh(
+StatusBarSetRefresh (
VOID
)
{
@@ -216,7 +218,7 @@ StatusBarSetRefresh(
@retval TRUE The status bar needs to be refreshed.
**/
BOOLEAN
-StatusBarGetRefresh(
+StatusBarGetRefresh (
VOID
)
{
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h
index eba3ee19c8..5008f2a0eb 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditStatusBar.h
@@ -62,7 +62,7 @@ StatusBarRefresh (
**/
EFI_STATUS
StatusBarSetStatusString (
- IN CHAR16 *Str
+ IN CHAR16 *Str
);
/**
@@ -70,7 +70,7 @@ StatusBarSetStatusString (
@return The string that is used.
**/
-CONST CHAR16*
+CONST CHAR16 *
StatusBarGetString (
VOID
);
@@ -79,7 +79,7 @@ StatusBarGetString (
Function to set the need refresh boolean to TRUE.
**/
VOID
-StatusBarSetRefresh(
+StatusBarSetRefresh (
VOID
);
@@ -89,7 +89,7 @@ StatusBarSetRefresh(
@retval TRUE The status bar needs to be refreshed.
**/
BOOLEAN
-StatusBarGetRefresh(
+StatusBarGetRefresh (
VOID
);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
index f9ef7117b2..663a872dc2 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.c
@@ -22,7 +22,7 @@ CHAR16 *Title = NULL;
**/
EFI_STATUS
MainTitleBarInit (
- CONST CHAR16 *Prompt
+ CONST CHAR16 *Prompt
)
{
SHELL_FREE_NON_NULL (Title);
@@ -34,6 +34,7 @@ MainTitleBarInit (
//
Title = CatSPrint (NULL, L"%s", Prompt);
}
+
if (Title == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -54,13 +55,13 @@ MainTitleBarCleanup (
}
typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
+ UINT32 Foreground : 4;
+ UINT32 Background : 4;
} TITLE_BAR_COLOR_ATTRIBUTES;
typedef union {
- TITLE_BAR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
+ TITLE_BAR_COLOR_ATTRIBUTES Colors;
+ UINTN Data;
} TITLE_BAR_COLOR_UNION;
/**
@@ -79,21 +80,20 @@ typedef union {
**/
EFI_STATUS
MainTitleBarRefresh (
- IN CONST CHAR16 *FileName OPTIONAL,
- IN CONST EDIT_FILE_TYPE FileType,
- IN CONST BOOLEAN ReadOnly,
- IN CONST BOOLEAN Modified,
- IN CONST UINTN LastCol,
- IN CONST UINTN LastRow,
- IN CONST UINTN Offset,
- IN CONST UINTN Size
+ IN CONST CHAR16 *FileName OPTIONAL,
+ IN CONST EDIT_FILE_TYPE FileType,
+ IN CONST BOOLEAN ReadOnly,
+ IN CONST BOOLEAN Modified,
+ IN CONST UINTN LastCol,
+ IN CONST UINTN LastRow,
+ IN CONST UINTN Offset,
+ IN CONST UINTN Size
)
{
- TITLE_BAR_COLOR_UNION Orig;
- TITLE_BAR_COLOR_UNION New;
- CONST CHAR16 *FileNameTmp;
- INTN TempInteger;
-
+ TITLE_BAR_COLOR_UNION Orig;
+ TITLE_BAR_COLOR_UNION New;
+ CONST CHAR16 *FileNameTmp;
+ INTN TempInteger;
//
// backup the old screen attributes
@@ -121,10 +121,12 @@ MainTitleBarRefresh (
Title
);
}
+
if (FileName == NULL) {
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
return EFI_SUCCESS;
}
+
//
// First Extract the FileName from fullpath
//
@@ -141,57 +143,62 @@ MainTitleBarRefresh (
// the space for file name is 20 characters
//
if (StrLen (FileNameTmp) <= 20) {
- ShellPrintEx (-1,-1, L"%s ", FileNameTmp);
+ ShellPrintEx (-1, -1, L"%s ", FileNameTmp);
for (TempInteger = StrLen (FileNameTmp); TempInteger < 20; TempInteger++) {
- ShellPrintEx (-1,-1, L" ");
+ ShellPrintEx (-1, -1, L" ");
}
-
} else {
for (TempInteger = 0; TempInteger < 17; TempInteger++) {
- ShellPrintEx (-1,-1, L"%c", FileNameTmp[TempInteger]);
+ ShellPrintEx (-1, -1, L"%c", FileNameTmp[TempInteger]);
}
+
//
// print "..."
//
- ShellPrintEx (-1,-1, L"... ");
+ ShellPrintEx (-1, -1, L"... ");
}
+
//
// print file type field
//
- switch (FileType){
+ switch (FileType) {
case FileTypeAscii:
case FileTypeUnicode:
- if (FileType == FileTypeAscii){
- ShellPrintEx (-1,-1, L" ASCII ");
+ if (FileType == FileTypeAscii) {
+ ShellPrintEx (-1, -1, L" ASCII ");
} else {
- ShellPrintEx (-1,-1, L" UNICODE ");
+ ShellPrintEx (-1, -1, L" UNICODE ");
}
+
//
// print read-only field for text files
//
if (ReadOnly) {
- ShellPrintEx (-1,-1, L"ReadOnly ");
+ ShellPrintEx (-1, -1, L"ReadOnly ");
} else {
- ShellPrintEx (-1,-1, L" ");
+ ShellPrintEx (-1, -1, L" ");
}
- break;
+
+ break;
case FileTypeDiskBuffer:
case FileTypeMemBuffer:
//
// Print the offset.
//
- ShellPrintEx (-1,-1, L"Offset %X | Size %X", Offset, Size);
+ ShellPrintEx (-1, -1, L"Offset %X | Size %X", Offset, Size);
case FileTypeFileBuffer:
break;
default:
break;
}
+
//
// print modified field
//
if (Modified) {
- ShellPrintEx (-1,-1, L"Modified");
+ ShellPrintEx (-1, -1, L"Modified");
}
+
//
// restore the old attribute
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h
index 30b1ecca5f..bd43541973 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditTitleBar.h
@@ -19,7 +19,7 @@
**/
EFI_STATUS
MainTitleBarInit (
- CONST CHAR16 *Prompt
+ CONST CHAR16 *Prompt
);
/**
@@ -55,14 +55,14 @@ typedef enum {
**/
EFI_STATUS
MainTitleBarRefresh (
- IN CONST CHAR16 *FileName OPTIONAL,
- IN CONST EDIT_FILE_TYPE FileType,
- IN CONST BOOLEAN ReadOnly,
- IN CONST BOOLEAN Modified,
- IN CONST UINTN LastCol,
- IN CONST UINTN LastRow,
- IN CONST UINTN Offset,
- IN CONST UINTN Size
+ IN CONST CHAR16 *FileName OPTIONAL,
+ IN CONST EDIT_FILE_TYPE FileType,
+ IN CONST BOOLEAN ReadOnly,
+ IN CONST BOOLEAN Modified,
+ IN CONST UINTN LastCol,
+ IN CONST UINTN LastRow,
+ IN CONST UINTN Offset,
+ IN CONST UINTN Size
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
index 261129e88c..d581a334f4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
@@ -23,103 +23,107 @@ ShellCommandRunEfiCompress (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE InShellFileHandle;
- SHELL_FILE_HANDLE OutShellFileHandle;
- UINT64 OutSize;
- UINTN OutSize2;
- VOID *OutBuffer;
- UINT64 InSize;
- UINTN InSize2;
- VOID *InBuffer;
- CHAR16 *InFileName;
- CONST CHAR16 *OutFileName;
- CONST CHAR16 *TempParam;
-
- InFileName = NULL;
- OutFileName = NULL;
- OutSize = 0;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- OutBuffer = NULL;
- InShellFileHandle = NULL;
- OutShellFileHandle = NULL;
- InBuffer = NULL;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ SHELL_FILE_HANDLE InShellFileHandle;
+ SHELL_FILE_HANDLE OutShellFileHandle;
+ UINT64 OutSize;
+ UINTN OutSize2;
+ VOID *OutBuffer;
+ UINT64 InSize;
+ UINTN InSize2;
+ VOID *InBuffer;
+ CHAR16 *InFileName;
+ CONST CHAR16 *OutFileName;
+ CONST CHAR16 *TempParam;
+
+ InFileName = NULL;
+ OutFileName = NULL;
+ OutSize = 0;
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ OutBuffer = NULL;
+ InShellFileHandle = NULL;
+ OutShellFileHandle = NULL;
+ InBuffer = NULL;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress");
+ if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress");
+ } else if (ShellCommandLineGetCount (Package) < 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- InFileName = ShellFindFilePath(TempParam);
- OutFileName = ShellCommandLineGetRawValue(Package, 2);
+ TempParam = ShellCommandLineGetRawValue (Package, 1);
+ ASSERT (TempParam != NULL);
+ InFileName = ShellFindFilePath (TempParam);
+ OutFileName = ShellCommandLineGetRawValue (Package, 2);
if (InFileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
- if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName);
+ if (ShellIsDirectory (InFileName) == EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName);
+
+ if (ShellIsDirectory (OutFileName) == EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName);
ShellStatus = SHELL_INVALID_PARAMETER;
}
+
if (ShellStatus == SHELL_SUCCESS) {
- Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 1));
+ Status = ShellOpenFileByName (InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue (Package, 1));
ShellStatus = SHELL_NOT_FOUND;
}
- Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 2));
+
+ Status = ShellOpenFileByName (OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue (Package, 2));
ShellStatus = SHELL_NOT_FOUND;
}
}
+
if (ShellStatus == SHELL_SUCCESS) {
- Status = gEfiShellProtocol->GetFileSize(InShellFileHandle, &InSize);
- ASSERT_EFI_ERROR(Status);
- InBuffer = AllocateZeroPool((UINTN)InSize);
+ Status = gEfiShellProtocol->GetFileSize (InShellFileHandle, &InSize);
+ ASSERT_EFI_ERROR (Status);
+ InBuffer = AllocateZeroPool ((UINTN)InSize);
if (InBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {
- InSize2 = (UINTN) InSize;
- Status = gEfiShellProtocol->ReadFile (InShellFileHandle, &InSize2, InBuffer);
- InSize = InSize2;
+ InSize2 = (UINTN)InSize;
+ Status = gEfiShellProtocol->ReadFile (InShellFileHandle, &InSize2, InBuffer);
+ InSize = InSize2;
ASSERT_EFI_ERROR (Status);
Status = Compress (InBuffer, InSize, OutBuffer, &OutSize);
if (Status == EFI_BUFFER_TOO_SMALL) {
- OutBuffer = AllocateZeroPool ((UINTN) OutSize);
+ OutBuffer = AllocateZeroPool ((UINTN)OutSize);
if (OutBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {
@@ -127,14 +131,15 @@ ShellCommandRunEfiCompress (
}
}
}
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_COMPRESS_FAIL), gShellDebug1HiiHandle, Status);
+
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EFI_COMPRESS_FAIL), gShellDebug1HiiHandle, Status);
ShellStatus = ((Status == EFI_OUT_OF_RESOURCES) ? SHELL_OUT_OF_RESOURCES : SHELL_DEVICE_ERROR);
} else {
OutSize2 = (UINTN)OutSize;
- Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &OutSize2, OutBuffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName);
+ Status = gEfiShellProtocol->WriteFile (OutShellFileHandle, &OutSize2, OutBuffer);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName);
ShellStatus = SHELL_DEVICE_ERROR;
}
}
@@ -144,15 +149,18 @@ ShellCommandRunEfiCompress (
ShellCommandLineFreeVarList (Package);
}
+
if (InShellFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(InShellFileHandle);
+ gEfiShellProtocol->CloseFile (InShellFileHandle);
}
+
if (OutShellFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(OutShellFileHandle);
+ gEfiShellProtocol->CloseFile (OutShellFileHandle);
}
- SHELL_FREE_NON_NULL(InFileName);
- SHELL_FREE_NON_NULL(InBuffer);
- SHELL_FREE_NON_NULL(OutBuffer);
+
+ SHELL_FREE_NON_NULL (InFileName);
+ SHELL_FREE_NON_NULL (InBuffer);
+ SHELL_FREE_NON_NULL (OutBuffer);
return (ShellStatus);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
index 4b293f5a7b..8bf23a2076 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c
@@ -10,7 +10,6 @@
#include "UefiShellDebug1CommandsLib.h"
#include <Protocol/Decompress.h>
-
/**
Function for 'decompress' command.
@@ -24,124 +23,126 @@ ShellCommandRunEfiDecompress (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_FILE_HANDLE InFileHandle;
- SHELL_FILE_HANDLE OutFileHandle;
- UINT32 OutSize;
- UINTN OutSizeTemp;
- VOID *OutBuffer;
- UINTN InSize;
- VOID *InBuffer;
- CHAR16 *InFileName;
- CONST CHAR16 *OutFileName;
- UINT64 Temp64Bit;
- UINT32 ScratchSize;
- VOID *ScratchBuffer;
- EFI_DECOMPRESS_PROTOCOL *Decompress;
- CONST CHAR16 *TempParam;
-
- InFileName = NULL;
- OutFileName = NULL;
- OutSize = 0;
- ScratchSize = 0;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- OutBuffer = NULL;
- InBuffer = NULL;
- ScratchBuffer = NULL;
- InFileHandle = NULL;
- OutFileHandle = NULL;
- Decompress = NULL;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ SHELL_FILE_HANDLE InFileHandle;
+ SHELL_FILE_HANDLE OutFileHandle;
+ UINT32 OutSize;
+ UINTN OutSizeTemp;
+ VOID *OutBuffer;
+ UINTN InSize;
+ VOID *InBuffer;
+ CHAR16 *InFileName;
+ CONST CHAR16 *OutFileName;
+ UINT64 Temp64Bit;
+ UINT32 ScratchSize;
+ VOID *ScratchBuffer;
+ EFI_DECOMPRESS_PROTOCOL *Decompress;
+ CONST CHAR16 *TempParam;
+
+ InFileName = NULL;
+ OutFileName = NULL;
+ OutSize = 0;
+ ScratchSize = 0;
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ OutBuffer = NULL;
+ InBuffer = NULL;
+ ScratchBuffer = NULL;
+ InFileHandle = NULL;
+ OutFileHandle = NULL;
+ Decompress = NULL;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress");
+ if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress");
+ } else if (ShellCommandLineGetCount (Package) < 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- TempParam = ShellCommandLineGetRawValue(Package, 1);
- ASSERT(TempParam != NULL);
- InFileName = ShellFindFilePath(TempParam);
- OutFileName = ShellCommandLineGetRawValue(Package, 2);
+ TempParam = ShellCommandLineGetRawValue (Package, 1);
+ ASSERT (TempParam != NULL);
+ InFileName = ShellFindFilePath (TempParam);
+ OutFileName = ShellCommandLineGetRawValue (Package, 2);
if (InFileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
- if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName);
+ if (ShellIsDirectory (InFileName) == EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName);
+
+ if (ShellIsDirectory (OutFileName) == EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName);
ShellStatus = SHELL_INVALID_PARAMETER;
}
+
if (ShellStatus == SHELL_SUCCESS) {
- Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue(Package, 1));
+ Status = ShellOpenFileByName (InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue (Package, 1));
ShellStatus = SHELL_NOT_FOUND;
}
}
if (ShellStatus == SHELL_SUCCESS) {
- Status = FileHandleGetSize(InFileHandle, &Temp64Bit);
- ASSERT(Temp64Bit <= (UINT32)(-1));
+ Status = FileHandleGetSize (InFileHandle, &Temp64Bit);
+ ASSERT (Temp64Bit <= (UINT32)(-1));
InSize = (UINTN)Temp64Bit;
- ASSERT_EFI_ERROR(Status);
- InBuffer = AllocateZeroPool(InSize);
+ ASSERT_EFI_ERROR (Status);
+ InBuffer = AllocateZeroPool (InSize);
if (InBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {
Status = gEfiShellProtocol->ReadFile (InFileHandle, &InSize, InBuffer);
ASSERT_EFI_ERROR (Status);
- Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID**) &Decompress);
+ Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress);
ASSERT_EFI_ERROR (Status);
- Status = Decompress->GetInfo (Decompress, InBuffer, (UINT32) InSize, &OutSize, &ScratchSize);
+ Status = Decompress->GetInfo (Decompress, InBuffer, (UINT32)InSize, &OutSize, &ScratchSize);
}
- if (EFI_ERROR(Status) || OutSize == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_DECOMPRESS_NOPE), gShellDebug1HiiHandle, InFileName);
+ if (EFI_ERROR (Status) || (OutSize == 0)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_EFI_DECOMPRESS_NOPE), gShellDebug1HiiHandle, InFileName);
ShellStatus = SHELL_NOT_FOUND;
} else {
- Status = ShellOpenFileByName(OutFileName, &OutFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
+ Status = ShellOpenFileByName (OutFileName, &OutFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue (Package, 2), Status);
ShellStatus = SHELL_NOT_FOUND;
} else {
- OutBuffer = AllocateZeroPool(OutSize);
- ScratchBuffer = AllocateZeroPool(ScratchSize);
- if (OutBuffer == NULL || ScratchBuffer == NULL) {
+ OutBuffer = AllocateZeroPool (OutSize);
+ ScratchBuffer = AllocateZeroPool (ScratchSize);
+ if ((OutBuffer == NULL) || (ScratchBuffer == NULL)) {
Status = EFI_OUT_OF_RESOURCES;
} else {
- Status = Decompress->Decompress (Decompress, InBuffer, (UINT32) InSize, OutBuffer, OutSize, ScratchBuffer, ScratchSize);
+ Status = Decompress->Decompress (Decompress, InBuffer, (UINT32)InSize, OutBuffer, OutSize, ScratchBuffer, ScratchSize);
}
}
}
@@ -151,8 +152,8 @@ ShellCommandRunEfiDecompress (
ShellStatus = ((Status == EFI_OUT_OF_RESOURCES) ? SHELL_OUT_OF_RESOURCES : SHELL_DEVICE_ERROR);
} else {
OutSizeTemp = OutSize;
- Status = gEfiShellProtocol->WriteFile (OutFileHandle, &OutSizeTemp, OutBuffer);
- OutSize = (UINT32) OutSizeTemp;
+ Status = gEfiShellProtocol->WriteFile (OutFileHandle, &OutSizeTemp, OutBuffer);
+ OutSize = (UINT32)OutSizeTemp;
if (EFI_ERROR (Status)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"efidecompress", OutFileName, Status);
ShellStatus = SHELL_DEVICE_ERROR;
@@ -164,17 +165,19 @@ ShellCommandRunEfiDecompress (
ShellCommandLineFreeVarList (Package);
}
+
if (InFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(InFileHandle);
+ gEfiShellProtocol->CloseFile (InFileHandle);
}
+
if (OutFileHandle != NULL) {
- gEfiShellProtocol->CloseFile(OutFileHandle);
+ gEfiShellProtocol->CloseFile (OutFileHandle);
}
- SHELL_FREE_NON_NULL(InFileName);
- SHELL_FREE_NON_NULL(InBuffer);
- SHELL_FREE_NON_NULL(OutBuffer);
- SHELL_FREE_NON_NULL(ScratchBuffer);
+ SHELL_FREE_NON_NULL (InFileName);
+ SHELL_FREE_NON_NULL (InBuffer);
+ SHELL_FREE_NON_NULL (OutBuffer);
+ SHELL_FREE_NON_NULL (ScratchBuffer);
return (ShellStatus);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
index a730cc105c..be77e31a40 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
@@ -9,28 +9,28 @@
#include "HexEditor.h"
-extern EFI_HANDLE HImageHandleBackup;
+extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_FILE_IMAGE HFileImage;
-extern HEFI_EDITOR_DISK_IMAGE HDiskImage;
-extern HEFI_EDITOR_MEM_IMAGE HMemImage;
+extern HEFI_EDITOR_FILE_IMAGE HFileImage;
+extern HEFI_EDITOR_DISK_IMAGE HDiskImage;
+extern HEFI_EDITOR_MEM_IMAGE HMemImage;
-extern HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
-extern HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
-extern HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
+extern HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
+extern HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
+extern HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
-extern BOOLEAN HEditorMouseAction;
+extern BOOLEAN HEditorMouseAction;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
-HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
+HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
+HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
//
// for basic initialization of HBufferImage
//
-HEFI_EDITOR_BUFFER_IMAGE HBufferImageConst = {
+HEFI_EDITOR_BUFFER_IMAGE HBufferImageConst = {
NULL,
NULL,
0,
@@ -59,14 +59,14 @@ HEFI_EDITOR_BUFFER_IMAGE HBufferImageConst = {
//
// the whole edit area needs to be refreshed
//
-BOOLEAN HBufferImageNeedRefresh;
+BOOLEAN HBufferImageNeedRefresh;
//
// only the current line in edit area needs to be refresh
//
-BOOLEAN HBufferImageOnlyLineNeedRefresh;
+BOOLEAN HBufferImageOnlyLineNeedRefresh;
-BOOLEAN HBufferImageMouseNeedRefresh;
+BOOLEAN HBufferImageMouseNeedRefresh;
/**
Initialization function for HBufferImage
@@ -101,17 +101,17 @@ HBufferImageInit (
HBufferImage.MousePosition.Row = 2;
HBufferImage.MousePosition.Column = 10;
- HBufferImage.FileImage = &HFileImage;
- HBufferImage.DiskImage = &HDiskImage;
- HBufferImage.MemImage = &HMemImage;
+ HBufferImage.FileImage = &HFileImage;
+ HBufferImage.DiskImage = &HDiskImage;
+ HBufferImage.MemImage = &HMemImage;
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- HBufferImageMouseNeedRefresh = FALSE;
+ HBufferImageNeedRefresh = FALSE;
+ HBufferImageOnlyLineNeedRefresh = FALSE;
+ HBufferImageMouseNeedRefresh = FALSE;
- HBufferImageBackupVar.FileImage = &HFileImageBackupVar;
- HBufferImageBackupVar.DiskImage = &HDiskImageBackupVar;
- HBufferImageBackupVar.MemImage = &HMemImageBackupVar;
+ HBufferImageBackupVar.FileImage = &HFileImageBackupVar;
+ HBufferImageBackupVar.DiskImage = &HDiskImageBackupVar;
+ HBufferImageBackupVar.MemImage = &HMemImageBackupVar;
Status = HFileImageInit ();
if (EFI_ERROR (Status)) {
@@ -142,15 +142,15 @@ HBufferImageBackup (
VOID
)
{
- HBufferImageBackupVar.MousePosition = HBufferImage.MousePosition;
+ HBufferImageBackupVar.MousePosition = HBufferImage.MousePosition;
- HBufferImageBackupVar.BufferPosition = HBufferImage.BufferPosition;
+ HBufferImageBackupVar.BufferPosition = HBufferImage.BufferPosition;
- HBufferImageBackupVar.Modified = HBufferImage.Modified;
+ HBufferImageBackupVar.Modified = HBufferImage.Modified;
- HBufferImageBackupVar.BufferType = HBufferImage.BufferType;
- HBufferImageBackupVar.LowVisibleRow = HBufferImage.LowVisibleRow;
- HBufferImageBackupVar.HighBits = HBufferImage.HighBits;
+ HBufferImageBackupVar.BufferType = HBufferImage.BufferType;
+ HBufferImageBackupVar.LowVisibleRow = HBufferImage.LowVisibleRow;
+ HBufferImageBackupVar.HighBits = HBufferImage.HighBits;
//
// three kinds of buffer supported
@@ -159,20 +159,20 @@ HBufferImageBackup (
// memory buffer
//
switch (HBufferImage.BufferType) {
- case FileTypeFileBuffer:
- HFileImageBackup ();
- break;
+ case FileTypeFileBuffer:
+ HFileImageBackup ();
+ break;
- case FileTypeDiskBuffer:
- HDiskImageBackup ();
- break;
+ case FileTypeDiskBuffer:
+ HDiskImageBackup ();
+ break;
- case FileTypeMemBuffer:
- HMemImageBackup ();
- break;
+ case FileTypeMemBuffer:
+ HMemImageBackup ();
+ break;
- default:
- break;
+ default:
+ break;
}
return EFI_SUCCESS;
@@ -195,9 +195,9 @@ HBufferImageFreeLines (
{
HFreeLines (HBufferImage.ListHead, HBufferImage.Lines);
- HBufferImage.Lines = NULL;
- HBufferImage.CurrentLine = NULL;
- HBufferImage.NumLines = 0;
+ HBufferImage.Lines = NULL;
+ HBufferImage.CurrentLine = NULL;
+ HBufferImage.NumLines = 0;
return EFI_SUCCESS;
}
@@ -226,7 +226,6 @@ HBufferImageCleanup (
HDiskImageCleanup ();
return Status;
-
}
/**
@@ -242,42 +241,41 @@ HBufferImageCleanup (
**/
EFI_STATUS
HBufferImagePrintLine (
- IN HEFI_EDITOR_LINE *Line,
- IN UINTN Row,
- IN UINTN FRow,
- IN HEFI_EDITOR_COLOR_UNION Orig,
- IN HEFI_EDITOR_COLOR_UNION New
+ IN HEFI_EDITOR_LINE *Line,
+ IN UINTN Row,
+ IN UINTN FRow,
+ IN HEFI_EDITOR_COLOR_UNION Orig,
+ IN HEFI_EDITOR_COLOR_UNION New
)
{
-
- UINTN Index;
- UINTN Pos;
- BOOLEAN Selected;
- BOOLEAN BeNewColor;
- UINTN RowStart;
- UINTN RowEnd;
- UINTN ColStart;
- UINTN ColEnd;
+ UINTN Index;
+ UINTN Pos;
+ BOOLEAN Selected;
+ BOOLEAN BeNewColor;
+ UINTN RowStart;
+ UINTN RowEnd;
+ UINTN ColStart;
+ UINTN ColEnd;
//
// variable initialization
//
- ColStart = 0;
- ColEnd = 0;
- Selected = FALSE;
+ ColStart = 0;
+ ColEnd = 0;
+ Selected = FALSE;
//
// print the selected area in opposite color
//
- if (HMainEditor.SelectStart != 0 && HMainEditor.SelectEnd != 0) {
- RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
+ if ((HMainEditor.SelectStart != 0) && (HMainEditor.SelectEnd != 0)) {
+ RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
+ RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
- ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
- ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
+ ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
+ ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
- if (FRow >= RowStart && FRow <= RowEnd) {
+ if ((FRow >= RowStart) && (FRow <= RowEnd)) {
Selected = TRUE;
}
@@ -288,7 +286,6 @@ HBufferImagePrintLine (
if (FRow < RowEnd) {
ColEnd = 0x10;
}
-
}
if (!HEditorMouseAction) {
@@ -298,15 +295,13 @@ HBufferImagePrintLine (
L"%8X ",
((INT32)Row - 2 + HBufferImage.LowVisibleRow - 1) * 0x10
);
-
}
for (Index = 0; Index < 0x08 && Index < Line->Size; Index++) {
-
BeNewColor = FALSE;
if (Selected) {
- if (Index + 1 >= ColStart && Index + 1 <= ColEnd) {
+ if ((Index + 1 >= ColStart) && (Index + 1 <= ColEnd)) {
BeNewColor = TRUE;
}
}
@@ -328,7 +323,6 @@ HBufferImagePrintLine (
} else {
ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%x ", Line->Buffer[Index]);
}
-
}
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data & 0x7F);
@@ -339,11 +333,10 @@ HBufferImagePrintLine (
}
while (Index < 0x10 && Index < Line->Size) {
-
BeNewColor = FALSE;
if (Selected) {
- if (Index + 1 >= ColStart && Index + 1 <= ColEnd) {
+ if ((Index + 1 >= ColStart) && (Index + 1 <= ColEnd)) {
BeNewColor = TRUE;
}
}
@@ -370,6 +363,7 @@ HBufferImagePrintLine (
ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L" ");
Index++;
}
+
//
// restore the original color
//
@@ -386,7 +380,7 @@ HBufferImagePrintLine (
// learned from shelle.h -- IsValidChar
//
if (Line->Buffer[Index] >= L' ') {
- ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%c", (CHAR16) Line->Buffer[Index]);
+ ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%c", (CHAR16)Line->Buffer[Index]);
} else {
ShellPrintEx ((INT32)Pos - 1, (INT32)Row - 1, L"%c", '.');
}
@@ -398,6 +392,7 @@ HBufferImagePrintLine (
Index++;
}
}
+
//
// restore the abundant blank in hex edit area to original color
//
@@ -428,8 +423,8 @@ HBufferImagePrintLine (
**/
BOOLEAN
HBufferImageIsAtHighBits (
- IN UINTN Column,
- OUT UINTN *FCol
+ IN UINTN Column,
+ OUT UINTN *FCol
)
{
Column -= 10;
@@ -471,17 +466,17 @@ HBufferImageIsAtHighBits (
**/
BOOLEAN
HBufferImageIsInSelectedArea (
- IN UINTN MouseRow,
- IN UINTN MouseCol
+ IN UINTN MouseRow,
+ IN UINTN MouseCol
)
{
- UINTN FRow;
- UINTN RowStart;
- UINTN RowEnd;
- UINTN ColStart;
- UINTN ColEnd;
- UINTN MouseColStart;
- UINTN MouseColEnd;
+ UINTN FRow;
+ UINTN RowStart;
+ UINTN RowEnd;
+ UINTN ColStart;
+ UINTN ColEnd;
+ UINTN MouseColStart;
+ UINTN MouseColEnd;
//
// judge mouse position whether is in selected area
@@ -489,20 +484,21 @@ HBufferImageIsInSelectedArea (
//
// not select
//
- if (HMainEditor.SelectStart == 0 || HMainEditor.SelectEnd == 0) {
+ if ((HMainEditor.SelectStart == 0) || (HMainEditor.SelectEnd == 0)) {
return FALSE;
}
+
//
// calculate the select area
//
- RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
- RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
+ RowStart = (HMainEditor.SelectStart - 1) / 0x10 + 1;
+ RowEnd = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
- ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
- ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
+ ColStart = (HMainEditor.SelectStart - 1) % 0x10 + 1;
+ ColEnd = (HMainEditor.SelectEnd - 1) % 0x10 + 1;
- FRow = HBufferImage.LowVisibleRow + MouseRow - 2;
- if (FRow < RowStart || FRow > RowEnd) {
+ FRow = HBufferImage.LowVisibleRow + MouseRow - 2;
+ if ((FRow < RowStart) || (FRow > RowEnd)) {
return FALSE;
}
@@ -524,7 +520,7 @@ HBufferImageIsInSelectedArea (
MouseColEnd++;
}
- if (MouseCol < MouseColStart || MouseCol > MouseColEnd) {
+ if ((MouseCol < MouseColStart) || (MouseCol > MouseColEnd)) {
return FALSE;
}
@@ -541,21 +537,19 @@ HBufferImageRestoreMousePosition (
VOID
)
{
- HEFI_EDITOR_COLOR_UNION Orig;
- HEFI_EDITOR_COLOR_UNION New;
- UINTN FRow;
- UINTN FColumn;
- BOOLEAN HasCharacter;
- HEFI_EDITOR_LINE *CurrentLine;
- HEFI_EDITOR_LINE *Line;
- UINT8 Value;
- BOOLEAN HighBits;
+ HEFI_EDITOR_COLOR_UNION Orig;
+ HEFI_EDITOR_COLOR_UNION New;
+ UINTN FRow;
+ UINTN FColumn;
+ BOOLEAN HasCharacter;
+ HEFI_EDITOR_LINE *CurrentLine;
+ HEFI_EDITOR_LINE *Line;
+ UINT8 Value;
+ BOOLEAN HighBits;
Line = NULL;
if (HMainEditor.MouseSupported) {
-
if (HBufferImageMouseNeedRefresh) {
-
HBufferImageMouseNeedRefresh = FALSE;
//
@@ -563,13 +557,15 @@ HBufferImageRestoreMousePosition (
// so do not need to refresh mouse position
//
if ((
- HBufferImage.MousePosition.Row == HBufferImageBackupVar.MousePosition.Row &&
- HBufferImage.MousePosition.Column == HBufferImageBackupVar.MousePosition.Column
- ) &&
+ (HBufferImage.MousePosition.Row == HBufferImageBackupVar.MousePosition.Row) &&
+ (HBufferImage.MousePosition.Column == HBufferImageBackupVar.MousePosition.Column)
+ ) &&
HEditorMouseAction
- ) {
+ )
+ {
return EFI_SUCCESS;
}
+
//
// backup the old screen attributes
//
@@ -583,31 +579,33 @@ HBufferImageRestoreMousePosition (
// so do not need to refresh mouse
//
if (!HBufferImageIsInSelectedArea (
- HBufferImageBackupVar.MousePosition.Row,
- HBufferImageBackupVar.MousePosition.Column
- )) {
+ HBufferImageBackupVar.MousePosition.Row,
+ HBufferImageBackupVar.MousePosition.Column
+ ))
+ {
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
} else {
gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
}
+
//
// clear the old mouse position
//
FRow = HBufferImage.LowVisibleRow + HBufferImageBackupVar.MousePosition.Row - 2;
HighBits = HBufferImageIsAtHighBits (
- HBufferImageBackupVar.MousePosition.Column,
- &FColumn
- );
+ HBufferImageBackupVar.MousePosition.Column,
+ &FColumn
+ );
HasCharacter = TRUE;
- if (FRow > HBufferImage.NumLines || FColumn == 0) {
+ if ((FRow > HBufferImage.NumLines) || (FColumn == 0)) {
HasCharacter = FALSE;
} else {
CurrentLine = HBufferImage.CurrentLine;
Line = HMoveLine (FRow - HBufferImage.BufferPosition.Row);
- if (Line == NULL || FColumn > Line->Size) {
+ if ((Line == NULL) || (FColumn > Line->Size)) {
HasCharacter = FALSE;
}
@@ -622,10 +620,10 @@ HBufferImageRestoreMousePosition (
if (HasCharacter) {
if (HighBits) {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf0);
- Value = (UINT8) (Value >> 4);
+ Value = (UINT8)(Line->Buffer[FColumn - 1] & 0xf0);
+ Value = (UINT8)(Value >> 4);
} else {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf);
+ Value = (UINT8)(Line->Buffer[FColumn - 1] & 0xf);
}
ShellPrintEx (
@@ -637,31 +635,33 @@ HBufferImageRestoreMousePosition (
}
if (!HBufferImageIsInSelectedArea (
- HBufferImage.MousePosition.Row,
- HBufferImage.MousePosition.Column
- )) {
+ HBufferImage.MousePosition.Row,
+ HBufferImage.MousePosition.Column
+ ))
+ {
gST->ConOut->SetAttribute (gST->ConOut, New.Data & 0x7F);
} else {
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
}
+
//
// clear the old mouse position
//
FRow = HBufferImage.LowVisibleRow + HBufferImage.MousePosition.Row - 2;
HighBits = HBufferImageIsAtHighBits (
- HBufferImage.MousePosition.Column,
- &FColumn
- );
+ HBufferImage.MousePosition.Column,
+ &FColumn
+ );
HasCharacter = TRUE;
- if (FRow > HBufferImage.NumLines || FColumn == 0) {
+ if ((FRow > HBufferImage.NumLines) || (FColumn == 0)) {
HasCharacter = FALSE;
} else {
CurrentLine = HBufferImage.CurrentLine;
Line = HMoveLine (FRow - HBufferImage.BufferPosition.Row);
- if (Line == NULL || FColumn > Line->Size) {
+ if ((Line == NULL) || (FColumn > Line->Size)) {
HasCharacter = FALSE;
}
@@ -676,10 +676,10 @@ HBufferImageRestoreMousePosition (
if (HasCharacter) {
if (HighBits) {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf0);
- Value = (UINT8) (Value >> 4);
+ Value = (UINT8)(Line->Buffer[FColumn - 1] & 0xf0);
+ Value = (UINT8)(Value >> 4);
} else {
- Value = (UINT8) (Line->Buffer[FColumn - 1] & 0xf);
+ Value = (UINT8)(Line->Buffer[FColumn - 1] & 0xf);
}
ShellPrintEx (
@@ -689,15 +689,18 @@ HBufferImageRestoreMousePosition (
Value
);
}
+
//
// end of HasCharacter
//
gST->ConOut->SetAttribute (gST->ConOut, Orig.Data);
}
+
//
// end of MouseNeedRefresh
//
}
+
//
// end of MouseSupported
//
@@ -718,10 +721,10 @@ HBufferImageRestorePosition (
// set cursor position
//
gST->ConOut->SetCursorPosition (
- gST->ConOut,
- HBufferImage.DisplayPosition.Column - 1,
- HBufferImage.DisplayPosition.Row - 1
- );
+ gST->ConOut,
+ HBufferImage.DisplayPosition.Column - 1,
+ HBufferImage.DisplayPosition.Row - 1
+ );
return EFI_SUCCESS;
}
@@ -738,16 +741,16 @@ HBufferImageRefresh (
VOID
)
{
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
- UINTN Row;
- HEFI_EDITOR_COLOR_UNION Orig;
- HEFI_EDITOR_COLOR_UNION New;
+ LIST_ENTRY *Link;
+ HEFI_EDITOR_LINE *Line;
+ UINTN Row;
+ HEFI_EDITOR_COLOR_UNION Orig;
+ HEFI_EDITOR_COLOR_UNION New;
- UINTN StartRow;
- UINTN EndRow;
- UINTN FStartRow;
- UINTN Tmp;
+ UINTN StartRow;
+ UINTN EndRow;
+ UINTN FStartRow;
+ UINTN Tmp;
Orig = HMainEditor.ColorAttributes;
New.Data = 0;
@@ -764,8 +767,9 @@ HBufferImageRefresh (
//
if (!HBufferImageNeedRefresh &&
!HBufferImageOnlyLineNeedRefresh &&
- HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow
- ) {
+ (HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow)
+ )
+ {
HBufferImageRestoreMousePosition ();
HBufferImageRestorePosition ();
return EFI_SUCCESS;
@@ -777,8 +781,7 @@ HBufferImageRefresh (
//
// only need to refresh current line
//
- if (HBufferImageOnlyLineNeedRefresh && HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow) {
-
+ if (HBufferImageOnlyLineNeedRefresh && (HBufferImageBackupVar.LowVisibleRow == HBufferImage.LowVisibleRow)) {
HBufferImagePrintLine (
HBufferImage.CurrentLine,
HBufferImage.DisplayPosition.Row,
@@ -790,9 +793,9 @@ HBufferImageRefresh (
//
// the whole edit area need refresh
//
- if (HEditorMouseAction && HMainEditor.SelectStart != 0 && HMainEditor.SelectEnd != 0) {
+ if (HEditorMouseAction && (HMainEditor.SelectStart != 0) && (HMainEditor.SelectEnd != 0)) {
if (HMainEditor.SelectStart != HMainEditorBackupVar.SelectStart) {
- if (HMainEditor.SelectStart >= HMainEditorBackupVar.SelectStart && HMainEditorBackupVar.SelectStart != 0) {
+ if ((HMainEditor.SelectStart >= HMainEditorBackupVar.SelectStart) && (HMainEditorBackupVar.SelectStart != 0)) {
StartRow = (HMainEditorBackupVar.SelectStart - 1) / 0x10 + 1;
} else {
StartRow = (HMainEditor.SelectStart - 1) / 0x10 + 1;
@@ -806,20 +809,20 @@ HBufferImageRefresh (
} else {
EndRow = (HMainEditor.SelectEnd - 1) / 0x10 + 1;
}
+
//
// swap
//
if (StartRow > EndRow) {
- Tmp = StartRow;
- StartRow = EndRow;
- EndRow = Tmp;
+ Tmp = StartRow;
+ StartRow = EndRow;
+ EndRow = Tmp;
}
FStartRow = StartRow;
- StartRow = 2 + StartRow - HBufferImage.LowVisibleRow;
- EndRow = 2 + EndRow - HBufferImage.LowVisibleRow;
-
+ StartRow = 2 + StartRow - HBufferImage.LowVisibleRow;
+ EndRow = 2 + EndRow - HBufferImage.LowVisibleRow;
} else {
//
// not mouse selection actions
@@ -828,6 +831,7 @@ HBufferImageRefresh (
StartRow = 2;
EndRow = (HMainEditor.ScreenSize.Row - 1);
}
+
//
// no line
//
@@ -837,6 +841,7 @@ HBufferImageRefresh (
gST->ConOut->EnableCursor (gST->ConOut, TRUE);
return EFI_SUCCESS;
}
+
//
// get the first line that will be displayed
//
@@ -846,8 +851,8 @@ HBufferImageRefresh (
return EFI_LOAD_ERROR;
}
- Link = &(Line->Link);
- Row = StartRow;
+ Link = &(Line->Link);
+ Row = StartRow;
do {
Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
@@ -870,6 +875,7 @@ HBufferImageRefresh (
EditorClearLine (Row, HMainEditor.ScreenSize.Column, HMainEditor.ScreenSize.Row);
Row++;
}
+
//
// while not file end and not screen full
//
@@ -901,23 +907,23 @@ HBufferImageRefresh (
**/
EFI_STATUS
HBufferImageRead (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType,
- IN BOOLEAN Recover
+ IN CONST CHAR16 *FileName,
+ IN CONST CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType,
+ IN BOOLEAN Recover
)
{
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferTypeBackup;
+ EFI_STATUS Status;
+ EDIT_FILE_TYPE BufferTypeBackup;
//
// variable initialization
//
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
HBufferImage.BufferType = BufferType;
//
@@ -929,21 +935,21 @@ HBufferImageRead (
BufferTypeBackup = HBufferImage.BufferType;
switch (BufferType) {
- case FileTypeFileBuffer:
- Status = HFileImageRead (FileName, Recover);
- break;
+ case FileTypeFileBuffer:
+ Status = HFileImageRead (FileName, Recover);
+ break;
- case FileTypeDiskBuffer:
- Status = HDiskImageRead (DiskName, DiskOffset, DiskSize, Recover);
- break;
+ case FileTypeDiskBuffer:
+ Status = HDiskImageRead (DiskName, DiskOffset, DiskSize, Recover);
+ break;
- case FileTypeMemBuffer:
- Status = HMemImageRead (MemOffset, MemSize, Recover);
- break;
+ case FileTypeMemBuffer:
+ Status = HMemImageRead (MemOffset, MemSize, Recover);
+ break;
- default:
- Status = EFI_NOT_FOUND;
- break;
+ default:
+ Status = EFI_NOT_FOUND;
+ break;
}
if (EFI_ERROR (Status)) {
@@ -968,49 +974,49 @@ HBufferImageRead (
**/
EFI_STATUS
HBufferImageSave (
- IN CHAR16 *FileName,
- IN CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType
+ IN CHAR16 *FileName,
+ IN CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType
)
{
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferTypeBackup;
+ EFI_STATUS Status;
+ EDIT_FILE_TYPE BufferTypeBackup;
//
// variable initialization
//
- Status = EFI_SUCCESS;
- BufferTypeBackup = HBufferImage.BufferType;
+ Status = EFI_SUCCESS;
+ BufferTypeBackup = HBufferImage.BufferType;
switch (HBufferImage.BufferType) {
- //
- // file buffer
- //
- case FileTypeFileBuffer:
- Status = HFileImageSave (FileName);
- break;
+ //
+ // file buffer
+ //
+ case FileTypeFileBuffer:
+ Status = HFileImageSave (FileName);
+ break;
- //
- // disk buffer
- //
- case FileTypeDiskBuffer:
- Status = HDiskImageSave (DiskName, DiskOffset, DiskSize);
- break;
+ //
+ // disk buffer
+ //
+ case FileTypeDiskBuffer:
+ Status = HDiskImageSave (DiskName, DiskOffset, DiskSize);
+ break;
- //
- // memory buffer
- //
- case FileTypeMemBuffer:
- Status = HMemImageSave (MemOffset, MemSize);
- break;
+ //
+ // memory buffer
+ //
+ case FileTypeMemBuffer:
+ Status = HMemImageSave (MemOffset, MemSize);
+ break;
- default:
- Status = EFI_NOT_FOUND;
- break;
+ default:
+ Status = EFI_NOT_FOUND;
+ break;
}
if (EFI_ERROR (Status)) {
@@ -1057,11 +1063,11 @@ HBufferImageCreateLine (
if (HBufferImage.Lines == NULL) {
HBufferImage.Lines = CR (
- HBufferImage.ListHead->ForwardLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
+ HBufferImage.ListHead->ForwardLink,
+ HEFI_EDITOR_LINE,
+ Link,
+ EFI_EDITOR_LINE_LIST
+ );
}
return Line;
@@ -1095,21 +1101,21 @@ HBufferImageFree (
**/
INTN
HBufferImageCharToHex (
- IN CHAR16 Char
+ IN CHAR16 Char
)
{
//
// change the character to hex
//
- if (Char >= L'0' && Char <= L'9') {
+ if ((Char >= L'0') && (Char <= L'9')) {
return (Char - L'0');
}
- if (Char >= L'a' && Char <= L'f') {
+ if ((Char >= L'a') && (Char <= L'f')) {
return (Char - L'a' + 10);
}
- if (Char >= L'A' && Char <= L'F') {
+ if ((Char >= L'A') && (Char <= L'F')) {
return (Char - L'A' + 10);
}
@@ -1146,10 +1152,10 @@ HBufferImageAddChar (
return EFI_SUCCESS;
}
- Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- High = HBufferImage.HighBits;
+ Line = HBufferImage.CurrentLine;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = HBufferImage.BufferPosition.Column;
+ High = HBufferImage.HighBits;
//
// only needs to refresh current line
@@ -1164,27 +1170,25 @@ HBufferImageAddChar (
// cursor always at high 4 bits
// and always put input to the low 4 bits
//
- Line->Buffer[Line->Size] = (UINT8) Value;
+ Line->Buffer[Line->Size] = (UINT8)Value;
Line->Size++;
High = FALSE;
} else {
-
Old = Line->Buffer[FCol - 1];
//
// always put the input to the low 4 bits
//
- Old = (UINT8) (Old & 0x0f);
- Old = (UINT8) (Old << 4);
- Old = (UINT8) (Value + Old);
- Line->Buffer[FCol - 1] = Old;
+ Old = (UINT8)(Old & 0x0f);
+ Old = (UINT8)(Old << 4);
+ Old = (UINT8)(Value + Old);
+ Line->Buffer[FCol - 1] = Old;
//
// at the low 4 bits of the last character of a full line
// so if no next line, need to create a new line
//
- if (!High && FCol == 0x10) {
-
+ if (!High && (FCol == 0x10)) {
HBufferImageOnlyLineNeedRefresh = FALSE;
HBufferImageNeedRefresh = TRUE;
@@ -1198,26 +1202,29 @@ HBufferImageAddChar (
if (NewLine == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// end of NULL
//
}
+
//
// end of == ListHead
//
}
+
//
// end of == 0x10
//
// if already at end of this line, scroll it to the start of next line
//
- if (FCol == 0x10 && !High) {
+ if ((FCol == 0x10) && !High) {
//
// definitely has next line
//
FRow++;
- FCol = 1;
- High = TRUE;
+ FCol = 1;
+ High = TRUE;
} else {
//
// if not at end of this line, just move to next column
@@ -1231,12 +1238,13 @@ HBufferImageAddChar (
} else {
High = TRUE;
}
-
}
+
//
// end of ==FALSE
//
}
+
//
// move cursor to right
//
@@ -1261,9 +1269,9 @@ HBufferImageDoBackspace (
{
HEFI_EDITOR_LINE *Line;
- UINTN FileColumn;
- UINTN FPos;
- BOOLEAN LastLine;
+ UINTN FileColumn;
+ UINTN FPos;
+ BOOLEAN LastLine;
//
// variable initialization
@@ -1273,17 +1281,17 @@ HBufferImageDoBackspace (
//
// already the first character
//
- if (HBufferImage.BufferPosition.Row == 1 && HBufferImage.BufferPosition.Column == 1) {
+ if ((HBufferImage.BufferPosition.Row == 1) && (HBufferImage.BufferPosition.Column == 1)) {
return EFI_SUCCESS;
}
- FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
+ FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
- FileColumn = HBufferImage.BufferPosition.Column;
+ FileColumn = HBufferImage.BufferPosition.Column;
- Line = HBufferImage.CurrentLine;
- LastLine = FALSE;
- if (Line->Link.ForwardLink == HBufferImage.ListHead && FileColumn > 1) {
+ Line = HBufferImage.CurrentLine;
+ LastLine = FALSE;
+ if ((Line->Link.ForwardLink == HBufferImage.ListHead) && (FileColumn > 1)) {
LastLine = TRUE;
}
@@ -1327,32 +1335,32 @@ HBufferImageDoCharInput (
Status = EFI_SUCCESS;
switch (Char) {
- case 0:
- break;
+ case 0:
+ break;
- case 0x08:
- Status = HBufferImageDoBackspace ();
- break;
+ case 0x08:
+ Status = HBufferImageDoBackspace ();
+ break;
- case 0x09:
- case 0x0a:
- case 0x0d:
- //
- // Tabs, Returns are thought as nothing
- //
- break;
+ case 0x09:
+ case 0x0a:
+ case 0x0d:
+ //
+ // Tabs, Returns are thought as nothing
+ //
+ break;
- default:
- //
- // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
- //
- if (Char > 127 || Char < 32) {
- Status = StatusBarSetStatusString (L"Unknown Command");
- } else {
- Status = HBufferImageAddChar (Char);
- }
+ default:
+ //
+ // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
+ //
+ if ((Char > 127) || (Char < 32)) {
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ } else {
+ Status = HBufferImageAddChar (Char);
+ }
- break;
+ break;
}
return Status;
@@ -1369,7 +1377,7 @@ HBufferImageDoCharInput (
**/
BOOLEAN
HAboveCurrentScreen (
- IN UINTN FileRow
+ IN UINTN FileRow
)
{
if (FileRow < HBufferImage.LowVisibleRow) {
@@ -1390,7 +1398,7 @@ HAboveCurrentScreen (
**/
BOOLEAN
HUnderCurrentScreen (
- IN UINTN FileRow
+ IN UINTN FileRow
)
{
if (FileRow > HBufferImage.LowVisibleRow + (HMainEditor.ScreenSize.Row - 2) - 1) {
@@ -1414,19 +1422,19 @@ HBufferImageMovePosition (
IN BOOLEAN HighBits
)
{
- INTN RowGap;
- UINTN Abs;
- BOOLEAN Above;
- BOOLEAN Under;
- UINTN NewDisplayCol;
+ INTN RowGap;
+ UINTN Abs;
+ BOOLEAN Above;
+ BOOLEAN Under;
+ UINTN NewDisplayCol;
//
// CALCULATE gap between current file position and new file position
//
- RowGap = NewFilePosRow - HBufferImage.BufferPosition.Row;
+ RowGap = NewFilePosRow - HBufferImage.BufferPosition.Row;
- Under = HUnderCurrentScreen (NewFilePosRow);
- Above = HAboveCurrentScreen (NewFilePosRow);
+ Under = HUnderCurrentScreen (NewFilePosRow);
+ Above = HAboveCurrentScreen (NewFilePosRow);
HBufferImage.HighBits = HighBits;
@@ -1456,12 +1464,11 @@ HBufferImageMovePosition (
//
HBufferImage.BufferPosition.Row = NewFilePosRow;
if (RowGap <= 0) {
- Abs = (UINTN)ABS(RowGap);
+ Abs = (UINTN)ABS (RowGap);
HBufferImage.DisplayPosition.Row -= Abs;
} else {
HBufferImage.DisplayPosition.Row += RowGap;
}
-
}
}
@@ -1470,9 +1477,9 @@ HBufferImageMovePosition (
//
// always in current screen
//
- HBufferImage.BufferPosition.Column = NewFilePosCol;
+ HBufferImage.BufferPosition.Column = NewFilePosCol;
- NewDisplayCol = 10 + (NewFilePosCol - 1) * 3;
+ NewDisplayCol = 10 + (NewFilePosCol - 1) * 3;
if (NewFilePosCol > 0x8) {
NewDisplayCol++;
}
@@ -1487,7 +1494,6 @@ HBufferImageMovePosition (
// let CurrentLine point to correct line;
//
HBufferImage.CurrentLine = HMoveCurrentLine (RowGap);
-
}
/**
@@ -1521,6 +1527,7 @@ HBufferImageScrollRight (
if (FCol > Line->Size) {
return EFI_SUCCESS;
}
+
//
// if already at end of this line, scroll it to the start of next line
//
@@ -1531,7 +1538,6 @@ HBufferImageScrollRight (
if (Line->Link.ForwardLink != HBufferImage.ListHead) {
FRow++;
FCol = 1;
-
} else {
return EFI_SUCCESS;
}
@@ -1540,7 +1546,6 @@ HBufferImageScrollRight (
// if not at end of this line, just move to next column
//
FCol++;
-
}
HBufferImageMovePosition (FRow, FCol, TRUE);
@@ -1558,7 +1563,6 @@ HBufferImageScrollLeft (
VOID
)
{
-
HEFI_EDITOR_LINE *Line;
UINTN FRow;
UINTN FCol;
@@ -1580,8 +1584,8 @@ HBufferImageScrollLeft (
//
if (Line->Link.BackLink != HBufferImage.ListHead) {
FRow--;
- Line = CR (Line->Link.BackLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- FCol = Line->Size;
+ Line = CR (Line->Link.BackLink, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
+ FCol = Line->Size;
} else {
return EFI_SUCCESS;
}
@@ -1612,11 +1616,11 @@ HBufferImageScrollDown (
UINTN FCol;
BOOLEAN HighBits;
- Line = HBufferImage.CurrentLine;
+ Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- HighBits = HBufferImage.HighBits;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = HBufferImage.BufferPosition.Column;
+ HighBits = HBufferImage.HighBits;
//
// has next line
@@ -1629,10 +1633,9 @@ HBufferImageScrollDown (
// if the next line is not that long, so move to end of next line
//
if (FCol > Line->Size) {
- FCol = Line->Size + 1;
- HighBits = TRUE;
+ FCol = Line->Size + 1;
+ HighBits = TRUE;
}
-
} else {
return EFI_SUCCESS;
}
@@ -1656,17 +1659,16 @@ HBufferImageScrollUp (
UINTN FRow;
UINTN FCol;
- Line = HBufferImage.CurrentLine;
+ Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = HBufferImage.BufferPosition.Column;
//
// has previous line
//
if (Line->Link.BackLink != HBufferImage.ListHead) {
FRow--;
-
} else {
return EFI_SUCCESS;
}
@@ -1692,11 +1694,11 @@ HBufferImagePageDown (
UINTN Gap;
BOOLEAN HighBits;
- Line = HBufferImage.CurrentLine;
+ Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
- HighBits = HBufferImage.HighBits;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = HBufferImage.BufferPosition.Column;
+ HighBits = HBufferImage.HighBits;
//
// has next page
@@ -1709,6 +1711,7 @@ HBufferImagePageDown (
//
Gap = HBufferImage.NumLines - FRow;
}
+
//
// get correct line
//
@@ -1717,9 +1720,9 @@ HBufferImagePageDown (
//
// if that line, is not that long, so move to the end of that line
//
- if (Line != NULL && FCol > Line->Size) {
- FCol = Line->Size + 1;
- HighBits = TRUE;
+ if ((Line != NULL) && (FCol > Line->Size)) {
+ FCol = Line->Size + 1;
+ HighBits = TRUE;
}
FRow += Gap;
@@ -1739,13 +1742,13 @@ HBufferImagePageUp (
VOID
)
{
- UINTN FRow;
- UINTN FCol;
- UINTN Gap;
- INTN Retreat;
+ UINTN FRow;
+ UINTN FCol;
+ UINTN Gap;
+ INTN Retreat;
- FRow = HBufferImage.BufferPosition.Row;
- FCol = HBufferImage.BufferPosition.Column;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = HBufferImage.BufferPosition.Column;
//
// has previous page
@@ -1779,16 +1782,16 @@ HBufferImageHome (
VOID
)
{
- UINTN FRow;
- UINTN FCol;
- BOOLEAN HighBits;
+ UINTN FRow;
+ UINTN FCol;
+ BOOLEAN HighBits;
//
// curosr will at the high bit
//
- FRow = HBufferImage.BufferPosition.Row;
- FCol = 1;
- HighBits = TRUE;
+ FRow = HBufferImage.BufferPosition.Row;
+ FCol = 1;
+ HighBits = TRUE;
//
// move cursor position
@@ -1816,19 +1819,20 @@ HBufferImageEnd (
//
// need refresh mouse
//
- HBufferImageMouseNeedRefresh = TRUE;
+ HBufferImageMouseNeedRefresh = TRUE;
- Line = HBufferImage.CurrentLine;
+ Line = HBufferImage.CurrentLine;
- FRow = HBufferImage.BufferPosition.Row;
+ FRow = HBufferImage.BufferPosition.Row;
if (Line->Size == 0x10) {
- FCol = Line->Size;
- HighBits = FALSE;
+ FCol = Line->Size;
+ HighBits = FALSE;
} else {
- FCol = Line->Size + 1;
- HighBits = TRUE;
+ FCol = Line->Size + 1;
+ HighBits = TRUE;
}
+
//
// move cursor position
//
@@ -1847,7 +1851,7 @@ HBufferImageGetTotalSize (
VOID
)
{
- UINTN Size;
+ UINTN Size;
HEFI_EDITOR_LINE *Line;
@@ -1859,11 +1863,11 @@ HBufferImageGetTotalSize (
}
Line = CR (
- HBufferImage.ListHead->BackLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
+ HBufferImage.ListHead->BackLink,
+ HEFI_EDITOR_LINE,
+ Link,
+ EFI_EDITOR_LINE_LIST
+ );
//
// one line at most 0x10
//
@@ -1883,29 +1887,29 @@ HBufferImageGetTotalSize (
**/
EFI_STATUS
HBufferImageDeleteCharacterFromBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- OUT UINT8 *DeleteBuffer
+ IN UINTN Pos,
+ IN UINTN Count,
+ OUT UINT8 *DeleteBuffer
)
{
- UINTN Index;
+ UINTN Index;
- VOID *Buffer;
- UINT8 *BufferPtr;
- UINTN Size;
+ VOID *Buffer;
+ UINT8 *BufferPtr;
+ UINTN Size;
HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
+ LIST_ENTRY *Link;
- UINTN OldFCol;
- UINTN OldFRow;
- UINTN OldPos;
+ UINTN OldFCol;
+ UINTN OldFRow;
+ UINTN OldPos;
- UINTN NewPos;
+ UINTN NewPos;
- EFI_STATUS Status;
+ EFI_STATUS Status;
- Size = HBufferImageGetTotalSize ();
+ Size = HBufferImageGetTotalSize ();
if (Size < Count) {
return EFI_LOAD_ERROR;
@@ -1928,7 +1932,6 @@ HBufferImageDeleteCharacterFromBuffer (
// so locate according to block's previous character
//
NewPos = Pos - 1;
-
} else {
//
// has no character before it,
@@ -1946,7 +1949,7 @@ HBufferImageDeleteCharacterFromBuffer (
HBufferImageListToBuffer (Buffer, Size);
- BufferPtr = (UINT8 *) Buffer;
+ BufferPtr = (UINT8 *)Buffer;
//
// pass deleted buffer out
@@ -1956,6 +1959,7 @@ HBufferImageDeleteCharacterFromBuffer (
DeleteBuffer[Index] = BufferPtr[Pos + Index];
}
}
+
//
// delete the part from Pos
//
@@ -1979,14 +1983,14 @@ HBufferImageDeleteCharacterFromBuffer (
Link = Link->ForwardLink;
}
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- HBufferImage.CurrentLine = Line;
+ Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
+ HBufferImage.CurrentLine = Line;
//
// if current cursor position if inside select area
// then move it to the block's NEXT character
//
- if (OldPos >= Pos && OldPos < (Pos + Count)) {
+ if ((OldPos >= Pos) && (OldPos < (Pos + Count))) {
NewPos = Pos;
} else {
if (OldPos < Pos) {
@@ -2012,28 +2016,28 @@ HBufferImageDeleteCharacterFromBuffer (
**/
EFI_STATUS
HBufferImageAddCharacterToBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- IN UINT8 *AddBuffer
+ IN UINTN Pos,
+ IN UINTN Count,
+ IN UINT8 *AddBuffer
)
{
- INTN Index;
+ INTN Index;
- VOID *Buffer;
- UINT8 *BufferPtr;
- UINTN Size;
+ VOID *Buffer;
+ UINT8 *BufferPtr;
+ UINTN Size;
HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
+ LIST_ENTRY *Link;
- UINTN OldFCol;
- UINTN OldFRow;
- UINTN OldPos;
+ UINTN OldFCol;
+ UINTN OldFRow;
+ UINTN OldPos;
- UINTN NewPos;
+ UINTN NewPos;
- Size = HBufferImageGetTotalSize ();
+ Size = HBufferImageGetTotalSize ();
//
// relocate all the HBufferImage fields
@@ -2060,18 +2064,19 @@ HBufferImageAddCharacterToBuffer (
HBufferImageListToBuffer (Buffer, Size);
- BufferPtr = (UINT8 *) Buffer;
+ BufferPtr = (UINT8 *)Buffer;
//
// get a place to add
//
- for (Index = (INTN) (Size + Count - 1); Index >= (INTN) Pos; Index--) {
+ for (Index = (INTN)(Size + Count - 1); Index >= (INTN)Pos; Index--) {
BufferPtr[Index] = BufferPtr[Index - Count];
}
+
//
// add the buffer
//
- for (Index = (INTN) 0; Index < (INTN) Count; Index++) {
+ for (Index = (INTN)0; Index < (INTN)Count; Index++) {
BufferPtr[Index + Pos] = AddBuffer[Index];
}
@@ -2084,12 +2089,12 @@ HBufferImageAddCharacterToBuffer (
FreePool (Buffer);
Link = HMainEditor.BufferImage->ListHead->ForwardLink;
- for (Index = 0; Index < (INTN) NewPos / 0x10; Index++) {
+ for (Index = 0; Index < (INTN)NewPos / 0x10; Index++) {
Link = Link->ForwardLink;
}
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- HBufferImage.CurrentLine = Line;
+ Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
+ HBufferImage.CurrentLine = Line;
if (OldPos >= Pos) {
NewPos = OldPos + Count;
@@ -2112,18 +2117,17 @@ HBufferImageDoDelete (
VOID
)
{
-
HEFI_EDITOR_LINE *Line;
- BOOLEAN LastLine;
- UINTN FileColumn;
- UINTN FPos;
+ BOOLEAN LastLine;
+ UINTN FileColumn;
+ UINTN FPos;
- FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
+ FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
- FileColumn = HBufferImage.BufferPosition.Column;
+ FileColumn = HBufferImage.BufferPosition.Column;
- Line = HBufferImage.CurrentLine;
+ Line = HBufferImage.CurrentLine;
//
// if beyond the last character
@@ -2179,9 +2183,9 @@ HBufferImageBufferToList (
HEFI_EDITOR_LINE *Line;
UINT8 *BufferPtr;
- TempI = 0;
+ TempI = 0;
Left = 0;
- BufferPtr = (UINT8 *) Buffer;
+ BufferPtr = (UINT8 *)Buffer;
//
// parse file content line by line
@@ -2207,13 +2211,12 @@ HBufferImageBufferToList (
Line->Buffer[TempJ] = BufferPtr[TempI];
TempI++;
}
-
}
//
// last line is a full line, SO create a new line
//
- if (Left == 0x10 || Bytes == 0) {
+ if ((Left == 0x10) || (Bytes == 0)) {
Line = HBufferImageCreateLine ();
if (Line == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -2240,7 +2243,7 @@ HBufferImageListToBuffer (
UINTN Count;
UINTN Index;
HEFI_EDITOR_LINE *Line;
- LIST_ENTRY *Link;
+ LIST_ENTRY *Link;
UINT8 *BufferPtr;
//
@@ -2252,16 +2255,15 @@ HBufferImageListToBuffer (
Link = &HBufferImage.Lines->Link;
Count = 0;
- BufferPtr = (UINT8 *) Buffer;
+ BufferPtr = (UINT8 *)Buffer;
//
// deal line by line
//
while (Link != HBufferImage.ListHead) {
-
Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- //@todo shouldn't this be an error???
+ // @todo shouldn't this be an error???
if (Count + Line->Size > Bytes) {
return EFI_SUCCESS;
}
@@ -2270,7 +2272,7 @@ HBufferImageListToBuffer (
BufferPtr[Index] = Line->Buffer[Index];
}
- Count += Line->Size;
+ Count += Line->Size;
BufferPtr += Line->Size;
Link = Link->ForwardLink;
@@ -2287,14 +2289,14 @@ HBufferImageListToBuffer (
**/
VOID
HBufferImageAdjustMousePosition (
- IN INT32 TextX,
- IN INT32 TextY
+ IN INT32 TextX,
+ IN INT32 TextY
)
{
- UINTN TempX;
- UINTN TempY;
- UINTN AbsX;
- UINTN AbsY;
+ UINTN TempX;
+ UINTN TempY;
+ UINTN AbsX;
+ UINTN AbsY;
//
// TextX and TextY is mouse movement data returned by mouse driver
@@ -2308,6 +2310,7 @@ HBufferImageAdjustMousePosition (
} else {
AbsX = -TextX;
}
+
//
// get absolute TempY value
//
@@ -2339,29 +2342,30 @@ HBufferImageAdjustMousePosition (
TempY = 0;
}
}
+
//
// check whether new mouse column position is beyond screen
// if not, adjust it
//
- if (TempX >= 10 && TempX <= (10 + 0x10 * 3 - 1)) {
+ if ((TempX >= 10) && (TempX <= (10 + 0x10 * 3 - 1))) {
HBufferImage.MousePosition.Column = TempX;
} else if (TempX < 10) {
HBufferImage.MousePosition.Column = 10;
} else if (TempX > (10 + 0x10 * 3 - 1)) {
HBufferImage.MousePosition.Column = 10 + 0x10 * 3 - 1;
}
+
//
// check whether new mouse row position is beyond screen
// if not, adjust it
//
- if (TempY >= 2 && TempY <= (HMainEditor.ScreenSize.Row - 1)) {
+ if ((TempY >= 2) && (TempY <= (HMainEditor.ScreenSize.Row - 1))) {
HBufferImage.MousePosition.Row = TempY;
} else if (TempY < 2) {
HBufferImage.MousePosition.Row = 2;
} else if (TempY > (HMainEditor.ScreenSize.Row - 1)) {
HBufferImage.MousePosition.Row = (HMainEditor.ScreenSize.Row - 1);
}
-
}
/**
@@ -2381,7 +2385,7 @@ HBufferImageAdjustMousePosition (
**/
EFI_STATUS
HBufferImageHandleInput (
- IN EFI_INPUT_KEY *Key
+ IN EFI_INPUT_KEY *Key
)
{
EFI_STATUS Status;
@@ -2389,81 +2393,80 @@ HBufferImageHandleInput (
Status = EFI_SUCCESS;
switch (Key->ScanCode) {
- //
- // ordinary key
- //
- case SCAN_NULL:
- Status = HBufferImageDoCharInput (Key->UnicodeChar);
- break;
+ //
+ // ordinary key
+ //
+ case SCAN_NULL:
+ Status = HBufferImageDoCharInput (Key->UnicodeChar);
+ break;
- //
- // up arrow
- //
- case SCAN_UP:
- Status = HBufferImageScrollUp ();
- break;
+ //
+ // up arrow
+ //
+ case SCAN_UP:
+ Status = HBufferImageScrollUp ();
+ break;
- //
- // down arrow
- //
- case SCAN_DOWN:
- Status = HBufferImageScrollDown ();
- break;
+ //
+ // down arrow
+ //
+ case SCAN_DOWN:
+ Status = HBufferImageScrollDown ();
+ break;
- //
- // right arrow
- //
- case SCAN_RIGHT:
- Status = HBufferImageScrollRight ();
- break;
+ //
+ // right arrow
+ //
+ case SCAN_RIGHT:
+ Status = HBufferImageScrollRight ();
+ break;
- //
- // left arrow
- //
- case SCAN_LEFT:
- Status = HBufferImageScrollLeft ();
- break;
+ //
+ // left arrow
+ //
+ case SCAN_LEFT:
+ Status = HBufferImageScrollLeft ();
+ break;
- //
- // page up
- //
- case SCAN_PAGE_UP:
- Status = HBufferImagePageUp ();
- break;
+ //
+ // page up
+ //
+ case SCAN_PAGE_UP:
+ Status = HBufferImagePageUp ();
+ break;
- //
- // page down
- //
- case SCAN_PAGE_DOWN:
- Status = HBufferImagePageDown ();
- break;
+ //
+ // page down
+ //
+ case SCAN_PAGE_DOWN:
+ Status = HBufferImagePageDown ();
+ break;
- //
- // delete
- //
- case SCAN_DELETE:
- Status = HBufferImageDoDelete ();
- break;
+ //
+ // delete
+ //
+ case SCAN_DELETE:
+ Status = HBufferImageDoDelete ();
+ break;
- //
- // home
- //
- case SCAN_HOME:
- Status = HBufferImageHome ();
- break;
+ //
+ // home
+ //
+ case SCAN_HOME:
+ Status = HBufferImageHome ();
+ break;
- //
- // end
- //
- case SCAN_END:
- Status = HBufferImageEnd ();
- break;
+ //
+ // end
+ //
+ case SCAN_END:
+ Status = HBufferImageEnd ();
+ break;
- default:
- Status = StatusBarSetStatusString (L"Unknown Command");
- break;
+ default:
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ break;
}
return Status;
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
index 0599f293ec..777a7ce93b 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
@@ -62,7 +62,7 @@ HBufferImageRefresh (
**/
EFI_STATUS
HBufferImageHandleInput (
- IN EFI_INPUT_KEY *Key
+ IN EFI_INPUT_KEY *Key
);
/**
@@ -92,14 +92,14 @@ HBufferImageBackup (
**/
EFI_STATUS
HBufferImageRead (
- IN CONST CHAR16 *FileName,
- IN CONST CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType,
- IN BOOLEAN Recover
+ IN CONST CHAR16 *FileName,
+ IN CONST CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType,
+ IN BOOLEAN Recover
);
/**
@@ -117,13 +117,13 @@ HBufferImageRead (
**/
EFI_STATUS
HBufferImageSave (
- IN CHAR16 *FileName,
- IN CHAR16 *DiskName,
- IN UINTN DiskOffset,
- IN UINTN DiskSize,
- IN UINTN MemOffset,
- IN UINTN MemSize,
- IN EDIT_FILE_TYPE BufferType
+ IN CHAR16 *FileName,
+ IN CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType
);
/**
@@ -140,7 +140,6 @@ HBufferImageMovePosition (
IN BOOLEAN HighBits
);
-
/**
Create a new line and append it to the line list.
Fields affected:
@@ -177,9 +176,9 @@ HBufferImageFree (
**/
EFI_STATUS
HBufferImageDeleteCharacterFromBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- OUT UINT8 *DeleteBuffer
+ IN UINTN Pos,
+ IN UINTN Count,
+ OUT UINT8 *DeleteBuffer
);
/**
@@ -193,9 +192,9 @@ HBufferImageDeleteCharacterFromBuffer (
**/
EFI_STATUS
HBufferImageAddCharacterToBuffer (
- IN UINTN Pos,
- IN UINTN Count,
- IN UINT8 *AddBuffer
+ IN UINTN Pos,
+ IN UINTN Count,
+ IN UINT8 *AddBuffer
);
/**
@@ -235,8 +234,8 @@ HBufferImageListToBuffer (
**/
VOID
HBufferImageAdjustMousePosition (
- IN INT32 TextX,
- IN INT32 TextY
+ IN INT32 TextX,
+ IN INT32 TextY
);
/**
@@ -250,8 +249,8 @@ HBufferImageAdjustMousePosition (
**/
BOOLEAN
HBufferImageIsAtHighBits (
- IN UINTN Column,
- OUT UINTN *FCol
+ IN UINTN Column,
+ OUT UINTN *FCol
);
/**
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
index c2d6c5fa9a..f18a7dd098 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
@@ -9,16 +9,16 @@
#include "HexEditor.h"
typedef struct {
- UINT8 *Buffer;
- UINTN Size;
+ UINT8 *Buffer;
+ UINTN Size;
} HEFI_EDITOR_CLIPBOARD;
-HEFI_EDITOR_CLIPBOARD HClipBoard;
+HEFI_EDITOR_CLIPBOARD HClipBoard;
//
// for basic initialization of HClipBoard
//
-HEFI_EDITOR_CLIPBOARD HClipBoardConst = {
+HEFI_EDITOR_CLIPBOARD HClipBoardConst = {
NULL,
0
};
@@ -53,7 +53,6 @@ HClipBoardCleanup (
VOID
)
{
-
SHELL_FREE_NON_NULL (HClipBoard.Buffer);
return EFI_SUCCESS;
@@ -69,8 +68,8 @@ HClipBoardCleanup (
**/
EFI_STATUS
HClipBoardSet (
- IN UINT8 *Buffer,
- IN UINTN Size
+ IN UINT8 *Buffer,
+ IN UINTN Size
)
{
//
@@ -80,7 +79,7 @@ HClipBoardSet (
SHELL_FREE_NON_NULL (HClipBoard.Buffer);
HClipBoard.Buffer = Buffer;
- HClipBoard.Size = Size;
+ HClipBoard.Size = Size;
return EFI_SUCCESS;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
index 6e1e2d42cc..eaeaa00d3a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
@@ -44,8 +44,8 @@ HClipBoardCleanup (
**/
EFI_STATUS
HClipBoardSet (
- IN UINT8 *Buffer,
- IN UINTN Size
+ IN UINT8 *Buffer,
+ IN UINTN Size
);
/**
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
index 771a5c6840..f884428240 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
@@ -9,22 +9,22 @@
#include "HexEditor.h"
#include <Protocol/BlockIo.h>
-extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
+extern EFI_HANDLE HImageHandleBackup;
+extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
+extern BOOLEAN HBufferImageNeedRefresh;
+extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
+extern BOOLEAN HBufferImageMouseNeedRefresh;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-HEFI_EDITOR_DISK_IMAGE HDiskImage;
-HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
+HEFI_EDITOR_DISK_IMAGE HDiskImage;
+HEFI_EDITOR_DISK_IMAGE HDiskImageBackupVar;
//
// for basic initialization of HDiskImage
//
-HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
+HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
NULL,
0,
0,
@@ -70,13 +70,13 @@ HDiskImageBackup (
//
SHELL_FREE_NON_NULL (HDiskImageBackupVar.Name);
- HDiskImageBackupVar.Name = CatSPrint(NULL, L"%s", HDiskImage.Name);
+ HDiskImageBackupVar.Name = CatSPrint (NULL, L"%s", HDiskImage.Name);
if (HDiskImageBackupVar.Name == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- HDiskImageBackupVar.Offset = HDiskImage.Offset;
- HDiskImageBackupVar.Size = HDiskImage.Size;
+ HDiskImageBackupVar.Offset = HDiskImage.Offset;
+ HDiskImageBackupVar.Size = HDiskImage.Size;
return EFI_SUCCESS;
}
@@ -109,9 +109,9 @@ HDiskImageCleanup (
**/
EFI_STATUS
HDiskImageSetDiskNameOffsetSize (
- IN CONST CHAR16 *Str,
- IN UINTN Offset,
- IN UINTN Size
+ IN CONST CHAR16 *Str,
+ IN UINTN Offset,
+ IN UINTN Size
)
{
if (Str == HDiskImage.Name) {
@@ -131,8 +131,8 @@ HDiskImageSetDiskNameOffsetSize (
return EFI_OUT_OF_RESOURCES;
}
- HDiskImage.Offset = Offset;
- HDiskImage.Size = Size;
+ HDiskImage.Offset = Offset;
+ HDiskImage.Size = Size;
return EFI_SUCCESS;
}
@@ -152,10 +152,10 @@ HDiskImageSetDiskNameOffsetSize (
**/
EFI_STATUS
HDiskImageRead (
- IN CONST CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
+ IN CONST CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
)
{
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
@@ -165,46 +165,49 @@ HDiskImageRead (
EFI_BLOCK_IO_PROTOCOL *BlkIo;
EFI_STATUS Status;
- VOID *Buffer;
- CHAR16 *Str;
- UINTN Bytes;
+ VOID *Buffer;
+ CHAR16 *Str;
+ UINTN Bytes;
- HEFI_EDITOR_LINE *Line;
+ HEFI_EDITOR_LINE *Line;
HBufferImage.BufferType = FileTypeDiskBuffer;
- DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
+ DevicePath = gEfiShellProtocol->GetDevicePathFromMap (DeviceName);
if (DevicePath == NULL) {
StatusBarSetStatusString (L"Cannot Find Device");
return EFI_INVALID_PARAMETER;
}
- DupDevicePath = DuplicateDevicePath(DevicePath);
+
+ DupDevicePath = DuplicateDevicePath (DevicePath);
DupDevicePathForFree = DupDevicePath;
//
// get blkio interface
//
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
- FreePool(DupDevicePathForFree);
+ Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DupDevicePath, &Handle);
+ FreePool (DupDevicePathForFree);
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
- Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+
+ Status = gBS->OpenProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
+
//
// if Offset exceeds LastBlock,
// return error
//
- if (Offset > BlkIo->Media->LastBlock || Offset + Size > BlkIo->Media->LastBlock) {
+ if ((Offset > BlkIo->Media->LastBlock) || (Offset + Size > BlkIo->Media->LastBlock)) {
StatusBarSetStatusString (L"Invalid Offset + Size");
return EFI_LOAD_ERROR;
}
- Bytes = BlkIo->Media->BlockSize * Size;
- Buffer = AllocateZeroPool (Bytes);
+ Bytes = BlkIo->Media->BlockSize * Size;
+ Buffer = AllocateZeroPool (Bytes);
if (Buffer == NULL) {
StatusBarSetStatusString (L"Read Disk Failed");
@@ -246,25 +249,26 @@ HDiskImageRead (
StatusBarSetStatusString (L"Read Disk Failed");
return EFI_OUT_OF_RESOURCES;
}
+
//
// initialize some variables
//
- HDiskImage.BlockSize = BlkIo->Media->BlockSize;
+ HDiskImage.BlockSize = BlkIo->Media->BlockSize;
HBufferImage.DisplayPosition.Row = 2;
HBufferImage.DisplayPosition.Column = 10;
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
+ HBufferImage.MousePosition.Row = 2;
+ HBufferImage.MousePosition.Column = 10;
- HBufferImage.LowVisibleRow = 1;
- HBufferImage.HighBits = TRUE;
+ HBufferImage.LowVisibleRow = 1;
+ HBufferImage.HighBits = TRUE;
- HBufferImage.BufferPosition.Row = 1;
- HBufferImage.BufferPosition.Column = 1;
+ HBufferImage.BufferPosition.Row = 1;
+ HBufferImage.BufferPosition.Column = 1;
if (!Recover) {
- Str = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
+ Str = CatSPrint (NULL, L"%d Lines Read", HBufferImage.NumLines);
if (Str == NULL) {
StatusBarSetStatusString (L"Read Disk Failed");
return EFI_OUT_OF_RESOURCES;
@@ -275,7 +279,6 @@ HDiskImageRead (
HMainEditor.SelectStart = 0;
HMainEditor.SelectEnd = 0;
-
}
//
@@ -283,11 +286,11 @@ HDiskImageRead (
//
if (HBufferImage.Lines != NULL) {
HBufferImage.CurrentLine = CR (
- HBufferImage.ListHead->ForwardLink,
- HEFI_EDITOR_LINE,
- Link,
- EFI_EDITOR_LINE_LIST
- );
+ HBufferImage.ListHead->ForwardLink,
+ HEFI_EDITOR_LINE,
+ Link,
+ EFI_EDITOR_LINE_LIST
+ );
} else {
//
// create a dummy line
@@ -324,12 +327,11 @@ HDiskImageRead (
**/
EFI_STATUS
HDiskImageSave (
- IN CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size
+ IN CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size
)
{
-
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_DEVICE_PATH_PROTOCOL *DupDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DupDevicePathForFree;
@@ -348,35 +350,38 @@ HDiskImageSave (
HBufferImage.BufferType = FileTypeDiskBuffer;
- DevicePath = gEfiShellProtocol->GetDevicePathFromMap(DeviceName);
+ DevicePath = gEfiShellProtocol->GetDevicePathFromMap (DeviceName);
if (DevicePath == NULL) {
-// StatusBarSetStatusString (L"Cannot Find Device");
+ // StatusBarSetStatusString (L"Cannot Find Device");
return EFI_INVALID_PARAMETER;
}
- DupDevicePath = DuplicateDevicePath(DevicePath);
+
+ DupDevicePath = DuplicateDevicePath (DevicePath);
DupDevicePathForFree = DupDevicePath;
//
// get blkio interface
//
- Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid,&DupDevicePath,&Handle);
- FreePool(DupDevicePathForFree);
+ Status = gBS->LocateDevicePath (&gEfiBlockIoProtocolGuid, &DupDevicePath, &Handle);
+ FreePool (DupDevicePathForFree);
if (EFI_ERROR (Status)) {
-// StatusBarSetStatusString (L"Read Disk Failed");
+ // StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
- Status = gBS->OpenProtocol(Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+
+ Status = gBS->OpenProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID **)&BlkIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR (Status)) {
-// StatusBarSetStatusString (L"Read Disk Failed");
+ // StatusBarSetStatusString (L"Read Disk Failed");
return Status;
}
- Bytes = BlkIo->Media->BlockSize * Size;
- Buffer = AllocateZeroPool (Bytes);
+ Bytes = BlkIo->Media->BlockSize * Size;
+ Buffer = AllocateZeroPool (Bytes);
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// concatenate the line list to a buffer
//
@@ -402,6 +407,7 @@ HDiskImageSave (
if (EFI_ERROR (Status)) {
return EFI_LOAD_ERROR;
}
+
//
// now not modified
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
index d0a78e0a12..69d822e7e4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
@@ -60,10 +60,10 @@ HDiskImageBackup (
**/
EFI_STATUS
HDiskImageRead (
- IN CONST CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
+ IN CONST CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
);
/**
@@ -81,9 +81,9 @@ HDiskImageRead (
**/
EFI_STATUS
HDiskImageSave (
- IN CHAR16 *DeviceName,
- IN UINTN Offset,
- IN UINTN Size
+ IN CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
index 4f96cb6cb5..d8818dd958 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
@@ -8,22 +8,22 @@
#include "HexEditor.h"
-extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
+extern EFI_HANDLE HImageHandleBackup;
+extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
+extern BOOLEAN HBufferImageNeedRefresh;
+extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
+extern BOOLEAN HBufferImageMouseNeedRefresh;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-HEFI_EDITOR_FILE_IMAGE HFileImage;
-HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
+HEFI_EDITOR_FILE_IMAGE HFileImage;
+HEFI_EDITOR_FILE_IMAGE HFileImageBackupVar;
//
// for basic initialization of HFileImage
//
-HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = {
+HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = {
NULL,
0,
FALSE
@@ -66,7 +66,7 @@ HFileImageBackup (
)
{
SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
- HFileImageBackupVar.FileName = CatSPrint(NULL, L"%s", HFileImage.FileName);
+ HFileImageBackupVar.FileName = CatSPrint (NULL, L"%s", HFileImage.FileName);
if (HFileImageBackupVar.FileName == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -84,7 +84,6 @@ HFileImageCleanup (
VOID
)
{
-
SHELL_FREE_NON_NULL (HFileImage.FileName);
SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
@@ -101,7 +100,7 @@ HFileImageCleanup (
**/
EFI_STATUS
HFileImageSetFileName (
- IN CONST CHAR16 *Str
+ IN CONST CHAR16 *Str
)
{
if (Str == HFileImage.FileName) {
@@ -111,6 +110,7 @@ HFileImageSetFileName (
//
return EFI_SUCCESS;
}
+
//
// free the old file name
//
@@ -136,18 +136,18 @@ HFileImageSetFileName (
EFI_STATUS
HFileImageRead (
IN CONST CHAR16 *FileName,
- IN BOOLEAN Recover
+ IN BOOLEAN Recover
)
{
- HEFI_EDITOR_LINE *Line;
- UINT8 *Buffer;
- CHAR16 *UnicodeBuffer;
- EFI_STATUS Status;
+ HEFI_EDITOR_LINE *Line;
+ UINT8 *Buffer;
+ CHAR16 *UnicodeBuffer;
+ EFI_STATUS Status;
//
// variable initialization
//
- Line = NULL;
+ Line = NULL;
//
// in this function, when you return error ( except EFI_OUT_OF_RESOURCES )
@@ -157,14 +157,14 @@ HFileImageRead (
// so if you want to print the error status
// you should set the status string
//
- Status = ReadFileIntoBuffer (FileName, (VOID**)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);
+ Status = ReadFileIntoBuffer (FileName, (VOID **)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);
//
// NULL pointer is only also a failure for a non-zero file size.
//
- if ((EFI_ERROR(Status)) || (Buffer == NULL && HFileImage.Size != 0)) {
- UnicodeBuffer = CatSPrint(NULL, L"Read error on file %s: %r", FileName, Status);
+ if ((EFI_ERROR (Status)) || ((Buffer == NULL) && (HFileImage.Size != 0))) {
+ UnicodeBuffer = CatSPrint (NULL, L"Read error on file %s: %r", FileName, Status);
if (UnicodeBuffer == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
+ SHELL_FREE_NON_NULL (Buffer);
return EFI_OUT_OF_RESOURCES;
}
@@ -195,12 +195,12 @@ HFileImageRead (
HBufferImage.HighBits = TRUE;
HBufferImage.BufferPosition.Row = 1;
HBufferImage.BufferPosition.Column = 1;
- HBufferImage.BufferType = FileTypeFileBuffer;
+ HBufferImage.BufferType = FileTypeFileBuffer;
if (!Recover) {
- UnicodeBuffer = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
+ UnicodeBuffer = CatSPrint (NULL, L"%d Lines Read", HBufferImage.NumLines);
if (UnicodeBuffer == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
+ SHELL_FREE_NON_NULL (Buffer);
return EFI_OUT_OF_RESOURCES;
}
@@ -222,7 +222,7 @@ HFileImageRead (
//
Line = HBufferImageCreateLine ();
if (Line == NULL) {
- SHELL_FREE_NON_NULL(Buffer);
+ SHELL_FREE_NON_NULL (Buffer);
return EFI_OUT_OF_RESOURCES;
}
@@ -248,20 +248,19 @@ HFileImageRead (
**/
EFI_STATUS
HFileImageSave (
- IN CHAR16 *FileName
+ IN CHAR16 *FileName
)
{
-
- LIST_ENTRY *Link;
- HEFI_EDITOR_LINE *Line;
- CHAR16 *Str;
- EFI_STATUS Status;
- UINTN NumLines;
- SHELL_FILE_HANDLE FileHandle;
- UINTN TotalSize;
- UINT8 *Buffer;
- UINT8 *Ptr;
- EDIT_FILE_TYPE BufferTypeBackup;
+ LIST_ENTRY *Link;
+ HEFI_EDITOR_LINE *Line;
+ CHAR16 *Str;
+ EFI_STATUS Status;
+ UINTN NumLines;
+ SHELL_FILE_HANDLE FileHandle;
+ UINTN TotalSize;
+ UINT8 *Buffer;
+ UINT8 *Ptr;
+ EDIT_FILE_TYPE BufferTypeBackup;
BufferTypeBackup = HBufferImage.BufferType;
HBufferImage.BufferType = FileTypeFileBuffer;
@@ -269,11 +268,11 @@ HFileImageSave (
//
// if is the old file
//
- if (HFileImage.FileName != NULL && FileName != NULL && StrCmp (FileName, HFileImage.FileName) == 0) {
+ if ((HFileImage.FileName != NULL) && (FileName != NULL) && (StrCmp (FileName, HFileImage.FileName) == 0)) {
//
// check whether file exists on disk
//
- if (ShellIsFile(FileName) == EFI_SUCCESS) {
+ if (ShellIsFile (FileName) == EFI_SUCCESS) {
//
// current file exists on disk
// so if not modified, then not save
@@ -281,6 +280,7 @@ HFileImageSave (
if (HBufferImage.Modified == FALSE) {
return EFI_SUCCESS;
}
+
//
// if file is read-only, set error
//
@@ -291,7 +291,7 @@ HFileImageSave (
}
}
- if (ShellIsDirectory(FileName) == EFI_SUCCESS) {
+ if (ShellIsDirectory (FileName) == EFI_SUCCESS) {
StatusBarSetStatusString (L"Directory Can Not Be Saved");
return EFI_LOAD_ERROR;
}
@@ -303,11 +303,11 @@ HFileImageSave (
// the file exits, delete it
//
Status = ShellDeleteFile (&FileHandle);
- if (EFI_ERROR (Status) || Status == EFI_WARN_DELETE_FAILURE) {
+ if (EFI_ERROR (Status) || (Status == EFI_WARN_DELETE_FAILURE)) {
StatusBarSetStatusString (L"Write File Failed");
return EFI_LOAD_ERROR;
}
- }
+ }
//
// write all the lines back to disk
@@ -320,11 +320,13 @@ HFileImageSave (
if (Line->Size != 0) {
TotalSize += Line->Size;
}
+
//
// end of if Line -> Size != 0
//
NumLines++;
}
+
//
// end of for Link
//
@@ -341,12 +343,12 @@ HFileImageSave (
CopyMem (Ptr, Line->Buffer, Line->Size);
Ptr += Line->Size;
}
+
//
// end of if Line -> Size != 0
//
}
-
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
if (EFI_ERROR (Status)) {
@@ -361,22 +363,23 @@ HFileImageSave (
return EFI_LOAD_ERROR;
}
- ShellCloseFile(&FileHandle);
+ ShellCloseFile (&FileHandle);
HBufferImage.Modified = FALSE;
//
// set status string
//
- Str = CatSPrint(NULL, L"%d Lines Written", NumLines);
+ Str = CatSPrint (NULL, L"%d Lines Written", NumLines);
StatusBarSetStatusString (Str);
FreePool (Str);
//
// now everything is ready , you can set the new file name to filebuffer
//
- if ((BufferTypeBackup != FileTypeFileBuffer && FileName != NULL) ||
- (FileName != NULL && HFileImage.FileName != NULL && StringNoCaseCompare (&FileName, &HFileImage.FileName) != 0)){
+ if (((BufferTypeBackup != FileTypeFileBuffer) && (FileName != NULL)) ||
+ ((FileName != NULL) && (HFileImage.FileName != NULL) && (StringNoCaseCompare (&FileName, &HFileImage.FileName) != 0)))
+ {
//
// not the same
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
index 9fb25ac5e9..36ee989b2e 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
@@ -57,7 +57,7 @@ HFileImageBackup (
EFI_STATUS
HFileImageRead (
IN CONST CHAR16 *FileName,
- IN BOOLEAN Recover
+ IN BOOLEAN Recover
);
/**
@@ -71,7 +71,7 @@ HFileImageRead (
**/
EFI_STATUS
HFileImageSave (
- IN CHAR16 *FileName
+ IN CHAR16 *FileName
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c
index 5e5d6fc290..9ca675648d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEdit.c
@@ -13,12 +13,12 @@
//
// Global Variables
//
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-f", TypeFlag},
- {L"-d", TypeFlag},
- {L"-m", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-f", TypeFlag },
+ { L"-d", TypeFlag },
+ { L"-m", TypeFlag },
+ { NULL, TypeMax }
+};
/**
Function for 'hexedit' command.
@@ -33,20 +33,20 @@ ShellCommandRunHexEdit (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- CHAR16 *Buffer;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- LIST_ENTRY *Package;
- CHAR16 *NewName;
- CONST CHAR16 *Name;
- UINTN Offset;
- UINTN Size;
- EDIT_FILE_TYPE WhatToDo;
+ EFI_STATUS Status;
+ CHAR16 *Buffer;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ LIST_ENTRY *Package;
+ CHAR16 *NewName;
+ CONST CHAR16 *Name;
+ UINTN Offset;
+ UINTN Size;
+ EDIT_FILE_TYPE WhatToDo;
Buffer = NULL;
ShellStatus = SHELL_SUCCESS;
- NewName = NULL;
+ NewName = NULL;
Buffer = NULL;
Name = NULL;
Offset = 0;
@@ -56,43 +56,44 @@ ShellCommandRunHexEdit (
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
//
// Check for -d
//
- if (ShellCommandLineGetFlag(Package, L"-d")){
- if (ShellCommandLineGetCount(Package) < 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
+ if (ShellCommandLineGetFlag (Package, L"-d")) {
+ if (ShellCommandLineGetCount (Package) < 4) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
+ } else if (ShellCommandLineGetCount (Package) > 4) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
WhatToDo = FileTypeDiskBuffer;
- Name = ShellCommandLineGetRawValue(Package, 1);
- Offset = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 2));
- Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 3));
+ Name = ShellCommandLineGetRawValue (Package, 1);
+ Offset = ShellStrToUintn (ShellCommandLineGetRawValue (Package, 2));
+ Size = ShellStrToUintn (ShellCommandLineGetRawValue (Package, 3));
}
- if (Offset == (UINTN)-1 || Size == (UINTN)-1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d");
+
+ if ((Offset == (UINTN)-1) || (Size == (UINTN)-1)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d");
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
@@ -100,20 +101,20 @@ ShellCommandRunHexEdit (
//
// check for -f
//
- if (ShellCommandLineGetFlag(Package, L"-f") && (WhatToDo == FileTypeNone)){
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
+ if (ShellCommandLineGetFlag (Package, L"-f") && (WhatToDo == FileTypeNone)) {
+ if (ShellCommandLineGetCount (Package) < 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
+ } else if (ShellCommandLineGetCount (Package) > 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Name = ShellCommandLineGetRawValue(Package, 1);
- if (Name == NULL || !IsValidFileName(Name)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
+ Name = ShellCommandLineGetRawValue (Package, 1);
+ if ((Name == NULL) || !IsValidFileName (Name)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- WhatToDo = FileTypeFileBuffer;
+ WhatToDo = FileTypeFileBuffer;
}
}
}
@@ -121,46 +122,47 @@ ShellCommandRunHexEdit (
//
// check for -m
//
- if (ShellCommandLineGetFlag(Package, L"-m") && (WhatToDo == FileTypeNone)){
- if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
+ if (ShellCommandLineGetFlag (Package, L"-m") && (WhatToDo == FileTypeNone)) {
+ if (ShellCommandLineGetCount (Package) < 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
+ } else if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
WhatToDo = FileTypeMemBuffer;
- Offset = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 1));
- Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 2));
+ Offset = ShellStrToUintn (ShellCommandLineGetRawValue (Package, 1));
+ Size = ShellStrToUintn (ShellCommandLineGetRawValue (Package, 2));
}
}
- Name = ShellCommandLineGetRawValue(Package, 1);
- if (WhatToDo == FileTypeNone && Name != NULL) {
- if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
+
+ Name = ShellCommandLineGetRawValue (Package, 1);
+ if ((WhatToDo == FileTypeNone) && (Name != NULL)) {
+ if (ShellCommandLineGetCount (Package) > 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (!IsValidFileName(Name)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
+ } else if (!IsValidFileName (Name)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- WhatToDo = FileTypeFileBuffer;
+ WhatToDo = FileTypeFileBuffer;
}
} else if (WhatToDo == FileTypeNone) {
- if (gEfiShellProtocol->GetCurDir(NULL) == NULL) {
+ if (gEfiShellProtocol->GetCurDir (NULL) == NULL) {
ShellStatus = SHELL_NOT_FOUND;
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
} else {
- NewName = EditGetDefaultFileName(L"bin");
- Name = NewName;
- WhatToDo = FileTypeFileBuffer;
+ NewName = EditGetDefaultFileName (L"bin");
+ Name = NewName;
+ WhatToDo = FileTypeFileBuffer;
}
}
- if (ShellStatus == SHELL_SUCCESS && WhatToDo == FileTypeNone) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
+ if ((ShellStatus == SHELL_SUCCESS) && (WhatToDo == FileTypeNone)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (WhatToDo == FileTypeFileBuffer && ShellGetCurrentDir(NULL) == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
+ } else if ((WhatToDo == FileTypeFileBuffer) && (ShellGetCurrentDir (NULL) == NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER;
}
@@ -172,62 +174,64 @@ ShellCommandRunHexEdit (
if (EFI_ERROR (Status)) {
gST->ConOut->ClearScreen (gST->ConOut);
gST->ConOut->EnableCursor (gST->ConOut, TRUE);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_INIT_FAILED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_INIT_FAILED), gShellDebug1HiiHandle);
} else {
HMainEditorBackup ();
switch (WhatToDo) {
- case FileTypeFileBuffer:
- Status = HBufferImageRead (
- Name==NULL?L"":Name,
- NULL,
- 0,
- 0,
- 0,
- 0,
- FileTypeFileBuffer,
- FALSE
- );
- break;
+ case FileTypeFileBuffer:
+ Status = HBufferImageRead (
+ Name == NULL ? L"" : Name,
+ NULL,
+ 0,
+ 0,
+ 0,
+ 0,
+ FileTypeFileBuffer,
+ FALSE
+ );
+ break;
- case FileTypeDiskBuffer:
- Status = HBufferImageRead (
- NULL,
- Name==NULL?L"":Name,
- Offset,
- Size,
- 0,
- 0,
- FileTypeDiskBuffer,
- FALSE
- );
- break;
+ case FileTypeDiskBuffer:
+ Status = HBufferImageRead (
+ NULL,
+ Name == NULL ? L"" : Name,
+ Offset,
+ Size,
+ 0,
+ 0,
+ FileTypeDiskBuffer,
+ FALSE
+ );
+ break;
- case FileTypeMemBuffer:
- Status = HBufferImageRead (
- NULL,
- NULL,
- 0,
- 0,
- (UINT32) Offset,
- Size,
- FileTypeMemBuffer,
- FALSE
- );
- break;
+ case FileTypeMemBuffer:
+ Status = HBufferImageRead (
+ NULL,
+ NULL,
+ 0,
+ 0,
+ (UINT32)Offset,
+ Size,
+ FileTypeMemBuffer,
+ FALSE
+ );
+ break;
- default:
- Status = EFI_NOT_FOUND;
- break;
+ default:
+ Status = EFI_NOT_FOUND;
+ break;
}
+
if (!EFI_ERROR (Status)) {
HMainEditorRefresh ();
Status = HMainEditorKeyInput ();
}
+
if (Status != EFI_OUT_OF_RESOURCES) {
//
// back up the status string
//
- Buffer = CatSPrint (NULL, L"%s\r\n", StatusBarGetString());
+ Buffer = CatSPrint (NULL, L"%s\r\n", StatusBarGetString ());
}
}
@@ -246,22 +250,23 @@ ShellCommandRunHexEdit (
// print editor exit code on screen
//
if (Status == EFI_OUT_OF_RESOURCES) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit");
- } else if (EFI_ERROR(Status)){
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit");
+ } else if (EFI_ERROR (Status)) {
if (Buffer != NULL) {
if (StrCmp (Buffer, L"") != 0) {
//
// print out the status string
//
- ShellPrintEx(-1, -1, L"%s", Buffer);
+ ShellPrintEx (-1, -1, L"%s", Buffer);
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
}
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_UNKNOWN_EDITOR), gShellDebug1HiiHandle);
}
}
}
+
ShellCommandLineFreeVarList (Package);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
index 404914eb4b..63a1d54965 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
@@ -14,12 +14,11 @@
#define EFI_EDITOR_LINE_LIST SIGNATURE_32 ('e', 'e', 'l', 'l')
-#define ASCII_POSITION ((0x10 * 3) + 12)
-
+#define ASCII_POSITION ((0x10 * 3) + 12)
typedef struct {
- UINTN Row;
- UINTN Column;
+ UINTN Row;
+ UINTN Column;
} HEFI_EDITOR_POSITION;
typedef
@@ -29,92 +28,90 @@ EFI_STATUS
);
typedef struct {
- CHAR16 Name[50];
- CHAR16 Key[3];
- HEFI_MENU_ITEM_FUNCTION Function;
+ CHAR16 Name[50];
+ CHAR16 Key[3];
+ HEFI_MENU_ITEM_FUNCTION Function;
} HMENU_ITEMS;
typedef struct _HEFI_EDITOR_LINE {
- UINTN Signature;
- UINT8 Buffer[0x10];
- UINTN Size; // unit is Unicode
- LIST_ENTRY Link;
+ UINTN Signature;
+ UINT8 Buffer[0x10];
+ UINTN Size; // unit is Unicode
+ LIST_ENTRY Link;
} HEFI_EDITOR_LINE;
typedef struct _HEFI_EDITOR_MENU_ITEM {
- CHAR16 NameToken;
- CHAR16 FunctionKeyToken;
- HEFI_MENU_ITEM_FUNCTION Function;
+ CHAR16 NameToken;
+ CHAR16 FunctionKeyToken;
+ HEFI_MENU_ITEM_FUNCTION Function;
} HEFI_EDITOR_MENU_ITEM;
typedef struct {
- UINT32 Foreground : 4;
- UINT32 Background : 4;
+ UINT32 Foreground : 4;
+ UINT32 Background : 4;
} HEFI_EDITOR_COLOR_ATTRIBUTES;
typedef union {
- HEFI_EDITOR_COLOR_ATTRIBUTES Colors;
- UINTN Data;
+ HEFI_EDITOR_COLOR_ATTRIBUTES Colors;
+ UINTN Data;
} HEFI_EDITOR_COLOR_UNION;
typedef struct {
- UINTN Columns;
- UINTN Rows;
+ UINTN Columns;
+ UINTN Rows;
} HEFI_EDITOR_TEXT_MODE;
-
typedef struct {
- CHAR16 *Name;
+ CHAR16 *Name;
- UINTN BlockSize;
- UINTN Size;
- UINTN Offset;
+ UINTN BlockSize;
+ UINTN Size;
+ UINTN Offset;
} HEFI_EDITOR_DISK_IMAGE;
typedef struct {
- EFI_CPU_IO2_PROTOCOL *IoFncs;
- UINTN Offset;
- UINTN Size;
+ EFI_CPU_IO2_PROTOCOL *IoFncs;
+ UINTN Offset;
+ UINTN Size;
} HEFI_EDITOR_MEM_IMAGE;
typedef struct {
- CHAR16 *FileName;
- UINTN Size; // file size
- BOOLEAN ReadOnly; // file is read-only or not
+ CHAR16 *FileName;
+ UINTN Size; // file size
+ BOOLEAN ReadOnly; // file is read-only or not
} HEFI_EDITOR_FILE_IMAGE;
typedef struct {
- LIST_ENTRY *ListHead; // list head of lines
- HEFI_EDITOR_LINE *Lines; // lines of current file
- UINTN NumLines; // number of lines
- HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at
- HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
- HEFI_EDITOR_POSITION MousePosition; // mouse position in screen
- HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer
- UINTN LowVisibleRow; // the lowest visible row of file position
- BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits
- BOOLEAN Modified; // BUFFER is modified or not
- EDIT_FILE_TYPE BufferType;
-
- HEFI_EDITOR_FILE_IMAGE *FileImage;
- HEFI_EDITOR_DISK_IMAGE *DiskImage;
- HEFI_EDITOR_MEM_IMAGE *MemImage;
-
+ LIST_ENTRY *ListHead; // list head of lines
+ HEFI_EDITOR_LINE *Lines; // lines of current file
+ UINTN NumLines; // number of lines
+ HEFI_EDITOR_LINE *CurrentLine; // current line cursor is at
+ HEFI_EDITOR_POSITION DisplayPosition; // cursor position in screen
+ HEFI_EDITOR_POSITION MousePosition; // mouse position in screen
+ HEFI_EDITOR_POSITION BufferPosition; // cursor position in buffer
+ UINTN LowVisibleRow; // the lowest visible row of file position
+ BOOLEAN HighBits; // cursor is at the high4 bits or low4 bits
+ BOOLEAN Modified; // BUFFER is modified or not
+ EDIT_FILE_TYPE BufferType;
+
+ HEFI_EDITOR_FILE_IMAGE *FileImage;
+ HEFI_EDITOR_DISK_IMAGE *DiskImage;
+ HEFI_EDITOR_MEM_IMAGE *MemImage;
} HEFI_EDITOR_BUFFER_IMAGE;
typedef struct {
- HEFI_EDITOR_BUFFER_IMAGE *BufferImage;
-
- HEFI_EDITOR_COLOR_UNION ColorAttributes;
- HEFI_EDITOR_POSITION ScreenSize; // row number and column number
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;
- BOOLEAN MouseSupported;
- EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
- INT32 MouseAccumulatorX;
- INT32 MouseAccumulatorY;
-
- UINTN SelectStart; // starting from 1
- UINTN SelectEnd; // starting from 1
+ HEFI_EDITOR_BUFFER_IMAGE *BufferImage;
+
+ HEFI_EDITOR_COLOR_UNION ColorAttributes;
+ HEFI_EDITOR_POSITION ScreenSize; // row number and column number
+ EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TextInputEx;
+ BOOLEAN MouseSupported;
+ EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
+ INT32 MouseAccumulatorX;
+ INT32 MouseAccumulatorY;
+
+ UINTN SelectStart; // starting from 1
+ UINTN SelectEnd; // starting from 1
} HEFI_EDITOR_GLOBAL_EDITOR;
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
index 9f72da1193..0eb917acf7 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
@@ -13,38 +13,38 @@
#include "EditStatusBar.h"
#include "EditInputBar.h"
-HEFI_EDITOR_COLOR_ATTRIBUTES HOriginalColors;
-INTN HOriginalMode;
+HEFI_EDITOR_COLOR_ATTRIBUTES HOriginalColors;
+INTN HOriginalMode;
//
// the first time editor launch
//
-BOOLEAN HEditorFirst;
+BOOLEAN HEditorFirst;
//
// it's time editor should exit
//
-BOOLEAN HEditorExit;
+BOOLEAN HEditorExit;
-BOOLEAN HEditorMouseAction;
+BOOLEAN HEditorMouseAction;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
+extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
+extern HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
+extern BOOLEAN HBufferImageMouseNeedRefresh;
+extern BOOLEAN HBufferImageNeedRefresh;
+extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
+HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
+HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
//
// basic initialization for MainEditor
//
-HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
+HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
&HBufferImage,
{
- {0, 0}
+ { 0, 0}
},
{
0,
@@ -63,33 +63,32 @@ HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
Help info that will be displayed.
**/
EFI_STRING_ID HexMainMenuHelpInfo[] = {
- STRING_TOKEN(STR_HEXEDIT_HELP_TITLE),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_LIST_TITLE),
- STRING_TOKEN(STR_HEXEDIT_HELP_DIV),
- STRING_TOKEN(STR_HEXEDIT_HELP_GO_TO_OFFSET),
- STRING_TOKEN(STR_HEXEDIT_HELP_SAVE_BUFFER),
- STRING_TOKEN(STR_HEXEDIT_HELP_EXIT),
- STRING_TOKEN(STR_HEXEDIT_HELP_SELECT_START),
- STRING_TOKEN(STR_HEXEDIT_HELP_SELECT_END),
- STRING_TOKEN(STR_HEXEDIT_HELP_CUT),
- STRING_TOKEN(STR_HEXEDIT_HELP_PASTE),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_FILE),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_DISK),
- STRING_TOKEN(STR_HEXEDIT_HELP_OPEN_MEMORY),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_EXIT_HELP),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_BLANK),
- STRING_TOKEN(STR_HEXEDIT_HELP_DIV),
+ STRING_TOKEN (STR_HEXEDIT_HELP_TITLE),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_LIST_TITLE),
+ STRING_TOKEN (STR_HEXEDIT_HELP_DIV),
+ STRING_TOKEN (STR_HEXEDIT_HELP_GO_TO_OFFSET),
+ STRING_TOKEN (STR_HEXEDIT_HELP_SAVE_BUFFER),
+ STRING_TOKEN (STR_HEXEDIT_HELP_EXIT),
+ STRING_TOKEN (STR_HEXEDIT_HELP_SELECT_START),
+ STRING_TOKEN (STR_HEXEDIT_HELP_SELECT_END),
+ STRING_TOKEN (STR_HEXEDIT_HELP_CUT),
+ STRING_TOKEN (STR_HEXEDIT_HELP_PASTE),
+ STRING_TOKEN (STR_HEXEDIT_HELP_OPEN_FILE),
+ STRING_TOKEN (STR_HEXEDIT_HELP_OPEN_DISK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_OPEN_MEMORY),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_EXIT_HELP),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_BLANK),
+ STRING_TOKEN (STR_HEXEDIT_HELP_DIV),
0
};
-
/**
show help menu.
@@ -100,19 +99,23 @@ HMainCommandDisplayHelp (
VOID
)
{
- INT32 CurrentLine;
- CHAR16 *InfoString;
- EFI_KEY_DATA KeyData;
- EFI_STATUS Status;
- UINTN EventIndex;
+ INT32 CurrentLine;
+ CHAR16 *InfoString;
+ EFI_KEY_DATA KeyData;
+ EFI_STATUS Status;
+ UINTN EventIndex;
//
// print helpInfo
//
for (CurrentLine = 0; 0 != HexMainMenuHelpInfo[CurrentLine]; CurrentLine++) {
- InfoString = HiiGetString(gShellDebug1HiiHandle, HexMainMenuHelpInfo[CurrentLine]
-, NULL);
- ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString);
+ InfoString = HiiGetString (
+ gShellDebug1HiiHandle,
+ HexMainMenuHelpInfo[CurrentLine]
+ ,
+ NULL
+ );
+ ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
}
//
@@ -123,13 +126,15 @@ HMainCommandDisplayHelp (
if (EFI_ERROR (Status) || (EventIndex != 0)) {
continue;
}
+
Status = HMainEditor.TextInputEx->ReadKeyStrokeEx (HMainEditor.TextInputEx, &KeyData);
if (EFI_ERROR (Status)) {
continue;
}
if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) == 0) ||
- (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID)) {
+ (KeyData.KeyState.KeyShiftState == EFI_SHIFT_STATE_VALID))
+ {
//
// For consoles that don't support/report shift state,
// CTRL+W is translated to L'W' - L'A' + 1.
@@ -139,7 +144,8 @@ HMainCommandDisplayHelp (
}
} else if (((KeyData.KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) &&
((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) &&
- ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0)) {
+ ((KeyData.KeyState.KeyShiftState & ~(EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) == 0))
+ {
//
// For consoles that supports/reports shift state,
// make sure that only CONTROL shift key is pressed.
@@ -151,7 +157,7 @@ HMainCommandDisplayHelp (
}
// update screen with buffer's info
- HBufferImageNeedRefresh = TRUE;
+ HBufferImageNeedRefresh = TRUE;
HBufferImageOnlyLineNeedRefresh = FALSE;
HBufferImageRefresh ();
@@ -177,10 +183,10 @@ HMainCommandGoToOffset (
//
// variable initialization
//
- Size = 0;
- Offset = 0;
- FRow = 0;
- FCol = 0;
+ Size = 0;
+ Offset = 0;
+ FRow = 0;
+ FCol = 0;
//
// get offset
@@ -202,14 +208,14 @@ HMainCommandGoToOffset (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
+ if (StrLen (InputBarGetString ()) > 0) {
+ Status = ShellConvertStringToUint64 (InputBarGetString (), &Offset, TRUE, FALSE);
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Invalid Offset");
return EFI_SUCCESS;
@@ -225,8 +231,8 @@ HMainCommandGoToOffset (
return EFI_SUCCESS;
}
- FRow = (UINTN)DivU64x32(Offset , 0x10) + 1;
- FCol = (UINTN)ModU64x32(Offset , 0x10) + 1;
+ FRow = (UINTN)DivU64x32 (Offset, 0x10) + 1;
+ FCol = (UINTN)ModU64x32 (Offset, 0x10) + 1;
HBufferImageMovePosition (FRow, FCol, TRUE);
@@ -251,13 +257,13 @@ HMainCommandSaveBuffer (
VOID
)
{
- EFI_STATUS Status;
- BOOLEAN Done;
- CHAR16 *FileName;
- BOOLEAN OldFile;
- CHAR16 *Str;
- EFI_FILE_INFO *Info;
- SHELL_FILE_HANDLE ShellFileHandle;
+ EFI_STATUS Status;
+ BOOLEAN Done;
+ CHAR16 *FileName;
+ BOOLEAN OldFile;
+ CHAR16 *Str;
+ EFI_FILE_INFO *Info;
+ SHELL_FILE_HANDLE ShellFileHandle;
if (HMainEditor.BufferImage->BufferType != FileTypeFileBuffer) {
if (!HMainEditor.BufferImage->Modified) {
@@ -268,6 +274,7 @@ HMainCommandSaveBuffer (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// the answer is just one character
//
@@ -275,6 +282,7 @@ HMainCommandSaveBuffer (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// loop for user's answer
// valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
@@ -289,48 +297,51 @@ HMainCommandSaveBuffer (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- NULL,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
-
- if (EFI_ERROR (Status)) {
- StatusBarSetStatusString (L"BufferSave: Problems Writing");
- return Status;
- }
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // want to save this buffer first
+ //
+ Status = HBufferImageSave (
+ NULL,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ HMainEditor.BufferImage->BufferType
+ );
+
+ if (EFI_ERROR (Status)) {
+ StatusBarSetStatusString (L"BufferSave: Problems Writing");
+ return Status;
+ }
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- return EFI_SUCCESS;
+ case L'n':
+ case L'N':
+ //
+ // the file won't be saved
+ //
+ return EFI_SUCCESS;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
+
//
// end of switch
//
}
+
//
// ENDOF WHILE
//
}
+
//
// ENDOF != FILEBUFFER
//
@@ -369,7 +380,8 @@ HMainCommandSaveBuffer (
// 7. Update File Name field in Title Bar to B
// and remove the Modified flag in Title Bar.
//
- Str = CatSPrint(NULL,
+ Str = CatSPrint (
+ NULL,
L"File to Save: [%s]",
HMainEditor.BufferImage->FileImage->FileName
);
@@ -397,6 +409,7 @@ HMainCommandSaveBuffer (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// get new file name
//
@@ -415,13 +428,14 @@ HMainCommandSaveBuffer (
//
// if just enter pressed, so think save to current file name
//
- if (StrLen (InputBarGetString()) == 0) {
- FileName = CatSPrint(NULL,
- L"%s",
- HMainEditor.BufferImage->FileImage->FileName
- );
+ if (StrLen (InputBarGetString ()) == 0) {
+ FileName = CatSPrint (
+ NULL,
+ L"%s",
+ HMainEditor.BufferImage->FileImage->FileName
+ );
} else {
- FileName = CatSPrint(NULL, L"%s", InputBarGetString());
+ FileName = CatSPrint (NULL, L"%s", InputBarGetString ());
}
if (FileName == NULL) {
@@ -442,7 +456,8 @@ HMainCommandSaveBuffer (
if (StringNoCaseCompare (
&FileName,
&HMainEditor.BufferImage->FileImage->FileName
- ) == 0) {
+ ) == 0)
+ {
OldFile = TRUE;
}
@@ -459,10 +474,9 @@ HMainCommandSaveBuffer (
Status = ShellOpenFileByName (FileName, &ShellFileHandle, EFI_FILE_MODE_READ, 0);
if (!EFI_ERROR (Status)) {
+ Info = ShellGetFileInfo (ShellFileHandle);
- Info = ShellGetFileInfo(ShellFileHandle);
-
- ShellCloseFile(&ShellFileHandle);
+ ShellCloseFile (&ShellFileHandle);
//
// check if read only
//
@@ -472,7 +486,7 @@ HMainCommandSaveBuffer (
return EFI_SUCCESS;
}
- SHELL_FREE_NON_NULL(Info);
+ SHELL_FREE_NON_NULL (Info);
//
// ask user whether to overwrite this file
//
@@ -497,19 +511,19 @@ HMainCommandSaveBuffer (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- Done = TRUE;
- break;
- case L'n':
- case L'N':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
- case L'c':
- case L'C':
- SHELL_FREE_NON_NULL (FileName);
- return EFI_SUCCESS;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ Done = TRUE;
+ break;
+ case L'n':
+ case L'N':
+ SHELL_FREE_NON_NULL (FileName);
+ return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ SHELL_FREE_NON_NULL (FileName);
+ return EFI_SUCCESS;
} // switch
} // while
} // if opened existing file
@@ -519,14 +533,14 @@ HMainCommandSaveBuffer (
// save file back to disk
//
Status = HBufferImageSave (
- FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- FileTypeFileBuffer
- );
+ FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ FileTypeFileBuffer
+ );
SHELL_FREE_NON_NULL (FileName);
if (EFI_ERROR (Status)) {
@@ -548,7 +562,7 @@ HMainCommandSelectStart (
VOID
)
{
- UINTN Start;
+ UINTN Start;
Start = (HMainEditor.BufferImage->BufferPosition.Row - 1) * 0x10 + HMainEditor.BufferImage->BufferPosition.Column;
@@ -562,7 +576,7 @@ HMainCommandSelectStart (
}
}
- if (HMainEditor.SelectEnd != 0 && Start > HMainEditor.SelectEnd) {
+ if ((HMainEditor.SelectEnd != 0) && (Start > HMainEditor.SelectEnd)) {
StatusBarSetStatusString (L"Invalid Block Start");
return EFI_LOAD_ERROR;
}
@@ -586,7 +600,7 @@ HMainCommandSelectEnd (
VOID
)
{
- UINTN End;
+ UINTN End;
End = (HMainEditor.BufferImage->BufferPosition.Row - 1) * 0x10 + HMainEditor.BufferImage->BufferPosition.Column;
@@ -600,12 +614,12 @@ HMainCommandSelectEnd (
}
}
- if (HMainEditor.SelectStart != 0 && End < HMainEditor.SelectStart) {
+ if ((HMainEditor.SelectStart != 0) && (End < HMainEditor.SelectStart)) {
StatusBarSetStatusString (L"Invalid Block End");
return EFI_SUCCESS;
}
- HMainEditor.SelectEnd = End;
+ HMainEditor.SelectEnd = End;
HBufferImageNeedRefresh = TRUE;
@@ -624,10 +638,10 @@ HMainCommandCut (
VOID
)
{
- UINTN Index;
- LIST_ENTRY *Link;
- UINT8 *Buffer;
- UINTN Count;
+ UINTN Index;
+ LIST_ENTRY *Link;
+ UINT8 *Buffer;
+ UINTN Count;
//
// not select, so not allowed to cut
@@ -636,6 +650,7 @@ HMainCommandCut (
StatusBarSetStatusString (L"No Block is Selected");
return EFI_SUCCESS;
}
+
//
// not select, so not allowed to cut
//
@@ -649,11 +664,12 @@ HMainCommandCut (
Link = Link->ForwardLink;
}
- Count = HMainEditor.SelectEnd - HMainEditor.SelectStart + 1;
- Buffer = AllocateZeroPool (Count);
+ Count = HMainEditor.SelectEnd - HMainEditor.SelectStart + 1;
+ Buffer = AllocateZeroPool (Count);
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// cut the selected area
//
@@ -696,7 +712,6 @@ HMainCommandPaste (
VOID
)
{
-
BOOLEAN OnlyLineRefresh;
HEFI_EDITOR_LINE *Line;
UINT8 *Buffer;
@@ -704,15 +719,15 @@ HMainCommandPaste (
UINTN FPos;
Count = HClipBoardGet (&Buffer);
- if (Count == 0 || Buffer == NULL) {
+ if ((Count == 0) || (Buffer == NULL)) {
StatusBarSetStatusString (L"Nothing to Paste");
return EFI_SUCCESS;
}
- Line = HMainEditor.BufferImage->CurrentLine;
+ Line = HMainEditor.BufferImage->CurrentLine;
OnlyLineRefresh = FALSE;
- if (Line->Link.ForwardLink == HMainEditor.BufferImage->ListHead && Line->Size + Count < 0x10) {
+ if ((Line->Link.ForwardLink == HMainEditor.BufferImage->ListHead) && (Line->Size + Count < 0x10)) {
//
// is at last line, and after paste will not exceed
// so only this line need to be refreshed
@@ -721,7 +736,6 @@ HMainCommandPaste (
// so the whole page will need be refreshed
//
OnlyLineRefresh = TRUE;
-
}
FPos = 0x10 * (HMainEditor.BufferImage->BufferPosition.Row - 1) + HMainEditor.BufferImage->BufferPosition.Column - 1;
@@ -741,7 +755,6 @@ HMainCommandPaste (
}
return EFI_SUCCESS;
-
}
/**
@@ -777,7 +790,6 @@ HMainCommandExit (
// whether to save the changes
//
if (HMainEditor.BufferImage->Modified) {
-
Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
@@ -798,43 +810,41 @@ HMainCommandExit (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // write file back to disk
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
- if (!EFI_ERROR (Status)) {
- HEditorExit = TRUE;
- }
-
- return Status;
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // write file back to disk
+ //
+ Status = HBufferImageSave (
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ HMainEditor.BufferImage->BufferType
+ );
+ if (!EFI_ERROR (Status)) {
+ HEditorExit = TRUE;
+ }
- case L'n':
- case L'N':
- HEditorExit = TRUE;
- return EFI_SUCCESS;
+ return Status;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'n':
+ case L'N':
+ HEditorExit = TRUE;
+ return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
HEditorExit = TRUE;
return EFI_SUCCESS;
-
}
/**
@@ -849,9 +859,9 @@ HMainCommandOpenFile (
VOID
)
{
- BOOLEAN Done;
- EFI_STATUS Status;
- EDIT_FILE_TYPE BufferType;
+ BOOLEAN Done;
+ EFI_STATUS Status;
+ EDIT_FILE_TYPE BufferType;
BufferType = HMainEditor.BufferImage->BufferType;
@@ -886,11 +896,11 @@ HMainCommandOpenFile (
// save it first.
//
if (HMainEditor.BufferImage->Modified) {
-
Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// the answer is just one character
//
@@ -898,6 +908,7 @@ HMainCommandOpenFile (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// loop for user's answer
// valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
@@ -913,52 +924,53 @@ HMainCommandOpenFile (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- HMainEditor.BufferImage->BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // want to save this buffer first
+ //
+ Status = HBufferImageSave (
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ HMainEditor.BufferImage->BufferType
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
+ MainTitleBarRefresh (
+ HMainEditor.BufferImage->BufferType == FileTypeFileBuffer ? HMainEditor.BufferImage->FileImage->FileName : HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Name : NULL,
+ HMainEditor.BufferImage->BufferType,
+ HMainEditor.BufferImage->FileImage->ReadOnly,
+ FALSE,
+ HMainEditor.ScreenSize.Column,
+ HMainEditor.ScreenSize.Row,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Offset : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Offset : 0,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Size : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Size : 0
+ );
+ Done = TRUE;
+ break;
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
+ case L'n':
+ case L'N':
+ //
+ // the file won't be saved
+ //
+ Done = TRUE;
+ break;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
+
//
// TO get the open file name
//
@@ -980,15 +992,15 @@ HMainCommandOpenFile (
Status = InputBarSetStringSize (100);
if (EFI_ERROR (Status)) {
Status = HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ BufferType,
+ TRUE
+ );
return Status;
}
@@ -1000,26 +1012,27 @@ HMainCommandOpenFile (
//
if (Status == EFI_NOT_READY) {
Status = HBufferImageRead (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType,
- TRUE
- );
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ BufferType,
+ TRUE
+ );
return Status;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
+ if (StrLen (InputBarGetString ()) > 0) {
//
// CHECK if filename's valid
//
- if (!IsValidFileName (InputBarGetString())) {
+ if (!IsValidFileName (InputBarGetString ())) {
HBufferImageRead (
HMainEditor.BufferImage->FileImage->FileName,
HMainEditor.BufferImage->DiskImage->Name,
@@ -1038,19 +1051,20 @@ HMainCommandOpenFile (
break;
}
}
+
//
// read from disk
//
Status = HBufferImageRead (
- InputBarGetString(),
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- FileTypeFileBuffer,
- FALSE
- );
+ InputBarGetString (),
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ FileTypeFileBuffer,
+ FALSE
+ );
if (EFI_ERROR (Status)) {
HBufferImageRead (
@@ -1083,31 +1097,31 @@ HMainCommandOpenDisk (
VOID
)
{
- UINT64 Size;
- UINT64 Offset;
- CHAR16 *DeviceName;
- EFI_STATUS Status;
- BOOLEAN Done;
+ UINT64 Size;
+ UINT64 Offset;
+ CHAR16 *DeviceName;
+ EFI_STATUS Status;
+ BOOLEAN Done;
- EDIT_FILE_TYPE BufferType;
+ EDIT_FILE_TYPE BufferType;
//
// variable initialization
//
- Size = 0;
- Offset = 0;
- BufferType = HMainEditor.BufferImage->BufferType;
+ Size = 0;
+ Offset = 0;
+ BufferType = HMainEditor.BufferImage->BufferType;
//
// if current file is modified, so you need to choose
// whether to save it first.
//
if (HMainEditor.BufferImage->Modified) {
-
Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// the answer is just one character
//
@@ -1115,6 +1129,7 @@ HMainCommandOpenDisk (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// loop for user's answer
// valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
@@ -1130,52 +1145,53 @@ HMainCommandOpenDisk (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // want to save this buffer first
+ //
+ Status = HBufferImageSave (
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ BufferType
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
+ MainTitleBarRefresh (
+ HMainEditor.BufferImage->BufferType == FileTypeFileBuffer ? HMainEditor.BufferImage->FileImage->FileName : HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Name : NULL,
+ HMainEditor.BufferImage->BufferType,
+ HMainEditor.BufferImage->FileImage->ReadOnly,
+ FALSE,
+ HMainEditor.ScreenSize.Column,
+ HMainEditor.ScreenSize.Row,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Offset : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Offset : 0,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Size : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Size : 0
+ );
+ Done = TRUE;
+ break;
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
+ case L'n':
+ case L'N':
+ //
+ // the file won't be saved
+ //
+ Done = TRUE;
+ break;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
+
//
// get disk block device name
//
@@ -1196,21 +1212,22 @@ HMainCommandOpenDisk (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
+ if (StrLen (InputBarGetString ()) > 0) {
break;
}
}
- DeviceName = CatSPrint(NULL, L"%s", InputBarGetString());
+ DeviceName = CatSPrint (NULL, L"%s", InputBarGetString ());
if (DeviceName == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// get starting offset
//
@@ -1231,14 +1248,14 @@ HMainCommandOpenDisk (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
+ if (StrLen (InputBarGetString ()) > 0) {
+ Status = ShellConvertStringToUint64 (InputBarGetString (), &Offset, TRUE, FALSE);
if (EFI_ERROR (Status)) {
continue;
}
@@ -1246,6 +1263,7 @@ HMainCommandOpenDisk (
break;
}
}
+
//
// get Number of Blocks:
//
@@ -1266,14 +1284,14 @@ HMainCommandOpenDisk (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Size, TRUE, FALSE);
+ if (StrLen (InputBarGetString ()) > 0) {
+ Status = ShellConvertStringToUint64 (InputBarGetString (), &Size, TRUE, FALSE);
if (EFI_ERROR (Status)) {
continue;
}
@@ -1287,18 +1305,17 @@ HMainCommandOpenDisk (
}
Status = HBufferImageRead (
- NULL,
- DeviceName,
- (UINTN)Offset,
- (UINTN)Size,
- 0,
- 0,
- FileTypeDiskBuffer,
- FALSE
- );
+ NULL,
+ DeviceName,
+ (UINTN)Offset,
+ (UINTN)Size,
+ 0,
+ 0,
+ FileTypeDiskBuffer,
+ FALSE
+ );
if (EFI_ERROR (Status)) {
-
HBufferImageRead (
HMainEditor.BufferImage->FileImage->FileName,
HMainEditor.BufferImage->DiskImage->Name,
@@ -1328,29 +1345,29 @@ HMainCommandOpenMemory (
VOID
)
{
- UINT64 Size;
- UINT64 Offset;
- EFI_STATUS Status;
- BOOLEAN Done;
- EDIT_FILE_TYPE BufferType;
+ UINT64 Size;
+ UINT64 Offset;
+ EFI_STATUS Status;
+ BOOLEAN Done;
+ EDIT_FILE_TYPE BufferType;
//
// variable initialization
//
- Size = 0;
- Offset = 0;
- BufferType = HMainEditor.BufferImage->BufferType;
+ Size = 0;
+ Offset = 0;
+ BufferType = HMainEditor.BufferImage->BufferType;
//
// if current buffer is modified, so you need to choose
// whether to save it first.
//
if (HMainEditor.BufferImage->Modified) {
-
Status = InputBarSetPrompt (L"Buffer modified. Save (Yes/No/Cancel) ? ");
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// the answer is just one character
//
@@ -1358,6 +1375,7 @@ HMainCommandOpenMemory (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// loop for user's answer
// valid answer is just 'y' 'Y', 'n' 'N', 'c' 'C'
@@ -1373,52 +1391,53 @@ HMainCommandOpenMemory (
return EFI_SUCCESS;
}
- switch (InputBarGetString()[0]) {
- case L'y':
- case L'Y':
- //
- // want to save this buffer first
- //
- Status = HBufferImageSave (
- HMainEditor.BufferImage->FileImage->FileName,
- HMainEditor.BufferImage->DiskImage->Name,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Size,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Size,
- BufferType
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
+ switch (InputBarGetString ()[0]) {
+ case L'y':
+ case L'Y':
+ //
+ // want to save this buffer first
+ //
+ Status = HBufferImageSave (
+ HMainEditor.BufferImage->FileImage->FileName,
+ HMainEditor.BufferImage->DiskImage->Name,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Size,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Size,
+ BufferType
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Name:NULL,
- HMainEditor.BufferImage->BufferType,
- HMainEditor.BufferImage->FileImage->ReadOnly,
- FALSE,
- HMainEditor.ScreenSize.Column,
- HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
- );
- Done = TRUE;
- break;
+ MainTitleBarRefresh (
+ HMainEditor.BufferImage->BufferType == FileTypeFileBuffer ? HMainEditor.BufferImage->FileImage->FileName : HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Name : NULL,
+ HMainEditor.BufferImage->BufferType,
+ HMainEditor.BufferImage->FileImage->ReadOnly,
+ FALSE,
+ HMainEditor.ScreenSize.Column,
+ HMainEditor.ScreenSize.Row,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Offset : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Offset : 0,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer ? HMainEditor.BufferImage->DiskImage->Size : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer ? HMainEditor.BufferImage->MemImage->Size : 0
+ );
+ Done = TRUE;
+ break;
- case L'n':
- case L'N':
- //
- // the file won't be saved
- //
- Done = TRUE;
- break;
+ case L'n':
+ case L'N':
+ //
+ // the file won't be saved
+ //
+ Done = TRUE;
+ break;
- case L'c':
- case L'C':
- return EFI_SUCCESS;
+ case L'c':
+ case L'C':
+ return EFI_SUCCESS;
}
}
}
+
//
// get starting offset
//
@@ -1439,14 +1458,14 @@ HMainCommandOpenMemory (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Offset, TRUE, FALSE);
+ if (StrLen (InputBarGetString ()) > 0) {
+ Status = ShellConvertStringToUint64 (InputBarGetString (), &Offset, TRUE, FALSE);
if (EFI_ERROR (Status)) {
continue;
}
@@ -1454,6 +1473,7 @@ HMainCommandOpenMemory (
break;
}
}
+
//
// get Number of Blocks:
//
@@ -1474,14 +1494,14 @@ HMainCommandOpenMemory (
// ESC pressed
//
if (Status == EFI_NOT_READY) {
-
return EFI_SUCCESS;
}
+
//
// THE input string length should > 0
//
- if (StrLen (InputBarGetString()) > 0) {
- Status = ShellConvertStringToUint64 (InputBarGetString(), &Size, TRUE, FALSE);
+ if (StrLen (InputBarGetString ()) > 0) {
+ Status = ShellConvertStringToUint64 (InputBarGetString (), &Size, TRUE, FALSE);
if (EFI_ERROR (Status)) {
continue;
}
@@ -1494,21 +1514,21 @@ HMainCommandOpenMemory (
}
}
- if ((Offset + Size - 1)> 0xffffffff) {
+ if ((Offset + Size - 1) > 0xffffffff) {
StatusBarSetStatusString (L"Invalid parameter");
return EFI_LOAD_ERROR;
}
Status = HBufferImageRead (
- NULL,
- NULL,
- 0,
- 0,
- (UINTN)Offset,
- (UINTN)Size,
- FileTypeMemBuffer,
- FALSE
- );
+ NULL,
+ NULL,
+ 0,
+ 0,
+ (UINTN)Offset,
+ (UINTN)Size,
+ FileTypeMemBuffer,
+ FALSE
+ );
if (EFI_ERROR (Status)) {
StatusBarSetStatusString (L"Read Device Error!");
@@ -1524,11 +1544,11 @@ HMainCommandOpenMemory (
);
return EFI_NOT_FOUND;
}
- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
-MENU_ITEM_FUNCTION HexMainControlBasedMenuFunctions[] = {
+MENU_ITEM_FUNCTION HexMainControlBasedMenuFunctions[] = {
NULL,
NULL, /* Ctrl - A */
NULL, /* Ctrl - B */
@@ -1558,57 +1578,57 @@ MENU_ITEM_FUNCTION HexMainControlBasedMenuFunctions[] = {
NULL, /* Ctrl - Z */
};
-CONST EDITOR_MENU_ITEM HexEditorMenuItems[] = {
+CONST EDITOR_MENU_ITEM HexEditorMenuItems[] = {
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_GO_TO_OFFSET),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F1),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_GO_TO_OFFSET),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F1),
HMainCommandGoToOffset
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SAVE_BUFFER),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F2),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_SAVE_BUFFER),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F2),
HMainCommandSaveBuffer
},
{
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_EXIT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F3),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_EXIT),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F3),
HMainCommandExit
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SELECT_START),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F4),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_SELECT_START),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F4),
HMainCommandSelectStart
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_SELECT_END),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F5),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_SELECT_END),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F5),
HMainCommandSelectEnd
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_CUT),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F6),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_CUT),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F6),
HMainCommandCut
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_PASTE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F7),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_PASTE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F7),
HMainCommandPaste
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_FILE),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F8),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_OPEN_FILE),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F8),
HMainCommandOpenFile
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_DISK),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F9),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_OPEN_DISK),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F9),
HMainCommandOpenDisk
},
{
- STRING_TOKEN(STR_HEXEDIT_LIBMENUBAR_OPEN_MEMORY),
- STRING_TOKEN(STR_EDIT_LIBMENUBAR_F10),
+ STRING_TOKEN (STR_HEXEDIT_LIBMENUBAR_OPEN_MEMORY),
+ STRING_TOKEN (STR_EDIT_LIBMENUBAR_F10),
HMainCommandOpenMemory
},
@@ -1645,7 +1665,7 @@ HMainEditorInit (
//
HMainEditor.ColorAttributes.Colors.Foreground = gST->ConOut->Mode->Attribute & 0x000000ff;
- HMainEditor.ColorAttributes.Colors.Background = (UINT8) (gST->ConOut->Mode->Attribute >> 4);
+ HMainEditor.ColorAttributes.Colors.Background = (UINT8)(gST->ConOut->Mode->Attribute >> 4);
HOriginalColors = HMainEditor.ColorAttributes.Colors;
@@ -1655,21 +1675,21 @@ HMainEditorInit (
// query screen size
//
gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &(HMainEditor.ScreenSize.Column),
- &(HMainEditor.ScreenSize.Row)
- );
+ gST->ConOut,
+ gST->ConOut->Mode->Mode,
+ &(HMainEditor.ScreenSize.Column),
+ &(HMainEditor.ScreenSize.Row)
+ );
//
// Find TextInEx in System Table ConsoleInHandle
// Per UEFI Spec, TextInEx is required for a console capable platform.
//
Status = gBS->HandleProtocol (
- gST->ConsoleInHandle,
- &gEfiSimpleTextInputExProtocolGuid,
- (VOID**)&HMainEditor.TextInputEx
- );
+ gST->ConsoleInHandle,
+ &gEfiSimpleTextInputExProtocolGuid,
+ (VOID **)&HMainEditor.TextInputEx
+ );
if (EFI_ERROR (Status)) {
return Status;
}
@@ -1678,47 +1698,48 @@ HMainEditorInit (
// Find mouse in System Table ConsoleInHandle
//
Status = gBS->HandleProtocol (
- gST->ConsoleInHandle,
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&HMainEditor.MouseInterface
- );
+ gST->ConsoleInHandle,
+ &gEfiSimplePointerProtocolGuid,
+ (VOID **)&HMainEditor.MouseInterface
+ );
if (EFI_ERROR (Status)) {
//
// If there is no Simple Pointer Protocol on System Table
//
- HandleBuffer = NULL;
+ HandleBuffer = NULL;
HMainEditor.MouseInterface = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiSimplePointerProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (!EFI_ERROR (Status) && HandleCount > 0) {
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiSimplePointerProtocolGuid,
+ NULL,
+ &HandleCount,
+ &HandleBuffer
+ );
+ if (!EFI_ERROR (Status) && (HandleCount > 0)) {
//
// Try to find the first available mouse device
//
for (Index = 0; Index < HandleCount; Index++) {
Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiSimplePointerProtocolGuid,
- (VOID**)&HMainEditor.MouseInterface
- );
+ HandleBuffer[Index],
+ &gEfiSimplePointerProtocolGuid,
+ (VOID **)&HMainEditor.MouseInterface
+ );
if (!EFI_ERROR (Status)) {
break;
}
}
}
+
if (HandleBuffer != NULL) {
FreePool (HandleBuffer);
}
}
- if (!EFI_ERROR (Status) && HMainEditor.MouseInterface != NULL) {
- HMainEditor.MouseAccumulatorX = 0;
- HMainEditor.MouseAccumulatorY = 0;
- HMainEditor.MouseSupported = TRUE;
+ if (!EFI_ERROR (Status) && (HMainEditor.MouseInterface != NULL)) {
+ HMainEditor.MouseAccumulatorX = 0;
+ HMainEditor.MouseAccumulatorY = 0;
+ HMainEditor.MouseSupported = TRUE;
}
//
@@ -1726,24 +1747,25 @@ HMainEditorInit (
//
Status = MainTitleBarInit (L"UEFI HEXEDIT");
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
Status = ControlHotKeyInit (HexMainControlBasedMenuFunctions);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
+
Status = MenuBarInit (HexEditorMenuItems);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
Status = StatusBarInit ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
@@ -1751,15 +1773,16 @@ HMainEditorInit (
Status = HBufferImageInit ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_BUFFERIMAGE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_BUFFERIMAGE), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
Status = HClipBoardInit ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_CLIPBOARD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_MAINEDITOR_CLIPBOARD), gShellDebug1HiiHandle);
return EFI_LOAD_ERROR;
}
+
//
// clear whole screen and enable cursor
//
@@ -1769,9 +1792,9 @@ HMainEditorInit (
//
// initialize EditorFirst and EditorExit
//
- HEditorFirst = TRUE;
- HEditorExit = FALSE;
- HEditorMouseAction = FALSE;
+ HEditorFirst = TRUE;
+ HEditorExit = FALSE;
+ HEditorMouseAction = FALSE;
return EFI_SUCCESS;
}
@@ -1802,13 +1825,14 @@ HMainEditorCleanup (
Status = HBufferImageCleanup ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle);
}
Status = HClipBoardCleanup ();
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_CLIPBOARD_CLEAN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_CLIPBOARD_CLEAN), gShellDebug1HiiHandle);
}
+
//
// restore old mode
//
@@ -1817,9 +1841,9 @@ HMainEditorCleanup (
}
gST->ConOut->SetAttribute (
- gST->ConOut,
- EFI_TEXT_ATTR (HOriginalColors.Foreground, HOriginalColors.Background)
- );
+ gST->ConOut,
+ EFI_TEXT_ATTR (HOriginalColors.Foreground, HOriginalColors.Background)
+ );
gST->ConOut->ClearScreen (gST->ConOut);
return EFI_SUCCESS;
@@ -1835,38 +1859,43 @@ HMainEditorRefresh (
VOID
)
{
- BOOLEAN NameChange;
- BOOLEAN ReadChange;
+ BOOLEAN NameChange;
+ BOOLEAN ReadChange;
NameChange = FALSE;
ReadChange = FALSE;
if (HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer) {
- if (HMainEditor.BufferImage->DiskImage != NULL &&
- HBufferImageBackupVar.DiskImage != NULL &&
- (HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset ||
- HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size) ){
+ if ((HMainEditor.BufferImage->DiskImage != NULL) &&
+ (HBufferImageBackupVar.DiskImage != NULL) &&
+ ((HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset) ||
+ (HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size)))
+ {
NameChange = TRUE;
}
} else if (HMainEditor.BufferImage->BufferType == FileTypeMemBuffer) {
- if (HMainEditor.BufferImage->MemImage != NULL &&
- HBufferImageBackupVar.MemImage != NULL &&
- (HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset ||
- HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size) ){
+ if ((HMainEditor.BufferImage->MemImage != NULL) &&
+ (HBufferImageBackupVar.MemImage != NULL) &&
+ ((HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset) ||
+ (HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size)))
+ {
NameChange = TRUE;
}
} else if (HMainEditor.BufferImage->BufferType == FileTypeFileBuffer) {
- if ( HMainEditor.BufferImage->FileImage != NULL &&
- HMainEditor.BufferImage->FileImage->FileName != NULL &&
- HBufferImageBackupVar.FileImage != NULL &&
- HBufferImageBackupVar.FileImage->FileName != NULL &&
- StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0 ) {
+ if ((HMainEditor.BufferImage->FileImage != NULL) &&
+ (HMainEditor.BufferImage->FileImage->FileName != NULL) &&
+ (HBufferImageBackupVar.FileImage != NULL) &&
+ (HBufferImageBackupVar.FileImage->FileName != NULL) &&
+ (StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0))
+ {
NameChange = TRUE;
}
}
- if ( HMainEditor.BufferImage->FileImage != NULL &&
- HBufferImageBackupVar.FileImage != NULL &&
- HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly ) {
+
+ if ((HMainEditor.BufferImage->FileImage != NULL) &&
+ (HBufferImageBackupVar.FileImage != NULL) &&
+ (HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly))
+ {
ReadChange = TRUE;
}
@@ -1879,29 +1908,30 @@ HMainEditorRefresh (
//
// call the components refresh function
//
- if (HEditorFirst
- || NameChange
- || HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType
- || HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified
- || ReadChange ) {
-
+ if ( HEditorFirst
+ || NameChange
+ || (HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType)
+ || (HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified)
+ || ReadChange )
+ {
MainTitleBarRefresh (
- HMainEditor.BufferImage->BufferType == FileTypeFileBuffer&&HMainEditor.BufferImage->FileImage!=NULL?HMainEditor.BufferImage->FileImage->FileName:HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Name:NULL,
+ HMainEditor.BufferImage->BufferType == FileTypeFileBuffer && HMainEditor.BufferImage->FileImage != NULL ? HMainEditor.BufferImage->FileImage->FileName : HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer && HMainEditor.BufferImage->DiskImage != NULL ? HMainEditor.BufferImage->DiskImage->Name : NULL,
HMainEditor.BufferImage->BufferType,
- (BOOLEAN)(HMainEditor.BufferImage->FileImage!=NULL?HMainEditor.BufferImage->FileImage->ReadOnly:FALSE),
+ (BOOLEAN)(HMainEditor.BufferImage->FileImage != NULL ? HMainEditor.BufferImage->FileImage->ReadOnly : FALSE),
HMainEditor.BufferImage->Modified,
HMainEditor.ScreenSize.Column,
HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Size :0
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer && HMainEditor.BufferImage->DiskImage != NULL ? HMainEditor.BufferImage->DiskImage->Offset : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer && HMainEditor.BufferImage->MemImage != NULL ? HMainEditor.BufferImage->MemImage->Offset : 0,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer && HMainEditor.BufferImage->DiskImage != NULL ? HMainEditor.BufferImage->DiskImage->Size : HMainEditor.BufferImage->BufferType == FileTypeMemBuffer && HMainEditor.BufferImage->MemImage != NULL ? HMainEditor.BufferImage->MemImage->Size : 0
);
HBufferImageRefresh ();
}
- if (HEditorFirst
- || HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row
- || HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column
- || StatusBarGetRefresh()) {
+ if ( HEditorFirst
+ || (HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row)
+ || (HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column)
+ || StatusBarGetRefresh ())
+ {
StatusBarRefresh (
HEditorFirst,
HMainEditor.ScreenSize.Row,
@@ -1938,17 +1968,16 @@ HMainEditorRefresh (
**/
EFI_STATUS
HMainEditorHandleMouseInput (
- IN EFI_SIMPLE_POINTER_STATE MouseState,
- OUT BOOLEAN *BeforeLeftButtonDown
+ IN EFI_SIMPLE_POINTER_STATE MouseState,
+ OUT BOOLEAN *BeforeLeftButtonDown
)
{
-
INT32 TextX;
INT32 TextY;
UINTN FRow;
UINTN FCol;
BOOLEAN HighBits;
- LIST_ENTRY *Link;
+ LIST_ENTRY *Link;
HEFI_EDITOR_LINE *Line;
UINTN Index;
BOOLEAN Action;
@@ -1968,14 +1997,13 @@ HMainEditorHandleMouseInput (
HBufferImageAdjustMousePosition (TextX, TextY);
Action = TRUE;
-
}
if (MouseState.LeftButton) {
HighBits = HBufferImageIsAtHighBits (
- HMainEditor.BufferImage->MousePosition.Column,
- &FCol
- );
+ HMainEditor.BufferImage->MousePosition.Column,
+ &FCol
+ );
//
// not at an movable place
@@ -2003,12 +2031,11 @@ HMainEditorHandleMouseInput (
}
HighBits = TRUE;
-
}
FRow = HMainEditor.BufferImage->BufferPosition.Row +
- HMainEditor.BufferImage->MousePosition.Row -
- HMainEditor.BufferImage->DisplayPosition.Row;
+ HMainEditor.BufferImage->MousePosition.Row -
+ HMainEditor.BufferImage->DisplayPosition.Row;
if (HMainEditor.BufferImage->NumLines < FRow) {
//
@@ -2017,8 +2044,8 @@ HMainEditorHandleMouseInput (
//
// now just move mouse pointer to legal position
//
- FRow = HMainEditor.BufferImage->NumLines;
- HighBits = TRUE;
+ FRow = HMainEditor.BufferImage->NumLines;
+ HighBits = TRUE;
}
Link = HMainEditor.BufferImage->ListHead->ForwardLink;
@@ -2043,26 +2070,25 @@ HMainEditorHandleMouseInput (
FRow--;
FCol = 16;
} else {
- FRow = 1;
- FCol = 1;
+ FRow = 1;
+ FCol = 1;
}
-
} else {
FCol = Line->Size;
}
} else {
- FCol = Line->Size + 1;
- HighBits = TRUE;
+ FCol = Line->Size + 1;
+ HighBits = TRUE;
}
}
HBufferImageMovePosition (FRow, FCol, HighBits);
- HMainEditor.BufferImage->MousePosition.Row = HMainEditor.BufferImage->DisplayPosition.Row;
+ HMainEditor.BufferImage->MousePosition.Row = HMainEditor.BufferImage->DisplayPosition.Row;
HMainEditor.BufferImage->MousePosition.Column = HMainEditor.BufferImage->DisplayPosition.Column;
- *BeforeLeftButtonDown = TRUE;
+ *BeforeLeftButtonDown = TRUE;
Action = TRUE;
} else {
@@ -2074,6 +2100,7 @@ HMainEditorHandleMouseInput (
if (*BeforeLeftButtonDown) {
Action = TRUE;
}
+
//
// mouse up
//
@@ -2118,20 +2145,19 @@ HMainEditorKeyInput (
//
// variable initialization
//
- OldSize = 0;
- FRow = 0;
- FCol = 0;
- LengthChange = FALSE;
+ OldSize = 0;
+ FRow = 0;
+ FCol = 0;
+ LengthChange = FALSE;
- MouseIsDown = FALSE;
- FirstDown = FALSE;
- MouseDrag = FALSE;
+ MouseIsDown = FALSE;
+ FirstDown = FALSE;
+ MouseDrag = FALSE;
do {
+ Status = EFI_SUCCESS;
- Status = EFI_SUCCESS;
-
- HEditorMouseAction = FALSE;
+ HEditorMouseAction = FALSE;
//
// backup some key elements, so that can aVOID some refresh work
@@ -2148,14 +2174,13 @@ HMainEditorKeyInput (
//
if (HMainEditor.MouseSupported) {
Status = HMainEditor.MouseInterface->GetState (
- HMainEditor.MouseInterface,
- &MouseState
- );
+ HMainEditor.MouseInterface,
+ &MouseState
+ );
if (!EFI_ERROR (Status)) {
-
BeforeMouseIsDown = MouseIsDown;
- Status = HMainEditorHandleMouseInput (MouseState, &MouseIsDown);
+ Status = HMainEditorHandleMouseInput (MouseState, &MouseIsDown);
if (!EFI_ERROR (Status)) {
if (!BeforeMouseIsDown) {
@@ -2168,10 +2193,9 @@ HMainEditorKeyInput (
SelectStartBackup = HMainEditor.SelectStart;
SelectEndBackup = HMainEditor.SelectEnd;
- FirstDown = TRUE;
+ FirstDown = TRUE;
}
} else {
-
SelectStartBackup = HMainEditor.SelectStart;
SelectEndBackup = HMainEditor.SelectEnd;
@@ -2185,23 +2209,25 @@ HMainEditorKeyInput (
HMainEditor.SelectEnd = 0;
HMainEditor.SelectStart = (FRow - 1) * 0x10 + FCol;
- MouseDrag = TRUE;
- FirstDown = FALSE;
+ MouseDrag = TRUE;
+ FirstDown = FALSE;
}
} else {
if ((
- (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column
- ) >= HMainEditor.SelectStart
- ) {
+ (HBufferImage.BufferPosition.Row - 1) *
+ 0x10 +
+ HBufferImage.BufferPosition.Column
+ ) >= HMainEditor.SelectStart
+ )
+ {
HMainEditor.SelectEnd = (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column;
+ 0x10 +
+ HBufferImage.BufferPosition.Column;
} else {
HMainEditor.SelectEnd = 0;
}
}
+
//
// end of if RelativeX/Y
//
@@ -2218,14 +2244,15 @@ HMainEditorKeyInput (
}
if ((
- (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column
- ) >= HMainEditor.SelectStart
- ) {
+ (HBufferImage.BufferPosition.Row - 1) *
+ 0x10 +
+ HBufferImage.BufferPosition.Column
+ ) >= HMainEditor.SelectStart
+ )
+ {
HMainEditor.SelectEnd = (HBufferImage.BufferPosition.Row - 1) *
- 0x10 +
- HBufferImage.BufferPosition.Column;
+ 0x10 +
+ HBufferImage.BufferPosition.Column;
} else {
HMainEditor.SelectEnd = 0;
}
@@ -2239,7 +2266,7 @@ HMainEditorKeyInput (
MouseDrag = FALSE;
}
- if (SelectStartBackup != HMainEditor.SelectStart || SelectEndBackup != HMainEditor.SelectEnd) {
+ if ((SelectStartBackup != HMainEditor.SelectStart) || (SelectEndBackup != HMainEditor.SelectEnd)) {
if ((SelectStartBackup - 1) / 0x10 != (HMainEditor.SelectStart - 1) / 0x10) {
HBufferImageNeedRefresh = TRUE;
} else {
@@ -2252,9 +2279,8 @@ HMainEditorKeyInput (
}
}
- HEditorMouseAction = TRUE;
- HBufferImageMouseNeedRefresh = TRUE;
-
+ HEditorMouseAction = TRUE;
+ HBufferImageMouseNeedRefresh = TRUE;
} else if (Status == EFI_LOAD_ERROR) {
StatusBarSetStatusString (L"Invalid Mouse Movement ");
}
@@ -2277,7 +2303,7 @@ HMainEditorKeyInput (
//
// clear previous status string
//
- StatusBarSetRefresh();
+ StatusBarSetRefresh ();
//
// NoShiftState: TRUE when no shift key is pressed.
//
@@ -2285,13 +2311,13 @@ HMainEditorKeyInput (
//
// dispatch to different components' key handling function
//
- if (EFI_SUCCESS == MenuBarDispatchControlHotKey(&KeyData)) {
+ if (EFI_SUCCESS == MenuBarDispatchControlHotKey (&KeyData)) {
Status = EFI_SUCCESS;
- } else if (NoShiftState && KeyData.Key.ScanCode == SCAN_NULL) {
+ } else if (NoShiftState && (KeyData.Key.ScanCode == SCAN_NULL)) {
Status = HBufferImageHandleInput (&KeyData.Key);
} else if (NoShiftState && ((KeyData.Key.ScanCode >= SCAN_UP) && (KeyData.Key.ScanCode <= SCAN_PAGE_DOWN))) {
Status = HBufferImageHandleInput (&KeyData.Key);
- } else if (NoShiftState && ((KeyData.Key.ScanCode >= SCAN_F1) && KeyData.Key.ScanCode <= SCAN_F12)) {
+ } else if (NoShiftState && ((KeyData.Key.ScanCode >= SCAN_F1) && (KeyData.Key.ScanCode <= SCAN_F12))) {
Status = MenuBarDispatchFunctionKey (&KeyData.Key);
} else {
StatusBarSetStatusString (L"Unknown Command");
@@ -2299,15 +2325,16 @@ HMainEditorKeyInput (
HBufferImageMouseNeedRefresh = FALSE;
}
- if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) {
+ if ((Status != EFI_SUCCESS) && (Status != EFI_OUT_OF_RESOURCES)) {
//
// not already has some error status
//
- if (StrCmp (L"", StatusBarGetString()) == 0) {
+ if (StrCmp (L"", StatusBarGetString ()) == 0) {
StatusBarSetStatusString (L"Disk Error. Try Again");
}
}
}
+
//
// decide if has to set length warning
//
@@ -2321,17 +2348,17 @@ HMainEditorKeyInput (
Size = HBufferImageGetTotalSize ();
switch (HBufferImage.BufferType) {
- case FileTypeDiskBuffer:
- OldSize = HBufferImage.DiskImage->Size * HBufferImage.DiskImage->BlockSize;
- break;
+ case FileTypeDiskBuffer:
+ OldSize = HBufferImage.DiskImage->Size * HBufferImage.DiskImage->BlockSize;
+ break;
- case FileTypeMemBuffer:
- OldSize = HBufferImage.MemImage->Size;
- break;
+ case FileTypeMemBuffer:
+ OldSize = HBufferImage.MemImage->Size;
+ break;
- default:
- OldSize = 0;
- break;
+ default:
+ OldSize = 0;
+ break;
}
if (!LengthChange) {
@@ -2348,11 +2375,11 @@ HMainEditorKeyInput (
}
}
}
+
//
// after handling, refresh editor
//
HMainEditorRefresh ();
-
} while (Status != EFI_OUT_OF_RESOURCES && !HEditorExit);
return Status;
@@ -2366,7 +2393,7 @@ HMainEditorBackup (
VOID
)
{
- HMainEditorBackupVar.SelectStart = HMainEditor.SelectStart;
- HMainEditorBackupVar.SelectEnd = HMainEditor.SelectEnd;
+ HMainEditorBackupVar.SelectStart = HMainEditor.SelectStart;
+ HMainEditorBackupVar.SelectEnd = HMainEditor.SelectEnd;
HBufferImageBackup ();
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
index 5e734f668a..a7c80a4e96 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
@@ -8,23 +8,23 @@
#include "HexEditor.h"
-extern EFI_HANDLE HImageHandleBackup;
+extern EFI_HANDLE HImageHandleBackup;
-extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
+extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
-extern BOOLEAN HBufferImageNeedRefresh;
-extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
-extern BOOLEAN HBufferImageMouseNeedRefresh;
+extern BOOLEAN HBufferImageNeedRefresh;
+extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
+extern BOOLEAN HBufferImageMouseNeedRefresh;
extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
-HEFI_EDITOR_MEM_IMAGE HMemImage;
-HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
+HEFI_EDITOR_MEM_IMAGE HMemImage;
+HEFI_EDITOR_MEM_IMAGE HMemImageBackupVar;
//
// for basic initialization of HDiskImage
//
-HEFI_EDITOR_MEM_IMAGE HMemImageConst = {
+HEFI_EDITOR_MEM_IMAGE HMemImageConst = {
NULL,
0,
0
@@ -49,10 +49,10 @@ HMemImageInit (
CopyMem (&HMemImage, &HMemImageConst, sizeof (HMemImage));
Status = gBS->LocateProtocol (
- &gEfiCpuIo2ProtocolGuid,
- NULL,
- (VOID**)&HMemImage.IoFncs
- );
+ &gEfiCpuIo2ProtocolGuid,
+ NULL,
+ (VOID **)&HMemImage.IoFncs
+ );
if (!EFI_ERROR (Status)) {
return EFI_SUCCESS;
} else {
@@ -88,13 +88,12 @@ HMemImageBackup (
**/
EFI_STATUS
HMemImageSetMemOffsetSize (
- IN UINTN Offset,
- IN UINTN Size
+ IN UINTN Offset,
+ IN UINTN Size
)
{
-
- HMemImage.Offset = Offset;
- HMemImage.Size = Size;
+ HMemImage.Offset = Offset;
+ HMemImage.Size = Size;
return EFI_SUCCESS;
}
@@ -112,32 +111,31 @@ HMemImageSetMemOffsetSize (
**/
EFI_STATUS
HMemImageRead (
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
)
{
-
- EFI_STATUS Status;
- void *Buffer;
- CHAR16 *Str;
- HEFI_EDITOR_LINE *Line;
+ EFI_STATUS Status;
+ void *Buffer;
+ CHAR16 *Str;
+ HEFI_EDITOR_LINE *Line;
HBufferImage.BufferType = FileTypeMemBuffer;
- Buffer = AllocateZeroPool (Size);
+ Buffer = AllocateZeroPool (Size);
if (Buffer == NULL) {
StatusBarSetStatusString (L"Read Memory Failed");
return EFI_OUT_OF_RESOURCES;
}
Status = HMemImage.IoFncs->Mem.Read (
- HMemImage.IoFncs,
- EfiCpuIoWidthUint8,
- Offset,
- Size,
- Buffer
- );
+ HMemImage.IoFncs,
+ EfiCpuIoWidthUint8,
+ Offset,
+ Size,
+ Buffer
+ );
if (EFI_ERROR (Status)) {
FreePool (Buffer);
@@ -155,22 +153,22 @@ HMemImageRead (
return Status;
}
- Status = HMemImageSetMemOffsetSize (Offset, Size);
+ Status = HMemImageSetMemOffsetSize (Offset, Size);
HBufferImage.DisplayPosition.Row = 2;
HBufferImage.DisplayPosition.Column = 10;
- HBufferImage.MousePosition.Row = 2;
- HBufferImage.MousePosition.Column = 10;
+ HBufferImage.MousePosition.Row = 2;
+ HBufferImage.MousePosition.Column = 10;
- HBufferImage.LowVisibleRow = 1;
- HBufferImage.HighBits = TRUE;
+ HBufferImage.LowVisibleRow = 1;
+ HBufferImage.HighBits = TRUE;
- HBufferImage.BufferPosition.Row = 1;
- HBufferImage.BufferPosition.Column = 1;
+ HBufferImage.BufferPosition.Row = 1;
+ HBufferImage.BufferPosition.Column = 1;
if (!Recover) {
- Str = CatSPrint(NULL, L"%d Lines Read", HBufferImage.NumLines);
+ Str = CatSPrint (NULL, L"%d Lines Read", HBufferImage.NumLines);
if (Str == NULL) {
StatusBarSetStatusString (L"Read Memory Failed");
return EFI_OUT_OF_RESOURCES;
@@ -181,7 +179,6 @@ HMemImageRead (
HMainEditor.SelectStart = 0;
HMainEditor.SelectEnd = 0;
-
}
//
@@ -208,7 +205,6 @@ HMemImageRead (
HBufferImageMouseNeedRefresh = TRUE;
return EFI_SUCCESS;
-
}
/**
@@ -223,13 +219,12 @@ HMemImageRead (
**/
EFI_STATUS
HMemImageSave (
- IN UINTN Offset,
- IN UINTN Size
+ IN UINTN Offset,
+ IN UINTN Size
)
{
-
- EFI_STATUS Status;
- VOID *Buffer;
+ EFI_STATUS Status;
+ VOID *Buffer;
//
// not modified, so directly return
@@ -240,7 +235,7 @@ HMemImageSave (
HBufferImage.BufferType = FileTypeMemBuffer;
- Buffer = AllocateZeroPool (Size);
+ Buffer = AllocateZeroPool (Size);
if (Buffer == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -251,22 +246,24 @@ HMemImageSave (
FreePool (Buffer);
return Status;
}
+
//
// write back to memory
//
Status = HMemImage.IoFncs->Mem.Write (
- HMemImage.IoFncs,
- EfiCpuIoWidthUint8,
- Offset,
- Size,
- Buffer
- );
+ HMemImage.IoFncs,
+ EfiCpuIoWidthUint8,
+ Offset,
+ Size,
+ Buffer
+ );
FreePool (Buffer);
if (EFI_ERROR (Status)) {
return EFI_LOAD_ERROR;
}
+
//
// now not modified
//
@@ -274,5 +271,3 @@ HMemImageSave (
return EFI_SUCCESS;
}
-
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
index 090a3fc775..5e7fdc0b17 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
@@ -45,8 +45,8 @@ HMemImageBackup (
**/
EFI_STATUS
HMemImageSetMemOffsetSize (
- IN UINTN Offset,
- IN UINTN Size
+ IN UINTN Offset,
+ IN UINTN Size
);
/**
@@ -62,9 +62,9 @@ HMemImageSetMemOffsetSize (
**/
EFI_STATUS
HMemImageRead (
- IN UINTN Offset,
- IN UINTN Size,
- IN BOOLEAN Recover
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
);
/**
@@ -79,8 +79,8 @@ HMemImageRead (
**/
EFI_STATUS
HMemImageSave (
- IN UINTN Offset,
- IN UINTN Size
+ IN UINTN Offset,
+ IN UINTN Size
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
index 10bf15cbfb..9f96780372 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
@@ -17,15 +17,14 @@ extern BOOLEAN HEditorMouseAction;
**/
VOID
HLineFree (
- IN HEFI_EDITOR_LINE *Src
+ IN HEFI_EDITOR_LINE *Src
)
{
if (Src == NULL) {
- return ;
+ return;
}
SHELL_FREE_NON_NULL (Src);
-
}
/**
@@ -38,7 +37,7 @@ HLineFree (
**/
HEFI_EDITOR_LINE *
HLineAdvance (
- IN UINTN Count
+ IN UINTN Count
)
{
UINTN Index;
@@ -73,7 +72,7 @@ HLineAdvance (
**/
HEFI_EDITOR_LINE *
HLineRetreat (
- IN UINTN Count
+ IN UINTN Count
)
{
UINTN Index;
@@ -110,7 +109,7 @@ HLineRetreat (
**/
HEFI_EDITOR_LINE *
HMoveLine (
- IN INTN Count
+ IN INTN Count
)
{
HEFI_EDITOR_LINE *Line;
@@ -122,8 +121,8 @@ HMoveLine (
// do not set currentline to Line
//
if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = HLineRetreat (AbsCount);
+ AbsCount = (UINTN)ABS (Count);
+ Line = HLineRetreat (AbsCount);
} else {
Line = HLineAdvance ((UINTN)Count);
}
@@ -143,7 +142,7 @@ HMoveLine (
**/
HEFI_EDITOR_LINE *
HMoveCurrentLine (
- IN INTN Count
+ IN INTN Count
)
{
HEFI_EDITOR_LINE *Line;
@@ -154,8 +153,8 @@ HMoveCurrentLine (
// >0: advance
//
if (Count <= 0) {
- AbsCount = (UINTN)ABS(Count);
- Line = HLineRetreat (AbsCount);
+ AbsCount = (UINTN)ABS (Count);
+ Line = HLineRetreat (AbsCount);
} else {
Line = HLineAdvance ((UINTN)Count);
}
@@ -169,7 +168,6 @@ HMoveCurrentLine (
return Line;
}
-
/**
Free all the lines in HBufferImage.
Fields affected:
@@ -185,8 +183,8 @@ HMoveCurrentLine (
**/
EFI_STATUS
HFreeLines (
- IN LIST_ENTRY *ListHead,
- IN HEFI_EDITOR_LINE *Lines
+ IN LIST_ENTRY *ListHead,
+ IN HEFI_EDITOR_LINE *Lines
)
{
LIST_ENTRY *Link;
@@ -196,18 +194,17 @@ HFreeLines (
// release all the lines
//
if (Lines != NULL) {
-
- Line = Lines;
- Link = &(Line->Link);
+ Line = Lines;
+ Link = &(Line->Link);
do {
- Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
- Link = Link->ForwardLink;
+ Line = CR (Link, HEFI_EDITOR_LINE, Link, EFI_EDITOR_LINE_LIST);
+ Link = Link->ForwardLink;
HLineFree (Line);
} while (Link != ListHead);
}
ListHead->ForwardLink = ListHead;
- ListHead->BackLink = ListHead;
+ ListHead->BackLink = ListHead;
return EFI_SUCCESS;
}
@@ -221,15 +218,15 @@ HFreeLines (
**/
INT32
HGetTextX (
- IN INT32 GuidX
+ IN INT32 GuidX
)
{
- INT32 Gap;
+ INT32 Gap;
HMainEditor.MouseAccumulatorX += GuidX;
- Gap = (HMainEditor.MouseAccumulatorX * (INT32) HMainEditor.ScreenSize.Column) / (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionX);
- HMainEditor.MouseAccumulatorX = (HMainEditor.MouseAccumulatorX * (INT32) HMainEditor.ScreenSize.Column) % (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionX);
- HMainEditor.MouseAccumulatorX = HMainEditor.MouseAccumulatorX / (INT32) HMainEditor.ScreenSize.Column;
+ Gap = (HMainEditor.MouseAccumulatorX * (INT32)HMainEditor.ScreenSize.Column) / (INT32)(50 * (INT32)HMainEditor.MouseInterface->Mode->ResolutionX);
+ HMainEditor.MouseAccumulatorX = (HMainEditor.MouseAccumulatorX * (INT32)HMainEditor.ScreenSize.Column) % (INT32)(50 * (INT32)HMainEditor.MouseInterface->Mode->ResolutionX);
+ HMainEditor.MouseAccumulatorX = HMainEditor.MouseAccumulatorX / (INT32)HMainEditor.ScreenSize.Column;
return Gap;
}
@@ -242,15 +239,15 @@ HGetTextX (
**/
INT32
HGetTextY (
- IN INT32 GuidY
+ IN INT32 GuidY
)
{
- INT32 Gap;
+ INT32 Gap;
HMainEditor.MouseAccumulatorY += GuidY;
- Gap = (HMainEditor.MouseAccumulatorY * (INT32) HMainEditor.ScreenSize.Row) / (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionY);
- HMainEditor.MouseAccumulatorY = (HMainEditor.MouseAccumulatorY * (INT32) HMainEditor.ScreenSize.Row) % (INT32) (50 * (INT32) HMainEditor.MouseInterface->Mode->ResolutionY);
- HMainEditor.MouseAccumulatorY = HMainEditor.MouseAccumulatorY / (INT32) HMainEditor.ScreenSize.Row;
+ Gap = (HMainEditor.MouseAccumulatorY * (INT32)HMainEditor.ScreenSize.Row) / (INT32)(50 * (INT32)HMainEditor.MouseInterface->Mode->ResolutionY);
+ HMainEditor.MouseAccumulatorY = (HMainEditor.MouseAccumulatorY * (INT32)HMainEditor.ScreenSize.Row) % (INT32)(50 * (INT32)HMainEditor.MouseInterface->Mode->ResolutionY);
+ HMainEditor.MouseAccumulatorY = HMainEditor.MouseAccumulatorY / (INT32)HMainEditor.ScreenSize.Row;
return Gap;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
index 02df65959c..f02324176a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
@@ -23,7 +23,7 @@
**/
HEFI_EDITOR_LINE *
HMoveLine (
- IN INTN Count
+ IN INTN Count
);
/**
@@ -38,7 +38,7 @@ HMoveLine (
**/
HEFI_EDITOR_LINE *
HMoveCurrentLine (
- IN INTN Count
+ IN INTN Count
);
/**
@@ -56,8 +56,8 @@ HMoveCurrentLine (
**/
EFI_STATUS
HFreeLines (
- IN LIST_ENTRY *ListHead,
- IN HEFI_EDITOR_LINE *Lines
+ IN LIST_ENTRY *ListHead,
+ IN HEFI_EDITOR_LINE *Lines
);
/**
@@ -69,7 +69,7 @@ HFreeLines (
**/
INT32
HGetTextX (
- IN INT32 GuidX
+ IN INT32 GuidX
);
/**
@@ -81,7 +81,7 @@ HGetTextX (
**/
INT32
HGetTextY (
- IN INT32 GuidY
+ IN INT32 GuidY
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
index 5b6cba17f3..852d6dcf80 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c
@@ -39,15 +39,15 @@ LoadPciRomConnectAllDriversToAllControllers (
**/
EFI_STATUS
LoadEfiDriversFromRomImage (
- VOID *RomBar,
- UINTN RomSize,
- CONST CHAR16 *FileName
+ VOID *RomBar,
+ UINTN RomSize,
+ CONST CHAR16 *FileName
);
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-nc", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-nc", TypeFlag },
+ { NULL, TypeMax }
+};
/**
Function for 'loadpcirom' command.
@@ -62,17 +62,18 @@ ShellCommandRunLoadPciRom (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_SHELL_FILE_INFO *FileList;
- UINTN SourceSize;
- UINT8 *File1Buffer;
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- BOOLEAN Connect;
- CONST CHAR16 *Param;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *Node;
+ EFI_SHELL_FILE_INFO *FileList;
+ UINTN SourceSize;
+ UINT8 *File1Buffer;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ BOOLEAN Connect;
+ CONST CHAR16 *Param;
+ UINTN ParamCount;
+ EFI_SHELL_FILE_INFO *Node;
+
//
// Local variable initializations
//
@@ -80,25 +81,24 @@ ShellCommandRunLoadPciRom (
ShellStatus = SHELL_SUCCESS;
FileList = NULL;
-
//
// verify number of arguments
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom");
+ if (ShellCommandLineGetCount (Package) < 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- if (ShellCommandLineGetFlag(Package, L"-nc")) {
+ if (ShellCommandLineGetFlag (Package, L"-nc")) {
Connect = FALSE;
} else {
Connect = TRUE;
@@ -108,64 +108,73 @@ ShellCommandRunLoadPciRom (
// get a list with each file specified by parameters
// if parameter is a directory then add all the files below it to the list
//
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param);
+ for ( ParamCount = 1, Param = ShellCommandLineGetRawValue (Package, ParamCount)
+ ; Param != NULL
+ ; ParamCount++, Param = ShellCommandLineGetRawValue (Package, ParamCount)
+ )
+ {
+ Status = ShellOpenFileMetaArg ((CHAR16 *)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param);
ShellStatus = SHELL_ACCESS_DENIED;
break;
}
}
- if (ShellStatus == SHELL_SUCCESS && FileList != NULL) {
+
+ if ((ShellStatus == SHELL_SUCCESS) && (FileList != NULL)) {
//
// loop through the list and make sure we are not aborting...
//
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
+ for ( Node = (EFI_SHELL_FILE_INFO *)GetFirstNode (&FileList->Link)
+ ; !IsNull (&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag ()
+ ; Node = (EFI_SHELL_FILE_INFO *)GetNextNode (&FileList->Link, &Node->Link)
+ )
+ {
+ if (EFI_ERROR (Node->Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER;
continue;
}
- if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
+
+ if (FileHandleIsDirectory (Node->Handle) == EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER;
continue;
}
- SourceSize = (UINTN) Node->Info->FileSize;
+
+ SourceSize = (UINTN)Node->Info->FileSize;
File1Buffer = AllocateZeroPool (SourceSize);
if (File1Buffer == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"loadpcirom");
ShellStatus = SHELL_OUT_OF_RESOURCES;
continue;
}
- Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
+
+ Status = gEfiShellProtocol->ReadFile (Node->Handle, &SourceSize, File1Buffer);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = LoadEfiDriversFromRomImage (
- File1Buffer,
- SourceSize,
- Node->FullName
- );
+ File1Buffer,
+ SourceSize,
+ Node->FullName
+ );
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOAD_PCI_ROM_RES), gShellDebug1HiiHandle, Node->FullName, Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOAD_PCI_ROM_RES), gShellDebug1HiiHandle, Node->FullName, Status);
}
- FreePool(File1Buffer);
+
+ FreePool (File1Buffer);
}
} else if (ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom");
ShellStatus = SHELL_NOT_FOUND;
}
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
+
+ if ((FileList != NULL) && !IsListEmpty (&FileList->Link)) {
+ Status = ShellCloseFileMetaArg (&FileList);
}
+
FileList = NULL;
if (Connect) {
@@ -192,9 +201,9 @@ ShellCommandRunLoadPciRom (
**/
EFI_STATUS
LoadEfiDriversFromRomImage (
- VOID *RomBar,
- UINTN RomSize,
- CONST CHAR16 *FileName
+ VOID *RomBar,
+ UINTN RomSize,
+ CONST CHAR16 *FileName
)
{
@@ -219,17 +228,16 @@ LoadEfiDriversFromRomImage (
EFI_DECOMPRESS_PROTOCOL *Decompress;
UINT32 InitializationSize;
- ImageIndex = 0;
- ReturnStatus = EFI_NOT_FOUND;
- RomBarOffset = (UINTN) RomBar;
+ ImageIndex = 0;
+ ReturnStatus = EFI_NOT_FOUND;
+ RomBarOffset = (UINTN)RomBar;
do {
-
- EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomBarOffset;
+ EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *)(UINTN)RomBarOffset;
if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
+ // PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
return ReturnStatus;
}
@@ -237,19 +245,21 @@ LoadEfiDriversFromRomImage (
// If the pointer to the PCI Data Structure is invalid, no further images can be located.
// The PCI Data Structure must be DWORD aligned.
//
- if (EfiRomHeader->PcirOffset == 0 ||
- (EfiRomHeader->PcirOffset & 3) != 0 ||
- RomBarOffset - (UINTN)RomBar + EfiRomHeader->PcirOffset + sizeof (PCI_DATA_STRUCTURE) > RomSize) {
+ if ((EfiRomHeader->PcirOffset == 0) ||
+ ((EfiRomHeader->PcirOffset & 3) != 0) ||
+ (RomBarOffset - (UINTN)RomBar + EfiRomHeader->PcirOffset + sizeof (PCI_DATA_STRUCTURE) > RomSize))
+ {
break;
}
- Pcir = (PCI_DATA_STRUCTURE *) (UINTN) (RomBarOffset + EfiRomHeader->PcirOffset);
+ Pcir = (PCI_DATA_STRUCTURE *)(UINTN)(RomBarOffset + EfiRomHeader->PcirOffset);
//
// If a valid signature is not present in the PCI Data Structure, no further images can be located.
//
if (Pcir->Signature != PCI_DATA_STRUCTURE_SIGNATURE) {
break;
}
+
ImageSize = Pcir->ImageLength * 512;
if (RomBarOffset - (UINTN)RomBar + ImageSize > RomSize) {
break;
@@ -258,14 +268,13 @@ LoadEfiDriversFromRomImage (
if ((Pcir->CodeType == PCI_CODE_TYPE_EFI_IMAGE) &&
(EfiRomHeader->EfiSignature == EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE) &&
((EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER) ||
- (EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER))) {
-
- ImageOffset = EfiRomHeader->EfiImageHeaderOffset;
- InitializationSize = EfiRomHeader->InitializationSize * 512;
-
- if (InitializationSize <= ImageSize && ImageOffset < InitializationSize) {
+ (EfiRomHeader->EfiSubsystem == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER)))
+ {
+ ImageOffset = EfiRomHeader->EfiImageHeaderOffset;
+ InitializationSize = EfiRomHeader->InitializationSize * 512;
- ImageBuffer = (VOID *) (UINTN) (RomBarOffset + ImageOffset);
+ if ((InitializationSize <= ImageSize) && (ImageOffset < InitializationSize)) {
+ ImageBuffer = (VOID *)(UINTN)(RomBarOffset + ImageOffset);
ImageLength = InitializationSize - ImageOffset;
DecompressedImageBuffer = NULL;
@@ -278,33 +287,33 @@ LoadEfiDriversFromRomImage (
}
if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
- Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
- ASSERT_EFI_ERROR(Status);
+ Status = gBS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID **)&Decompress);
+ ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
SkipImage = TRUE;
} else {
SkipImage = TRUE;
- Status = Decompress->GetInfo (
- Decompress,
- ImageBuffer,
- ImageLength,
- &DestinationSize,
- &ScratchSize
- );
+ Status = Decompress->GetInfo (
+ Decompress,
+ ImageBuffer,
+ ImageLength,
+ &DestinationSize,
+ &ScratchSize
+ );
if (!EFI_ERROR (Status)) {
DecompressedImageBuffer = AllocateZeroPool (DestinationSize);
if (ImageBuffer != NULL) {
Scratch = AllocateZeroPool (ScratchSize);
if (Scratch != NULL) {
Status = Decompress->Decompress (
- Decompress,
- ImageBuffer,
- ImageLength,
- DecompressedImageBuffer,
- DestinationSize,
- Scratch,
- ScratchSize
- );
+ Decompress,
+ ImageBuffer,
+ ImageLength,
+ DecompressedImageBuffer,
+ DestinationSize,
+ Scratch,
+ ScratchSize
+ );
if (!EFI_ERROR (Status)) {
ImageBuffer = DecompressedImageBuffer;
ImageLength = DestinationSize;
@@ -326,13 +335,13 @@ LoadEfiDriversFromRomImage (
FilePath = FileDevicePath (NULL, RomFileName);
Status = gBS->LoadImage (
- TRUE,
- gImageHandle,
- FilePath,
- ImageBuffer,
- ImageLength,
- &ImageHandle
- );
+ TRUE,
+ gImageHandle,
+ FilePath,
+ ImageBuffer,
+ ImageLength,
+ &ImageHandle
+ );
if (EFI_ERROR (Status)) {
//
// With EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created
@@ -343,13 +352,14 @@ LoadEfiDriversFromRomImage (
if (Status == EFI_SECURITY_VIOLATION) {
gBS->UnloadImage (ImageHandle);
}
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status);
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
+ // PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status);
} else {
Status = gBS->StartImage (ImageHandle, NULL, NULL);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
-// PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
+ // PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
} else {
ReturnStatus = Status;
}
@@ -359,13 +369,12 @@ LoadEfiDriversFromRomImage (
if (DecompressedImageBuffer != NULL) {
FreePool (DecompressedImageBuffer);
}
-
}
}
RomBarOffset = RomBarOffset + ImageSize;
ImageIndex++;
- } while (((Pcir->Indicator & 0x80) == 0x00) && ((RomBarOffset - (UINTN) RomBar) < RomSize));
+ } while (((Pcir->Indicator & 0x80) == 0x00) && ((RomBarOffset - (UINTN)RomBar) < RomSize));
return ReturnStatus;
}
@@ -402,11 +411,13 @@ LoadPciRomConnectAllDriversToAllControllers (
Status = EFI_ABORTED;
break;
}
+
gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
}
if (HandleBuffer != NULL) {
FreePool (HandleBuffer);
}
+
return Status;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
index ea651802cb..72f3c58b09 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c
@@ -11,41 +11,41 @@
//
// Need full names for Standard-Format Output
//
-STATIC CONST CHAR16 NameEfiReservedMemoryType[] = L"Reserved";
-STATIC CONST CHAR16 NameEfiLoaderCode[] = L"LoaderCode";
-STATIC CONST CHAR16 NameEfiLoaderData[] = L"LoaderData";
-STATIC CONST CHAR16 NameEfiBootServicesCode[] = L"BootServiceCode";
-STATIC CONST CHAR16 NameEfiBootServicesData[] = L"BootServiceData";
-STATIC CONST CHAR16 NameEfiRuntimeServicesCode[] = L"RuntimeCode";
-STATIC CONST CHAR16 NameEfiRuntimeServicesData[] = L"RuntimeData";
-STATIC CONST CHAR16 NameEfiConventionalMemory[] = L"Available";
-STATIC CONST CHAR16 NameEfiPersistentMemory[] = L"Persistent";
-STATIC CONST CHAR16 NameEfiUnusableMemory[] = L"UnusableMemory";
-STATIC CONST CHAR16 NameEfiACPIReclaimMemory[] = L"ACPIReclaimMemory";
-STATIC CONST CHAR16 NameEfiACPIMemoryNVS[] = L"ACPIMemoryNVS";
-STATIC CONST CHAR16 NameEfiMemoryMappedIO[] = L"MemoryMappedIO";
-STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] = L"MemoryMappedIOPortSpace";
-STATIC CONST CHAR16 NameEfiPalCode[] = L"PalCode";
+STATIC CONST CHAR16 NameEfiReservedMemoryType[] = L"Reserved";
+STATIC CONST CHAR16 NameEfiLoaderCode[] = L"LoaderCode";
+STATIC CONST CHAR16 NameEfiLoaderData[] = L"LoaderData";
+STATIC CONST CHAR16 NameEfiBootServicesCode[] = L"BootServiceCode";
+STATIC CONST CHAR16 NameEfiBootServicesData[] = L"BootServiceData";
+STATIC CONST CHAR16 NameEfiRuntimeServicesCode[] = L"RuntimeCode";
+STATIC CONST CHAR16 NameEfiRuntimeServicesData[] = L"RuntimeData";
+STATIC CONST CHAR16 NameEfiConventionalMemory[] = L"Available";
+STATIC CONST CHAR16 NameEfiPersistentMemory[] = L"Persistent";
+STATIC CONST CHAR16 NameEfiUnusableMemory[] = L"UnusableMemory";
+STATIC CONST CHAR16 NameEfiACPIReclaimMemory[] = L"ACPIReclaimMemory";
+STATIC CONST CHAR16 NameEfiACPIMemoryNVS[] = L"ACPIMemoryNVS";
+STATIC CONST CHAR16 NameEfiMemoryMappedIO[] = L"MemoryMappedIO";
+STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] = L"MemoryMappedIOPortSpace";
+STATIC CONST CHAR16 NameEfiPalCode[] = L"PalCode";
//
// Need short names for some memory types
//
-STATIC CONST CHAR16 NameEfiBootServicesCodeShort[] = L"BS_Code";
-STATIC CONST CHAR16 NameEfiBootServicesDataShort[] = L"BS_Data";
-STATIC CONST CHAR16 NameEfiRuntimeServicesCodeShort[] = L"RT_Code";
-STATIC CONST CHAR16 NameEfiRuntimeServicesDataShort[] = L"RT_Data";
-STATIC CONST CHAR16 NameEfiUnusableMemoryShort[] = L"Unusable";
-STATIC CONST CHAR16 NameEfiACPIReclaimMemoryShort[] = L"ACPI_Recl";
-STATIC CONST CHAR16 NameEfiACPIMemoryNVSShort[] = L"ACPI_NVS";
-STATIC CONST CHAR16 NameEfiMemoryMappedIOShort[] = L"MMIO";
-STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpaceShort[] = L"MMIO_Port";
+STATIC CONST CHAR16 NameEfiBootServicesCodeShort[] = L"BS_Code";
+STATIC CONST CHAR16 NameEfiBootServicesDataShort[] = L"BS_Data";
+STATIC CONST CHAR16 NameEfiRuntimeServicesCodeShort[] = L"RT_Code";
+STATIC CONST CHAR16 NameEfiRuntimeServicesDataShort[] = L"RT_Data";
+STATIC CONST CHAR16 NameEfiUnusableMemoryShort[] = L"Unusable";
+STATIC CONST CHAR16 NameEfiACPIReclaimMemoryShort[] = L"ACPI_Recl";
+STATIC CONST CHAR16 NameEfiACPIMemoryNVSShort[] = L"ACPI_NVS";
+STATIC CONST CHAR16 NameEfiMemoryMappedIOShort[] = L"MMIO";
+STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpaceShort[] = L"MMIO_Port";
#include "UefiShellDebug1CommandsLib.h"
typedef struct {
- UINT32 Type;
- UINT64 NumberOfPages;
- LIST_ENTRY Link;
+ UINT32 Type;
+ UINT64 NumberOfPages;
+ LIST_ENTRY Link;
} MEMORY_LENGTH_ENTRY;
/**
@@ -57,14 +57,14 @@ typedef struct {
**/
VOID
AddMemoryLength (
- LIST_ENTRY *List,
- UINT32 Type,
- UINT64 NumberOfPages
+ LIST_ENTRY *List,
+ UINT32 Type,
+ UINT64 NumberOfPages
)
{
- MEMORY_LENGTH_ENTRY *Entry;
- MEMORY_LENGTH_ENTRY *NewEntry;
- LIST_ENTRY *Link;
+ MEMORY_LENGTH_ENTRY *Entry;
+ MEMORY_LENGTH_ENTRY *NewEntry;
+ LIST_ENTRY *Link;
Entry = NULL;
for (Link = GetFirstNode (List); !IsNull (List, Link); Link = GetNextNode (List, Link)) {
@@ -89,7 +89,8 @@ AddMemoryLength (
if (NewEntry == NULL) {
return;
}
- NewEntry->Type = Type;
+
+ NewEntry->Type = Type;
NewEntry->NumberOfPages = 0;
InsertTailList (Link, &NewEntry->Link);
}
@@ -110,52 +111,52 @@ ShellCommandRunMemMap (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN Size;
- EFI_MEMORY_DESCRIPTOR *Descriptors;
- UINTN MapKey;
- UINTN ItemSize;
- UINT32 Version;
- EFI_MEMORY_DESCRIPTOR *Walker;
- UINT64 ReservedPages;
- UINT64 LoadCodePages;
- UINT64 LoadDataPages;
- UINT64 BSCodePages;
- UINT64 BSDataPages;
- UINT64 RTDataPages;
- UINT64 RTCodePages;
- UINT64 AvailPages;
- UINT64 TotalPages;
- UINT64 ReservedPagesSize;
- UINT64 LoadCodePagesSize;
- UINT64 LoadDataPagesSize;
- UINT64 BSCodePagesSize;
- UINT64 BSDataPagesSize;
- UINT64 RTDataPagesSize;
- UINT64 RTCodePagesSize;
- UINT64 AvailPagesSize;
- UINT64 TotalPagesSize;
- UINT64 AcpiReclaimPages;
- UINT64 AcpiNvsPages;
- UINT64 MmioSpacePages;
- UINT64 AcpiReclaimPagesSize;
- UINT64 AcpiNvsPagesSize;
- UINT64 MmioSpacePagesSize;
- UINT64 MmioPortPages;
- UINT64 MmioPortPagesSize;
- UINT64 UnusableMemoryPages;
- UINT64 UnusableMemoryPagesSize;
- UINT64 PalCodePages;
- UINT64 PalCodePagesSize;
- UINT64 PersistentPages;
- UINT64 PersistentPagesSize;
- BOOLEAN Sfo;
- LIST_ENTRY MemoryList;
- MEMORY_LENGTH_ENTRY *Entry;
- LIST_ENTRY *Link;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ UINTN Size;
+ EFI_MEMORY_DESCRIPTOR *Descriptors;
+ UINTN MapKey;
+ UINTN ItemSize;
+ UINT32 Version;
+ EFI_MEMORY_DESCRIPTOR *Walker;
+ UINT64 ReservedPages;
+ UINT64 LoadCodePages;
+ UINT64 LoadDataPages;
+ UINT64 BSCodePages;
+ UINT64 BSDataPages;
+ UINT64 RTDataPages;
+ UINT64 RTCodePages;
+ UINT64 AvailPages;
+ UINT64 TotalPages;
+ UINT64 ReservedPagesSize;
+ UINT64 LoadCodePagesSize;
+ UINT64 LoadDataPagesSize;
+ UINT64 BSCodePagesSize;
+ UINT64 BSDataPagesSize;
+ UINT64 RTDataPagesSize;
+ UINT64 RTCodePagesSize;
+ UINT64 AvailPagesSize;
+ UINT64 TotalPagesSize;
+ UINT64 AcpiReclaimPages;
+ UINT64 AcpiNvsPages;
+ UINT64 MmioSpacePages;
+ UINT64 AcpiReclaimPagesSize;
+ UINT64 AcpiNvsPagesSize;
+ UINT64 MmioSpacePagesSize;
+ UINT64 MmioPortPages;
+ UINT64 MmioPortPagesSize;
+ UINT64 UnusableMemoryPages;
+ UINT64 UnusableMemoryPagesSize;
+ UINT64 PalCodePages;
+ UINT64 PalCodePagesSize;
+ UINT64 PersistentPages;
+ UINT64 PersistentPagesSize;
+ BOOLEAN Sfo;
+ LIST_ENTRY MemoryList;
+ MEMORY_LENGTH_ENTRY *Entry;
+ LIST_ENTRY *Link;
AcpiReclaimPages = 0;
AcpiNvsPages = 0;
@@ -182,42 +183,43 @@ ShellCommandRunMemMap (
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap");
+ if (ShellCommandLineGetCount (Package) > 1) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version);
- if (Status == EFI_BUFFER_TOO_SMALL){
- Size += SIZE_1KB;
- Descriptors = AllocateZeroPool(Size);
- Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version);
+ Status = gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ Size += SIZE_1KB;
+ Descriptors = AllocateZeroPool (Size);
+ Status = gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
}
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap");
+
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap");
ShellStatus = SHELL_ACCESS_DENIED;
} else {
- ASSERT(Version == EFI_MEMORY_DESCRIPTOR_VERSION);
+ ASSERT (Version == EFI_MEMORY_DESCRIPTOR_VERSION);
- Sfo = ShellCommandLineGetFlag(Package, L"-sfo");
+ Sfo = ShellCommandLineGetFlag (Package, L"-sfo");
if (!Sfo) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_HEAD), gShellDebug1HiiHandle);
} else {
@@ -225,79 +227,80 @@ ShellCommandRunMemMap (
}
for ( Walker = Descriptors
- ; (Walker < (EFI_MEMORY_DESCRIPTOR *) ((UINT8*)Descriptors + Size)) && (Walker != NULL)
- ; Walker = (EFI_MEMORY_DESCRIPTOR *) ((UINT8 *)Walker + ItemSize)
- ){
+ ; (Walker < (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)Descriptors + Size)) && (Walker != NULL)
+ ; Walker = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)Walker + ItemSize)
+ )
+ {
switch (Walker->Type) {
- case EfiReservedMemoryType:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiReservedMemoryType, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ case EfiReservedMemoryType:
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiReservedMemoryType, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
ReservedPages += Walker->NumberOfPages;
break;
case EfiLoaderCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
LoadCodePages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiLoaderData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
LoadDataPages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiBootServicesCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiBootServicesCodeShort:NameEfiBootServicesCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiBootServicesCodeShort : NameEfiBootServicesCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
BSCodePages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiBootServicesData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiBootServicesDataShort:NameEfiBootServicesData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiBootServicesDataShort : NameEfiBootServicesData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
BSDataPages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiRuntimeServicesCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiRuntimeServicesCodeShort:NameEfiRuntimeServicesCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiRuntimeServicesCodeShort : NameEfiRuntimeServicesCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
RTCodePages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiRuntimeServicesData:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiRuntimeServicesDataShort:NameEfiRuntimeServicesData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiRuntimeServicesDataShort : NameEfiRuntimeServicesData, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
RTDataPages += Walker->NumberOfPages;
- TotalPages += Walker->NumberOfPages;
+ TotalPages += Walker->NumberOfPages;
break;
case EfiConventionalMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiConventionalMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiConventionalMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
AvailPages += Walker->NumberOfPages;
TotalPages += Walker->NumberOfPages;
break;
case EfiPersistentMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPersistentMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPersistentMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
PersistentPages += Walker->NumberOfPages;
TotalPages += Walker->NumberOfPages;
break;
case EfiUnusableMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiUnusableMemoryShort:NameEfiUnusableMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiUnusableMemoryShort : NameEfiUnusableMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
UnusableMemoryPages += Walker->NumberOfPages;
break;
case EfiACPIReclaimMemory:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiACPIReclaimMemoryShort:NameEfiACPIReclaimMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
- TotalPages += Walker->NumberOfPages;
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiACPIReclaimMemoryShort : NameEfiACPIReclaimMemory, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ TotalPages += Walker->NumberOfPages;
AcpiReclaimPages += Walker->NumberOfPages;
break;
case EfiACPIMemoryNVS:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiACPIMemoryNVSShort:NameEfiACPIMemoryNVS, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
- TotalPages += Walker->NumberOfPages;
- AcpiNvsPages += Walker->NumberOfPages;
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiACPIMemoryNVSShort : NameEfiACPIMemoryNVS, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ TotalPages += Walker->NumberOfPages;
+ AcpiNvsPages += Walker->NumberOfPages;
break;
case EfiMemoryMappedIO:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiMemoryMappedIOShort:NameEfiMemoryMappedIO, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
- MmioSpacePages += Walker->NumberOfPages;
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiMemoryMappedIOShort : NameEfiMemoryMappedIO, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ MmioSpacePages += Walker->NumberOfPages;
break;
case EfiMemoryMappedIOPortSpace:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo?NameEfiMemoryMappedIOPortSpaceShort:NameEfiMemoryMappedIOPortSpace, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, !Sfo ? NameEfiMemoryMappedIOPortSpaceShort : NameEfiMemoryMappedIOPortSpace, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
MmioPortPages += Walker->NumberOfPages;
break;
case EfiPalCode:
- ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPalCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64(SIZE_4KB,Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
- TotalPages += Walker->NumberOfPages;
+ ShellPrintHiiEx (-1, -1, NULL, (EFI_STRING_ID)(!Sfo ? STRING_TOKEN (STR_MEMMAP_LIST_ITEM) : STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPalCode, Walker->PhysicalStart, Walker->PhysicalStart+MultU64x64 (SIZE_4KB, Walker->NumberOfPages)-1, Walker->NumberOfPages, Walker->Attribute);
+ TotalPages += Walker->NumberOfPages;
PalCodePages += Walker->NumberOfPages;
break;
default:
@@ -308,46 +311,67 @@ ShellCommandRunMemMap (
if (!Sfo) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_ITEM_OTHER), gShellDebug1HiiHandle, Walker->Type, Walker->PhysicalStart, Walker->PhysicalStart + MultU64x64 (SIZE_4KB, Walker->NumberOfPages) - 1, Walker->NumberOfPages, Walker->Attribute);
}
+
TotalPages += Walker->NumberOfPages;
AddMemoryLength (&MemoryList, Walker->Type, Walker->NumberOfPages);
break;
}
}
+
//
// print the summary
//
- ReservedPagesSize = MultU64x64(SIZE_4KB,ReservedPages);
- LoadCodePagesSize = MultU64x64(SIZE_4KB,LoadCodePages);
- LoadDataPagesSize = MultU64x64(SIZE_4KB,LoadDataPages);
- BSCodePagesSize = MultU64x64(SIZE_4KB,BSCodePages);
- BSDataPagesSize = MultU64x64(SIZE_4KB,BSDataPages);
- RTDataPagesSize = MultU64x64(SIZE_4KB,RTDataPages);
- RTCodePagesSize = MultU64x64(SIZE_4KB,RTCodePages);
- AvailPagesSize = MultU64x64(SIZE_4KB,AvailPages);
- TotalPagesSize = MultU64x64(SIZE_4KB,TotalPages);
- AcpiReclaimPagesSize = MultU64x64(SIZE_4KB,AcpiReclaimPages);
- AcpiNvsPagesSize = MultU64x64(SIZE_4KB,AcpiNvsPages);
- MmioSpacePagesSize = MultU64x64(SIZE_4KB,MmioSpacePages);
- MmioPortPagesSize = MultU64x64(SIZE_4KB,MmioPortPages);
- PalCodePagesSize = MultU64x64(SIZE_4KB,PalCodePages);
- PersistentPagesSize = MultU64x64(SIZE_4KB,PersistentPages);
- UnusableMemoryPagesSize = MultU64x64(SIZE_4KB,UnusableMemoryPages);
+ ReservedPagesSize = MultU64x64 (SIZE_4KB, ReservedPages);
+ LoadCodePagesSize = MultU64x64 (SIZE_4KB, LoadCodePages);
+ LoadDataPagesSize = MultU64x64 (SIZE_4KB, LoadDataPages);
+ BSCodePagesSize = MultU64x64 (SIZE_4KB, BSCodePages);
+ BSDataPagesSize = MultU64x64 (SIZE_4KB, BSDataPages);
+ RTDataPagesSize = MultU64x64 (SIZE_4KB, RTDataPages);
+ RTCodePagesSize = MultU64x64 (SIZE_4KB, RTCodePages);
+ AvailPagesSize = MultU64x64 (SIZE_4KB, AvailPages);
+ TotalPagesSize = MultU64x64 (SIZE_4KB, TotalPages);
+ AcpiReclaimPagesSize = MultU64x64 (SIZE_4KB, AcpiReclaimPages);
+ AcpiNvsPagesSize = MultU64x64 (SIZE_4KB, AcpiNvsPages);
+ MmioSpacePagesSize = MultU64x64 (SIZE_4KB, MmioSpacePages);
+ MmioPortPagesSize = MultU64x64 (SIZE_4KB, MmioPortPages);
+ PalCodePagesSize = MultU64x64 (SIZE_4KB, PalCodePages);
+ PersistentPagesSize = MultU64x64 (SIZE_4KB, PersistentPages);
+ UnusableMemoryPagesSize = MultU64x64 (SIZE_4KB, UnusableMemoryPages);
if (!Sfo) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM), gShellDebug1HiiHandle,
- ReservedPages, ReservedPagesSize,
- LoadCodePages, LoadCodePagesSize,
- LoadDataPages, LoadDataPagesSize,
- BSCodePages, BSCodePagesSize,
- BSDataPages, BSDataPagesSize,
- RTCodePages, RTCodePagesSize,
- RTDataPages, RTDataPagesSize,
- AcpiReclaimPages, AcpiReclaimPagesSize,
- AcpiNvsPages, AcpiNvsPagesSize,
- MmioSpacePages, MmioSpacePagesSize,
- MmioPortPages, MmioPortPagesSize,
- PalCodePages, PalCodePagesSize,
- AvailPages, AvailPagesSize,
- PersistentPages, PersistentPagesSize
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_MEMMAP_LIST_SUMM),
+ gShellDebug1HiiHandle,
+ ReservedPages,
+ ReservedPagesSize,
+ LoadCodePages,
+ LoadCodePagesSize,
+ LoadDataPages,
+ LoadDataPagesSize,
+ BSCodePages,
+ BSCodePagesSize,
+ BSDataPages,
+ BSDataPagesSize,
+ RTCodePages,
+ RTCodePagesSize,
+ RTDataPages,
+ RTDataPagesSize,
+ AcpiReclaimPages,
+ AcpiReclaimPagesSize,
+ AcpiNvsPages,
+ AcpiNvsPagesSize,
+ MmioSpacePages,
+ MmioSpacePagesSize,
+ MmioPortPages,
+ MmioPortPagesSize,
+ PalCodePages,
+ PalCodePagesSize,
+ AvailPages,
+ AvailPagesSize,
+ PersistentPages,
+ PersistentPagesSize
);
//
@@ -355,16 +379,34 @@ ShellCommandRunMemMap (
//
for (Link = GetFirstNode (&MemoryList); !IsNull (&MemoryList, Link); Link = GetNextNode (&MemoryList, Link)) {
Entry = BASE_CR (Link, MEMORY_LENGTH_ENTRY, Link);
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM_OTHER), gShellDebug1HiiHandle,
- Entry->Type, Entry->NumberOfPages, MultU64x64 (SIZE_4KB, Entry->NumberOfPages)
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_MEMMAP_LIST_SUMM_OTHER),
+ gShellDebug1HiiHandle,
+ Entry->Type,
+ Entry->NumberOfPages,
+ MultU64x64 (SIZE_4KB, Entry->NumberOfPages)
);
}
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM2), gShellDebug1HiiHandle,
- DivU64x32(MultU64x64(SIZE_4KB,TotalPages), SIZE_1MB), TotalPagesSize
- );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_MEMMAP_LIST_SUMM2),
+ gShellDebug1HiiHandle,
+ DivU64x32 (MultU64x64 (SIZE_4KB, TotalPages), SIZE_1MB),
+ TotalPagesSize
+ );
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM_SFO), gShellDebug1HiiHandle,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_MEMMAP_LIST_SUMM_SFO),
+ gShellDebug1HiiHandle,
TotalPagesSize,
ReservedPagesSize,
BSCodePagesSize,
@@ -381,15 +423,16 @@ ShellCommandRunMemMap (
AcpiNvsPagesSize,
PalCodePagesSize,
PersistentPagesSize
- );
+ );
}
}
}
+
ShellCommandLineFreeVarList (Package);
}
if (Descriptors != NULL) {
- FreePool(Descriptors);
+ FreePool (Descriptors);
}
//
@@ -401,4 +444,3 @@ ShellCommandRunMemMap (
return (ShellStatus);
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
index 4e60baa325..b75e2f4770 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
@@ -21,7 +21,7 @@ typedef enum {
ShellMmPciExpress
} SHELL_MM_ACCESS_TYPE;
-CONST UINT16 mShellMmAccessTypeStr[] = {
+CONST UINT16 mShellMmAccessTypeStr[] = {
STRING_TOKEN (STR_MM_MEM),
STRING_TOKEN (STR_MM_MMIO),
STRING_TOKEN (STR_MM_IO),
@@ -29,24 +29,24 @@ CONST UINT16 mShellMmAccessTypeStr[] = {
STRING_TOKEN (STR_MM_PCIE)
};
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-mmio", TypeFlag},
- {L"-mem", TypeFlag},
- {L"-io", TypeFlag},
- {L"-pci", TypeFlag},
- {L"-pcie", TypeFlag},
- {L"-n", TypeFlag},
- {L"-w", TypeValue},
- {NULL, TypeMax}
- };
-
-CONST UINT64 mShellMmMaxNumber[] = {
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-mmio", TypeFlag },
+ { L"-mem", TypeFlag },
+ { L"-io", TypeFlag },
+ { L"-pci", TypeFlag },
+ { L"-pcie", TypeFlag },
+ { L"-n", TypeFlag },
+ { L"-w", TypeValue },
+ { NULL, TypeMax }
+};
+
+CONST UINT64 mShellMmMaxNumber[] = {
0, MAX_UINT8, MAX_UINT16, 0, MAX_UINT32, 0, 0, 0, MAX_UINT64
};
-CONST EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH mShellMmRootBridgeIoWidth[] = {
+CONST EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH mShellMmRootBridgeIoWidth[] = {
0, EfiPciWidthUint8, EfiPciWidthUint16, 0, EfiPciWidthUint32, 0, 0, 0, EfiPciWidthUint64
};
-CONST EFI_CPU_IO_PROTOCOL_WIDTH mShellMmCpuIoWidth[] = {
+CONST EFI_CPU_IO_PROTOCOL_WIDTH mShellMmCpuIoWidth[] = {
0, EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, 0, EfiCpuIoWidthUint32, 0, 0, 0, EfiCpuIoWidthUint64
};
@@ -64,13 +64,13 @@ CONST EFI_CPU_IO_PROTOCOL_WIDTH mShellMmCpuIoWidth[] = {
**/
VOID
ShellMmDecodePciAddress (
- IN BOOLEAN PciFormat,
- IN UINT64 Address,
- OUT UINT32 *Segment,
- OUT UINT8 *Bus,
- OUT UINT8 *Device OPTIONAL,
- OUT UINT8 *Function OPTIONAL,
- OUT UINT32 *Register OPTIONAL
+ IN BOOLEAN PciFormat,
+ IN UINT64 Address,
+ OUT UINT32 *Segment,
+ OUT UINT8 *Bus,
+ OUT UINT8 *Device OPTIONAL,
+ OUT UINT8 *Function OPTIONAL,
+ OUT UINT32 *Register OPTIONAL
)
{
if (PciFormat) {
@@ -78,33 +78,37 @@ ShellMmDecodePciAddress (
// PCI Configuration Space.The address will have the format ssssbbddffrr,
// where ssss = Segment, bb = Bus, dd = Device, ff = Function and rr = Register.
//
- *Segment = (UINT32) (RShiftU64 (Address, 32) & 0xFFFF);
- *Bus = (UINT8) (((UINT32) Address) >> 24);
+ *Segment = (UINT32)(RShiftU64 (Address, 32) & 0xFFFF);
+ *Bus = (UINT8)(((UINT32)Address) >> 24);
if (Device != NULL) {
- *Device = (UINT8) (((UINT32) Address) >> 16);
+ *Device = (UINT8)(((UINT32)Address) >> 16);
}
+
if (Function != NULL) {
- *Function = (UINT8) (((UINT32) Address) >> 8);
+ *Function = (UINT8)(((UINT32)Address) >> 8);
}
+
if (Register != NULL) {
- *Register = (UINT8) Address;
+ *Register = (UINT8)Address;
}
} else {
//
// PCI Express Configuration Space.The address will have the format ssssssbbddffrrr,
// where ssss = Segment, bb = Bus, dd = Device, ff = Function and rrr = Register.
//
- *Segment = (UINT32) (RShiftU64 (Address, 36) & 0xFFFF);
- *Bus = (UINT8) RShiftU64 (Address, 28);
+ *Segment = (UINT32)(RShiftU64 (Address, 36) & 0xFFFF);
+ *Bus = (UINT8)RShiftU64 (Address, 28);
if (Device != NULL) {
- *Device = (UINT8) (((UINT32) Address) >> 20);
+ *Device = (UINT8)(((UINT32)Address) >> 20);
}
+
if (Function != NULL) {
- *Function = (UINT8) (((UINT32) Address) >> 12);
+ *Function = (UINT8)(((UINT32)Address) >> 12);
}
+
if (Register != NULL) {
- *Register = (UINT32) (Address & 0xFFF);
+ *Register = (UINT32)(Address & 0xFFF);
}
}
}
@@ -122,80 +126,90 @@ ShellMmDecodePciAddress (
**/
VOID
ShellMmAccess (
- IN SHELL_MM_ACCESS_TYPE AccessType,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
- IN EFI_CPU_IO2_PROTOCOL *CpuIo,
- IN BOOLEAN Read,
- IN UINT64 Address,
- IN UINTN Size,
- IN OUT VOID *Buffer
+ IN SHELL_MM_ACCESS_TYPE AccessType,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
+ IN EFI_CPU_IO2_PROTOCOL *CpuIo,
+ IN BOOLEAN Read,
+ IN UINT64 Address,
+ IN UINTN Size,
+ IN OUT VOID *Buffer
)
{
- EFI_STATUS Status;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM RootBridgeIoMem;
- EFI_CPU_IO_PROTOCOL_IO_MEM CpuIoMem;
- UINT32 Segment;
- UINT8 Bus;
- UINT8 Device;
- UINT8 Function;
- UINT32 Register;
+ EFI_STATUS Status;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM RootBridgeIoMem;
+ EFI_CPU_IO_PROTOCOL_IO_MEM CpuIoMem;
+ UINT32 Segment;
+ UINT8 Bus;
+ UINT8 Device;
+ UINT8 Function;
+ UINT32 Register;
if (AccessType == ShellMmMemory) {
if (Read) {
- CopyMem (Buffer, (VOID *) (UINTN) Address, Size);
+ CopyMem (Buffer, (VOID *)(UINTN)Address, Size);
} else {
- CopyMem ((VOID *) (UINTN) Address, Buffer, Size);
+ CopyMem ((VOID *)(UINTN)Address, Buffer, Size);
}
} else {
RootBridgeIoMem = NULL;
- CpuIoMem = NULL;
+ CpuIoMem = NULL;
switch (AccessType) {
- case ShellMmPci:
- case ShellMmPciExpress:
- ASSERT (PciRootBridgeIo != NULL);
- ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci), Address, &Segment, &Bus, &Device, &Function, &Register);
- if (Read) {
- Status = PciRootBridgeIo->Pci.Read (
- PciRootBridgeIo, mShellMmRootBridgeIoWidth[Size],
- EFI_PCI_ADDRESS (Bus, Device, Function, Register),
- 1, Buffer
- );
- } else {
- Status = PciRootBridgeIo->Pci.Write (
- PciRootBridgeIo, mShellMmRootBridgeIoWidth[Size],
- EFI_PCI_ADDRESS (Bus, Device, Function, Register),
- 1, Buffer
- );
- }
- ASSERT_EFI_ERROR (Status);
- return;
+ case ShellMmPci:
+ case ShellMmPciExpress:
+ ASSERT (PciRootBridgeIo != NULL);
+ ShellMmDecodePciAddress ((BOOLEAN)(AccessType == ShellMmPci), Address, &Segment, &Bus, &Device, &Function, &Register);
+ if (Read) {
+ Status = PciRootBridgeIo->Pci.Read (
+ PciRootBridgeIo,
+ mShellMmRootBridgeIoWidth[Size],
+ EFI_PCI_ADDRESS (Bus, Device, Function, Register),
+ 1,
+ Buffer
+ );
+ } else {
+ Status = PciRootBridgeIo->Pci.Write (
+ PciRootBridgeIo,
+ mShellMmRootBridgeIoWidth[Size],
+ EFI_PCI_ADDRESS (Bus, Device, Function, Register),
+ 1,
+ Buffer
+ );
+ }
- case ShellMmMemoryMappedIo:
- if (PciRootBridgeIo != NULL) {
- RootBridgeIoMem = Read ? PciRootBridgeIo->Mem.Read : PciRootBridgeIo->Mem.Write;
- }
- if (CpuIo != NULL) {
- CpuIoMem = Read ? CpuIo->Mem.Read : CpuIo->Mem.Write;
- }
- break;
+ ASSERT_EFI_ERROR (Status);
+ return;
- case ShellMmIo:
- if (PciRootBridgeIo != NULL) {
- RootBridgeIoMem = Read ? PciRootBridgeIo->Io.Read : PciRootBridgeIo->Io.Write;
- }
- if (CpuIo != NULL) {
- CpuIoMem = Read ? CpuIo->Io.Read : CpuIo->Io.Write;
- }
- break;
- default:
- ASSERT (FALSE);
- break;
+ case ShellMmMemoryMappedIo:
+ if (PciRootBridgeIo != NULL) {
+ RootBridgeIoMem = Read ? PciRootBridgeIo->Mem.Read : PciRootBridgeIo->Mem.Write;
+ }
+
+ if (CpuIo != NULL) {
+ CpuIoMem = Read ? CpuIo->Mem.Read : CpuIo->Mem.Write;
+ }
+
+ break;
+
+ case ShellMmIo:
+ if (PciRootBridgeIo != NULL) {
+ RootBridgeIoMem = Read ? PciRootBridgeIo->Io.Read : PciRootBridgeIo->Io.Write;
+ }
+
+ if (CpuIo != NULL) {
+ CpuIoMem = Read ? CpuIo->Io.Read : CpuIo->Io.Write;
+ }
+
+ break;
+ default:
+ ASSERT (FALSE);
+ break;
}
Status = EFI_UNSUPPORTED;
if (RootBridgeIoMem != NULL) {
Status = RootBridgeIoMem (PciRootBridgeIo, mShellMmRootBridgeIoWidth[Size], Address, 1, Buffer);
}
+
if (EFI_ERROR (Status) && (CpuIoMem != NULL)) {
Status = CpuIoMem (CpuIo, mShellMmCpuIoWidth[Size], Address, 1, Buffer);
}
@@ -203,71 +217,79 @@ ShellMmAccess (
if (EFI_ERROR (Status)) {
if (AccessType == ShellMmIo) {
switch (Size) {
- case 1:
- if (Read) {
- *(UINT8 *) Buffer = IoRead8 ((UINTN) Address);
- } else {
- IoWrite8 ((UINTN) Address, *(UINT8 *) Buffer);
- }
- break;
- case 2:
- if (Read) {
- *(UINT16 *) Buffer = IoRead16 ((UINTN) Address);
- } else {
- IoWrite16 ((UINTN) Address, *(UINT16 *) Buffer);
- }
- break;
- case 4:
- if (Read) {
- *(UINT32 *) Buffer = IoRead32 ((UINTN) Address);
- } else {
- IoWrite32 ((UINTN) Address, *(UINT32 *) Buffer);
- }
- break;
- case 8:
- if (Read) {
- *(UINT64 *) Buffer = IoRead64 ((UINTN) Address);
- } else {
- IoWrite64 ((UINTN) Address, *(UINT64 *) Buffer);
- }
- break;
- default:
- ASSERT (FALSE);
- break;
+ case 1:
+ if (Read) {
+ *(UINT8 *)Buffer = IoRead8 ((UINTN)Address);
+ } else {
+ IoWrite8 ((UINTN)Address, *(UINT8 *)Buffer);
+ }
+
+ break;
+ case 2:
+ if (Read) {
+ *(UINT16 *)Buffer = IoRead16 ((UINTN)Address);
+ } else {
+ IoWrite16 ((UINTN)Address, *(UINT16 *)Buffer);
+ }
+
+ break;
+ case 4:
+ if (Read) {
+ *(UINT32 *)Buffer = IoRead32 ((UINTN)Address);
+ } else {
+ IoWrite32 ((UINTN)Address, *(UINT32 *)Buffer);
+ }
+
+ break;
+ case 8:
+ if (Read) {
+ *(UINT64 *)Buffer = IoRead64 ((UINTN)Address);
+ } else {
+ IoWrite64 ((UINTN)Address, *(UINT64 *)Buffer);
+ }
+
+ break;
+ default:
+ ASSERT (FALSE);
+ break;
}
} else {
switch (Size) {
- case 1:
- if (Read) {
- *(UINT8 *) Buffer = MmioRead8 ((UINTN) Address);
- } else {
- MmioWrite8 ((UINTN) Address, *(UINT8 *) Buffer);
- }
- break;
- case 2:
- if (Read) {
- *(UINT16 *) Buffer = MmioRead16 ((UINTN) Address);
- } else {
- MmioWrite16 ((UINTN) Address, *(UINT16 *) Buffer);
- }
- break;
- case 4:
- if (Read) {
- *(UINT32 *) Buffer = MmioRead32 ((UINTN) Address);
- } else {
- MmioWrite32 ((UINTN) Address, *(UINT32 *) Buffer);
- }
- break;
- case 8:
- if (Read) {
- *(UINT64 *) Buffer = MmioRead64 ((UINTN) Address);
- } else {
- MmioWrite64 ((UINTN) Address, *(UINT64 *) Buffer);
- }
- break;
- default:
- ASSERT (FALSE);
- break;
+ case 1:
+ if (Read) {
+ *(UINT8 *)Buffer = MmioRead8 ((UINTN)Address);
+ } else {
+ MmioWrite8 ((UINTN)Address, *(UINT8 *)Buffer);
+ }
+
+ break;
+ case 2:
+ if (Read) {
+ *(UINT16 *)Buffer = MmioRead16 ((UINTN)Address);
+ } else {
+ MmioWrite16 ((UINTN)Address, *(UINT16 *)Buffer);
+ }
+
+ break;
+ case 4:
+ if (Read) {
+ *(UINT32 *)Buffer = MmioRead32 ((UINTN)Address);
+ } else {
+ MmioWrite32 ((UINTN)Address, *(UINT32 *)Buffer);
+ }
+
+ break;
+ case 8:
+ if (Read) {
+ *(UINT64 *)Buffer = MmioRead64 ((UINTN)Address);
+ } else {
+ MmioWrite64 ((UINTN)Address, *(UINT64 *)Buffer);
+ }
+
+ break;
+ default:
+ ASSERT (FALSE);
+ break;
}
}
}
@@ -289,35 +311,35 @@ ShellMmAccess (
**/
BOOLEAN
ShellMmLocateIoProtocol (
- IN SHELL_MM_ACCESS_TYPE AccessType,
- IN UINT64 Address,
- OUT EFI_CPU_IO2_PROTOCOL **CpuIo,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **PciRootBridgeIo
+ IN SHELL_MM_ACCESS_TYPE AccessType,
+ IN UINT64 Address,
+ OUT EFI_CPU_IO2_PROTOCOL **CpuIo,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **PciRootBridgeIo
)
{
- EFI_STATUS Status;
- UINTN Index;
- UINTN HandleCount;
- EFI_HANDLE *HandleBuffer;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *Io;
- UINT32 Segment;
- UINT8 Bus;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
-
- Status = gBS->LocateProtocol (&gEfiCpuIo2ProtocolGuid, NULL, (VOID **) CpuIo);
+ EFI_STATUS Status;
+ UINTN Index;
+ UINTN HandleCount;
+ EFI_HANDLE *HandleBuffer;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *Io;
+ UINT32 Segment;
+ UINT8 Bus;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
+
+ Status = gBS->LocateProtocol (&gEfiCpuIo2ProtocolGuid, NULL, (VOID **)CpuIo);
if (EFI_ERROR (Status)) {
*CpuIo = NULL;
}
*PciRootBridgeIo = NULL;
HandleBuffer = NULL;
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &HandleCount,
- &HandleBuffer
- );
+ Status = gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiPciRootBridgeIoProtocolGuid,
+ NULL,
+ &HandleCount,
+ &HandleBuffer
+ );
if (EFI_ERROR (Status) || (HandleCount == 0) || (HandleBuffer == NULL)) {
return FALSE;
}
@@ -325,7 +347,7 @@ ShellMmLocateIoProtocol (
Segment = 0;
Bus = 0;
if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) {
- ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci), Address, &Segment, &Bus, NULL, NULL, NULL);
+ ShellMmDecodePciAddress ((BOOLEAN)(AccessType == ShellMmPci), Address, &Segment, &Bus, NULL, NULL, NULL);
}
//
@@ -335,7 +357,7 @@ ShellMmLocateIoProtocol (
Status = gBS->HandleProtocol (
HandleBuffer[Index],
&gEfiPciRootBridgeIoProtocolGuid,
- (VOID *) &Io
+ (VOID *)&Io
);
if (EFI_ERROR (Status)) {
continue;
@@ -343,8 +365,9 @@ ShellMmLocateIoProtocol (
if ((((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) && (Io->SegmentNumber == Segment)) ||
((AccessType == ShellMmIo) || (AccessType == ShellMmMemoryMappedIo))
- ) {
- Status = Io->Configuration (Io, (VOID **) &Descriptors);
+ )
+ {
+ Status = Io->Configuration (Io, (VOID **)&Descriptors);
if (!EFI_ERROR (Status)) {
while (Descriptors->Desc != ACPI_END_TAG_DESCRIPTOR) {
//
@@ -353,25 +376,29 @@ ShellMmLocateIoProtocol (
if ((Descriptors->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) &&
((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) &&
((Bus >= Descriptors->AddrRangeMin) && (Bus <= Descriptors->AddrRangeMax))
- ) {
+ )
+ {
*PciRootBridgeIo = Io;
break;
- //
- // Compare the address range for MMIO/IO access
- //
+ //
+ // Compare the address range for MMIO/IO access
+ //
} else if ((((Descriptors->ResType == ACPI_ADDRESS_SPACE_TYPE_IO) && (AccessType == ShellMmIo)) ||
((Descriptors->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM) && (AccessType == ShellMmMemoryMappedIo))
) && ((Address >= Descriptors->AddrRangeMin) && (Address <= Descriptors->AddrRangeMax))
- ) {
+ )
+ {
*PciRootBridgeIo = Io;
break;
}
+
Descriptors++;
}
}
}
}
+
if (HandleBuffer != NULL) {
FreePool (HandleBuffer);
}
@@ -392,37 +419,37 @@ ShellCommandRunMm (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
- EFI_CPU_IO2_PROTOCOL *CpuIo;
- UINT64 Address;
- UINT64 Value;
- SHELL_MM_ACCESS_TYPE AccessType;
- UINT64 Buffer;
- UINTN Index;
- UINTN Size;
- BOOLEAN Complete;
- CHAR16 *InputStr;
- BOOLEAN Interactive;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
- BOOLEAN HasPciRootBridgeIo;
-
- Value = 0;
- Address = 0;
+ EFI_STATUS Status;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
+ EFI_CPU_IO2_PROTOCOL *CpuIo;
+ UINT64 Address;
+ UINT64 Value;
+ SHELL_MM_ACCESS_TYPE AccessType;
+ UINT64 Buffer;
+ UINTN Index;
+ UINTN Size;
+ BOOLEAN Complete;
+ CHAR16 *InputStr;
+ BOOLEAN Interactive;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *Temp;
+ BOOLEAN HasPciRootBridgeIo;
+
+ Value = 0;
+ Address = 0;
ShellStatus = SHELL_SUCCESS;
- InputStr = NULL;
- Size = 1;
- AccessType = ShellMmMemory;
+ InputStr = NULL;
+ Size = 1;
+ AccessType = ShellMmMemory;
//
// Parse arguments
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR (Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mm", ProblemParam);
FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -439,37 +466,40 @@ ShellCommandRunMm (
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mm");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
- } else if (ShellCommandLineGetFlag (Package, L"-w") && ShellCommandLineGetValue (Package, L"-w") == NULL) {
+ } else if (ShellCommandLineGetFlag (Package, L"-w") && (ShellCommandLineGetValue (Package, L"-w") == NULL)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"mm", L"-w");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
} else {
if (ShellCommandLineGetFlag (Package, L"-mmio")) {
AccessType = ShellMmMemoryMappedIo;
- if (ShellCommandLineGetFlag (Package, L"-mem")
- || ShellCommandLineGetFlag (Package, L"-io")
- || ShellCommandLineGetFlag (Package, L"-pci")
- || ShellCommandLineGetFlag (Package, L"-pcie")
- ) {
+ if ( ShellCommandLineGetFlag (Package, L"-mem")
+ || ShellCommandLineGetFlag (Package, L"-io")
+ || ShellCommandLineGetFlag (Package, L"-pci")
+ || ShellCommandLineGetFlag (Package, L"-pcie")
+ )
+ {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mm");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
} else if (ShellCommandLineGetFlag (Package, L"-mem")) {
AccessType = ShellMmMemory;
- if (ShellCommandLineGetFlag (Package, L"-io")
- || ShellCommandLineGetFlag (Package, L"-pci")
- || ShellCommandLineGetFlag (Package, L"-pcie")
- ) {
+ if ( ShellCommandLineGetFlag (Package, L"-io")
+ || ShellCommandLineGetFlag (Package, L"-pci")
+ || ShellCommandLineGetFlag (Package, L"-pcie")
+ )
+ {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mm");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
} else if (ShellCommandLineGetFlag (Package, L"-io")) {
AccessType = ShellMmIo;
- if (ShellCommandLineGetFlag (Package, L"-pci")
- || ShellCommandLineGetFlag (Package, L"-pcie")
- ) {
+ if ( ShellCommandLineGetFlag (Package, L"-pci")
+ || ShellCommandLineGetFlag (Package, L"-pcie")
+ )
+ {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mm");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
@@ -477,7 +507,8 @@ ShellCommandRunMm (
} else if (ShellCommandLineGetFlag (Package, L"-pci")) {
AccessType = ShellMmPci;
if (ShellCommandLineGetFlag (Package, L"-pcie")
- ) {
+ )
+ {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mm");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
@@ -499,13 +530,14 @@ ShellCommandRunMm (
if (Temp != NULL) {
Size = ShellStrToUintn (Temp);
}
+
if ((Size != 1) && (Size != 2) && (Size != 4) && (Size != 8)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"mm", Temp, L"-w");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- Temp = ShellCommandLineGetRawValue (Package, 1);
+ Temp = ShellCommandLineGetRawValue (Package, 1);
Status = ShellConvertStringToUint64 (Temp, &Address, TRUE, FALSE);
if (EFI_ERROR (Status)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mm", Temp);
@@ -529,6 +561,7 @@ ShellCommandRunMm (
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
+
if (PciRootBridgeIo == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE_ADDRESS_RANGE), gShellDebug1HiiHandle, L"mm", Address);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -565,11 +598,13 @@ ShellCommandRunMm (
if (!gEfiShellProtocol->BatchIsActive ()) {
ShellPrintHiiEx (-1, -1, NULL, mShellMmAccessTypeStr[AccessType], gShellDebug1HiiHandle);
}
+
ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, TRUE, Address, Size, &Buffer);
if (!gEfiShellProtocol->BatchIsActive ()) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS), gShellDebug1HiiHandle, Address);
}
+
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_BUF), gShellDebug1HiiHandle, Size * 2, Buffer & mShellMmMaxNumber[Size]);
ShellPrintEx (-1, -1, L"\r\n");
goto Done;
@@ -592,20 +627,23 @@ ShellCommandRunMm (
FreePool (InputStr);
InputStr = NULL;
}
- ShellPromptForResponse (ShellPromptResponseTypeFreeform, NULL, (VOID**) &InputStr);
+
+ ShellPromptForResponse (ShellPromptResponseTypeFreeform, NULL, (VOID **)&InputStr);
if (InputStr != NULL) {
//
// skip space characters
//
- for (Index = 0; InputStr[Index] == ' '; Index++);
+ for (Index = 0; InputStr[Index] == ' '; Index++) {
+ }
if (InputStr[Index] != CHAR_NULL) {
if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || (InputStr[Index] == 'Q')) {
Complete = TRUE;
} else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index, &Buffer, TRUE, TRUE)) &&
(Buffer <= mShellMmMaxNumber[Size])
- ) {
+ )
+ {
ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address, Size, &Buffer);
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), gShellDebug1HiiHandle, L"mm");
@@ -618,14 +656,17 @@ ShellCommandRunMm (
ShellPrintEx (-1, -1, L"\r\n");
} while (!Complete);
}
+
ASSERT (ShellStatus == SHELL_SUCCESS);
Done:
if (InputStr != NULL) {
FreePool (InputStr);
}
+
if (Package != NULL) {
ShellCommandLineFreeVarList (Package);
}
+
return ShellStatus;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c
index 68e775d78d..d907ddd415 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c
@@ -22,99 +22,104 @@ ShellCommandRunMode (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINTN NewCol;
- UINTN NewRow;
- UINTN Col;
- UINTN Row;
- CONST CHAR16 *Temp;
- BOOLEAN Done;
- INT32 LoopVar;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ UINTN NewCol;
+ UINTN NewRow;
+ UINTN Col;
+ UINTN Row;
+ CONST CHAR16 *Temp;
+ BOOLEAN Done;
+ INT32 LoopVar;
+
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode");
+ if (ShellCommandLineGetCount (Package) > 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode");
+ } else if (ShellCommandLineGetCount (Package) == 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) == 3) {
- Temp = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
+ } else if (ShellCommandLineGetCount (Package) == 3) {
+ Temp = ShellCommandLineGetRawValue (Package, 1);
+ if (!ShellIsHexOrDecimalNumber (Temp, FALSE, FALSE)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- NewCol = ShellStrToUintn(Temp);
- Temp = ShellCommandLineGetRawValue(Package, 2);
- if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
+
+ NewCol = ShellStrToUintn (Temp);
+ Temp = ShellCommandLineGetRawValue (Package, 2);
+ if (!ShellIsHexOrDecimalNumber (Temp, FALSE, FALSE)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- NewRow = ShellStrToUintn(Temp);
- for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = gST->ConOut->QueryMode(gST->ConOut, LoopVar, &Col, &Row);
- if (EFI_ERROR(Status)) {
+ NewRow = ShellStrToUintn (Temp);
+
+ for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS; LoopVar++) {
+ Status = gST->ConOut->QueryMode (gST->ConOut, LoopVar, &Col, &Row);
+ if (EFI_ERROR (Status)) {
continue;
}
- if (Col == NewCol && Row == NewRow) {
- Status = gST->ConOut->SetMode(gST->ConOut, LoopVar);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode");
+
+ if ((Col == NewCol) && (Row == NewRow)) {
+ Status = gST->ConOut->SetMode (gST->ConOut, LoopVar);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_DEVICE_ERROR;
} else {
// worked fine...
Done = TRUE;
}
+
break;
}
}
if (!Done) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER;
}
-
- } else if (ShellCommandLineGetCount(Package) == 1) {
+ } else if (ShellCommandLineGetCount (Package) == 1) {
//
// print out valid
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_HEAD), gShellDebug1HiiHandle);
- for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = gST->ConOut->QueryMode(gST->ConOut, LoopVar, &Col, &Row);
- if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_HEAD), gShellDebug1HiiHandle);
+ for (LoopVar = 0, Done = FALSE; LoopVar < gST->ConOut->Mode->MaxMode && ShellStatus == SHELL_SUCCESS; LoopVar++) {
+ Status = gST->ConOut->QueryMode (gST->ConOut, LoopVar, &Col, &Row);
+ if (EFI_ERROR (Status)) {
continue;
}
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_ITEM), gShellDebug1HiiHandle, Col, Row, LoopVar == gST->ConOut->Mode->Mode?L'*':L' ');
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MODE_LIST_ITEM), gShellDebug1HiiHandle, Col, Row, LoopVar == gST->ConOut->Mode->Mode ? L'*' : L' ');
}
}
+
ShellCommandLineFreeVarList (Package);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
index 1e5dc75e27..7b11f49d0d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
@@ -19,9 +19,9 @@
// Printable strings for Pci class code
//
typedef struct {
- CHAR16 *BaseClass; // Pointer to the PCI base class string
- CHAR16 *SubClass; // Pointer to the PCI sub class string
- CHAR16 *PIFClass; // Pointer to the PCI programming interface string
+ CHAR16 *BaseClass; // Pointer to the PCI base class string
+ CHAR16 *SubClass; // Pointer to the PCI sub class string
+ CHAR16 *PIFClass; // Pointer to the PCI programming interface string
} PCI_CLASS_STRINGS;
//
@@ -29,65 +29,65 @@ typedef struct {
// class
//
typedef struct PCI_CLASS_ENTRY_TAG {
- UINT8 Code; // Class, subclass or I/F code
- CHAR16 *DescText; // Description string
- struct PCI_CLASS_ENTRY_TAG *LowerLevelClass; // Subclass or I/F if any
+ UINT8 Code; // Class, subclass or I/F code
+ CHAR16 *DescText; // Description string
+ struct PCI_CLASS_ENTRY_TAG *LowerLevelClass; // Subclass or I/F if any
} PCI_CLASS_ENTRY;
//
// Declarations of entries which contain printable strings for class codes
// in PCI configuration space
//
-PCI_CLASS_ENTRY PCIBlankEntry[];
-PCI_CLASS_ENTRY PCISubClass_00[];
-PCI_CLASS_ENTRY PCISubClass_01[];
-PCI_CLASS_ENTRY PCISubClass_02[];
-PCI_CLASS_ENTRY PCISubClass_03[];
-PCI_CLASS_ENTRY PCISubClass_04[];
-PCI_CLASS_ENTRY PCISubClass_05[];
-PCI_CLASS_ENTRY PCISubClass_06[];
-PCI_CLASS_ENTRY PCISubClass_07[];
-PCI_CLASS_ENTRY PCISubClass_08[];
-PCI_CLASS_ENTRY PCISubClass_09[];
-PCI_CLASS_ENTRY PCISubClass_0a[];
-PCI_CLASS_ENTRY PCISubClass_0b[];
-PCI_CLASS_ENTRY PCISubClass_0c[];
-PCI_CLASS_ENTRY PCISubClass_0d[];
-PCI_CLASS_ENTRY PCISubClass_0e[];
-PCI_CLASS_ENTRY PCISubClass_0f[];
-PCI_CLASS_ENTRY PCISubClass_10[];
-PCI_CLASS_ENTRY PCISubClass_11[];
-PCI_CLASS_ENTRY PCISubClass_12[];
-PCI_CLASS_ENTRY PCISubClass_13[];
-PCI_CLASS_ENTRY PCIPIFClass_0100[];
-PCI_CLASS_ENTRY PCIPIFClass_0101[];
-PCI_CLASS_ENTRY PCIPIFClass_0105[];
-PCI_CLASS_ENTRY PCIPIFClass_0106[];
-PCI_CLASS_ENTRY PCIPIFClass_0107[];
-PCI_CLASS_ENTRY PCIPIFClass_0108[];
-PCI_CLASS_ENTRY PCIPIFClass_0109[];
-PCI_CLASS_ENTRY PCIPIFClass_0300[];
-PCI_CLASS_ENTRY PCIPIFClass_0604[];
-PCI_CLASS_ENTRY PCIPIFClass_0609[];
-PCI_CLASS_ENTRY PCIPIFClass_060b[];
-PCI_CLASS_ENTRY PCIPIFClass_0700[];
-PCI_CLASS_ENTRY PCIPIFClass_0701[];
-PCI_CLASS_ENTRY PCIPIFClass_0703[];
-PCI_CLASS_ENTRY PCIPIFClass_0800[];
-PCI_CLASS_ENTRY PCIPIFClass_0801[];
-PCI_CLASS_ENTRY PCIPIFClass_0802[];
-PCI_CLASS_ENTRY PCIPIFClass_0803[];
-PCI_CLASS_ENTRY PCIPIFClass_0904[];
-PCI_CLASS_ENTRY PCIPIFClass_0c00[];
-PCI_CLASS_ENTRY PCIPIFClass_0c03[];
-PCI_CLASS_ENTRY PCIPIFClass_0c07[];
-PCI_CLASS_ENTRY PCIPIFClass_0d01[];
-PCI_CLASS_ENTRY PCIPIFClass_0e00[];
+PCI_CLASS_ENTRY PCIBlankEntry[];
+PCI_CLASS_ENTRY PCISubClass_00[];
+PCI_CLASS_ENTRY PCISubClass_01[];
+PCI_CLASS_ENTRY PCISubClass_02[];
+PCI_CLASS_ENTRY PCISubClass_03[];
+PCI_CLASS_ENTRY PCISubClass_04[];
+PCI_CLASS_ENTRY PCISubClass_05[];
+PCI_CLASS_ENTRY PCISubClass_06[];
+PCI_CLASS_ENTRY PCISubClass_07[];
+PCI_CLASS_ENTRY PCISubClass_08[];
+PCI_CLASS_ENTRY PCISubClass_09[];
+PCI_CLASS_ENTRY PCISubClass_0a[];
+PCI_CLASS_ENTRY PCISubClass_0b[];
+PCI_CLASS_ENTRY PCISubClass_0c[];
+PCI_CLASS_ENTRY PCISubClass_0d[];
+PCI_CLASS_ENTRY PCISubClass_0e[];
+PCI_CLASS_ENTRY PCISubClass_0f[];
+PCI_CLASS_ENTRY PCISubClass_10[];
+PCI_CLASS_ENTRY PCISubClass_11[];
+PCI_CLASS_ENTRY PCISubClass_12[];
+PCI_CLASS_ENTRY PCISubClass_13[];
+PCI_CLASS_ENTRY PCIPIFClass_0100[];
+PCI_CLASS_ENTRY PCIPIFClass_0101[];
+PCI_CLASS_ENTRY PCIPIFClass_0105[];
+PCI_CLASS_ENTRY PCIPIFClass_0106[];
+PCI_CLASS_ENTRY PCIPIFClass_0107[];
+PCI_CLASS_ENTRY PCIPIFClass_0108[];
+PCI_CLASS_ENTRY PCIPIFClass_0109[];
+PCI_CLASS_ENTRY PCIPIFClass_0300[];
+PCI_CLASS_ENTRY PCIPIFClass_0604[];
+PCI_CLASS_ENTRY PCIPIFClass_0609[];
+PCI_CLASS_ENTRY PCIPIFClass_060b[];
+PCI_CLASS_ENTRY PCIPIFClass_0700[];
+PCI_CLASS_ENTRY PCIPIFClass_0701[];
+PCI_CLASS_ENTRY PCIPIFClass_0703[];
+PCI_CLASS_ENTRY PCIPIFClass_0800[];
+PCI_CLASS_ENTRY PCIPIFClass_0801[];
+PCI_CLASS_ENTRY PCIPIFClass_0802[];
+PCI_CLASS_ENTRY PCIPIFClass_0803[];
+PCI_CLASS_ENTRY PCIPIFClass_0904[];
+PCI_CLASS_ENTRY PCIPIFClass_0c00[];
+PCI_CLASS_ENTRY PCIPIFClass_0c03[];
+PCI_CLASS_ENTRY PCIPIFClass_0c07[];
+PCI_CLASS_ENTRY PCIPIFClass_0d01[];
+PCI_CLASS_ENTRY PCIPIFClass_0e00[];
//
// Base class strings entries
//
-PCI_CLASS_ENTRY gClassStringList[] = {
+PCI_CLASS_ENTRY gClassStringList[] = {
{
0x00,
L"Pre 2.0 device",
@@ -196,14 +196,14 @@ PCI_CLASS_ENTRY gClassStringList[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
//
// Subclass strings entries
//
-PCI_CLASS_ENTRY PCIBlankEntry[] = {
+PCI_CLASS_ENTRY PCIBlankEntry[] = {
{
0x00,
L"",
@@ -212,11 +212,11 @@ PCI_CLASS_ENTRY PCIBlankEntry[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_00[] = {
+PCI_CLASS_ENTRY PCISubClass_00[] = {
{
0x00,
L"All devices other than VGA",
@@ -230,11 +230,11 @@ PCI_CLASS_ENTRY PCISubClass_00[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_01[] = {
+PCI_CLASS_ENTRY PCISubClass_01[] = {
{
0x00,
L"SCSI",
@@ -293,11 +293,11 @@ PCI_CLASS_ENTRY PCISubClass_01[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_02[] = {
+PCI_CLASS_ENTRY PCISubClass_02[] = {
{
0x00,
L"Ethernet controller",
@@ -346,11 +346,11 @@ PCI_CLASS_ENTRY PCISubClass_02[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_03[] = {
+PCI_CLASS_ENTRY PCISubClass_03[] = {
{
0x00,
L"VGA/8514 controller",
@@ -374,11 +374,11 @@ PCI_CLASS_ENTRY PCISubClass_03[] = {
{
0x00,
NULL,
- /* null string ends the list */PCIBlankEntry
+ /* null string ends the list */ PCIBlankEntry
}
};
-PCI_CLASS_ENTRY PCISubClass_04[] = {
+PCI_CLASS_ENTRY PCISubClass_04[] = {
{
0x00,
L"Video device",
@@ -407,11 +407,11 @@ PCI_CLASS_ENTRY PCISubClass_04[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_05[] = {
+PCI_CLASS_ENTRY PCISubClass_05[] = {
{
0x00,
L"RAM memory controller",
@@ -430,11 +430,11 @@ PCI_CLASS_ENTRY PCISubClass_05[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_06[] = {
+PCI_CLASS_ENTRY PCISubClass_06[] = {
{
0x00,
L"Host/PCI bridge",
@@ -503,11 +503,11 @@ PCI_CLASS_ENTRY PCISubClass_06[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_07[] = {
+PCI_CLASS_ENTRY PCISubClass_07[] = {
{
0x00,
L"Serial controller",
@@ -546,11 +546,11 @@ PCI_CLASS_ENTRY PCISubClass_07[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_08[] = {
+PCI_CLASS_ENTRY PCISubClass_08[] = {
{
0x00,
L"PIC",
@@ -599,11 +599,11 @@ PCI_CLASS_ENTRY PCISubClass_08[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_09[] = {
+PCI_CLASS_ENTRY PCISubClass_09[] = {
{
0x00,
L"Keyboard controller",
@@ -637,11 +637,11 @@ PCI_CLASS_ENTRY PCISubClass_09[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0a[] = {
+PCI_CLASS_ENTRY PCISubClass_0a[] = {
{
0x00,
L"Generic docking station",
@@ -655,11 +655,11 @@ PCI_CLASS_ENTRY PCISubClass_0a[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0b[] = {
+PCI_CLASS_ENTRY PCISubClass_0b[] = {
{
0x00,
L"386",
@@ -703,11 +703,11 @@ PCI_CLASS_ENTRY PCISubClass_0b[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0c[] = {
+PCI_CLASS_ENTRY PCISubClass_0c[] = {
{
0x00,
L"IEEE 1394",
@@ -766,11 +766,11 @@ PCI_CLASS_ENTRY PCISubClass_0c[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0d[] = {
+PCI_CLASS_ENTRY PCISubClass_0d[] = {
{
0x00,
L"iRDA compatible controller",
@@ -814,11 +814,11 @@ PCI_CLASS_ENTRY PCISubClass_0d[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0e[] = {
+PCI_CLASS_ENTRY PCISubClass_0e[] = {
{
0x00,
L"I2O Architecture",
@@ -827,11 +827,11 @@ PCI_CLASS_ENTRY PCISubClass_0e[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_0f[] = {
+PCI_CLASS_ENTRY PCISubClass_0f[] = {
{
0x01,
L"TV",
@@ -860,11 +860,11 @@ PCI_CLASS_ENTRY PCISubClass_0f[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_10[] = {
+PCI_CLASS_ENTRY PCISubClass_10[] = {
{
0x00,
L"Network & computing Encrypt/Decrypt",
@@ -883,11 +883,11 @@ PCI_CLASS_ENTRY PCISubClass_10[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_11[] = {
+PCI_CLASS_ENTRY PCISubClass_11[] = {
{
0x00,
L"DPIO modules",
@@ -916,11 +916,11 @@ PCI_CLASS_ENTRY PCISubClass_11[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_12[] = {
+PCI_CLASS_ENTRY PCISubClass_12[] = {
{
0x00,
L"Processing Accelerator",
@@ -929,11 +929,11 @@ PCI_CLASS_ENTRY PCISubClass_12[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCISubClass_13[] = {
+PCI_CLASS_ENTRY PCISubClass_13[] = {
{
0x00,
L"Non-Essential Instrumentation Function",
@@ -942,14 +942,14 @@ PCI_CLASS_ENTRY PCISubClass_13[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
//
// Programming Interface entries
//
-PCI_CLASS_ENTRY PCIPIFClass_0100[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0100[] = {
{
0x00,
L"SCSI controller",
@@ -978,11 +978,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0100[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0101[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0101[] = {
{
0x00,
L"",
@@ -1146,11 +1146,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0101[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0105[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0105[] = {
{
0x20,
L"Single stepping",
@@ -1164,11 +1164,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0105[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0106[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0106[] = {
{
0x00,
L"",
@@ -1187,11 +1187,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0106[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0107[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0107[] = {
{
0x00,
L"",
@@ -1205,11 +1205,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0107[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0108[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0108[] = {
{
0x00,
L"",
@@ -1228,11 +1228,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0108[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0109[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0109[] = {
{
0x00,
L"",
@@ -1246,11 +1246,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0109[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0300[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0300[] = {
{
0x00,
L"VGA compatible",
@@ -1264,11 +1264,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0300[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0604[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0604[] = {
{
0x00,
L"",
@@ -1282,11 +1282,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0604[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0609[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0609[] = {
{
0x40,
L"Primary PCI bus side facing the system host processor",
@@ -1300,11 +1300,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0609[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_060b[] = {
+PCI_CLASS_ENTRY PCIPIFClass_060b[] = {
{
0x00,
L"Custom",
@@ -1318,11 +1318,11 @@ PCI_CLASS_ENTRY PCIPIFClass_060b[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0700[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0700[] = {
{
0x00,
L"Generic XT-compatible",
@@ -1361,11 +1361,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0700[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0701[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0701[] = {
{
0x00,
L"",
@@ -1394,11 +1394,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0701[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0703[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0703[] = {
{
0x00,
L"Generic",
@@ -1427,11 +1427,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0703[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0800[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0800[] = {
{
0x00,
L"Generic 8259",
@@ -1460,11 +1460,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0800[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0801[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0801[] = {
{
0x00,
L"Generic 8237",
@@ -1483,11 +1483,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0801[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0802[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0802[] = {
{
0x00,
L"Generic 8254",
@@ -1506,11 +1506,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0802[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0803[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0803[] = {
{
0x00,
L"Generic",
@@ -1529,11 +1529,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0803[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0904[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0904[] = {
{
0x00,
L"Generic",
@@ -1547,11 +1547,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0904[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0c00[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0c00[] = {
{
0x00,
L"",
@@ -1565,11 +1565,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0c00[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0c03[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0c03[] = {
{
0x00,
L"UHCI",
@@ -1603,11 +1603,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0c03[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0c07[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0c07[] = {
{
0x00,
L"SMIC",
@@ -1626,11 +1626,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0c07[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0d01[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0d01[] = {
{
0x00,
L"Consumer IR controller",
@@ -1644,11 +1644,11 @@ PCI_CLASS_ENTRY PCIPIFClass_0d01[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
+PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
{
0x00,
L"Message FIFO at offset 40h",
@@ -1662,11 +1662,10 @@ PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
{
0x00,
NULL,
- /* null string ends the list */NULL
+ /* null string ends the list */ NULL
}
};
-
/**
Generates printable Unicode strings that represent PCI device class,
subclass and programmed I/F based on a value passed to the function.
@@ -1683,13 +1682,13 @@ PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
**/
VOID
PciGetClassStrings (
- IN UINT32 ClassCode,
- IN OUT PCI_CLASS_STRINGS *ClassStrings
+ IN UINT32 ClassCode,
+ IN OUT PCI_CLASS_STRINGS *ClassStrings
)
{
- INTN Index;
- UINT8 Code;
- PCI_CLASS_ENTRY *CurrentClass;
+ INTN Index;
+ UINT8 Code;
+ PCI_CLASS_ENTRY *CurrentClass;
//
// Assume no strings found
@@ -1699,8 +1698,8 @@ PciGetClassStrings (
ClassStrings->PIFClass = L"UNDEFINED";
CurrentClass = gClassStringList;
- Code = (UINT8) (ClassCode >> 16);
- Index = 0;
+ Code = (UINT8)(ClassCode >> 16);
+ Index = 0;
//
// Go through all entries of the base class, until the entry with a matching
@@ -1710,11 +1709,12 @@ PciGetClassStrings (
//
while (Code != CurrentClass[Index].Code) {
if (NULL == CurrentClass[Index].DescText) {
- return ;
+ return;
}
Index++;
}
+
//
// A base class was found. Assign description, and check if this class has
// sub-class defined. If sub-class defined, no more action is needed,
@@ -1722,14 +1722,15 @@ PciGetClassStrings (
//
ClassStrings->BaseClass = CurrentClass[Index].DescText;
if (NULL == CurrentClass[Index].LowerLevelClass) {
- return ;
+ return;
}
+
//
// find Subclass entry
//
- CurrentClass = CurrentClass[Index].LowerLevelClass;
- Code = (UINT8) (ClassCode >> 8);
- Index = 0;
+ CurrentClass = CurrentClass[Index].LowerLevelClass;
+ Code = (UINT8)(ClassCode >> 8);
+ Index = 0;
//
// Go through all entries of the sub-class, until the entry with a matching
@@ -1739,11 +1740,12 @@ PciGetClassStrings (
//
while (Code != CurrentClass[Index].Code) {
if (NULL == CurrentClass[Index].DescText) {
- return ;
+ return;
}
Index++;
}
+
//
// A class was found for the sub-class code. Assign description, and check if
// this sub-class has programming interface defined. If no, no more action is
@@ -1752,14 +1754,15 @@ PciGetClassStrings (
//
ClassStrings->SubClass = CurrentClass[Index].DescText;
if (NULL == CurrentClass[Index].LowerLevelClass) {
- return ;
+ return;
}
+
//
// Find programming interface entry
//
- CurrentClass = CurrentClass[Index].LowerLevelClass;
- Code = (UINT8) ClassCode;
- Index = 0;
+ CurrentClass = CurrentClass[Index].LowerLevelClass;
+ Code = (UINT8)ClassCode;
+ Index = 0;
//
// Go through all entries of the I/F entries, until the entry with a
@@ -1769,16 +1772,17 @@ PciGetClassStrings (
//
while (Code != CurrentClass[Index].Code) {
if (NULL == CurrentClass[Index].DescText) {
- return ;
+ return;
}
Index++;
}
+
//
// A class was found for the I/F code. Assign description, done!
//
ClassStrings->PIFClass = CurrentClass[Index].DescText;
- return ;
+ return;
}
/**
@@ -1790,14 +1794,14 @@ PciGetClassStrings (
**/
VOID
PciPrintClassCode (
- IN UINT8 *ClassCodePtr,
- IN BOOLEAN IncludePIF
+ IN UINT8 *ClassCodePtr,
+ IN BOOLEAN IncludePIF
)
{
- UINT32 ClassCode;
- PCI_CLASS_STRINGS ClassStrings;
+ UINT32 ClassCode;
+ PCI_CLASS_STRINGS ClassStrings;
- ClassCode = 0;
+ ClassCode = 0;
ClassCode |= (UINT32)ClassCodePtr[0];
ClassCode |= (UINT32)(ClassCodePtr[1] << 8);
ClassCode |= (UINT32)(ClassCodePtr[2] << 16);
@@ -1811,20 +1815,25 @@ PciPrintClassCode (
//
// Print base class, sub class, and programming inferface name
//
- ShellPrintEx (-1, -1, L"%s - %s - %s",
+ ShellPrintEx (
+ -1,
+ -1,
+ L"%s - %s - %s",
ClassStrings.BaseClass,
ClassStrings.SubClass,
ClassStrings.PIFClass
- );
-
+ );
} else {
//
// Only print base class and sub class name
//
- ShellPrintEx (-1, -1, L"%s - %s",
+ ShellPrintEx (
+ -1,
+ -1,
+ L"%s - %s",
ClassStrings.BaseClass,
ClassStrings.SubClass
- );
+ );
}
}
@@ -1846,11 +1855,11 @@ PciPrintClassCode (
**/
EFI_STATUS
PciFindProtocolInterface (
- IN EFI_HANDLE *HandleBuf,
- IN UINTN HandleCount,
- IN UINT16 Segment,
- IN UINT16 Bus,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
+ IN EFI_HANDLE *HandleBuf,
+ IN UINTN HandleCount,
+ IN UINT16 Segment,
+ IN UINT16 Bus,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
);
/**
@@ -1865,9 +1874,9 @@ PciFindProtocolInterface (
**/
EFI_STATUS
PciGetProtocolAndResource (
- IN EFI_HANDLE Handle,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
- OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
+ IN EFI_HANDLE Handle,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
+ OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
);
/**
@@ -1902,9 +1911,9 @@ PciGetNextBusRange (
**/
VOID
PciExplainPci (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_CONFIG_SPACE *ConfigSpace,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
/**
@@ -1918,9 +1927,9 @@ PciExplainPci (
**/
EFI_STATUS
PciExplainDeviceData (
- IN PCI_DEVICE_HEADER_TYPE_REGION *Device,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_DEVICE_HEADER_TYPE_REGION *Device,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
/**
@@ -1934,9 +1943,9 @@ PciExplainDeviceData (
**/
EFI_STATUS
PciExplainBridgeData (
- IN PCI_BRIDGE_CONTROL_REGISTER *Bridge,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_BRIDGE_CONTROL_REGISTER *Bridge,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
/**
@@ -1952,11 +1961,11 @@ PciExplainBridgeData (
**/
EFI_STATUS
PciExplainBar (
- IN UINT32 *Bar,
- IN UINT16 *Command,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN OUT UINTN *Index
+ IN UINT32 *Bar,
+ IN UINT16 *Command,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
+ IN OUT UINTN *Index
);
/**
@@ -1970,9 +1979,9 @@ PciExplainBar (
**/
EFI_STATUS
PciExplainCardBusData (
- IN PCI_CARDBUS_CONTROL_REGISTER *CardBus,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_CARDBUS_CONTROL_REGISTER *CardBus,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
/**
@@ -1988,9 +1997,9 @@ PciExplainCardBusData (
**/
EFI_STATUS
PciExplainStatus (
- IN UINT16 *Status,
- IN BOOLEAN MainStatus,
- IN PCI_HEADER_TYPE HeaderType
+ IN UINT16 *Status,
+ IN BOOLEAN MainStatus,
+ IN PCI_HEADER_TYPE HeaderType
);
/**
@@ -2002,7 +2011,7 @@ PciExplainStatus (
**/
EFI_STATUS
PciExplainCommand (
- IN UINT16 *Command
+ IN UINT16 *Command
);
/**
@@ -2015,8 +2024,8 @@ PciExplainCommand (
**/
EFI_STATUS
PciExplainBridgeControl (
- IN UINT16 *BridgeControl,
- IN PCI_HEADER_TYPE HeaderType
+ IN UINT16 *BridgeControl,
+ IN PCI_HEADER_TYPE HeaderType
);
/**
@@ -2029,8 +2038,8 @@ PciExplainBridgeControl (
**/
UINT8
LocatePciCapability (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT8 CapabilityId
+ IN PCI_CONFIG_SPACE *ConfigSpace,
+ IN UINT8 CapabilityId
);
/**
@@ -2043,10 +2052,10 @@ LocatePciCapability (
**/
VOID
PciExplainPciExpress (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap,
- IN UINT8 *ExtendedConfigSpace,
- IN UINTN ExtendedConfigSize,
- IN CONST UINT16 ExtendedCapability
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap,
+ IN UINT8 *ExtendedConfigSpace,
+ IN UINTN ExtendedConfigSize,
+ IN CONST UINT16 ExtendedCapability
);
/**
@@ -2058,7 +2067,7 @@ PciExplainPciExpress (
**/
EFI_STATUS
ExplainPcieCapReg (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2070,7 +2079,7 @@ ExplainPcieCapReg (
**/
EFI_STATUS
ExplainPcieDeviceCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2082,7 +2091,7 @@ ExplainPcieDeviceCap (
**/
EFI_STATUS
ExplainPcieDeviceControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2094,7 +2103,7 @@ ExplainPcieDeviceControl (
**/
EFI_STATUS
ExplainPcieDeviceStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2106,7 +2115,7 @@ ExplainPcieDeviceStatus (
**/
EFI_STATUS
ExplainPcieLinkCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2118,7 +2127,7 @@ ExplainPcieLinkCap (
**/
EFI_STATUS
ExplainPcieLinkControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2130,7 +2139,7 @@ ExplainPcieLinkControl (
**/
EFI_STATUS
ExplainPcieLinkStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2142,7 +2151,7 @@ ExplainPcieLinkStatus (
**/
EFI_STATUS
ExplainPcieSlotCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2154,7 +2163,7 @@ ExplainPcieSlotCap (
**/
EFI_STATUS
ExplainPcieSlotControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2166,7 +2175,7 @@ ExplainPcieSlotControl (
**/
EFI_STATUS
ExplainPcieSlotStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2178,7 +2187,7 @@ ExplainPcieSlotStatus (
**/
EFI_STATUS
ExplainPcieRootControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2190,7 +2199,7 @@ ExplainPcieRootControl (
**/
EFI_STATUS
ExplainPcieRootCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
/**
@@ -2202,10 +2211,12 @@ ExplainPcieRootCap (
**/
EFI_STATUS
ExplainPcieRootStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
);
-typedef EFI_STATUS (*PCIE_EXPLAIN_FUNCTION) (IN PCI_CAPABILITY_PCIEXP *PciExpressCap);
+typedef EFI_STATUS (*PCIE_EXPLAIN_FUNCTION) (
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ );
typedef enum {
FieldWidthUINT8,
@@ -2222,16 +2233,15 @@ typedef enum {
PcieExplainTypeMax
} PCIE_EXPLAIN_TYPE;
-typedef struct
-{
- UINT16 Token;
- UINTN Offset;
- PCIE_CAPREG_FIELD_WIDTH Width;
- PCIE_EXPLAIN_FUNCTION Func;
- PCIE_EXPLAIN_TYPE Type;
+typedef struct {
+ UINT16 Token;
+ UINTN Offset;
+ PCIE_CAPREG_FIELD_WIDTH Width;
+ PCIE_EXPLAIN_FUNCTION Func;
+ PCIE_EXPLAIN_TYPE Type;
} PCIE_EXPLAIN_STRUCT;
-PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
+PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
{
STRING_TOKEN (STR_PCIEX_CAPABILITY_CAPID),
0x00,
@@ -2349,15 +2359,15 @@ PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
//
// Global Variables
//
-PCI_CONFIG_SPACE *mConfigSpace = NULL;
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-s", TypeValue},
- {L"-i", TypeFlag},
- {L"-ec", TypeValue},
- {NULL, TypeMax}
- };
-
-CHAR16 *DevicePortTypeTable[] = {
+PCI_CONFIG_SPACE *mConfigSpace = NULL;
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-s", TypeValue },
+ { L"-i", TypeFlag },
+ { L"-ec", TypeValue },
+ { NULL, TypeMax }
+};
+
+CHAR16 *DevicePortTypeTable[] = {
L"PCI Express Endpoint",
L"Legacy PCI Express Endpoint",
L"Unknown Type",
@@ -2371,7 +2381,7 @@ CHAR16 *DevicePortTypeTable[] = {
L"Root Complex Event Collector"
};
-CHAR16 *L0sLatencyStrTable[] = {
+CHAR16 *L0sLatencyStrTable[] = {
L"Less than 64ns",
L"64ns to less than 128ns",
L"128ns to less than 256ns",
@@ -2382,7 +2392,7 @@ CHAR16 *L0sLatencyStrTable[] = {
L"More than 4us"
};
-CHAR16 *L1LatencyStrTable[] = {
+CHAR16 *L1LatencyStrTable[] = {
L"Less than 1us",
L"1us to less than 2us",
L"2us to less than 4us",
@@ -2393,28 +2403,27 @@ CHAR16 *L1LatencyStrTable[] = {
L"More than 64us"
};
-CHAR16 *ASPMCtrlStrTable[] = {
+CHAR16 *ASPMCtrlStrTable[] = {
L"Disabled",
L"L0s Entry Enabled",
L"L1 Entry Enabled",
L"L0s and L1 Entry Enabled"
};
-CHAR16 *SlotPwrLmtScaleTable[] = {
+CHAR16 *SlotPwrLmtScaleTable[] = {
L"1.0x",
L"0.1x",
L"0.01x",
L"0.001x"
};
-CHAR16 *IndicatorTable[] = {
+CHAR16 *IndicatorTable[] = {
L"Reserved",
L"On",
L"Blink",
L"Off"
};
-
/**
Function for 'pci' command.
@@ -2428,130 +2437,132 @@ ShellCommandRunPci (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- UINT16 Segment;
- UINT16 Bus;
- UINT16 Device;
- UINT16 Func;
- UINT64 Address;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev;
- EFI_STATUS Status;
- PCI_DEVICE_INDEPENDENT_REGION PciHeader;
- PCI_CONFIG_SPACE ConfigSpace;
- UINTN ScreenCount;
- UINTN TempColumn;
- UINTN ScreenSize;
- BOOLEAN ExplainData;
- UINTN Index;
- UINTN SizeOfHeader;
- BOOLEAN PrintTitle;
- UINTN HandleBufSize;
- EFI_HANDLE *HandleBuf;
- UINTN HandleCount;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
- UINT16 MinBus;
- UINT16 MaxBus;
- BOOLEAN IsEnd;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
- UINT64 RetVal;
- UINT16 ExtendedCapability;
- UINT8 PcieCapabilityPtr;
- UINT8 *ExtendedConfigSpace;
- UINTN ExtendedConfigSize;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Address = 0;
- IoDev = NULL;
- HandleBuf = NULL;
- Package = NULL;
+ UINT16 Segment;
+ UINT16 Bus;
+ UINT16 Device;
+ UINT16 Func;
+ UINT64 Address;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev;
+ EFI_STATUS Status;
+ PCI_DEVICE_INDEPENDENT_REGION PciHeader;
+ PCI_CONFIG_SPACE ConfigSpace;
+ UINTN ScreenCount;
+ UINTN TempColumn;
+ UINTN ScreenSize;
+ BOOLEAN ExplainData;
+ UINTN Index;
+ UINTN SizeOfHeader;
+ BOOLEAN PrintTitle;
+ UINTN HandleBufSize;
+ EFI_HANDLE *HandleBuf;
+ UINTN HandleCount;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
+ UINT16 MinBus;
+ UINT16 MaxBus;
+ BOOLEAN IsEnd;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *Temp;
+ UINT64 RetVal;
+ UINT16 ExtendedCapability;
+ UINT8 PcieCapabilityPtr;
+ UINT8 *ExtendedConfigSpace;
+ UINTN ExtendedConfigSize;
+
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ Address = 0;
+ IoDev = NULL;
+ HandleBuf = NULL;
+ Package = NULL;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
-
- if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci");
+ if (ShellCommandLineGetCount (Package) == 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- if (ShellCommandLineGetCount(Package) > 4) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci");
+ if (ShellCommandLineGetCount (Package) > 4) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- if (ShellCommandLineGetFlag(Package, L"-ec") && ShellCommandLineGetValue(Package, L"-ec") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec");
+
+ if (ShellCommandLineGetFlag (Package, L"-ec") && (ShellCommandLineGetValue (Package, L"-ec") == NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s");
+
+ if (ShellCommandLineGetFlag (Package, L"-s") && (ShellCommandLineGetValue (Package, L"-s") == NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
+
//
// Get all instances of PciRootBridgeIo. Allocate space for 1 EFI_HANDLE and
// call LibLocateHandle(), if EFI_BUFFER_TOO_SMALL is returned, allocate enough
// space for handles and call it again.
//
HandleBufSize = sizeof (EFI_HANDLE);
- HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize);
+ HandleBuf = (EFI_HANDLE *)AllocateZeroPool (HandleBufSize);
if (HandleBuf == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Done;
}
Status = gBS->LocateHandle (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &HandleBufSize,
- HandleBuf
- );
+ ByProtocol,
+ &gEfiPciRootBridgeIoProtocolGuid,
+ NULL,
+ &HandleBufSize,
+ HandleBuf
+ );
if (Status == EFI_BUFFER_TOO_SMALL) {
HandleBuf = ReallocatePool (sizeof (EFI_HANDLE), HandleBufSize, HandleBuf);
if (HandleBuf == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Done;
}
Status = gBS->LocateHandle (
- ByProtocol,
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- &HandleBufSize,
- HandleBuf
- );
+ ByProtocol,
+ &gEfiPciRootBridgeIoProtocolGuid,
+ NULL,
+ &HandleBufSize,
+ HandleBuf
+ );
}
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
@@ -2560,13 +2571,13 @@ ShellCommandRunPci (
//
// Argument Count == 1(no other argument): enumerate all pci functions
//
- if (ShellCommandLineGetCount(Package) == 1) {
+ if (ShellCommandLineGetCount (Package) == 1) {
gST->ConOut->QueryMode (
- gST->ConOut,
- gST->ConOut->Mode->Mode,
- &TempColumn,
- &ScreenSize
- );
+ gST->ConOut,
+ gST->ConOut->Mode->Mode,
+ &TempColumn,
+ &ScreenSize
+ );
ScreenCount = 0;
ScreenSize -= 4;
@@ -2582,15 +2593,16 @@ ShellCommandRunPci (
//
for (Index = 0; Index < HandleCount; Index++) {
Status = PciGetProtocolAndResource (
- HandleBuf[Index],
- &IoDev,
- &Descriptors
- );
+ HandleBuf[Index],
+ &IoDev,
+ &Descriptors
+ );
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
+
//
// No document say it's impossible for a RootBridgeIo protocol handle
// to have more than one address space descriptors, so find out every
@@ -2600,7 +2612,7 @@ ShellCommandRunPci (
Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
@@ -2622,14 +2634,15 @@ ShellCommandRunPci (
ShellStatus = SHELL_ABORTED;
goto Done;
}
+
Address = EFI_PCI_ADDRESS (Bus, Device, Func, 0);
IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint16,
- Address,
- 1,
- &PciHeader.VendorId
- );
+ IoDev,
+ EfiPciWidthUint16,
+ Address,
+ 1,
+ &PciHeader.VendorId
+ );
//
// If VendorId = 0xffff, there does not exist a device at this
@@ -2638,60 +2651,69 @@ ShellCommandRunPci (
// will be no more functions in the same device, so we can break
// loop to deal with the next device.
//
- if (PciHeader.VendorId == 0xffff && Func == 0) {
+ if ((PciHeader.VendorId == 0xffff) && (Func == 0)) {
break;
}
if (PciHeader.VendorId != 0xffff) {
-
if (PrintTitle) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_TITLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_TITLE), gShellDebug1HiiHandle);
PrintTitle = FALSE;
}
IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint32,
- Address,
- sizeof (PciHeader) / sizeof (UINT32),
- &PciHeader
- );
-
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_P1), gShellDebug1HiiHandle,
+ IoDev,
+ EfiPciWidthUint32,
+ Address,
+ sizeof (PciHeader) / sizeof (UINT32),
+ &PciHeader
+ );
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_LINE_P1),
+ gShellDebug1HiiHandle,
IoDev->SegmentNumber,
Bus,
Device,
Func
- );
+ );
PciPrintClassCode (PciHeader.ClassCode, FALSE);
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_P2), gShellDebug1HiiHandle,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_LINE_P2),
+ gShellDebug1HiiHandle,
PciHeader.VendorId,
PciHeader.DeviceId,
PciHeader.ClassCode[0]
- );
+ );
ScreenCount += 2;
- if (ScreenCount >= ScreenSize && ScreenSize != 0) {
+ if ((ScreenCount >= ScreenSize) && (ScreenSize != 0)) {
//
// If ScreenSize == 0 we have the console redirected so don't
// block updates
//
ScreenCount = 0;
}
+
//
// If this is not a multi-function device, we can leave the loop
// to deal with the next device.
//
- if (Func == 0 && ((PciHeader.HeaderType & HEADER_TYPE_MULTI_FUNCTION) == 0x00)) {
+ if ((Func == 0) && ((PciHeader.HeaderType & HEADER_TYPE_MULTI_FUNCTION) == 0x00)) {
break;
}
}
}
}
}
+
//
// If Descriptor is NULL, Configuration() returns EFI_UNSUPPRORED,
// we assume the bus range is 0~PCI_MAX_BUS. After enumerated all
@@ -2707,23 +2729,23 @@ ShellCommandRunPci (
goto Done;
}
- ExplainData = FALSE;
- Segment = 0;
- Bus = 0;
- Device = 0;
- Func = 0;
- ExtendedCapability = 0xFFFF;
- if (ShellCommandLineGetFlag(Package, L"-i")) {
+ ExplainData = FALSE;
+ Segment = 0;
+ Bus = 0;
+ Device = 0;
+ Func = 0;
+ ExtendedCapability = 0xFFFF;
+ if (ShellCommandLineGetFlag (Package, L"-i")) {
ExplainData = TRUE;
}
- Temp = ShellCommandLineGetValue(Package, L"-s");
+ Temp = ShellCommandLineGetValue (Package, L"-s");
if (Temp != NULL) {
//
// Input converted to hexadecimal number.
//
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
- Segment = (UINT16) RetVal;
+ Segment = (UINT16)RetVal;
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2735,13 +2757,13 @@ ShellCommandRunPci (
// The first Argument(except "-i") is assumed to be Bus number, second
// to be Device number, and third to be Func number.
//
- Temp = ShellCommandLineGetRawValue(Package, 1);
+ Temp = ShellCommandLineGetRawValue (Package, 1);
if (Temp != NULL) {
//
// Input converted to hexadecimal number.
//
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
- Bus = (UINT16) RetVal;
+ Bus = (UINT16)RetVal;
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2749,46 +2771,47 @@ ShellCommandRunPci (
}
if (Bus > PCI_MAX_BUS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
}
- Temp = ShellCommandLineGetRawValue(Package, 2);
+
+ Temp = ShellCommandLineGetRawValue (Package, 2);
if (Temp != NULL) {
//
// Input converted to hexadecimal number.
//
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
- Device = (UINT16) RetVal;
+ Device = (UINT16)RetVal;
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- if (Device > PCI_MAX_DEVICE){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
+ if (Device > PCI_MAX_DEVICE) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
}
- Temp = ShellCommandLineGetRawValue(Package, 3);
+ Temp = ShellCommandLineGetRawValue (Package, 3);
if (Temp != NULL) {
//
// Input converted to hexadecimal number.
//
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
- Func = (UINT16) RetVal;
+ Func = (UINT16)RetVal;
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
- if (Func > PCI_MAX_FUNC){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
+ if (Func > PCI_MAX_FUNC) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
@@ -2800,7 +2823,7 @@ ShellCommandRunPci (
// Input converted to hexadecimal number.
//
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
- ExtendedCapability = (UINT16) RetVal;
+ ExtendedCapability = (UINT16)RetVal;
} else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2813,40 +2836,45 @@ ShellCommandRunPci (
// bus range covers the current bus
//
Status = PciFindProtocolInterface (
- HandleBuf,
- HandleCount,
- Segment,
- Bus,
- &IoDev
- );
+ HandleBuf,
+ HandleCount,
+ Segment,
+ Bus,
+ &IoDev
+ );
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(
- -1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle, L"pci",
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_NO_FIND),
+ gShellDebug1HiiHandle,
+ L"pci",
Segment,
Bus
- );
+ );
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
Address = EFI_PCI_ADDRESS (Bus, Device, Func, 0);
- Status = IoDev->Pci.Read (
- IoDev,
- EfiPciWidthUint8,
- Address,
- sizeof (ConfigSpace),
- &ConfigSpace
- );
+ Status = IoDev->Pci.Read (
+ IoDev,
+ EfiPciWidthUint8,
+ Address,
+ sizeof (ConfigSpace),
+ &ConfigSpace
+ );
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_ACCESS_DENIED;
goto Done;
}
mConfigSpace = &ConfigSpace;
- ShellPrintHiiEx(
+ ShellPrintHiiEx (
-1,
-1,
NULL,
@@ -2860,7 +2888,7 @@ ShellCommandRunPci (
Bus,
Device,
Func
- );
+ );
//
// Dump standard header of configuration space
@@ -2868,7 +2896,7 @@ ShellCommandRunPci (
SizeOfHeader = sizeof (ConfigSpace.Common) + sizeof (ConfigSpace.NonCommon);
DumpHex (2, 0, SizeOfHeader, &ConfigSpace);
- ShellPrintEx(-1,-1, L"\r\n");
+ ShellPrintEx (-1, -1, L"\r\n");
//
// Dump device dependent Part of configuration space
@@ -2878,11 +2906,11 @@ ShellCommandRunPci (
SizeOfHeader,
sizeof (ConfigSpace) - SizeOfHeader,
ConfigSpace.Data
- );
+ );
ExtendedConfigSpace = NULL;
ExtendedConfigSize = 0;
- PcieCapabilityPtr = LocatePciCapability (&ConfigSpace, EFI_PCI_CAPABILITY_ID_PCIEXP);
+ PcieCapabilityPtr = LocatePciCapability (&ConfigSpace, EFI_PCI_CAPABILITY_ID_PCIEXP);
if (PcieCapabilityPtr != 0) {
ExtendedConfigSize = 0x1000 - EFI_PCIE_CAPABILITY_BASE_OFFSET;
ExtendedConfigSpace = AllocatePool (ExtendedConfigSize);
@@ -2921,7 +2949,7 @@ ShellCommandRunPci (
PciExplainPci (&ConfigSpace, Address, IoDev);
if ((ExtendedConfigSpace != NULL) && !ShellGetExecutionBreakFlag ()) {
PciExplainPciExpress (
- (PCI_CAPABILITY_PCIEXP *) ((UINT8 *) &ConfigSpace + PcieCapabilityPtr),
+ (PCI_CAPABILITY_PCIEXP *)((UINT8 *)&ConfigSpace + PcieCapabilityPtr),
ExtendedConfigSpace,
ExtendedConfigSize,
ExtendedCapability
@@ -2929,13 +2957,16 @@ ShellCommandRunPci (
}
}
}
+
Done:
if (HandleBuf != NULL) {
FreePool (HandleBuf);
}
+
if (Package != NULL) {
ShellCommandLineFreeVarList (Package);
}
+
mConfigSpace = NULL;
return ShellStatus;
}
@@ -2958,19 +2989,19 @@ Done:
**/
EFI_STATUS
PciFindProtocolInterface (
- IN EFI_HANDLE *HandleBuf,
- IN UINTN HandleCount,
- IN UINT16 Segment,
- IN UINT16 Bus,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
+ IN EFI_HANDLE *HandleBuf,
+ IN UINTN HandleCount,
+ IN UINT16 Segment,
+ IN UINT16 Bus,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
)
{
- UINTN Index;
- EFI_STATUS Status;
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
- UINT16 MinBus;
- UINT16 MaxBus;
- BOOLEAN IsEnd;
+ UINTN Index;
+ EFI_STATUS Status;
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Descriptors;
+ UINT16 MinBus;
+ UINT16 MaxBus;
+ BOOLEAN IsEnd;
//
// Go through all handles, until the one meets the criteria is found
@@ -2980,11 +3011,12 @@ PciFindProtocolInterface (
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// When Descriptors == NULL, the Configuration() is not implemented,
// so we only check the Segment number
//
- if (Descriptors == NULL && Segment == (*IoDev)->SegmentNumber) {
+ if ((Descriptors == NULL) && (Segment == (*IoDev)->SegmentNumber)) {
return EFI_SUCCESS;
}
@@ -3002,7 +3034,7 @@ PciFindProtocolInterface (
break;
}
- if (MinBus <= Bus && MaxBus >= Bus) {
+ if ((MinBus <= Bus) && (MaxBus >= Bus)) {
return EFI_SUCCESS;
}
}
@@ -3023,9 +3055,9 @@ PciFindProtocolInterface (
**/
EFI_STATUS
PciGetProtocolAndResource (
- IN EFI_HANDLE Handle,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
- OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
+ IN EFI_HANDLE Handle,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
+ OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
)
{
EFI_STATUS Status;
@@ -3034,22 +3066,22 @@ PciGetProtocolAndResource (
// Get inferface from protocol
//
Status = gBS->HandleProtocol (
- Handle,
- &gEfiPciRootBridgeIoProtocolGuid,
- (VOID**)IoDev
- );
+ Handle,
+ &gEfiPciRootBridgeIoProtocolGuid,
+ (VOID **)IoDev
+ );
if (EFI_ERROR (Status)) {
return Status;
}
+
//
// Call Configuration() to get address space descriptors
//
- Status = (*IoDev)->Configuration (*IoDev, (VOID**)Descriptors);
+ Status = (*IoDev)->Configuration (*IoDev, (VOID **)Descriptors);
if (Status == EFI_UNSUPPORTED) {
*Descriptors = NULL;
return EFI_SUCCESS;
-
} else {
return Status;
}
@@ -3087,6 +3119,7 @@ PciGetNextBusRange (
*MaxBus = PCI_MAX_BUS;
return EFI_SUCCESS;
}
+
//
// *Descriptors points to one or more address space descriptors, which
// ends with a end tagged descriptor. Examine each of the descriptors,
@@ -3096,8 +3129,8 @@ PciGetNextBusRange (
while ((*Descriptors)->Desc != ACPI_END_TAG_DESCRIPTOR) {
if ((*Descriptors)->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) {
- *MinBus = (UINT16) (*Descriptors)->AddrRangeMin;
- *MaxBus = (UINT16) (*Descriptors)->AddrRangeMax;
+ *MinBus = (UINT16)(*Descriptors)->AddrRangeMin;
+ *MaxBus = (UINT16)(*Descriptors)->AddrRangeMax;
(*Descriptors)++;
return (EFI_SUCCESS);
}
@@ -3123,13 +3156,13 @@ PciGetNextBusRange (
**/
VOID
PciExplainPci (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_CONFIG_SPACE *ConfigSpace,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
{
- PCI_DEVICE_INDEPENDENT_REGION *Common;
- PCI_HEADER_TYPE HeaderType;
+ PCI_DEVICE_INDEPENDENT_REGION *Common;
+ PCI_HEADER_TYPE HeaderType;
Common = &(ConfigSpace->Common);
@@ -3138,12 +3171,17 @@ PciExplainPci (
//
// Print Vendor Id and Device Id
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_VID_DID), gShellDebug1HiiHandle,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_LINE_VID_DID),
+ gShellDebug1HiiHandle,
INDEX_OF (&(Common->VendorId)),
Common->VendorId,
INDEX_OF (&(Common->DeviceId)),
Common->DeviceId
- );
+ );
//
// Print register Command
@@ -3158,82 +3196,96 @@ PciExplainPci (
//
// Print register Revision ID
//
- ShellPrintEx(-1, -1, L"\r\n");
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_RID), gShellDebug1HiiHandle,
+ ShellPrintEx (-1, -1, L"\r\n");
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_LINE_RID),
+ gShellDebug1HiiHandle,
INDEX_OF (&(Common->RevisionID)),
Common->RevisionID
- );
+ );
//
// Print register BIST
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_BIST), gShellDebug1HiiHandle, INDEX_OF (&(Common->BIST)));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_BIST), gShellDebug1HiiHandle, INDEX_OF (&(Common->BIST)));
if ((Common->BIST & BIT7) != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP), gShellDebug1HiiHandle, 0x0f & Common->BIST);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP), gShellDebug1HiiHandle, 0x0f & Common->BIST);
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP_NO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP_NO), gShellDebug1HiiHandle);
}
+
//
// Print register Cache Line Size
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CACHE_LINE_SIZE),
gShellDebug1HiiHandle,
INDEX_OF (&(Common->CacheLineSize)),
Common->CacheLineSize
- );
+ );
//
// Print register Latency Timer
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_LATENCY_TIMER),
gShellDebug1HiiHandle,
INDEX_OF (&(Common->LatencyTimer)),
Common->LatencyTimer
- );
+ );
//
// Print register Header Type
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_HEADER_TYPE),
gShellDebug1HiiHandle,
INDEX_OF (&(Common->HeaderType)),
Common->HeaderType
- );
+ );
if ((Common->HeaderType & BIT7) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MULTI_FUNCTION), gShellDebug1HiiHandle);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MULTI_FUNCTION), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SINGLE_FUNCTION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_SINGLE_FUNCTION), gShellDebug1HiiHandle);
}
- HeaderType = (PCI_HEADER_TYPE)(UINT8) (Common->HeaderType & 0x7f);
+ HeaderType = (PCI_HEADER_TYPE)(UINT8)(Common->HeaderType & 0x7f);
switch (HeaderType) {
- case PciDevice:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_PCI_DEVICE), gShellDebug1HiiHandle);
- break;
+ case PciDevice:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_PCI_DEVICE), gShellDebug1HiiHandle);
+ break;
- case PciP2pBridge:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_P2P_BRIDGE), gShellDebug1HiiHandle);
- break;
+ case PciP2pBridge:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_P2P_BRIDGE), gShellDebug1HiiHandle);
+ break;
- case PciCardBusBridge:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_BRIDGE), gShellDebug1HiiHandle);
- break;
+ case PciCardBusBridge:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_CARDBUS_BRIDGE), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESERVED), gShellDebug1HiiHandle);
- HeaderType = PciUndefined;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RESERVED), gShellDebug1HiiHandle);
+ HeaderType = PciUndefined;
}
//
// Print register Class Code
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CLASS), gShellDebug1HiiHandle);
- PciPrintClassCode ((UINT8 *) Common->ClassCode, TRUE);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_CLASS), gShellDebug1HiiHandle);
+ PciPrintClassCode ((UINT8 *)Common->ClassCode, TRUE);
ShellPrintEx (-1, -1, L"\r\n");
}
@@ -3248,9 +3300,9 @@ PciExplainPci (
**/
EFI_STATUS
PciExplainDeviceData (
- IN PCI_DEVICE_HEADER_TYPE_REGION *Device,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_DEVICE_HEADER_TYPE_REGION *Device,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
{
UINTN Index;
@@ -3263,10 +3315,10 @@ PciExplainDeviceData (
// exist. If these no Bar for this function, print "none", otherwise
// list detail information about this Bar.
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BASE_ADDR), gShellDebug1HiiHandle, INDEX_OF (Device->Bar));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BASE_ADDR), gShellDebug1HiiHandle, INDEX_OF (Device->Bar));
- BarExist = FALSE;
- BarCount = sizeof (Device->Bar) / sizeof (Device->Bar[0]);
+ BarExist = FALSE;
+ BarCount = sizeof (Device->Bar) / sizeof (Device->Bar[0]);
for (Index = 0; Index < BarCount; Index++) {
if (Device->Bar[Index] == 0) {
continue;
@@ -3274,17 +3326,17 @@ PciExplainDeviceData (
if (!BarExist) {
BarExist = TRUE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_START_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_START_TYPE), gShellDebug1HiiHandle);
ShellPrintEx (-1, -1, L" --------------------------------------------------------------------------");
}
Status = PciExplainBar (
- &(Device->Bar[Index]),
- &(mConfigSpace->Common.Command),
- Address,
- IoDev,
- &Index
- );
+ &(Device->Bar[Index]),
+ &(mConfigSpace->Common.Command),
+ Address,
+ IoDev,
+ &Index
+ );
if (EFI_ERROR (Status)) {
break;
@@ -3292,8 +3344,7 @@ PciExplainDeviceData (
}
if (!BarExist) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
} else {
ShellPrintEx (-1, -1, L"\r\n --------------------------------------------------------------------------");
}
@@ -3302,86 +3353,113 @@ PciExplainDeviceData (
// Print register Expansion ROM Base Address
//
if ((Device->ExpansionRomBar & BIT0) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_EXPANSION_ROM_DISABLED), gShellDebug1HiiHandle, INDEX_OF (&(Device->ExpansionRomBar)));
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_EXPANSION_ROM_DISABLED), gShellDebug1HiiHandle, INDEX_OF (&(Device->ExpansionRomBar)));
} else {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_EXPANSION_ROM_BASE),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->ExpansionRomBar)),
Device->ExpansionRomBar
- );
+ );
}
+
//
// Print register Cardbus CIS ptr
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CARDBUS_CIS),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->CISPtr)),
Device->CISPtr
- );
+ );
//
// Print register Sub-vendor ID and subsystem ID
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SUB_VENDOR_ID),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->SubsystemVendorID)),
Device->SubsystemVendorID
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SUBSYSTEM_ID),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->SubsystemID)),
Device->SubsystemID
- );
+ );
//
// Print register Capabilities Ptr
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CAPABILITIES_PTR),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->CapabilityPtr)),
Device->CapabilityPtr
- );
+ );
//
// Print register Interrupt Line and interrupt pin
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_INTERRUPT_LINE),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->InterruptLine)),
Device->InterruptLine
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_INTERRUPT_PIN),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->InterruptPin)),
Device->InterruptPin
- );
+ );
//
// Print register Min_Gnt and Max_Lat
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MIN_GNT),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->MinGnt)),
Device->MinGnt
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MAX_LAT),
gShellDebug1HiiHandle,
INDEX_OF (&(Device->MaxLat)),
Device->MaxLat
- );
+ );
return EFI_SUCCESS;
}
@@ -3397,9 +3475,9 @@ PciExplainDeviceData (
**/
EFI_STATUS
PciExplainBridgeData (
- IN PCI_BRIDGE_CONTROL_REGISTER *Bridge,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_BRIDGE_CONTROL_REGISTER *Bridge,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
{
UINTN Index;
@@ -3413,10 +3491,10 @@ PciExplainBridgeData (
// exist. If these no Bar for this function, print "none", otherwise
// list detail information about this Bar.
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BASE_ADDRESS), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->Bar)));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BASE_ADDRESS), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->Bar)));
- BarExist = FALSE;
- BarCount = sizeof (Bridge->Bar) / sizeof (Bridge->Bar[0]);
+ BarExist = FALSE;
+ BarCount = sizeof (Bridge->Bar) / sizeof (Bridge->Bar[0]);
for (Index = 0; Index < BarCount; Index++) {
if (Bridge->Bar[Index] == 0) {
@@ -3425,17 +3503,17 @@ PciExplainBridgeData (
if (!BarExist) {
BarExist = TRUE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_START_TYPE_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_START_TYPE_2), gShellDebug1HiiHandle);
ShellPrintEx (-1, -1, L" --------------------------------------------------------------------------");
}
Status = PciExplainBar (
- &(Bridge->Bar[Index]),
- &(mConfigSpace->Common.Command),
- Address,
- IoDev,
- &Index
- );
+ &(Bridge->Bar[Index]),
+ &(mConfigSpace->Common.Command),
+ Address,
+ IoDev,
+ &Index
+ );
if (EFI_ERROR (Status)) {
break;
@@ -3443,7 +3521,7 @@ PciExplainBridgeData (
}
if (!BarExist) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NONE), gShellDebug1HiiHandle);
} else {
ShellPrintEx (-1, -1, L"\r\n --------------------------------------------------------------------------");
}
@@ -3452,42 +3530,51 @@ PciExplainBridgeData (
// Expansion register ROM Base Address
//
if ((Bridge->ExpansionRomBAR & BIT0) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NO_EXPANSION_ROM), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->ExpansionRomBAR)));
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NO_EXPANSION_ROM), gShellDebug1HiiHandle, INDEX_OF (&(Bridge->ExpansionRomBAR)));
} else {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_EXPANSION_ROM_BASE_2),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->ExpansionRomBAR)),
Bridge->ExpansionRomBAR
- );
+ );
}
+
//
// Print Bus Numbers(Primary, Secondary, and Subordinate
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_BUS_NUMBERS),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->PrimaryBus)),
INDEX_OF (&(Bridge->SecondaryBus)),
INDEX_OF (&(Bridge->SubordinateBus))
- );
+ );
ShellPrintEx (-1, -1, L" ------------------------------------------------------\r\n");
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->PrimaryBus);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SecondaryBus);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SubordinateBus);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->PrimaryBus);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SecondaryBus);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BRIDGE), gShellDebug1HiiHandle, Bridge->SubordinateBus);
//
// Print register Secondary Latency Timer
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SECONDARY_TIMER),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->SecondaryLatencyTimer)),
Bridge->SecondaryLatencyTimer
- );
+ );
//
// Print register Secondary Status
@@ -3499,68 +3586,86 @@ PciExplainBridgeData (
// types: I/O, memory, and pre-fetchable memory. For each resource type,
// base and limit address are listed.
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESOURCE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RESOURCE_TYPE), gShellDebug1HiiHandle);
ShellPrintEx (-1, -1, L"----------------------------------------------------------------------\r\n");
//
// IO Base & Limit
//
- IoAddress32 = (Bridge->IoBaseUpper16 << 16 | Bridge->IoBase << 8);
+ IoAddress32 = (Bridge->IoBaseUpper16 << 16 | Bridge->IoBase << 8);
IoAddress32 &= 0xfffff000;
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_TWO_VARS),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->IoBase)),
IoAddress32
- );
+ );
- IoAddress32 = (Bridge->IoLimitUpper16 << 16 | Bridge->IoLimit << 8);
+ IoAddress32 = (Bridge->IoLimitUpper16 << 16 | Bridge->IoLimit << 8);
IoAddress32 |= 0x00000fff;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR), gShellDebug1HiiHandle, IoAddress32);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_ONE_VAR), gShellDebug1HiiHandle, IoAddress32);
//
// Memory Base & Limit
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MEMORY),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->MemoryBase)),
(Bridge->MemoryBase << 16) & 0xfff00000
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_ONE_VAR),
gShellDebug1HiiHandle,
(Bridge->MemoryLimit << 16) | 0x000fffff
- );
+ );
//
// Pre-fetch-able Memory Base & Limit
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_PREFETCHABLE),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->PrefetchableMemoryBase)),
Bridge->PrefetchableBaseUpper32,
(Bridge->PrefetchableMemoryBase << 16) & 0xfff00000
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_TWO_VARS_2),
gShellDebug1HiiHandle,
Bridge->PrefetchableLimitUpper32,
(Bridge->PrefetchableMemoryLimit << 16) | 0x000fffff
- );
+ );
//
// Print register Capabilities Pointer
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CAPABILITIES_PTR_2),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->CapabilityPtr)),
Bridge->CapabilityPtr
- );
+ );
//
// Print register Bridge Control
@@ -3570,19 +3675,25 @@ PciExplainBridgeData (
//
// Print register Interrupt Line & PIN
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_INTERRUPT_LINE_2),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->InterruptLine)),
Bridge->InterruptLine
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_INTERRUPT_PIN),
gShellDebug1HiiHandle,
INDEX_OF (&(Bridge->InterruptPin)),
Bridge->InterruptPin
- );
+ );
return EFI_SUCCESS;
}
@@ -3600,28 +3711,28 @@ PciExplainBridgeData (
**/
EFI_STATUS
PciExplainBar (
- IN UINT32 *Bar,
- IN UINT16 *Command,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
- IN OUT UINTN *Index
+ IN UINT32 *Bar,
+ IN UINT16 *Command,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
+ IN OUT UINTN *Index
)
{
- UINT16 OldCommand;
- UINT16 NewCommand;
- UINT64 Bar64;
- UINT32 OldBar32;
- UINT32 NewBar32;
- UINT64 OldBar64;
- UINT64 NewBar64;
- BOOLEAN IsMem;
- BOOLEAN IsBar32;
- UINT64 RegAddress;
-
- IsBar32 = TRUE;
- Bar64 = 0;
- NewBar32 = 0;
- NewBar64 = 0;
+ UINT16 OldCommand;
+ UINT16 NewCommand;
+ UINT64 Bar64;
+ UINT32 OldBar32;
+ UINT32 NewBar32;
+ UINT64 OldBar64;
+ UINT64 NewBar64;
+ BOOLEAN IsMem;
+ BOOLEAN IsBar32;
+ UINT64 RegAddress;
+
+ IsBar32 = TRUE;
+ Bar64 = 0;
+ NewBar32 = 0;
+ NewBar64 = 0;
//
// According the bar type, list detail about this bar, for example: 32 or
@@ -3633,42 +3744,38 @@ PciExplainBar (
//
IsMem = TRUE;
- if ((*Bar & BIT1) == 0 && (*Bar & BIT2) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_32_BITS), gShellDebug1HiiHandle);
-
- } else if ((*Bar & BIT1) == 0 && (*Bar & BIT2) != 0) {
+ if (((*Bar & BIT1) == 0) && ((*Bar & BIT2) == 0)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_32_BITS), gShellDebug1HiiHandle);
+ } else if (((*Bar & BIT1) == 0) && ((*Bar & BIT2) != 0)) {
Bar64 = 0x0;
CopyMem (&Bar64, Bar, sizeof (UINT64));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_2), gShellDebug1HiiHandle, (UINT32) RShiftU64 ((Bar64 & 0xfffffffffffffff0ULL), 32));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_3), gShellDebug1HiiHandle, (UINT32) (Bar64 & 0xfffffffffffffff0ULL));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_64_BITS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_ONE_VAR_2), gShellDebug1HiiHandle, (UINT32)RShiftU64 ((Bar64 & 0xfffffffffffffff0ULL), 32));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_ONE_VAR_3), gShellDebug1HiiHandle, (UINT32)(Bar64 & 0xfffffffffffffff0ULL));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_64_BITS), gShellDebug1HiiHandle);
IsBar32 = FALSE;
*Index += 1;
-
} else {
//
// Reserved
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEM_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_BAR), gShellDebug1HiiHandle, *Bar & 0xfffffff0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MEM_2), gShellDebug1HiiHandle);
}
if ((*Bar & BIT3) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NO), gShellDebug1HiiHandle);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NO), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_YES), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_YES), gShellDebug1HiiHandle);
}
-
} else {
//
// This bar is of io type
//
IsMem = FALSE;
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_ONE_VAR_4), gShellDebug1HiiHandle, *Bar & 0xfffffffc);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_ONE_VAR_4), gShellDebug1HiiHandle, *Bar & 0xfffffffc);
ShellPrintEx (-1, -1, L"I/O ");
}
@@ -3682,9 +3789,9 @@ PciExplainBar (
//
// Disable io & mem access
//
- OldCommand = *Command;
- NewCommand = (UINT16) (OldCommand & 0xfffc);
- RegAddress = Address | INDEX_OF (Command);
+ OldCommand = *Command;
+ NewCommand = (UINT16)(OldCommand & 0xfffc);
+ RegAddress = Address | INDEX_OF (Command);
IoDev->Pci.Write (IoDev, EfiPciWidthUint16, RegAddress, 1, &NewCommand);
RegAddress = Address | INDEX_OF (Bar);
@@ -3693,24 +3800,22 @@ PciExplainBar (
// Read after write the BAR to get the size
//
if (IsBar32) {
- OldBar32 = *Bar;
- NewBar32 = 0xffffffff;
+ OldBar32 = *Bar;
+ NewBar32 = 0xffffffff;
IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 1, &NewBar32);
IoDev->Pci.Read (IoDev, EfiPciWidthUint32, RegAddress, 1, &NewBar32);
IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 1, &OldBar32);
if (IsMem) {
- NewBar32 = NewBar32 & 0xfffffff0;
- NewBar32 = (~NewBar32) + 1;
-
+ NewBar32 = NewBar32 & 0xfffffff0;
+ NewBar32 = (~NewBar32) + 1;
} else {
- NewBar32 = NewBar32 & 0xfffffffc;
- NewBar32 = (~NewBar32) + 1;
- NewBar32 = NewBar32 & 0x0000ffff;
+ NewBar32 = NewBar32 & 0xfffffffc;
+ NewBar32 = (~NewBar32) + 1;
+ NewBar32 = NewBar32 & 0x0000ffff;
}
} else {
-
OldBar64 = 0x0;
CopyMem (&OldBar64, Bar, sizeof (UINT64));
NewBar64 = 0xffffffffffffffffULL;
@@ -3720,15 +3825,15 @@ PciExplainBar (
IoDev->Pci.Write (IoDev, EfiPciWidthUint32, RegAddress, 2, &OldBar64);
if (IsMem) {
- NewBar64 = NewBar64 & 0xfffffffffffffff0ULL;
- NewBar64 = (~NewBar64) + 1;
-
+ NewBar64 = NewBar64 & 0xfffffffffffffff0ULL;
+ NewBar64 = (~NewBar64) + 1;
} else {
- NewBar64 = NewBar64 & 0xfffffffffffffffcULL;
- NewBar64 = (~NewBar64) + 1;
- NewBar64 = NewBar64 & 0x000000000000ffff;
+ NewBar64 = NewBar64 & 0xfffffffffffffffcULL;
+ NewBar64 = (~NewBar64) + 1;
+ NewBar64 = NewBar64 & 0x000000000000ffff;
}
}
+
//
// Enable io & mem access
//
@@ -3737,24 +3842,25 @@ PciExplainBar (
if (IsMem) {
if (IsBar32) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32), gShellDebug1HiiHandle, NewBar32);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_2), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffff0) - 1);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NEWBAR_32), gShellDebug1HiiHandle, NewBar32);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NEWBAR_32_2), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffff0) - 1);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32) RShiftU64 (NewBar64, 32));
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32) NewBar64);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32)RShiftU64 (NewBar64, 32));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32)NewBar64);
ShellPrintEx (-1, -1, L" ");
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_RSHIFT),
gShellDebug1HiiHandle,
- (UINT32) RShiftU64 ((NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1), 32)
- );
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32) (NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1));
-
+ (UINT32)RShiftU64 ((NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1), 32)
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RSHIFT), gShellDebug1HiiHandle, (UINT32)(NewBar64 + (Bar64 & 0xfffffffffffffff0ULL) - 1));
}
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_3), gShellDebug1HiiHandle, NewBar32);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEWBAR_32_4), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffffc) - 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NEWBAR_32_3), gShellDebug1HiiHandle, NewBar32);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NEWBAR_32_4), gShellDebug1HiiHandle, NewBar32 + (*Bar & 0xfffffffc) - 1);
}
return EFI_SUCCESS;
@@ -3771,20 +3877,23 @@ PciExplainBar (
**/
EFI_STATUS
PciExplainCardBusData (
- IN PCI_CARDBUS_CONTROL_REGISTER *CardBus,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_CARDBUS_CONTROL_REGISTER *CardBus,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
{
BOOLEAN Io32Bit;
PCI_CARDBUS_DATA *CardBusData;
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CARDBUS_SOCKET),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->CardBusSocketReg)),
CardBus->CardBusSocketReg
- );
+ );
//
// Print Secondary Status
@@ -3795,85 +3904,106 @@ PciExplainCardBusData (
// Print Bus Numbers(Primary bus number, CardBus bus number, and
// Subordinate bus number
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_BUS_NUMBERS_2),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->PciBusNumber)),
INDEX_OF (&(CardBus->CardBusBusNumber)),
INDEX_OF (&(CardBus->SubordinateBusNumber))
- );
+ );
ShellPrintEx (-1, -1, L" ------------------------------------------------------\r\n");
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS), gShellDebug1HiiHandle, CardBus->PciBusNumber);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_2), gShellDebug1HiiHandle, CardBus->CardBusBusNumber);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_CARDBUS_3), gShellDebug1HiiHandle, CardBus->SubordinateBusNumber);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_CARDBUS), gShellDebug1HiiHandle, CardBus->PciBusNumber);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_CARDBUS_2), gShellDebug1HiiHandle, CardBus->CardBusBusNumber);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_CARDBUS_3), gShellDebug1HiiHandle, CardBus->SubordinateBusNumber);
//
// Print CardBus Latency Timer
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CARDBUS_LATENCY),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->CardBusLatencyTimer)),
CardBus->CardBusLatencyTimer
- );
+ );
//
// Print Memory/Io ranges this cardbus bridge forwards
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESOURCE_TYPE_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RESOURCE_TYPE_2), gShellDebug1HiiHandle);
ShellPrintEx (-1, -1, L"----------------------------------------------------------------------\r\n");
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MEM_3),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->MemoryBase0)),
CardBus->BridgeControl & BIT8 ? L" Prefetchable" : L"Non-Prefetchable",
CardBus->MemoryBase0 & 0xfffff000,
CardBus->MemoryLimit0 | 0x00000fff
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MEM_3),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->MemoryBase1)),
CardBus->BridgeControl & BIT9 ? L" Prefetchable" : L"Non-Prefetchable",
CardBus->MemoryBase1 & 0xfffff000,
CardBus->MemoryLimit1 | 0x00000fff
- );
+ );
- Io32Bit = (BOOLEAN) (CardBus->IoBase0 & BIT0);
- ShellPrintHiiEx(-1, -1, NULL,
+ Io32Bit = (BOOLEAN)(CardBus->IoBase0 & BIT0);
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_IO_2),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->IoBase0)),
Io32Bit ? L" 32 bit" : L" 16 bit",
CardBus->IoBase0 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
(CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
+ );
- Io32Bit = (BOOLEAN) (CardBus->IoBase1 & BIT0);
- ShellPrintHiiEx(-1, -1, NULL,
+ Io32Bit = (BOOLEAN)(CardBus->IoBase1 & BIT0);
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_IO_2),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->IoBase1)),
Io32Bit ? L" 32 bit" : L" 16 bit",
CardBus->IoBase1 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
(CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
+ );
//
// Print register Interrupt Line & PIN
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_INTERRUPT_LINE_3),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBus->InterruptLine)),
CardBus->InterruptLine,
INDEX_OF (&(CardBus->InterruptPin)),
CardBus->InterruptPin
- );
+ );
//
// Print register Bridge Control
@@ -3885,23 +4015,29 @@ PciExplainCardBusData (
// bridge. Fields include: Sub VendorId, Subsystem ID, and Legacy Mode Base
// Address.
//
- CardBusData = (PCI_CARDBUS_DATA *) ((UINT8 *) CardBus + sizeof (PCI_CARDBUS_CONTROL_REGISTER));
+ CardBusData = (PCI_CARDBUS_DATA *)((UINT8 *)CardBus + sizeof (PCI_CARDBUS_CONTROL_REGISTER));
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SUB_VENDOR_ID_2),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBusData->SubVendorId)),
CardBusData->SubVendorId,
INDEX_OF (&(CardBusData->SubSystemId)),
CardBusData->SubSystemId
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_OPTIONAL),
gShellDebug1HiiHandle,
INDEX_OF (&(CardBusData->LegacyBase)),
CardBusData->LegacyBase
- );
+ );
return EFI_SUCCESS;
}
@@ -3919,88 +4055,100 @@ PciExplainCardBusData (
**/
EFI_STATUS
PciExplainStatus (
- IN UINT16 *Status,
- IN BOOLEAN MainStatus,
- IN PCI_HEADER_TYPE HeaderType
+ IN UINT16 *Status,
+ IN BOOLEAN MainStatus,
+ IN PCI_HEADER_TYPE HeaderType
)
{
if (MainStatus) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SECONDARY_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_SECONDARY_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
}
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_NEW_CAPABILITIES), gShellDebug1HiiHandle, (*Status & BIT4) != 0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_NEW_CAPABILITIES), gShellDebug1HiiHandle, (*Status & BIT4) != 0);
//
// Bit 5 is meaningless for CardBus Bridge
//
if (HeaderType == PciCardBusBridge) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_66_CAPABLE), gShellDebug1HiiHandle, (*Status & BIT5) != 0);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_66_CAPABLE), gShellDebug1HiiHandle, (*Status & BIT5) != 0);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_66_CAPABLE_2), gShellDebug1HiiHandle, (*Status & BIT5) != 0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_66_CAPABLE_2), gShellDebug1HiiHandle, (*Status & BIT5) != 0);
}
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_FAST_BACK), gShellDebug1HiiHandle, (*Status & BIT7) != 0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_FAST_BACK), gShellDebug1HiiHandle, (*Status & BIT7) != 0);
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MASTER_DATA), gShellDebug1HiiHandle, (*Status & BIT8) != 0);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MASTER_DATA), gShellDebug1HiiHandle, (*Status & BIT8) != 0);
//
// Bit 9 and bit 10 together decides the DEVSEL timing
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_DEVSEL_TIMING), gShellDebug1HiiHandle);
- if ((*Status & BIT9) == 0 && (*Status & BIT10) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_FAST), gShellDebug1HiiHandle);
-
- } else if ((*Status & BIT9) != 0 && (*Status & BIT10) == 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_MEDIUM), gShellDebug1HiiHandle);
-
- } else if ((*Status & BIT9) == 0 && (*Status & BIT10) != 0) {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_SLOW), gShellDebug1HiiHandle);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_DEVSEL_TIMING), gShellDebug1HiiHandle);
+ if (((*Status & BIT9) == 0) && ((*Status & BIT10) == 0)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_FAST), gShellDebug1HiiHandle);
+ } else if (((*Status & BIT9) != 0) && ((*Status & BIT10) == 0)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_MEDIUM), gShellDebug1HiiHandle);
+ } else if (((*Status & BIT9) == 0) && ((*Status & BIT10) != 0)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_SLOW), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_RESERVED_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_RESERVED_2), gShellDebug1HiiHandle);
}
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SIGNALED_TARGET),
gShellDebug1HiiHandle,
(*Status & BIT11) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_RECEIVED_TARGET),
gShellDebug1HiiHandle,
(*Status & BIT12) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_RECEIVED_MASTER),
gShellDebug1HiiHandle,
(*Status & BIT13) != 0
- );
+ );
if (MainStatus) {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SIGNALED_ERROR),
gShellDebug1HiiHandle,
(*Status & BIT14) != 0
- );
-
+ );
} else {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_RECEIVED_ERROR),
gShellDebug1HiiHandle,
(*Status & BIT14) != 0
- );
+ );
}
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_DETECTED_ERROR),
gShellDebug1HiiHandle,
(*Status & BIT15) != 0
- );
+ );
return EFI_SUCCESS;
}
@@ -4014,76 +4162,106 @@ PciExplainStatus (
**/
EFI_STATUS
PciExplainCommand (
- IN UINT16 *Command
+ IN UINT16 *Command
)
{
//
// Print the binary value of register Command
//
- ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_COMMAND), gShellDebug1HiiHandle, INDEX_OF (Command), *Command);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_PCI2_COMMAND), gShellDebug1HiiHandle, INDEX_OF (Command), *Command);
//
// Explain register Command bit by bit
//
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SPACE_ACCESS_DENIED),
gShellDebug1HiiHandle,
(*Command & BIT0) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MEMORY_SPACE),
gShellDebug1HiiHandle,
(*Command & BIT1) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_BEHAVE_BUS_MASTER),
gShellDebug1HiiHandle,
(*Command & BIT2) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MONITOR_SPECIAL_CYCLE),
gShellDebug1HiiHandle,
(*Command & BIT3) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MEM_WRITE_INVALIDATE),
gShellDebug1HiiHandle,
(*Command & BIT4) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_PALETTE_SNOOPING),
gShellDebug1HiiHandle,
(*Command & BIT5) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_ASSERT_PERR),
gShellDebug1HiiHandle,
(*Command & BIT6) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_DO_ADDR_STEPPING),
gShellDebug1HiiHandle,
(*Command & BIT7) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SERR_DRIVER),
gShellDebug1HiiHandle,
(*Command & BIT8) != 0
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_FAST_BACK_2),
gShellDebug1HiiHandle,
(*Command & BIT9) != 0
- );
+ );
return EFI_SUCCESS;
}
@@ -4098,95 +4276,139 @@ PciExplainCommand (
**/
EFI_STATUS
PciExplainBridgeControl (
- IN UINT16 *BridgeControl,
- IN PCI_HEADER_TYPE HeaderType
+ IN UINT16 *BridgeControl,
+ IN PCI_HEADER_TYPE HeaderType
)
{
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_BRIDGE_CONTROL),
gShellDebug1HiiHandle,
INDEX_OF (BridgeControl),
*BridgeControl
- );
+ );
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_PARITY_ERROR),
gShellDebug1HiiHandle,
(*BridgeControl & BIT0) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SERR_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT1) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_ISA_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT2) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_VGA_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT3) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_MASTER_ABORT),
gShellDebug1HiiHandle,
(*BridgeControl & BIT5) != 0
- );
+ );
//
// Register Bridge Control has some slight differences between P2P bridge
// and Cardbus bridge from bit 6 to bit 11.
//
if (HeaderType == PciP2pBridge) {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SECONDARY_BUS_RESET),
gShellDebug1HiiHandle,
(*BridgeControl & BIT6) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_FAST_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT7) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_PRIMARY_DISCARD_TIMER),
gShellDebug1HiiHandle,
- (*BridgeControl & BIT8)!=0 ? L"2^10" : L"2^15"
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ (*BridgeControl & BIT8) != 0 ? L"2^10" : L"2^15"
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_SECONDARY_DISCARD_TIMER),
gShellDebug1HiiHandle,
- (*BridgeControl & BIT9)!=0 ? L"2^10" : L"2^15"
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ (*BridgeControl & BIT9) != 0 ? L"2^10" : L"2^15"
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_DISCARD_TIMER_STATUS),
gShellDebug1HiiHandle,
(*BridgeControl & BIT10) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_DISCARD_TIMER_SERR),
gShellDebug1HiiHandle,
(*BridgeControl & BIT11) != 0
- );
-
+ );
} else {
- ShellPrintHiiEx(-1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_CARDBUS_RESET),
gShellDebug1HiiHandle,
(*BridgeControl & BIT6) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_IREQ_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT7) != 0
- );
- ShellPrintHiiEx(-1, -1, NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI2_WRITE_POSTING_ENABLE),
gShellDebug1HiiHandle,
(*BridgeControl & BIT10) != 0
- );
+ );
}
return EFI_SUCCESS;
@@ -4203,8 +4425,8 @@ PciExplainBridgeControl (
**/
UINT8
LocatePciCapability (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT8 CapabilityId
+ IN PCI_CONFIG_SPACE *ConfigSpace,
+ IN UINT8 CapabilityId
)
{
UINT8 CapabilityPtr;
@@ -4232,7 +4454,7 @@ LocatePciCapability (
}
while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {
- CapabilityEntry = (EFI_PCI_CAPABILITY_HDR *) ((UINT8 *) ConfigSpace + CapabilityPtr);
+ CapabilityEntry = (EFI_PCI_CAPABILITY_HDR *)((UINT8 *)ConfigSpace + CapabilityPtr);
if (CapabilityEntry->CapabilityID == CapabilityId) {
return CapabilityPtr;
}
@@ -4260,40 +4482,51 @@ LocatePciCapability (
**/
EFI_STATUS
ExplainPcieCapReg (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- CHAR16 *DevicePortType;
+ CHAR16 *DevicePortType;
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Capability Version(3:0): %E0x%04x%N\r\n",
PciExpressCap->Capability.Bits.Version
- );
+ );
if (PciExpressCap->Capability.Bits.DevicePortType < ARRAY_SIZE (DevicePortTypeTable)) {
DevicePortType = DevicePortTypeTable[PciExpressCap->Capability.Bits.DevicePortType];
} else {
DevicePortType = L"Unknown Type";
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Device/PortType(7:4): %E%s%N\r\n",
DevicePortType
- );
+ );
//
// 'Slot Implemented' is only valid for:
// a) Root Port of PCI Express Root Complex, or
// b) Downstream Port of PCI Express Switch
//
- if (PciExpressCap->Capability.Bits.DevicePortType== PCIE_DEVICE_PORT_TYPE_ROOT_PORT ||
- PciExpressCap->Capability.Bits.DevicePortType == PCIE_DEVICE_PORT_TYPE_DOWNSTREAM_PORT) {
- ShellPrintEx (-1, -1,
+ if ((PciExpressCap->Capability.Bits.DevicePortType == PCIE_DEVICE_PORT_TYPE_ROOT_PORT) ||
+ (PciExpressCap->Capability.Bits.DevicePortType == PCIE_DEVICE_PORT_TYPE_DOWNSTREAM_PORT))
+ {
+ ShellPrintEx (
+ -1,
+ -1,
L" Slot Implemented(8): %E%d%N\r\n",
PciExpressCap->Capability.Bits.SlotImplemented
- );
+ );
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Interrupt Message Number(13:9): %E0x%05x%N\r\n",
PciExpressCap->Capability.Bits.InterruptMessageNumber
- );
+ );
return EFI_SUCCESS;
}
@@ -4306,7 +4539,7 @@ ExplainPcieCapReg (
**/
EFI_STATUS
ExplainPcieDeviceCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
UINT8 DevicePortType;
@@ -4320,14 +4553,19 @@ ExplainPcieDeviceCap (
} else {
ShellPrintEx (-1, -1, L"%EUnknown%N\r\n");
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Phantom Functions Supported(4:3): %E%d%N\r\n",
PciExpressCap->DeviceCapability.Bits.PhantomFunctions
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Extended Tag Field Supported(5): %E%d-bit Tag field supported%N\r\n",
PciExpressCap->DeviceCapability.Bits.ExtendedTagField ? 8 : 5
- );
+ );
//
// Endpoint L0s and L1 Acceptable Latency is only valid for Endpoint
//
@@ -4344,6 +4582,7 @@ ExplainPcieDeviceCap (
ShellPrintEx (-1, -1, L"%ENo limit%N\r\n");
}
}
+
ShellPrintEx (-1, -1, L" Endpoint L1 Acceptable Latency(11:9): ");
if (L1Latency < 7) {
ShellPrintEx (-1, -1, L"%EMaximum of %d us%N\r\n", 1 << (L1Latency + 1));
@@ -4351,34 +4590,45 @@ ExplainPcieDeviceCap (
ShellPrintEx (-1, -1, L"%ENo limit%N\r\n");
}
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Role-based Error Reporting(15): %E%d%N\r\n",
PciExpressCap->DeviceCapability.Bits.RoleBasedErrorReporting
- );
+ );
//
// Only valid for Upstream Port:
// a) Captured Slot Power Limit Value
// b) Captured Slot Power Scale
//
if (DevicePortType == PCIE_DEVICE_PORT_TYPE_UPSTREAM_PORT) {
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Captured Slot Power Limit Value(25:18): %E0x%02x%N\r\n",
PciExpressCap->DeviceCapability.Bits.CapturedSlotPowerLimitValue
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Captured Slot Power Limit Scale(27:26): %E%s%N\r\n",
SlotPwrLmtScaleTable[PciExpressCap->DeviceCapability.Bits.CapturedSlotPowerLimitScale]
- );
+ );
}
+
//
// Function Level Reset Capability is only valid for Endpoint
//
if (IS_PCIE_ENDPOINT (DevicePortType)) {
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Function Level Reset Capability(28): %E%d%N\r\n",
PciExpressCap->DeviceCapability.Bits.FunctionLevelReset
- );
+ );
}
+
return EFI_SUCCESS;
}
@@ -4391,66 +4641,89 @@ ExplainPcieDeviceCap (
**/
EFI_STATUS
ExplainPcieDeviceControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Correctable Error Reporting Enable(0): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.CorrectableError
);
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Non-Fatal Error Reporting Enable(1): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.NonFatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Fatal Error Reporting Enable(2): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.FatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Unsupported Request Reporting Enable(3): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.UnsupportedRequest
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Enable Relaxed Ordering(4): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.RelaxedOrdering
- );
+ );
ShellPrintEx (-1, -1, L" Max_Payload_Size(7:5): ");
if (PciExpressCap->DeviceControl.Bits.MaxPayloadSize < 6) {
ShellPrintEx (-1, -1, L"%E%d bytes%N\r\n", 1 << (PciExpressCap->DeviceControl.Bits.MaxPayloadSize + 7));
} else {
ShellPrintEx (-1, -1, L"%EUnknown%N\r\n");
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Extended Tag Field Enable(8): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.ExtendedTagField
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Phantom Functions Enable(9): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.PhantomFunctions
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Auxiliary (AUX) Power PM Enable(10): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.AuxPower
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Enable No Snoop(11): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.NoSnoop
- );
+ );
ShellPrintEx (-1, -1, L" Max_Read_Request_Size(14:12): ");
if (PciExpressCap->DeviceControl.Bits.MaxReadRequestSize < 6) {
ShellPrintEx (-1, -1, L"%E%d bytes%N\r\n", 1 << (PciExpressCap->DeviceControl.Bits.MaxReadRequestSize + 7));
} else {
ShellPrintEx (-1, -1, L"%EUnknown%N\r\n");
}
+
//
// Read operation is only valid for PCI Express to PCI/PCI-X Bridges
//
if (PciExpressCap->Capability.Bits.DevicePortType == PCIE_DEVICE_PORT_TYPE_PCIE_TO_PCI_BRIDGE) {
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Bridge Configuration Retry Enable(15): %E%d%N\r\n",
PciExpressCap->DeviceControl.Bits.BridgeConfigurationRetryOrFunctionLevelReset
- );
+ );
}
+
return EFI_SUCCESS;
}
@@ -4463,33 +4736,45 @@ ExplainPcieDeviceControl (
**/
EFI_STATUS
ExplainPcieDeviceStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Correctable Error Detected(0): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.CorrectableError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Non-Fatal Error Detected(1): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.NonFatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Fatal Error Detected(2): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.FatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Unsupported Request Detected(3): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.UnsupportedRequest
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" AUX Power Detected(4): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.AuxPower
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Transactions Pending(5): %E%d%N\r\n",
PciExpressCap->DeviceStatus.Bits.TransactionsPending
- );
+ );
return EFI_SUCCESS;
}
@@ -4502,11 +4787,11 @@ ExplainPcieDeviceStatus (
**/
EFI_STATUS
ExplainPcieLinkCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- CHAR16 *MaxLinkSpeed;
- CHAR16 *AspmValue;
+ CHAR16 *MaxLinkSpeed;
+ CHAR16 *AspmValue;
switch (PciExpressCap->LinkCapability.Bits.MaxLinkSpeed) {
case 1:
@@ -4528,14 +4813,19 @@ ExplainPcieLinkCap (
MaxLinkSpeed = L"Reserved";
break;
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Maximum Link Speed(3:0): %E%s%N\r\n",
MaxLinkSpeed
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Maximum Link Width(9:4): %Ex%d%N\r\n",
PciExpressCap->LinkCapability.Bits.MaxLinkWidth
- );
+ );
switch (PciExpressCap->LinkCapability.Bits.Aspm) {
case 0:
AspmValue = L"Not";
@@ -4553,38 +4843,55 @@ ExplainPcieLinkCap (
AspmValue = L"Reserved";
break;
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Active State Power Management Support(11:10): %E%s Supported%N\r\n",
AspmValue
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" L0s Exit Latency(14:12): %E%s%N\r\n",
L0sLatencyStrTable[PciExpressCap->LinkCapability.Bits.L0sExitLatency]
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" L1 Exit Latency(17:15): %E%s%N\r\n",
L1LatencyStrTable[PciExpressCap->LinkCapability.Bits.L1ExitLatency]
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Clock Power Management(18): %E%d%N\r\n",
PciExpressCap->LinkCapability.Bits.ClockPowerManagement
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Surprise Down Error Reporting Capable(19): %E%d%N\r\n",
PciExpressCap->LinkCapability.Bits.SurpriseDownError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Data Link Layer Link Active Reporting Capable(20): %E%d%N\r\n",
PciExpressCap->LinkCapability.Bits.DataLinkLayerLinkActive
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Bandwidth Notification Capability(21): %E%d%N\r\n",
PciExpressCap->LinkCapability.Bits.LinkBandwidthNotification
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Port Number(31:24): %E0x%02x%N\r\n",
PciExpressCap->LinkCapability.Bits.PortNumber
- );
+ );
return EFI_SUCCESS;
}
@@ -4597,25 +4904,30 @@ ExplainPcieLinkCap (
**/
EFI_STATUS
ExplainPcieLinkControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
UINT8 DevicePortType;
- DevicePortType = (UINT8)PciExpressCap->Capability.Bits.DevicePortType;
- ShellPrintEx (-1, -1,
+ DevicePortType = (UINT8)PciExpressCap->Capability.Bits.DevicePortType;
+ ShellPrintEx (
+ -1,
+ -1,
L" Active State Power Management Control(1:0): %E%s%N\r\n",
ASPMCtrlStrTable[PciExpressCap->LinkControl.Bits.AspmControl]
- );
+ );
//
// RCB is not applicable to switches
//
- if (!IS_PCIE_SWITCH(DevicePortType)) {
- ShellPrintEx (-1, -1,
+ if (!IS_PCIE_SWITCH (DevicePortType)) {
+ ShellPrintEx (
+ -1,
+ -1,
L" Read Completion Boundary (RCB)(3): %E%d byte%N\r\n",
1 << (PciExpressCap->LinkControl.Bits.ReadCompletionBoundary + 6)
- );
+ );
}
+
//
// Link Disable is reserved on
// a) Endpoints
@@ -4623,37 +4935,53 @@ ExplainPcieLinkControl (
// c) Upstream Ports of Switches
//
if (!IS_PCIE_ENDPOINT (DevicePortType) &&
- DevicePortType != PCIE_DEVICE_PORT_TYPE_UPSTREAM_PORT &&
- DevicePortType != PCIE_DEVICE_PORT_TYPE_PCIE_TO_PCI_BRIDGE) {
- ShellPrintEx (-1, -1,
+ (DevicePortType != PCIE_DEVICE_PORT_TYPE_UPSTREAM_PORT) &&
+ (DevicePortType != PCIE_DEVICE_PORT_TYPE_PCIE_TO_PCI_BRIDGE))
+ {
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Disable(4): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.LinkDisable
- );
+ );
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Common Clock Configuration(6): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.CommonClockConfiguration
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Extended Synch(7): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.ExtendedSynch
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Enable Clock Power Management(8): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.ClockPowerManagement
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Hardware Autonomous Width Disable(9): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.HardwareAutonomousWidthDisable
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Bandwidth Management Interrupt Enable(10): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.LinkBandwidthManagementInterrupt
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Autonomous Bandwidth Interrupt Enable(11): %E%d%N\r\n",
PciExpressCap->LinkControl.Bits.LinkAutonomousBandwidthInterrupt
- );
+ );
return EFI_SUCCESS;
}
@@ -4666,10 +4994,10 @@ ExplainPcieLinkControl (
**/
EFI_STATUS
ExplainPcieLinkStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- CHAR16 *CurLinkSpeed;
+ CHAR16 *CurLinkSpeed;
switch (PciExpressCap->LinkStatus.Bits.CurrentLinkSpeed) {
case 1:
@@ -4691,34 +5019,49 @@ ExplainPcieLinkStatus (
CurLinkSpeed = L"Reserved";
break;
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Current Link Speed(3:0): %E%s%N\r\n",
CurLinkSpeed
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Negotiated Link Width(9:4): %Ex%d%N\r\n",
PciExpressCap->LinkStatus.Bits.NegotiatedLinkWidth
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Training(11): %E%d%N\r\n",
PciExpressCap->LinkStatus.Bits.LinkTraining
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Slot Clock Configuration(12): %E%d%N\r\n",
PciExpressCap->LinkStatus.Bits.SlotClockConfiguration
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Data Link Layer Link Active(13): %E%d%N\r\n",
PciExpressCap->LinkStatus.Bits.DataLinkLayerLinkActive
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Bandwidth Management Status(14): %E%d%N\r\n",
PciExpressCap->LinkStatus.Bits.LinkBandwidthManagement
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Link Autonomous Bandwidth Status(15): %E%d%N\r\n",
PciExpressCap->LinkStatus.Bits.LinkAutonomousBandwidth
- );
+ );
return EFI_SUCCESS;
}
@@ -4731,57 +5074,81 @@ ExplainPcieLinkStatus (
**/
EFI_STATUS
ExplainPcieSlotCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Attention Button Present(0): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.AttentionButton
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Power Controller Present(1): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.PowerController
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" MRL Sensor Present(2): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.MrlSensor
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Attention Indicator Present(3): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.AttentionIndicator
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Power Indicator Present(4): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.PowerIndicator
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Hot-Plug Surprise(5): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.HotPlugSurprise
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Hot-Plug Capable(6): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.HotPlugCapable
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Slot Power Limit Value(14:7): %E0x%02x%N\r\n",
PciExpressCap->SlotCapability.Bits.SlotPowerLimitValue
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Slot Power Limit Scale(16:15): %E%s%N\r\n",
SlotPwrLmtScaleTable[PciExpressCap->SlotCapability.Bits.SlotPowerLimitScale]
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Electromechanical Interlock Present(17): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.ElectromechanicalInterlock
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" No Command Completed Support(18): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.NoCommandCompleted
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Physical Slot Number(31:19): %E%d%N\r\n",
PciExpressCap->SlotCapability.Bits.PhysicalSlotNumber
- );
+ );
return EFI_SUCCESS;
}
@@ -4795,57 +5162,79 @@ ExplainPcieSlotCap (
**/
EFI_STATUS
ExplainPcieSlotControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Attention Button Pressed Enable(0): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.AttentionButtonPressed
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Power Fault Detected Enable(1): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.PowerFaultDetected
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" MRL Sensor Changed Enable(2): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.MrlSensorChanged
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Presence Detect Changed Enable(3): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.PresenceDetectChanged
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Command Completed Interrupt Enable(4): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.CommandCompletedInterrupt
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Hot-Plug Interrupt Enable(5): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.HotPlugInterrupt
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Attention Indicator Control(7:6): %E%s%N\r\n",
IndicatorTable[
- PciExpressCap->SlotControl.Bits.AttentionIndicator]
- );
- ShellPrintEx (-1, -1,
+ PciExpressCap->SlotControl.Bits.AttentionIndicator]
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Power Indicator Control(9:8): %E%s%N\r\n",
IndicatorTable[PciExpressCap->SlotControl.Bits.PowerIndicator]
- );
+ );
ShellPrintEx (-1, -1, L" Power Controller Control(10): %EPower ");
if (
- PciExpressCap->SlotControl.Bits.PowerController) {
+ PciExpressCap->SlotControl.Bits.PowerController)
+ {
ShellPrintEx (-1, -1, L"Off%N\r\n");
} else {
ShellPrintEx (-1, -1, L"On%N\r\n");
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Electromechanical Interlock Control(11): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.ElectromechanicalInterlock
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Data Link Layer State Changed Enable(12): %E%d%N\r\n",
PciExpressCap->SlotControl.Bits.DataLinkLayerStateChanged
- );
+ );
return EFI_SUCCESS;
}
@@ -4858,54 +5247,72 @@ ExplainPcieSlotControl (
**/
EFI_STATUS
ExplainPcieSlotStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" Attention Button Pressed(0): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.AttentionButtonPressed
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Power Fault Detected(1): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.PowerFaultDetected
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" MRL Sensor Changed(2): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.MrlSensorChanged
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Presence Detect Changed(3): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.PresenceDetectChanged
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" Command Completed(4): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.CommandCompleted
- );
+ );
ShellPrintEx (-1, -1, L" MRL Sensor State(5): %EMRL ");
if (
- PciExpressCap->SlotStatus.Bits.MrlSensor) {
+ PciExpressCap->SlotStatus.Bits.MrlSensor)
+ {
ShellPrintEx (-1, -1, L" Opened%N\r\n");
} else {
ShellPrintEx (-1, -1, L" Closed%N\r\n");
}
+
ShellPrintEx (-1, -1, L" Presence Detect State(6): ");
if (
- PciExpressCap->SlotStatus.Bits.PresenceDetect) {
+ PciExpressCap->SlotStatus.Bits.PresenceDetect)
+ {
ShellPrintEx (-1, -1, L"%ECard Present in slot%N\r\n");
} else {
ShellPrintEx (-1, -1, L"%ESlot Empty%N\r\n");
}
+
ShellPrintEx (-1, -1, L" Electromechanical Interlock Status(7): %EElectromechanical Interlock ");
if (
- PciExpressCap->SlotStatus.Bits.ElectromechanicalInterlock) {
+ PciExpressCap->SlotStatus.Bits.ElectromechanicalInterlock)
+ {
ShellPrintEx (-1, -1, L"Engaged%N\r\n");
} else {
ShellPrintEx (-1, -1, L"Disengaged%N\r\n");
}
- ShellPrintEx (-1, -1,
+
+ ShellPrintEx (
+ -1,
+ -1,
L" Data Link Layer State Changed(8): %E%d%N\r\n",
PciExpressCap->SlotStatus.Bits.DataLinkLayerStateChanged
- );
+ );
return EFI_SUCCESS;
}
@@ -4918,29 +5325,39 @@ ExplainPcieSlotStatus (
**/
EFI_STATUS
ExplainPcieRootControl (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" System Error on Correctable Error Enable(0): %E%d%N\r\n",
PciExpressCap->RootControl.Bits.SystemErrorOnCorrectableError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" System Error on Non-Fatal Error Enable(1): %E%d%N\r\n",
PciExpressCap->RootControl.Bits.SystemErrorOnNonFatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" System Error on Fatal Error Enable(2): %E%d%N\r\n",
PciExpressCap->RootControl.Bits.SystemErrorOnFatalError
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" PME Interrupt Enable(3): %E%d%N\r\n",
PciExpressCap->RootControl.Bits.PmeInterrupt
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" CRS Software Visibility Enable(4): %E%d%N\r\n",
PciExpressCap->RootControl.Bits.CrsSoftwareVisibility
- );
+ );
return EFI_SUCCESS;
}
@@ -4954,13 +5371,15 @@ ExplainPcieRootControl (
**/
EFI_STATUS
ExplainPcieRootCap (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" CRS Software Visibility(0): %E%d%N\r\n",
PciExpressCap->RootCapability.Bits.CrsSoftwareVisibility
- );
+ );
return EFI_SUCCESS;
}
@@ -4974,21 +5393,27 @@ ExplainPcieRootCap (
**/
EFI_STATUS
ExplainPcieRootStatus (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L" PME Requester ID(15:0): %E0x%04x%N\r\n",
PciExpressCap->RootStatus.Bits.PmeRequesterId
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" PME Status(16): %E%d%N\r\n",
PciExpressCap->RootStatus.Bits.PmeStatus
- );
- ShellPrintEx (-1, -1,
+ );
+ ShellPrintEx (
+ -1,
+ -1,
L" PME Pending(17): %E%d%N\r\n",
PciExpressCap->RootStatus.Bits.PmePending
- );
+ );
return EFI_SUCCESS;
}
@@ -5000,15 +5425,18 @@ ExplainPcieRootStatus (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityLinkControl (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL),
gShellDebug1HiiHandle,
Header->RootComplexLinkCapabilities,
@@ -5017,9 +5445,9 @@ PrintInterpretedExtendedCompatibilityLinkControl (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5032,15 +5460,18 @@ PrintInterpretedExtendedCompatibilityLinkControl (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityPowerBudgeting (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_POWER),
gShellDebug1HiiHandle,
Header->DataSelect,
@@ -5049,9 +5480,9 @@ PrintInterpretedExtendedCompatibilityPowerBudgeting (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5064,32 +5495,37 @@ PrintInterpretedExtendedCompatibilityPowerBudgeting (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityAcs (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED *Header;
UINT16 VectorSize;
UINT16 LoopCounter;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED*)HeaderAddress;
- VectorSize = 0;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED *)HeaderAddress;
+ VectorSize = 0;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ACS),
gShellDebug1HiiHandle,
Header->AcsCapability,
Header->AcsControl
);
- if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(Header)) {
- VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(Header);
+ if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL (Header)) {
+ VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE (Header);
if (VectorSize == 0) {
VectorSize = 256;
}
- for (LoopCounter = 0 ; LoopCounter * 8 < VectorSize ; LoopCounter++) {
- ShellPrintHiiEx(
- -1, -1, NULL,
+
+ for (LoopCounter = 0; LoopCounter * 8 < VectorSize; LoopCounter++) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ACS2),
gShellDebug1HiiHandle,
LoopCounter + 1,
@@ -5097,11 +5533,12 @@ PrintInterpretedExtendedCompatibilityAcs (
);
}
}
+
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED) + (VectorSize / 8) - 1,
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED) + (VectorSize / 8) - 1,
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5114,15 +5551,18 @@ PrintInterpretedExtendedCompatibilityAcs (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LAT),
gShellDebug1HiiHandle,
Header->MaxSnoopLatency,
@@ -5130,9 +5570,9 @@ PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5145,24 +5585,27 @@ PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilitySerialNumber (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_SN),
gShellDebug1HiiHandle,
Header->SerialNumber
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5175,15 +5618,18 @@ PrintInterpretedExtendedCompatibilitySerialNumber (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityRcrb (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_RCRB),
gShellDebug1HiiHandle,
Header->VendorId,
@@ -5193,9 +5639,9 @@ PrintInterpretedExtendedCompatibilityRcrb (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5208,24 +5654,27 @@ PrintInterpretedExtendedCompatibilityRcrb (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityVendorSpecific (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VEN),
gShellDebug1HiiHandle,
Header->VendorSpecificHeader
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_GET_SIZE(Header),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_GET_SIZE (Header),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5238,24 +5687,27 @@ PrintInterpretedExtendedCompatibilityVendorSpecific (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityECEA (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ECEA),
gShellDebug1HiiHandle,
Header->AssociationBitmap
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5268,15 +5720,18 @@ PrintInterpretedExtendedCompatibilityECEA (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityAri (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ARI),
gShellDebug1HiiHandle,
Header->AriCapability,
@@ -5284,9 +5739,9 @@ PrintInterpretedExtendedCompatibilityAri (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5299,16 +5754,19 @@ PrintInterpretedExtendedCompatibilityAri (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *Header;
- UINT8 LinkCount;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *Header;
+ UINT8 LinkCount;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_DPA),
gShellDebug1HiiHandle,
Header->DpaCapability,
@@ -5316,20 +5774,23 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (
Header->DpaStatus,
Header->DpaControl
);
- for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header) + 1 ; LinkCount++) {
- ShellPrintHiiEx(
- -1, -1, NULL,
+ for (LinkCount = 0; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX (Header) + 1; LinkCount++) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_DPA2),
gShellDebug1HiiHandle,
LinkCount+1,
Header->DpaPowerAllocationArray[LinkCount]
);
}
+
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION) - 1 + PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION) - 1 + PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX (Header),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5342,35 +5803,41 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityLinkDeclaration (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION *Header;
UINT8 LinkCount;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION*)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR),
gShellDebug1HiiHandle,
Header->ElementSelfDescription
);
- for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header) ; LinkCount++) {
- ShellPrintHiiEx(
- -1, -1, NULL,
+ for (LinkCount = 0; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT (Header); LinkCount++) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2),
gShellDebug1HiiHandle,
LinkCount+1,
Header->LinkEntry[LinkCount]
);
}
+
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION) + (PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header)-1)*sizeof(UINT32),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION) + (PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT (Header)-1)*sizeof (UINT32),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5383,15 +5850,18 @@ PrintInterpretedExtendedCompatibilityLinkDeclaration (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityAer (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_AER),
gShellDebug1HiiHandle,
Header->UncorrectableErrorStatus,
@@ -5415,9 +5885,9 @@ PrintInterpretedExtendedCompatibilityAer (
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
}
@@ -5431,16 +5901,19 @@ PrintInterpretedExtendedCompatibilityAer (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityMulticast (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
- IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST *Header;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST),
gShellDebug1HiiHandle,
Header->MultiCastCapability,
@@ -5454,9 +5927,9 @@ PrintInterpretedExtendedCompatibilityMulticast (
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
@@ -5470,17 +5943,20 @@ PrintInterpretedExtendedCompatibilityMulticast (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityVirtualChannel (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY *Header;
CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC *CapabilityItem;
UINT32 ItemCount;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY*)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE),
gShellDebug1HiiHandle,
Header->ExtendedVcCount,
@@ -5490,10 +5966,12 @@ PrintInterpretedExtendedCompatibilityVirtualChannel (
Header->PortVcControl,
Header->PortVcStatus
);
- for (ItemCount = 0 ; ItemCount < Header->ExtendedVcCount ; ItemCount++) {
+ for (ItemCount = 0; ItemCount < Header->ExtendedVcCount; ItemCount++) {
CapabilityItem = &Header->Capability[ItemCount];
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM),
gShellDebug1HiiHandle,
ItemCount+1,
@@ -5506,10 +5984,10 @@ PrintInterpretedExtendedCompatibilityVirtualChannel (
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY)
+ Header->ExtendedVcCount * sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC),
- (VOID *) (HeaderAddress)
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
@@ -5523,17 +6001,20 @@ PrintInterpretedExtendedCompatibilityVirtualChannel (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityResizeableBar (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR *Header;
- UINT32 ItemCount;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR *Header;
+ UINT32 ItemCount;
- for (ItemCount = 0 ; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) ; ItemCount++) {
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR *)HeaderAddress;
+
+ for (ItemCount = 0; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS (Header); ItemCount++) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR),
gShellDebug1HiiHandle,
ItemCount+1,
@@ -5544,9 +6025,9 @@ PrintInterpretedExtendedCompatibilityResizeableBar (
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) * sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ (UINT32)GET_NUMBER_RESIZABLE_BARS (Header) * sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
@@ -5560,15 +6041,18 @@ PrintInterpretedExtendedCompatibilityResizeableBar (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilityTph (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH *Header;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_TPH),
gShellDebug1HiiHandle,
Header->TphRequesterCapability,
@@ -5576,16 +6060,16 @@ PrintInterpretedExtendedCompatibilityTph (
);
DumpHex (
8,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)Header->TphStTable - (UINT8*)HeadersBaseAddress),
- GET_TPH_TABLE_SIZE(Header),
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)Header->TphStTable - (UINT8 *)HeadersBaseAddress),
+ GET_TPH_TABLE_SIZE (Header),
(VOID *)Header->TphStTable
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
- sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH) + GET_TPH_TABLE_SIZE(Header) - sizeof(UINT16),
- (VOID *) (HeaderAddress)
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH) + GET_TPH_TABLE_SIZE (Header) - sizeof (UINT16),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
@@ -5600,16 +6084,19 @@ PrintInterpretedExtendedCompatibilityTph (
**/
EFI_STATUS
PrintInterpretedExtendedCompatibilitySecondary (
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
- IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCap
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCap
)
{
- CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE *Header;
- Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE*)HeaderAddress;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE *)HeaderAddress;
- ShellPrintHiiEx(
- -1, -1, NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY),
gShellDebug1HiiHandle,
Header->LinkControl3.Uint32,
@@ -5617,17 +6104,17 @@ PrintInterpretedExtendedCompatibilitySecondary (
);
DumpHex (
8,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)Header->EqualizationControl - (UINT8*)HeadersBaseAddress),
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)Header->EqualizationControl - (UINT8 *)HeadersBaseAddress),
PciExpressCap->LinkCapability.Bits.MaxLinkWidth * sizeof (PCI_EXPRESS_REG_LANE_EQUALIZATION_CONTROL),
(VOID *)Header->EqualizationControl
);
DumpHex (
4,
- EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE) - sizeof (Header->EqualizationControl)
- + PciExpressCap->LinkCapability.Bits.MaxLinkWidth * sizeof (PCI_EXPRESS_REG_LANE_EQUALIZATION_CONTROL),
- (VOID *) (HeaderAddress)
+ + PciExpressCap->LinkCapability.Bits.MaxLinkWidth * sizeof (PCI_EXPRESS_REG_LANE_EQUALIZATION_CONTROL),
+ (VOID *)(HeaderAddress)
);
return (EFI_SUCCESS);
@@ -5641,59 +6128,60 @@ PrintInterpretedExtendedCompatibilitySecondary (
@param[in] PciExpressCapPtr The address of the PCIe capabilities structure.
**/
EFI_STATUS
-PrintPciExtendedCapabilityDetails(
- IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
- IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
- IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr
+PrintPciExtendedCapabilityDetails (
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr
)
{
- switch (HeaderAddress->CapabilityId){
+ switch (HeaderAddress->CapabilityId) {
case PCI_EXPRESS_EXTENDED_CAPABILITY_ADVANCED_ERROR_REPORTING_ID:
- return PrintInterpretedExtendedCompatibilityAer(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityAer (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_CONTROL_ID:
- return PrintInterpretedExtendedCompatibilityLinkControl(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityLinkControl (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_ID:
- return PrintInterpretedExtendedCompatibilityLinkDeclaration(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityLinkDeclaration (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_SERIAL_NUMBER_ID:
- return PrintInterpretedExtendedCompatibilitySerialNumber(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilitySerialNumber (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_POWER_BUDGETING_ID:
- return PrintInterpretedExtendedCompatibilityPowerBudgeting(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityPowerBudgeting (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_ID:
- return PrintInterpretedExtendedCompatibilityAcs(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityAcs (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_LATENCE_TOLERANCE_REPORTING_ID:
- return PrintInterpretedExtendedCompatibilityLatencyToleranceReporting(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID:
- return PrintInterpretedExtendedCompatibilityAri(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityAri (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_RCRB_HEADER_ID:
- return PrintInterpretedExtendedCompatibilityRcrb(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityRcrb (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_ID:
- return PrintInterpretedExtendedCompatibilityVendorSpecific(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityVendorSpecific (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_ID:
- return PrintInterpretedExtendedCompatibilityDynamicPowerAllocation(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_ID:
- return PrintInterpretedExtendedCompatibilityECEA(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityECEA (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID:
case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID:
- return PrintInterpretedExtendedCompatibilityVirtualChannel(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityVirtualChannel (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID:
//
// should only be present if PCIE_CAP_DEVICEPORT_TYPE(PciExpressCapPtr->PcieCapReg) == 0100b, 0101b, or 0110b
//
- return PrintInterpretedExtendedCompatibilityMulticast(HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
+ return PrintInterpretedExtendedCompatibilityMulticast (HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
case PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_ID:
- return PrintInterpretedExtendedCompatibilityResizeableBar(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityResizeableBar (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_TPH_ID:
- return PrintInterpretedExtendedCompatibilityTph(HeaderAddress, HeadersBaseAddress);
+ return PrintInterpretedExtendedCompatibilityTph (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_SECONDARY_PCIE_ID:
- return PrintInterpretedExtendedCompatibilitySecondary(HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
+ return PrintInterpretedExtendedCompatibilitySecondary (HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
default:
- ShellPrintEx (-1, -1,
+ ShellPrintEx (
+ -1,
+ -1,
L"Unknown PCIe extended capability ID (%04xh). No interpretation available.\r\n",
HeaderAddress->CapabilityId
);
return EFI_SUCCESS;
- };
-
+ }
}
/**
@@ -5706,50 +6194,56 @@ PrintPciExtendedCapabilityDetails(
**/
VOID
PciExplainPciExpress (
- IN PCI_CAPABILITY_PCIEXP *PciExpressCap,
- IN UINT8 *ExtendedConfigSpace,
- IN UINTN ExtendedConfigSize,
- IN CONST UINT16 ExtendedCapability
+ IN PCI_CAPABILITY_PCIEXP *PciExpressCap,
+ IN UINT8 *ExtendedConfigSpace,
+ IN UINTN ExtendedConfigSize,
+ IN CONST UINT16 ExtendedCapability
)
{
- UINT8 DevicePortType;
- UINTN Index;
- UINT8 *RegAddr;
- UINTN RegValue;
- PCI_EXP_EXT_HDR *ExtHdr;
+ UINT8 DevicePortType;
+ UINTN Index;
+ UINT8 *RegAddr;
+ UINTN RegValue;
+ PCI_EXP_EXT_HDR *ExtHdr;
DevicePortType = (UINT8)PciExpressCap->Capability.Bits.DevicePortType;
ShellPrintEx (-1, -1, L"\r\nPci Express device capability structure:\r\n");
for (Index = 0; PcieExplainList[Index].Type < PcieExplainTypeMax; Index++) {
- if (ShellGetExecutionBreakFlag()) {
+ if (ShellGetExecutionBreakFlag ()) {
return;
}
- RegAddr = (UINT8 *) PciExpressCap + PcieExplainList[Index].Offset;
+
+ RegAddr = (UINT8 *)PciExpressCap + PcieExplainList[Index].Offset;
switch (PcieExplainList[Index].Width) {
case FieldWidthUINT8:
- RegValue = *(UINT8 *) RegAddr;
+ RegValue = *(UINT8 *)RegAddr;
break;
case FieldWidthUINT16:
- RegValue = *(UINT16 *) RegAddr;
+ RegValue = *(UINT16 *)RegAddr;
break;
case FieldWidthUINT32:
- RegValue = *(UINT32 *) RegAddr;
+ RegValue = *(UINT32 *)RegAddr;
break;
default:
RegValue = 0;
break;
}
- ShellPrintHiiEx(-1, -1, NULL,
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
PcieExplainList[Index].Token,
gShellDebug1HiiHandle,
PcieExplainList[Index].Offset,
RegValue
- );
+ );
if (PcieExplainList[Index].Func == NULL) {
continue;
}
+
switch (PcieExplainList[Index].Type) {
case PcieExplainTypeLink:
//
@@ -5757,10 +6251,12 @@ PciExplainPciExpress (
// a) Root Complex Integrated Endpoint
// b) Root Complex Event Collector
//
- if (DevicePortType == PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT ||
- DevicePortType == PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_EVENT_COLLECTOR) {
+ if ((DevicePortType == PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT) ||
+ (DevicePortType == PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_EVENT_COLLECTOR))
+ {
continue;
}
+
break;
case PcieExplainTypeSlot:
//
@@ -5769,11 +6265,13 @@ PciExplainPciExpress (
// b) Downstream Port of PCI Express Switch
// and when SlotImplemented bit is set in PCIE cap register.
//
- if ((DevicePortType != PCIE_DEVICE_PORT_TYPE_ROOT_PORT &&
- DevicePortType != PCIE_DEVICE_PORT_TYPE_DOWNSTREAM_PORT) ||
- !PciExpressCap->Capability.Bits.SlotImplemented) {
+ if (((DevicePortType != PCIE_DEVICE_PORT_TYPE_ROOT_PORT) &&
+ (DevicePortType != PCIE_DEVICE_PORT_TYPE_DOWNSTREAM_PORT)) ||
+ !PciExpressCap->Capability.Bits.SlotImplemented)
+ {
continue;
}
+
break;
case PcieExplainTypeRoot:
//
@@ -5783,31 +6281,34 @@ PciExplainPciExpress (
if (DevicePortType != PCIE_DEVICE_PORT_TYPE_ROOT_PORT) {
continue;
}
+
break;
default:
break;
}
+
PcieExplainList[Index].Func (PciExpressCap);
}
- ExtHdr = (PCI_EXP_EXT_HDR*)ExtendedConfigSpace;
+ ExtHdr = (PCI_EXP_EXT_HDR *)ExtendedConfigSpace;
while (ExtHdr->CapabilityId != 0 && ExtHdr->CapabilityVersion != 0 && ExtHdr->CapabilityId != 0xFFFF) {
//
// Process this item
//
- if (ExtendedCapability == 0xFFFF || ExtendedCapability == ExtHdr->CapabilityId) {
+ if ((ExtendedCapability == 0xFFFF) || (ExtendedCapability == ExtHdr->CapabilityId)) {
//
// Print this item
//
- PrintPciExtendedCapabilityDetails((PCI_EXP_EXT_HDR*)ExtendedConfigSpace, ExtHdr, PciExpressCap);
+ PrintPciExtendedCapabilityDetails ((PCI_EXP_EXT_HDR *)ExtendedConfigSpace, ExtHdr, PciExpressCap);
}
//
// Advance to the next item if it exists
//
- if (ExtHdr->NextCapabilityOffset != 0 &&
- (ExtHdr->NextCapabilityOffset <= (UINT32) (ExtendedConfigSize + EFI_PCIE_CAPABILITY_BASE_OFFSET - sizeof (PCI_EXP_EXT_HDR)))) {
- ExtHdr = (PCI_EXP_EXT_HDR*)(ExtendedConfigSpace + ExtHdr->NextCapabilityOffset - EFI_PCIE_CAPABILITY_BASE_OFFSET);
+ if ((ExtHdr->NextCapabilityOffset != 0) &&
+ (ExtHdr->NextCapabilityOffset <= (UINT32)(ExtendedConfigSize + EFI_PCIE_CAPABILITY_BASE_OFFSET - sizeof (PCI_EXP_EXT_HDR))))
+ {
+ ExtHdr = (PCI_EXP_EXT_HDR *)(ExtendedConfigSpace + ExtHdr->NextCapabilityOffset - EFI_PCIE_CAPABILITY_BASE_OFFSET);
} else {
break;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
index 6e423d521e..d2896675bf 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
@@ -17,7 +17,7 @@ typedef enum {
PciUndefined
} PCI_HEADER_TYPE;
-#define INDEX_OF(Field) ((UINT8 *) (Field) - (UINT8 *) mConfigSpace)
+#define INDEX_OF(Field) ((UINT8 *) (Field) - (UINT8 *) mConfigSpace)
#define IS_PCIE_ENDPOINT(DevicePortType) \
((DevicePortType) == PCIE_DEVICE_PORT_TYPE_PCIE_ENDPOINT || \
@@ -33,24 +33,24 @@ typedef enum {
// Data region after PCI configuration header(for cardbus bridge)
//
typedef struct {
- UINT16 SubVendorId; // Subsystem Vendor ID
- UINT16 SubSystemId; // Subsystem ID
- UINT32 LegacyBase; // Optional 16-Bit PC Card Legacy
+ UINT16 SubVendorId; // Subsystem Vendor ID
+ UINT16 SubSystemId; // Subsystem ID
+ UINT32 LegacyBase; // Optional 16-Bit PC Card Legacy
// Mode Base Address
//
- UINT32 Data[46];
+ UINT32 Data[46];
} PCI_CARDBUS_DATA;
typedef union {
- PCI_DEVICE_HEADER_TYPE_REGION Device;
- PCI_BRIDGE_CONTROL_REGISTER Bridge;
- PCI_CARDBUS_CONTROL_REGISTER CardBus;
+ PCI_DEVICE_HEADER_TYPE_REGION Device;
+ PCI_BRIDGE_CONTROL_REGISTER Bridge;
+ PCI_CARDBUS_CONTROL_REGISTER CardBus;
} NON_COMMON_UNION;
typedef struct {
- PCI_DEVICE_INDEPENDENT_REGION Common;
- NON_COMMON_UNION NonCommon;
- UINT32 Data[48];
+ PCI_DEVICE_INDEPENDENT_REGION Common;
+ NON_COMMON_UNION NonCommon;
+ UINT32 Data[48];
} PCI_CONFIG_SPACE;
#pragma pack()
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
index eb415a3f16..99cc448942 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
@@ -24,8 +24,8 @@
**/
SHELL_STATUS
DisplaySettings (
- IN UINTN HandleIdx,
- IN BOOLEAN HandleValid
+ IN UINTN HandleIdx,
+ IN BOOLEAN HandleValid
)
{
EFI_SERIAL_IO_PROTOCOL *SerialIo;
@@ -37,88 +37,89 @@ DisplaySettings (
CHAR16 Parity;
SHELL_STATUS ShellStatus;
- Handles = NULL;
- StopBits = NULL;
+ Handles = NULL;
+ StopBits = NULL;
ShellStatus = SHELL_SUCCESS;
- Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
+ Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
return SHELL_INVALID_PARAMETER;
}
for (Index = 0; Index < NoHandles; Index++) {
if (HandleValid) {
- if (ConvertHandleIndexToHandle(HandleIdx) != Handles[Index]) {
+ if (ConvertHandleIndexToHandle (HandleIdx) != Handles[Index]) {
continue;
}
}
- Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
+ Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID **)&SerialIo);
if (!EFI_ERROR (Status)) {
switch (SerialIo->Mode->Parity) {
- case DefaultParity:
+ case DefaultParity:
- Parity = 'D';
- break;
+ Parity = 'D';
+ break;
- case NoParity:
+ case NoParity:
- Parity = 'N';
- break;
+ Parity = 'N';
+ break;
- case EvenParity:
+ case EvenParity:
- Parity = 'E';
- break;
+ Parity = 'E';
+ break;
- case OddParity:
+ case OddParity:
- Parity = 'O';
- break;
+ Parity = 'O';
+ break;
- case MarkParity:
+ case MarkParity:
- Parity = 'M';
- break;
+ Parity = 'M';
+ break;
- case SpaceParity:
+ case SpaceParity:
- Parity = 'S';
- break;
+ Parity = 'S';
+ break;
- default:
+ default:
- Parity = 'U';
+ Parity = 'U';
}
switch (SerialIo->Mode->StopBits) {
- case DefaultStopBits:
+ case DefaultStopBits:
- StopBits = L"Default";
- break;
+ StopBits = L"Default";
+ break;
- case OneStopBit:
+ case OneStopBit:
- StopBits = L"1";
- break;
+ StopBits = L"1";
+ break;
- case TwoStopBits:
+ case TwoStopBits:
- StopBits = L"2";
- break;
+ StopBits = L"2";
+ break;
- case OneFiveStopBits:
+ case OneFiveStopBits:
- StopBits = L"1.5";
- break;
+ StopBits = L"1.5";
+ break;
- default:
+ default:
- StopBits = L"Unknown";
+ StopBits = L"Unknown";
}
- ShellPrintHiiEx(
+
+ ShellPrintHiiEx (
-1,
-1,
NULL,
@@ -130,9 +131,9 @@ DisplaySettings (
Parity,
SerialIo->Mode->DataBits,
StopBits
- );
+ );
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_NOT_FOUND;
break;
}
@@ -143,8 +144,8 @@ DisplaySettings (
}
if (Index == NoHandles) {
- if ((NoHandles != 0 && HandleValid) || 0 == NoHandles) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode");
+ if (((NoHandles != 0) && HandleValid) || (0 == NoHandles)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_NOT_FOUND;
}
}
@@ -191,27 +192,27 @@ ShellCommandRunSerMode (
Package = NULL;
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode");
+ if ((ShellCommandLineGetCount (Package) < 6) && (ShellCommandLineGetCount (Package) > 2)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetCount(Package) > 6) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode");
+ } else if (ShellCommandLineGetCount (Package) > 6) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- Temp = ShellCommandLineGetRawValue(Package, 1);
+ Temp = ShellCommandLineGetRawValue (Package, 1);
if (Temp != NULL) {
- Status = ShellConvertStringToUint64(Temp, &Intermediate, TRUE, FALSE);
+ Status = ShellConvertStringToUint64 (Temp, &Intermediate, TRUE, FALSE);
HandleIdx = (UINTN)Intermediate;
- Temp = ShellCommandLineGetRawValue(Package, 2);
+ Temp = ShellCommandLineGetRawValue (Package, 2);
if (Temp == NULL) {
ShellStatus = DisplaySettings (HandleIdx, TRUE);
goto Done;
@@ -220,95 +221,101 @@ ShellCommandRunSerMode (
ShellStatus = DisplaySettings (0, FALSE);
goto Done;
}
- Temp = ShellCommandLineGetRawValue(Package, 2);
+
+ Temp = ShellCommandLineGetRawValue (Package, 2);
if (Temp != NULL) {
- BaudRate = ShellStrToUintn(Temp);
+ BaudRate = ShellStrToUintn (Temp);
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
BaudRate = 0;
}
- Temp = ShellCommandLineGetRawValue(Package, 3);
- if (Temp == NULL || StrLen(Temp)>1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
+
+ Temp = ShellCommandLineGetRawValue (Package, 3);
+ if ((Temp == NULL) || (StrLen (Temp) > 1)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- switch(Temp[0]){
- case 'd':
- case 'D':
- Parity = DefaultParity;
- break;
- case 'n':
- case 'N':
- Parity = NoParity;
- break;
- case 'e':
- case 'E':
- Parity = EvenParity;
- break;
- case 'o':
- case 'O':
- Parity = OddParity;
- break;
- case 'm':
- case 'M':
- Parity = MarkParity;
- break;
- case 's':
- case 'S':
- Parity = SpaceParity;
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
+ switch (Temp[0]) {
+ case 'd':
+ case 'D':
+ Parity = DefaultParity;
+ break;
+ case 'n':
+ case 'N':
+ Parity = NoParity;
+ break;
+ case 'e':
+ case 'E':
+ Parity = EvenParity;
+ break;
+ case 'o':
+ case 'O':
+ Parity = OddParity;
+ break;
+ case 'm':
+ case 'M':
+ Parity = MarkParity;
+ break;
+ case 's':
+ case 'S':
+ Parity = SpaceParity;
+ break;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
}
}
- Temp = ShellCommandLineGetRawValue(Package, 4);
+
+ Temp = ShellCommandLineGetRawValue (Package, 4);
if (Temp != NULL) {
- DataBits = ShellStrToUintn(Temp);
+ DataBits = ShellStrToUintn (Temp);
} else {
//
// make sure this is some number not in the list below.
//
DataBits = 0;
}
+
switch (DataBits) {
- case 4:
- case 7:
- case 8:
- break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
+ case 4:
+ case 7:
+ case 8:
+ break;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
}
- Temp = ShellCommandLineGetRawValue(Package, 5);
- Value = ShellStrToUintn(Temp);
+
+ Temp = ShellCommandLineGetRawValue (Package, 5);
+ Value = ShellStrToUintn (Temp);
switch (Value) {
- case 0:
- StopBits = DefaultStopBits;
- break;
+ case 0:
+ StopBits = DefaultStopBits;
+ break;
- case 1:
- StopBits = OneStopBit;
- break;
+ case 1:
+ StopBits = OneStopBit;
+ break;
- case 2:
- StopBits = TwoStopBits;
- break;
+ case 2:
+ StopBits = TwoStopBits;
+ break;
- case 15:
- StopBits = OneFiveStopBits;
- break;
+ case 15:
+ StopBits = OneFiveStopBits;
+ break;
- default:
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
- ShellStatus = SHELL_INVALID_PARAMETER;
- goto Done;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
}
- Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
+
+ Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
@@ -318,39 +325,40 @@ ShellCommandRunSerMode (
continue;
}
- Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
+ Status = gBS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID **)&SerialIo);
if (!EFI_ERROR (Status)) {
Status = SerialIo->SetAttributes (
- SerialIo,
- (UINT64) BaudRate,
- SerialIo->Mode->ReceiveFifoDepth,
- SerialIo->Mode->Timeout,
- Parity,
- (UINT8) DataBits,
- StopBits
- );
+ SerialIo,
+ (UINT64)BaudRate,
+ SerialIo->Mode->ReceiveFifoDepth,
+ SerialIo->Mode->Timeout,
+ Parity,
+ (UINT8)DataBits,
+ StopBits
+ );
if (EFI_ERROR (Status)) {
if (Status == EFI_INVALID_PARAMETER) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex (Handles[Index]));
ShellStatus = SHELL_UNSUPPORTED;
} else if (Status == EFI_DEVICE_ERROR) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex (Handles[Index]));
ShellStatus = SHELL_ACCESS_DENIED;
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex (Handles[Index]));
ShellStatus = SHELL_ACCESS_DENIED;
}
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_HANDLE), gShellDebug1HiiHandle, ConvertHandleToHandleIndex(Handles[Index]));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_HANDLE), gShellDebug1HiiHandle, ConvertHandleToHandleIndex (Handles[Index]));
}
+
break;
}
}
}
}
- if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx);
+ if ((ShellStatus == SHELL_SUCCESS) && (Index == NoHandles)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx);
ShellStatus = SHELL_INVALID_PARAMETER;
}
@@ -358,8 +366,10 @@ Done:
if (Package != NULL) {
ShellCommandLineFreeVarList (Package);
}
+
if (Handles != NULL) {
FreePool (Handles);
}
+
return ShellStatus;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c
index 9c1fa72c64..e5bacde638 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c
@@ -22,78 +22,81 @@ ShellCommandRunSetSize (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp1;
- UINTN NewSize;
- UINTN LoopVar;
- SHELL_FILE_HANDLE FileHandle;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *Temp1;
+ UINTN NewSize;
+ UINTN LoopVar;
+ SHELL_FILE_HANDLE FileHandle;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) < 3) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize");
+ if (ShellCommandLineGetCount (Package) < 3) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER;
- NewSize = 0;
+ NewSize = 0;
} else {
- Temp1 = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
+ Temp1 = ShellCommandLineGetRawValue (Package, 1);
+ if (!ShellIsHexOrDecimalNumber (Temp1, FALSE, FALSE)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER;
- NewSize = 0;
+ NewSize = 0;
} else {
- NewSize = ShellStrToUintn(Temp1);
+ NewSize = ShellStrToUintn (Temp1);
}
}
- for (LoopVar = 2 ; LoopVar < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
- Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
- if (EFI_ERROR(Status)) {
- Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
+
+ for (LoopVar = 2; LoopVar < ShellCommandLineGetCount (Package) && ShellStatus == SHELL_SUCCESS; LoopVar++) {
+ Status = ShellOpenFileByName (ShellCommandLineGetRawValue (Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
+ if (EFI_ERROR (Status)) {
+ Status = ShellOpenFileByName (ShellCommandLineGetRawValue (Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
}
- if (EFI_ERROR(Status) && LoopVar == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
+
+ if (EFI_ERROR (Status) && (LoopVar == 2)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar));
+ } else if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue (Package, LoopVar));
ShellStatus = SHELL_INVALID_PARAMETER;
break;
} else {
- Status = FileHandleSetSize(FileHandle, NewSize);
+ Status = FileHandleSetSize (FileHandle, NewSize);
if (Status == EFI_VOLUME_FULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_VOLUME_FULL;
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar));
+ } else if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue (Package, LoopVar));
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue (Package, LoopVar));
}
- ShellCloseFile(&FileHandle);
+
+ ShellCloseFile (&FileHandle);
}
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
index 015d842abe..61788d1993 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c
@@ -9,21 +9,21 @@
#include "UefiShellDebug1CommandsLib.h"
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-guid", TypeValue},
- {L"-bs", TypeFlag},
- {L"-rt", TypeFlag},
- {L"-nv", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-guid", TypeValue },
+ { L"-bs", TypeFlag },
+ { L"-rt", TypeFlag },
+ { L"-nv", TypeFlag },
+ { NULL, TypeMax }
+};
typedef enum {
- DataTypeHexNumber = 0,
- DataTypeHexArray = 1,
- DataTypeAscii = 2,
- DataTypeUnicode = 3,
- DataTypeDevicePath = 4,
- DataTypeUnKnow = 5
+ DataTypeHexNumber = 0,
+ DataTypeHexArray = 1,
+ DataTypeAscii = 2,
+ DataTypeUnicode = 3,
+ DataTypeDevicePath = 4,
+ DataTypeUnKnow = 5
} DATA_TYPE;
typedef union {
@@ -49,13 +49,14 @@ IsStringOfHexNibbles (
IN CONST CHAR16 *String
)
{
- CONST CHAR16 *Pos;
+ CONST CHAR16 *Pos;
for (Pos = String; *Pos != L'\0'; ++Pos) {
if (!ShellIsHexaDecimalDigitCharacter (*Pos)) {
return FALSE;
}
}
+
return TRUE;
}
@@ -71,14 +72,14 @@ TestDataType (
IN CONST CHAR16 *Data
)
{
- if (Data[0] == L'0' && (Data[1] == L'x' || Data[1] == L'X')) {
- if (IsStringOfHexNibbles (Data+2) && StrLen (Data + 2) <= 16) {
+ if ((Data[0] == L'0') && ((Data[1] == L'x') || (Data[1] == L'X'))) {
+ if (IsStringOfHexNibbles (Data+2) && (StrLen (Data + 2) <= 16)) {
return DataTypeHexNumber;
} else {
return DataTypeUnKnow;
}
} else if (Data[0] == L'H') {
- if (IsStringOfHexNibbles (Data + 1) && StrLen (Data + 1) % 2 == 0) {
+ if (IsStringOfHexNibbles (Data + 1) && (StrLen (Data + 1) % 2 == 0)) {
return DataTypeHexArray;
} else {
return DataTypeUnKnow;
@@ -87,11 +88,11 @@ TestDataType (
return DataTypeAscii;
} else if (Data[0] == L'L') {
return DataTypeUnicode;
- } else if (Data[0] == L'P' || StrnCmp (Data, L"--", 2) == 0) {
+ } else if ((Data[0] == L'P') || (StrnCmp (Data, L"--", 2) == 0)) {
return DataTypeDevicePath;
}
- if (IsStringOfHexNibbles (Data) && StrLen (Data) % 2 == 0) {
+ if (IsStringOfHexNibbles (Data) && (StrLen (Data) % 2 == 0)) {
return DataTypeHexArray;
}
@@ -114,9 +115,9 @@ TestDataType (
**/
EFI_STATUS
ParseParameterData (
- IN CONST CHAR16 *Data,
- OUT VOID *Buffer,
- IN OUT UINTN *BufferSize
+ IN CONST CHAR16 *Data,
+ OUT VOID *Buffer,
+ IN OUT UINTN *BufferSize
)
{
UINT64 HexNumber;
@@ -127,14 +128,14 @@ ParseParameterData (
EFI_DEVICE_PATH_PROTOCOL *DevPath;
EFI_STATUS Status;
- HexNumber = 0;
- HexNumberLen = 0;
- Size = 0;
- AsciiBuffer = NULL;
- DevPath = NULL;
- Status = EFI_SUCCESS;
+ HexNumber = 0;
+ HexNumberLen = 0;
+ Size = 0;
+ AsciiBuffer = NULL;
+ DevPath = NULL;
+ Status = EFI_SUCCESS;
- if (Data == NULL || BufferSize == NULL) {
+ if ((Data == NULL) || (BufferSize == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -145,20 +146,22 @@ ParseParameterData (
//
StrHexToUint64S (Data + 2, NULL, &HexNumber);
HexNumberLen = StrLen (Data + 2);
- if (HexNumberLen >= 1 && HexNumberLen <= 2) {
+ if ((HexNumberLen >= 1) && (HexNumberLen <= 2)) {
Size = 1;
- } else if (HexNumberLen >= 3 && HexNumberLen <= 4) {
+ } else if ((HexNumberLen >= 3) && (HexNumberLen <= 4)) {
Size = 2;
- } else if (HexNumberLen >= 5 && HexNumberLen <= 8) {
+ } else if ((HexNumberLen >= 5) && (HexNumberLen <= 8)) {
Size = 4;
- } else if (HexNumberLen >= 9 && HexNumberLen <= 16) {
+ } else if ((HexNumberLen >= 9) && (HexNumberLen <= 16)) {
Size = 8;
}
- if (Buffer != NULL && *BufferSize >= Size) {
- CopyMem(Buffer, (VOID *)&HexNumber, Size);
+
+ if ((Buffer != NULL) && (*BufferSize >= Size)) {
+ CopyMem (Buffer, (VOID *)&HexNumber, Size);
} else {
Status = EFI_BUFFER_TOO_SMALL;
}
+
*BufferSize = Size;
} else if (DataType == DataTypeHexArray) {
//
@@ -169,11 +172,12 @@ ParseParameterData (
}
Size = StrLen (Data) / 2;
- if (Buffer != NULL && *BufferSize >= Size) {
- StrHexToBytes(Data, StrLen (Data), (UINT8 *)Buffer, Size);
+ if ((Buffer != NULL) && (*BufferSize >= Size)) {
+ StrHexToBytes (Data, StrLen (Data), (UINT8 *)Buffer, Size);
} else {
Status = EFI_BUFFER_TOO_SMALL;
}
+
*BufferSize = Size;
} else if (DataType == DataTypeAscii) {
//
@@ -182,6 +186,7 @@ ParseParameterData (
if (*Data == L'S') {
Data = Data + 1;
}
+
AsciiBuffer = AllocateZeroPool (StrSize (Data) / 2);
if (AsciiBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -189,13 +194,15 @@ ParseParameterData (
AsciiSPrint (AsciiBuffer, StrSize (Data) / 2, "%s", (CHAR8 *)Data);
Size = StrSize (Data) / 2 - 1;
- if (Buffer != NULL && *BufferSize >= Size) {
+ if ((Buffer != NULL) && (*BufferSize >= Size)) {
CopyMem (Buffer, AsciiBuffer, Size);
} else {
Status = EFI_BUFFER_TOO_SMALL;
}
+
*BufferSize = Size;
}
+
SHELL_FREE_NON_NULL (AsciiBuffer);
} else if (DataType == DataTypeUnicode) {
//
@@ -204,12 +211,14 @@ ParseParameterData (
if (*Data == L'L') {
Data = Data + 1;
}
+
Size = StrSize (Data) - sizeof (CHAR16);
- if (Buffer != NULL && *BufferSize >= Size) {
+ if ((Buffer != NULL) && (*BufferSize >= Size)) {
CopyMem (Buffer, Data, Size);
} else {
Status = EFI_BUFFER_TOO_SMALL;
}
+
*BufferSize = Size;
} else if (DataType == DataTypeDevicePath) {
if (*Data == L'P') {
@@ -217,19 +226,22 @@ ParseParameterData (
} else if (StrnCmp (Data, L"--", 2) == 0) {
Data = Data + 2;
}
+
DevPath = ConvertTextToDevicePath (Data);
if (DevPath == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, L"setvar");
Status = EFI_INVALID_PARAMETER;
} else {
Size = GetDevicePathSize (DevPath);
- if (Buffer != NULL && *BufferSize >= Size) {
+ if ((Buffer != NULL) && (*BufferSize >= Size)) {
CopyMem (Buffer, DevPath, Size);
} else {
Status = EFI_BUFFER_TOO_SMALL;
}
+
*BufferSize = Size;
}
+
SHELL_FREE_NON_NULL (DevPath);
} else {
Status = EFI_INVALID_PARAMETER;
@@ -251,23 +263,23 @@ ParseParameterData (
**/
EFI_STATUS
GetVariableDataFromParameter (
- IN CONST LIST_ENTRY *Package,
- OUT UINT8 **Buffer,
- OUT UINTN *BufferSize
+ IN CONST LIST_ENTRY *Package,
+ OUT UINT8 **Buffer,
+ OUT UINTN *BufferSize
)
{
- CONST CHAR16 *TempData;
- UINTN Index;
- UINTN TotalSize;
- UINTN Size;
- UINT8 *BufferWalker;
- EFI_STATUS Status;
-
- TotalSize = 0;
- Size = 0;
- Status = EFI_SUCCESS;
-
- if (BufferSize == NULL || Buffer == NULL || ShellCommandLineGetCount (Package) < 3) {
+ CONST CHAR16 *TempData;
+ UINTN Index;
+ UINTN TotalSize;
+ UINTN Size;
+ UINT8 *BufferWalker;
+ EFI_STATUS Status;
+
+ TotalSize = 0;
+ Size = 0;
+ Status = EFI_SUCCESS;
+
+ if ((BufferSize == NULL) || (Buffer == NULL) || (ShellCommandLineGetCount (Package) < 3)) {
return EFI_INVALID_PARAMETER;
}
@@ -281,8 +293,8 @@ GetVariableDataFromParameter (
}
TempData = TempData + 1;
- Size = 0;
- Status = ParseParameterData (TempData, NULL, &Size);
+ Size = 0;
+ Status = ParseParameterData (TempData, NULL, &Size);
if (EFI_ERROR (Status)) {
if (Status == EFI_BUFFER_TOO_SMALL) {
//
@@ -295,13 +307,14 @@ GetVariableDataFromParameter (
} else if (Status == EFI_NOT_FOUND) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, L"setvar");
}
+
return Status;
}
}
}
*BufferSize = TotalSize;
- *Buffer = AllocateZeroPool (TotalSize);
+ *Buffer = AllocateZeroPool (TotalSize);
if (*Buffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -311,11 +324,11 @@ GetVariableDataFromParameter (
TempData = ShellCommandLineGetRawValue (Package, Index);
TempData = TempData + 1;
- Size = TotalSize;
+ Size = TotalSize;
Status = ParseParameterData (TempData, (VOID *)BufferWalker, &Size);
if (!EFI_ERROR (Status)) {
BufferWalker = BufferWalker + Size;
- TotalSize = TotalSize - Size;
+ TotalSize = TotalSize - Size;
} else {
return Status;
}
@@ -338,131 +351,139 @@ ShellCommandRunSetVar (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- RETURN_STATUS RStatus;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *VariableName;
- EFI_GUID Guid;
- CONST CHAR16 *StringGuid;
- UINT32 Attributes;
- VOID *Buffer;
- UINTN Size;
- UINTN LoopVar;
-
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
- Buffer = NULL;
- Size = 0;
- Attributes = 0;
+ EFI_STATUS Status;
+ RETURN_STATUS RStatus;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *VariableName;
+ EFI_GUID Guid;
+ CONST CHAR16 *StringGuid;
+ UINT32 Attributes;
+ VOID *Buffer;
+ UINTN Size;
+ UINTN LoopVar;
+
+ ShellStatus = SHELL_SUCCESS;
+ Status = EFI_SUCCESS;
+ Buffer = NULL;
+ Size = 0;
+ Attributes = 0;
//
// initialize the shell lib (we must be in non-auto-init...)
//
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
+ Status = ShellInitialize ();
+ ASSERT_EFI_ERROR (Status);
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
+ Status = CommandInit ();
+ ASSERT_EFI_ERROR (Status);
//
// parse the command line
//
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
- } else if (ShellCommandLineCheckDuplicate (Package,&ProblemParam) != EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
+ } else if (ShellCommandLineCheckDuplicate (Package, &ProblemParam) != EFI_SUCCESS) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam);
+ FreePool (ProblemParam);
+ ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- if (ShellCommandLineGetCount(Package) < 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar");
+ if (ShellCommandLineGetCount (Package) < 2) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- VariableName = ShellCommandLineGetRawValue(Package, 1);
- if (!ShellCommandLineGetFlag(Package, L"-guid")){
- CopyGuid(&Guid, &gEfiGlobalVariableGuid);
+ VariableName = ShellCommandLineGetRawValue (Package, 1);
+ if (!ShellCommandLineGetFlag (Package, L"-guid")) {
+ CopyGuid (&Guid, &gEfiGlobalVariableGuid);
} else {
- StringGuid = ShellCommandLineGetValue(Package, L"-guid");
- RStatus = StrToGuid (StringGuid, &Guid);
+ StringGuid = ShellCommandLineGetValue (Package, L"-guid");
+ RStatus = StrToGuid (StringGuid, &Guid);
if (RETURN_ERROR (RStatus) || (StringGuid[GUID_STRING_LENGTH] != L'\0')) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
ShellStatus = SHELL_INVALID_PARAMETER;
}
}
- if (ShellCommandLineGetCount(Package) == 2) {
+ if (ShellCommandLineGetCount (Package) == 2) {
//
// Display
//
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(Size);
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
+ Buffer = AllocateZeroPool (Size);
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
}
- if (!EFI_ERROR(Status) && Buffer != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_SETVAR_PRINT), gShellDebug1HiiHandle, &Guid, VariableName, Size);
+
+ if (!EFI_ERROR (Status) && (Buffer != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SETVAR_PRINT), gShellDebug1HiiHandle, &Guid, VariableName, Size);
for (LoopVar = 0; LoopVar < Size; LoopVar++) {
- ShellPrintEx(-1, -1, L"%02x ", ((UINT8*)Buffer)[LoopVar]);
+ ShellPrintEx (-1, -1, L"%02x ", ((UINT8 *)Buffer)[LoopVar]);
}
- ShellPrintEx(-1, -1, L"\r\n");
+
+ ShellPrintEx (-1, -1, L"\r\n");
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_GET), gShellDebug1HiiHandle, L"setvar", &Guid, VariableName);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_GET), gShellDebug1HiiHandle, L"setvar", &Guid, VariableName);
ShellStatus = SHELL_ACCESS_DENIED;
}
} else {
//
// Create, Delete or Modify.
//
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
- Buffer = AllocateZeroPool(Size);
- Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
+ Buffer = AllocateZeroPool (Size);
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
}
- if (EFI_ERROR(Status) || Buffer == NULL) {
+
+ if (EFI_ERROR (Status) || (Buffer == NULL)) {
//
// Creating a new variable. determine attributes from command line.
//
Attributes = 0;
- if (ShellCommandLineGetFlag(Package, L"-bs")) {
+ if (ShellCommandLineGetFlag (Package, L"-bs")) {
Attributes |= EFI_VARIABLE_BOOTSERVICE_ACCESS;
}
- if (ShellCommandLineGetFlag(Package, L"-rt")) {
+
+ if (ShellCommandLineGetFlag (Package, L"-rt")) {
Attributes |= EFI_VARIABLE_RUNTIME_ACCESS |
EFI_VARIABLE_BOOTSERVICE_ACCESS;
}
- if (ShellCommandLineGetFlag(Package, L"-nv")) {
+
+ if (ShellCommandLineGetFlag (Package, L"-nv")) {
Attributes |= EFI_VARIABLE_NON_VOLATILE;
}
}
- SHELL_FREE_NON_NULL(Buffer);
- Size = 0;
- Status = GetVariableDataFromParameter(Package, (UINT8 **)&Buffer, &Size);
- if (!EFI_ERROR(Status)) {
- Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, Size, Buffer);
+ SHELL_FREE_NON_NULL (Buffer);
+
+ Size = 0;
+ Status = GetVariableDataFromParameter (Package, (UINT8 **)&Buffer, &Size);
+ if (!EFI_ERROR (Status)) {
+ Status = gRT->SetVariable ((CHAR16 *)VariableName, &Guid, Attributes, Size, Buffer);
}
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, L"setvar", &Guid, VariableName);
+
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, L"setvar", &Guid, VariableName);
ShellStatus = SHELL_ACCESS_DENIED;
} else {
- ASSERT(ShellStatus == SHELL_SUCCESS);
+ ASSERT (ShellStatus == SHELL_SUCCESS);
}
}
}
+
ShellCommandLineFreeVarList (Package);
}
if (Buffer != NULL) {
- FreePool(Buffer);
+ FreePool (Buffer);
}
return (ShellStatus);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
index 984c178890..9a38ffddeb 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
@@ -19,46 +19,46 @@
**/
VOID
DisplaySELAccessMethod (
- IN CONST UINT8 Key,
- IN CONST UINT8 Option
+ IN CONST UINT8 Key,
+ IN CONST UINT8 Option
)
{
//
// Print prompt
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ACCESS_METHOD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ACCESS_METHOD), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
//
// Print value info
//
switch (Key) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_EIGHT_BIT), gShellDebug1HiiHandle);
- break;
-
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TWO_EIGHT_BITS), gShellDebug1HiiHandle);
- break;
-
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_SIXTEEN_BIT), gShellDebug1HiiHandle);
- break;
-
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MEM_MAPPED_PHYS), gShellDebug1HiiHandle);
- break;
-
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_VIA_GENERAL), gShellDebug1HiiHandle);
- break;
-
- default:
- if (Key <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR_OEM), gShellDebug1HiiHandle);
- }
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_EIGHT_BIT), gShellDebug1HiiHandle);
+ break;
+
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TWO_EIGHT_BITS), gShellDebug1HiiHandle);
+ break;
+
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_SIXTEEN_BIT), gShellDebug1HiiHandle);
+ break;
+
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MEM_MAPPED_PHYS), gShellDebug1HiiHandle);
+ break;
+
+ case 4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_VIA_GENERAL), gShellDebug1HiiHandle);
+ break;
+
+ default:
+ if (Key <= 0x7f) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR_OEM), gShellDebug1HiiHandle);
+ }
}
}
@@ -70,33 +70,33 @@ DisplaySELAccessMethod (
**/
VOID
DisplaySELLogStatus (
- UINT8 Key,
- UINT8 Option
+ UINT8 Key,
+ UINT8 Option
)
{
//
// Print prompt
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
//
// Print value info
//
if ((Key & 0x01) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_VALID), gShellDebug1HiiHandle);
}
if ((Key & 0x02) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_FULL), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_FULL), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_NOT_FULL), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_AREA_NOT_FULL), gShellDebug1HiiHandle);
}
if ((Key & 0xFC) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_RES_BITS_NOT_ZERO), gShellDebug1HiiHandle, Key & 0xFC);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_RES_BITS_NOT_ZERO), gShellDebug1HiiHandle, Key & 0xFC);
}
}
@@ -108,27 +108,27 @@ DisplaySELLogStatus (
**/
VOID
DisplaySysEventLogHeaderFormat (
- UINT8 Key,
- UINT8 Option
+ UINT8 Key,
+ UINT8 Option
)
{
//
// Print prompt
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_FORMAT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_FORMAT), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
//
// Print value info
//
if (Key == 0x00) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
} else if (Key == 0x01) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
} else if (Key <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_FUTURE), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
}
}
@@ -140,23 +140,23 @@ DisplaySysEventLogHeaderFormat (
**/
VOID
DisplaySELLogHeaderLen (
- UINT8 Key,
- UINT8 Option
+ UINT8 Key,
+ UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_LEN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER_LEN), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_VAR_D), gShellDebug1HiiHandle, Key & 0x7F);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ONE_VAR_D), gShellDebug1HiiHandle, Key & 0x7F);
//
// The most-significant bit of the field specifies
// whether (0) or not (1) the record has been read
//
if ((Key & 0x80) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_READ), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_READ), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_NOT_READ), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_THIS_RECORD_NOT_READ), gShellDebug1HiiHandle);
}
}
@@ -167,19 +167,22 @@ DisplaySELLogHeaderLen (
**/
VOID
DisplaySysEventLogHeaderType1 (
- IN UINT8 *LogHeader
+ IN UINT8 *LogHeader
)
{
- LOG_HEADER_TYPE1_FORMAT *Header;
+ LOG_HEADER_TYPE1_FORMAT *Header;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG), gShellDebug1HiiHandle);
//
// Print Log Header Type1 Format info
//
- Header = (LOG_HEADER_TYPE1_FORMAT *) (LogHeader);
+ Header = (LOG_HEADER_TYPE1_FORMAT *)(LogHeader);
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_OEM_RESERVED),
gShellDebug1HiiHandle,
Header->OEMReserved[0],
@@ -187,21 +190,24 @@ DisplaySysEventLogHeaderType1 (
Header->OEMReserved[2],
Header->OEMReserved[3],
Header->OEMReserved[4]
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUN_BYTE_COUNT), gShellDebug1HiiHandle, Header->ChecksumOffset);
- ShellPrintHiiEx(-1,-1,NULL,
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUN_BYTE_COUNT), gShellDebug1HiiHandle, Header->ChecksumOffset);
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_RESERVED),
gShellDebug1HiiHandle,
Header->OEMReserved[0],
Header->OEMReserved[1],
Header->OEMReserved[2]
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_HEADER_REVISION), gShellDebug1HiiHandle, Header->HeaderRevision);
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_HEADER_REVISION), gShellDebug1HiiHandle, Header->HeaderRevision);
}
/**
@@ -212,27 +218,27 @@ DisplaySysEventLogHeaderType1 (
**/
VOID
DisplaySysEventLogHeader (
- UINT8 LogHeaderFormat,
- UINT8 *LogHeader
+ UINT8 LogHeaderFormat,
+ UINT8 *LogHeader
)
{
//
// Print prompt
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_LOG_HEADER), gShellDebug1HiiHandle);
//
// Print value info
//
if (LogHeaderFormat == 0x00) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_HEADER), gShellDebug1HiiHandle);
} else if (LogHeaderFormat == 0x01) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TYPE_LOG_HEADER), gShellDebug1HiiHandle);
DisplaySysEventLogHeaderType1 (LogHeader);
} else if (LogHeaderFormat <= 0x7f) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FUTURE_ASSIGN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FUTURE_ASSIGN), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_BIOS_VENDOR), gShellDebug1HiiHandle);
}
}
@@ -244,8 +250,8 @@ DisplaySysEventLogHeader (
**/
VOID
DisplayElVdfInfo (
- UINT8 ElVdfType,
- UINT8 *VarData
+ UINT8 ElVdfType,
+ UINT8 *VarData
)
{
UINT16 *Word;
@@ -260,60 +266,60 @@ DisplayElVdfInfo (
// Display Type description
//
switch (ElVdfType) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_STD_FORMAT), gShellDebug1HiiHandle);
- break;
-
- case 1:
- Word = (UINT16 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
- break;
-
- case 2:
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- case 3:
- Word = (UINT16 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
- //
- // Followed by a multiple-event counter
- //
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- case 4:
- Dword = (UINT32 *) (VarData + 1);
- DisplayPostResultsBitmapDw1 (*Dword, SHOW_DETAIL);
- Dword++;
- DisplayPostResultsBitmapDw2 (*Dword, SHOW_DETAIL);
- break;
-
- case 5:
- Dword = (UINT32 *) (VarData + 1);
- DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
- break;
-
- case 6:
- Dword = (UINT32 *) (VarData + 1);
- DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
- //
- // Followed by a multiple-event counter
- //
- Dword = (UINT32 *) (VarData + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
- break;
-
- default:
- if (ElVdfType <= 0x7F) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_UNUSED_AVAIL_FOR_ASSIGN), gShellDebug1HiiHandle);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_SYSTEM), gShellDebug1HiiHandle);
- }
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_NO_STD_FORMAT), gShellDebug1HiiHandle);
+ break;
+
+ case 1:
+ Word = (UINT16 *)(VarData + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
+ break;
+
+ case 2:
+ Dword = (UINT32 *)(VarData + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
+ break;
+
+ case 3:
+ Word = (UINT16 *)(VarData + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SMBIOS_STRUCT_ASSOC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, *Word);
+ //
+ // Followed by a multiple-event counter
+ //
+ Dword = (UINT32 *)(VarData + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
+ break;
+
+ case 4:
+ Dword = (UINT32 *)(VarData + 1);
+ DisplayPostResultsBitmapDw1 (*Dword, SHOW_DETAIL);
+ Dword++;
+ DisplayPostResultsBitmapDw2 (*Dword, SHOW_DETAIL);
+ break;
+
+ case 5:
+ Dword = (UINT32 *)(VarData + 1);
+ DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
+ break;
+
+ case 6:
+ Dword = (UINT32 *)(VarData + 1);
+ DisplaySELSysManagementTypes (*Dword, SHOW_DETAIL);
+ //
+ // Followed by a multiple-event counter
+ //
+ Dword = (UINT32 *)(VarData + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULT_EVENT_COUNTER), gShellDebug1HiiHandle, *Dword);
+ break;
+
+ default:
+ if (ElVdfType <= 0x7F) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_UNUSED_AVAIL_FOR_ASSIGN), gShellDebug1HiiHandle);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_AVAIL_FOR_SYSTEM), gShellDebug1HiiHandle);
+ }
}
}
@@ -329,25 +335,24 @@ DisplaySysEventLogData (
UINT16 LogAreaLength
)
{
- LOG_RECORD_FORMAT *Log;
- UINT8 ElVdfType;
+ LOG_RECORD_FORMAT *Log;
+ UINT8 ElVdfType;
//
// Event Log Variable Data Format Types
//
- UINTN Offset;
+ UINTN Offset;
//
// Print prompt
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_SYSTEM_EVENT_LOG_2), gShellDebug1HiiHandle);
//
// Print Log info
//
- Offset = 0;
- Log = (LOG_RECORD_FORMAT *) LogData;
+ Offset = 0;
+ Log = (LOG_RECORD_FORMAT *)LogData;
while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) {
-
if (Log != NULL) {
//
// Display Event Log Record Information
@@ -362,21 +367,24 @@ DisplaySysEventLogData (
// (as read from CMOS) of the occurrence of the event
// So Print as hex and represent decimal
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle);
- if (Log != NULL && Log->Year >= 80 && Log->Year <= 99) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_DATE), gShellDebug1HiiHandle);
+ if ((Log != NULL) && (Log->Year >= 80) && (Log->Year <= 99)) {
Print (L"19");
- } else if (Log != NULL && Log->Year <= 79) {
+ } else if ((Log != NULL) && (Log->Year <= 79)) {
Print (L"20");
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle);
//
// Get a Event Log Record
//
- Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
+ Log = (LOG_RECORD_FORMAT *)(LogData + Offset);
continue;
}
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS),
gShellDebug1HiiHandle,
Log->Year,
@@ -385,7 +393,7 @@ DisplaySysEventLogData (
Log->Hour,
Log->Minute,
Log->Second
- );
+ );
//
// Display Variable Data Format
@@ -394,7 +402,7 @@ DisplaySysEventLogData (
//
// Get a Event Log Record
//
- Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
+ Log = (LOG_RECORD_FORMAT *)(LogData + Offset);
continue;
}
@@ -403,7 +411,7 @@ DisplaySysEventLogData (
//
// Get a Event Log Record
//
- Log = (LOG_RECORD_FORMAT *) (LogData + Offset);
+ Log = (LOG_RECORD_FORMAT *)(LogData + Offset);
}
}
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
index 0a24ada655..bb26924259 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
@@ -14,28 +14,28 @@
#pragma pack(1)
typedef struct {
- UINT8 Type;
- UINT8 Length;
- UINT8 Year;
- UINT8 Month;
- UINT8 Day;
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
- UINT8 LogVariableData[1];
+ UINT8 Type;
+ UINT8 Length;
+ UINT8 Year;
+ UINT8 Month;
+ UINT8 Day;
+ UINT8 Hour;
+ UINT8 Minute;
+ UINT8 Second;
+ UINT8 LogVariableData[1];
} LOG_RECORD_FORMAT;
typedef struct {
- UINT8 OEMReserved[5];
- UINT8 Metw; // Multiple Event Time Window
- UINT8 Meci; // Multiple Event Count Increment
- UINT8 CMOSAddress; // Pre-boot Event Log Reset - CMOS Address
- UINT8 CMOSBitIndex; // Pre-boot Event Log Reset - CMOS Bit Index
- UINT8 StartingOffset; // CMOS Checksum - Starting Offset
- UINT8 ByteCount; // CMOS Checksum - Byte Count
- UINT8 ChecksumOffset; // CMOS Checksum - Checksum Offset
- UINT8 Reserved[3];
- UINT8 HeaderRevision;
+ UINT8 OEMReserved[5];
+ UINT8 Metw; // Multiple Event Time Window
+ UINT8 Meci; // Multiple Event Count Increment
+ UINT8 CMOSAddress; // Pre-boot Event Log Reset - CMOS Address
+ UINT8 CMOSBitIndex; // Pre-boot Event Log Reset - CMOS Bit Index
+ UINT8 StartingOffset; // CMOS Checksum - Starting Offset
+ UINT8 ByteCount; // CMOS Checksum - Byte Count
+ UINT8 ChecksumOffset; // CMOS Checksum - Checksum Offset
+ UINT8 Reserved[3];
+ UINT8 HeaderRevision;
} LOG_HEADER_TYPE1_FORMAT;
#pragma pack()
@@ -51,8 +51,8 @@ typedef struct {
**/
VOID
DisplaySELAccessMethod (
- IN CONST UINT8 Key,
- IN CONST UINT8 Option
+ IN CONST UINT8 Key,
+ IN CONST UINT8 Option
);
/**
@@ -63,8 +63,8 @@ DisplaySELAccessMethod (
**/
VOID
DisplaySELLogStatus (
- UINT8 Key,
- UINT8 Option
+ UINT8 Key,
+ UINT8 Option
);
/**
@@ -75,8 +75,8 @@ DisplaySELLogStatus (
**/
VOID
DisplaySysEventLogHeaderFormat (
- UINT8 Key,
- UINT8 Option
+ UINT8 Key,
+ UINT8 Option
);
/**
@@ -87,8 +87,8 @@ DisplaySysEventLogHeaderFormat (
**/
VOID
DisplaySysEventLogHeader (
- UINT8 LogHeaderFormat,
- UINT8 *LogHeader
+ UINT8 LogHeaderFormat,
+ UINT8 *LogHeader
);
/**
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
index dad9b3c1ff..a9ea3e13b0 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
@@ -6,20 +6,19 @@
**/
-
#include "UefiShellDebug1CommandsLib.h"
#include <Guid/SmBios.h>
#include "LibSmbiosView.h"
#include "SmbiosView.h"
-STATIC UINT8 mInit = 0;
-STATIC UINT8 m64Init = 0;
-STATIC SMBIOS_TABLE_ENTRY_POINT *mSmbiosTable = NULL;
-STATIC SMBIOS_TABLE_3_0_ENTRY_POINT *mSmbios64BitTable = NULL;
-STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;
-STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;
-STATIC SMBIOS_STRUCTURE_POINTER m_Smbios64BitStruct;
-STATIC SMBIOS_STRUCTURE_POINTER *mSmbios64BitStruct = &m_Smbios64BitStruct;
+STATIC UINT8 mInit = 0;
+STATIC UINT8 m64Init = 0;
+STATIC SMBIOS_TABLE_ENTRY_POINT *mSmbiosTable = NULL;
+STATIC SMBIOS_TABLE_3_0_ENTRY_POINT *mSmbios64BitTable = NULL;
+STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;
+STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;
+STATIC SMBIOS_STRUCTURE_POINTER m_Smbios64BitStruct;
+STATIC SMBIOS_STRUCTURE_POINTER *mSmbios64BitStruct = &m_Smbios64BitStruct;
/**
Init the SMBIOS VIEW API's environment.
@@ -39,25 +38,27 @@ LibSmbiosInit (
if (mInit == 1) {
return EFI_SUCCESS;
}
+
//
// Get SMBIOS table from System Configure table
//
- Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID**)&mSmbiosTable);
+ Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **)&mSmbiosTable);
if (mSmbiosTable == NULL) {
return EFI_NOT_FOUND;
}
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_GET_TABLE_ERROR), gShellDebug1HiiHandle, Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_GET_TABLE_ERROR), gShellDebug1HiiHandle, Status);
return Status;
}
+
//
// Init SMBIOS structure table address
//
- mSmbiosStruct->Raw = (UINT8 *) (UINTN) (mSmbiosTable->TableAddress);
+ mSmbiosStruct->Raw = (UINT8 *)(UINTN)(mSmbiosTable->TableAddress);
- mInit = 1;
+ mInit = 1;
return EFI_SUCCESS;
}
@@ -79,25 +80,27 @@ LibSmbios64BitInit (
if (m64Init == 1) {
return EFI_SUCCESS;
}
+
//
// Get SMBIOS table from System Configure table
//
- Status = GetSystemConfigurationTable (&gEfiSmbios3TableGuid, (VOID**)&mSmbios64BitTable);
+ Status = GetSystemConfigurationTable (&gEfiSmbios3TableGuid, (VOID **)&mSmbios64BitTable);
if (mSmbios64BitTable == NULL) {
return EFI_NOT_FOUND;
}
if (EFI_ERROR (Status)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_GET_TABLE_ERROR), gShellDebug1HiiHandle, Status);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_GET_TABLE_ERROR), gShellDebug1HiiHandle, Status);
return Status;
}
+
//
// Init SMBIOS structure table address
//
- mSmbios64BitStruct->Raw = (UINT8 *) (UINTN) (mSmbios64BitTable->TableAddress);
+ mSmbios64BitStruct->Raw = (UINT8 *)(UINTN)(mSmbios64BitTable->TableAddress);
- m64Init = 1;
+ m64Init = 1;
return EFI_SUCCESS;
}
@@ -144,7 +147,7 @@ LibSmbios64BitCleanup (
**/
VOID
LibSmbiosGetEPS (
- OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
+ OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
)
{
//
@@ -160,7 +163,7 @@ LibSmbiosGetEPS (
**/
VOID
LibSmbios64BitGetEPS (
- OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure
+ OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure
)
{
//
@@ -178,10 +181,10 @@ LibSmbios64BitGetEPS (
@return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
**/
-CHAR8*
+CHAR8 *
LibGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
+ IN SMBIOS_STRUCTURE_POINTER *Smbios,
+ IN UINT16 StringNumber
)
{
UINT16 Index;
@@ -192,7 +195,7 @@ LibGetSmbiosString (
//
// Skip over formatted section
//
- String = (CHAR8 *) (Smbios->Raw + Smbios->Hdr->Length);
+ String = (CHAR8 *)(Smbios->Raw + Smbios->Hdr->Length);
//
// Look through unformated section
@@ -201,10 +204,13 @@ LibGetSmbiosString (
if (StringNumber == Index) {
return String;
}
+
//
// Skip string
//
- for (; *String != 0; String++);
+ for ( ; *String != 0; String++) {
+ }
+
String++;
if (*String == 0) {
@@ -254,7 +260,7 @@ LibGetSmbiosStructure (
}
if ((Buffer == NULL) || (Length == NULL)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle);
return DMI_INVALID_HANDLE;
}
@@ -267,11 +273,11 @@ LibGetSmbiosStructure (
//
// Walk to next structure
//
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
+ LibGetSmbiosString (&Smbios, (UINT16)(-1));
//
// Length = Next structure head - this structure head
//
- *Length = (UINT16) (Smbios.Raw - Raw);
+ *Length = (UINT16)(Smbios.Raw - Raw);
*Buffer = Raw;
//
// update with the next structure handle.
@@ -281,12 +287,14 @@ LibGetSmbiosStructure (
} else {
*Handle = INVALID_HANDLE;
}
+
return DMI_SUCCESS;
}
+
//
// Walk to next structure
//
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
+ LibGetSmbiosString (&Smbios, (UINT16)(-1));
}
*Handle = INVALID_HANDLE;
@@ -326,12 +334,12 @@ LibGetSmbios64BitStructure (
}
if ((Buffer == NULL) || (Length == NULL)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_NO_BUFF_LEN_SPEC), gShellDebug1HiiHandle);
return DMI_INVALID_HANDLE;
}
- *Length = 0;
- Smbios.Hdr = mSmbios64BitStruct->Hdr;
+ *Length = 0;
+ Smbios.Hdr = mSmbios64BitStruct->Hdr;
SmbiosEnd.Raw = Smbios.Raw + mSmbios64BitTableLength;
while (Smbios.Raw < SmbiosEnd.Raw) {
@@ -340,11 +348,11 @@ LibGetSmbios64BitStructure (
//
// Walk to next structure
//
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
+ LibGetSmbiosString (&Smbios, (UINT16)(-1));
//
// Length = Next structure head - this structure head
//
- *Length = (UINT16) (Smbios.Raw - Raw);
+ *Length = (UINT16)(Smbios.Raw - Raw);
*Buffer = Raw;
//
// update with the next structure handle.
@@ -354,12 +362,14 @@ LibGetSmbios64BitStructure (
} else {
*Handle = INVALID_HANDLE;
}
+
return DMI_SUCCESS;
}
+
//
// Walk to next structure
//
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
+ LibGetSmbiosString (&Smbios, (UINT16)(-1));
}
*Handle = INVALID_HANDLE;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
index 14013fe29a..87ae6e91c6 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
@@ -11,22 +11,22 @@
#include <IndustryStandard/SmBios.h>
-#define DMI_SUCCESS 0x00
-#define DMI_UNKNOWN_FUNCTION 0x81
-#define DMI_FUNCTION_NOT_SUPPORTED 0x82
-#define DMI_INVALID_HANDLE 0x83
-#define DMI_BAD_PARAMETER 0x84
-#define DMI_INVALID_SUBFUNCTION 0x85
-#define DMI_NO_CHANGE 0x86
-#define DMI_ADD_STRUCTURE_FAILED 0x87
-#define DMI_READ_ONLY 0x8D
-#define DMI_LOCK_NOT_SUPPORTED 0x90
-#define DMI_CURRENTLY_LOCKED 0x91
-#define DMI_INVALID_LOCK 0x92
-
-#define INVALID_HANDLE (UINT16) (-1)
-
-#define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)
+#define DMI_SUCCESS 0x00
+#define DMI_UNKNOWN_FUNCTION 0x81
+#define DMI_FUNCTION_NOT_SUPPORTED 0x82
+#define DMI_INVALID_HANDLE 0x83
+#define DMI_BAD_PARAMETER 0x84
+#define DMI_INVALID_SUBFUNCTION 0x85
+#define DMI_NO_CHANGE 0x86
+#define DMI_ADD_STRUCTURE_FAILED 0x87
+#define DMI_READ_ONLY 0x8D
+#define DMI_LOCK_NOT_SUPPORTED 0x90
+#define DMI_CURRENTLY_LOCKED 0x91
+#define DMI_INVALID_LOCK 0x92
+
+#define INVALID_HANDLE (UINT16) (-1)
+
+#define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)
#define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)
#define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)
@@ -76,7 +76,7 @@ LibSmbios64BitCleanup (
**/
VOID
LibSmbiosGetEPS (
- OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
+ OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure
);
/**
@@ -86,7 +86,7 @@ LibSmbiosGetEPS (
**/
VOID
LibSmbios64BitGetEPS (
- OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure
+ OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure
);
/**
@@ -98,10 +98,10 @@ LibSmbios64BitGetEPS (
@return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
**/
-CHAR8*
+CHAR8 *
LibGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
+ IN SMBIOS_STRUCTURE_POINTER *Smbios,
+ IN UINT16 StringNumber
);
/**
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 8d757c0014..b144600a25 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -14,11 +14,10 @@
#include "QueryTable.h"
#include "EventLogInfo.h"
-
//
// Get the certain bit of 'value'
//
-#define BIT(value, bit) ((value) & ((UINT64) 1) << (bit))
+#define BIT(value, bit) ((value) & ((UINT64) 1) << (bit))
//
// Check if above or equal to version
@@ -94,21 +93,23 @@
**/
VOID
MemToString (
- IN OUT VOID *Dest,
- IN VOID *Src,
- IN UINTN Length
+ IN OUT VOID *Dest,
+ IN VOID *Src,
+ IN UINTN Length
)
{
- UINT8 *SrcBuffer;
- UINT8 *DestBuffer;
- SrcBuffer = (UINT8 *) Src;
- DestBuffer = (UINT8 *) Dest;
+ UINT8 *SrcBuffer;
+ UINT8 *DestBuffer;
+
+ SrcBuffer = (UINT8 *)Src;
+ DestBuffer = (UINT8 *)Dest;
//
// copy byte by byte
//
- while ((Length--)!=0) {
+ while ((Length--) != 0) {
*DestBuffer++ = *SrcBuffer++;
}
+
//
// append a NULL terminator
//
@@ -133,61 +134,73 @@ SmbiosPrintEPSInfo (
IN UINT8 Option
)
{
- UINT8 Anchor[5];
- UINT8 InAnchor[6];
+ UINT8 Anchor[5];
+ UINT8 InAnchor[6];
if (SmbiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);
- return ;
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);
+ return;
}
if (Option == SHOW_NONE) {
- return ;
+ return;
}
if (Option >= SHOW_NORMAL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);
MemToString (Anchor, SmbiosTable->AnchorString, 4);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EPS_CHECKSUM),
gShellDebug1HiiHandle,
SmbiosTable->EntryPointStructureChecksum
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);
- ShellPrintHiiEx(-1,-1,NULL,
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VERSION),
gShellDebug1HiiHandle,
SmbiosTable->MajorVersion,
SmbiosTable->MinorVersion
- );
- ShellPrintHiiEx(-1,-1,NULL,
+ );
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NUMBER_STRUCT),
gShellDebug1HiiHandle,
SmbiosTable->NumberOfSmbiosStructures
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_STRUCT_SIZE), gShellDebug1HiiHandle, SmbiosTable->MaxStructureSize);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_LENGTH), gShellDebug1HiiHandle, SmbiosTable->TableLength);
-
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_STRUCT_SIZE), gShellDebug1HiiHandle, SmbiosTable->MaxStructureSize);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_LENGTH), gShellDebug1HiiHandle, SmbiosTable->TableLength);
}
+
//
// If SHOW_ALL, also print followings.
//
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_REVISION),
gShellDebug1HiiHandle,
SmbiosTable->EntryPointRevision
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BCD_REVISION), gShellDebug1HiiHandle, SmbiosTable->SmbiosBcdRevision);
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BCD_REVISION), gShellDebug1HiiHandle, SmbiosTable->SmbiosBcdRevision);
//
// Since raw data is not string, add a NULL terminater.
//
MemToString (InAnchor, SmbiosTable->IntermediateAnchorString, 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_ACHOR), gShellDebug1HiiHandle, InAnchor);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_CHECKSUM), gShellDebug1HiiHandle, SmbiosTable->IntermediateChecksum);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMATTED_AREA), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_ACHOR), gShellDebug1HiiHandle, InAnchor);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTER_CHECKSUM), gShellDebug1HiiHandle, SmbiosTable->IntermediateChecksum);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMATTED_AREA), gShellDebug1HiiHandle);
DumpHex (2, 0, 5, SmbiosTable->FormattedArea);
}
@@ -206,58 +219,70 @@ Smbios64BitPrintEPSInfo (
IN UINT8 Option
)
{
- UINT8 Anchor[5];
+ UINT8 Anchor[5];
if (SmbiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);
- return ;
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMBIOSTABLE_NULL), gShellDebug1HiiHandle);
+ return;
}
if (Option == SHOW_NONE) {
- return ;
+ return;
}
if (Option >= SHOW_NORMAL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_64_BIT_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_64_BIT_ENTRY_POINT_SIGN), gShellDebug1HiiHandle);
MemToString (Anchor, SmbiosTable->AnchorString, 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR), gShellDebug1HiiHandle, Anchor);
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EPS_CHECKSUM),
gShellDebug1HiiHandle,
SmbiosTable->EntryPointStructureChecksum
- );
+ );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_LEN), gShellDebug1HiiHandle, SmbiosTable->EntryPointLength);
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VERSION),
gShellDebug1HiiHandle,
SmbiosTable->MajorVersion,
SmbiosTable->MinorVersion
- );
+ );
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DOCREV),
gShellDebug1HiiHandle,
SmbiosTable->DocRev
- );
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_MAX_SIZE), gShellDebug1HiiHandle, SmbiosTable->TableMaximumSize);
+ );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_MAX_SIZE), gShellDebug1HiiHandle, SmbiosTable->TableMaximumSize);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR), gShellDebug1HiiHandle, SmbiosTable->TableAddress);
}
+
//
// If SHOW_ALL, also print followings.
//
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENTRY_POINT_REVISION),
gShellDebug1HiiHandle,
SmbiosTable->EntryPointRevision
- );
+ );
}
Print (L"\n");
@@ -279,9 +304,9 @@ SmbiosPrintStructure (
IN UINT8 Option
)
{
- UINT8 Index;
- UINT8 Index2;
- UINT8 *Buffer;
+ UINT8 Index;
+ UINT8 Index2;
+ UINT8 *Buffer;
if (Struct == NULL) {
return EFI_INVALID_PARAMETER;
@@ -291,268 +316,286 @@ SmbiosPrintStructure (
return EFI_SUCCESS;
}
- Buffer = (UINT8 *) (UINTN) (Struct->Raw);
+ Buffer = (UINT8 *)(UINTN)(Struct->Raw);
//
// Display structure header
//
DisplayStructureTypeInfo (Struct->Hdr->Type, SHOW_DETAIL);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMAT_PART_LEN), gShellDebug1HiiHandle, Struct->Hdr->Length);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, Struct->Hdr->Handle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMAT_PART_LEN), gShellDebug1HiiHandle, Struct->Hdr->Length);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, Struct->Hdr->Handle);
if (Option == SHOW_OUTLINE) {
return EFI_SUCCESS;
}
switch (Struct->Hdr->Type) {
- //
- // BIOS Information (Type 0)
- //
- case 0:
- PRINT_PENDING_STRING (Struct, Type0, Vendor);
- PRINT_PENDING_STRING (Struct, Type0, BiosVersion);
- PRINT_STRUCT_VALUE_H (Struct, Type0, BiosSegment);
- PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
+ //
+ // BIOS Information (Type 0)
+ //
+ case 0:
+ PRINT_PENDING_STRING (Struct, Type0, Vendor);
+ PRINT_PENDING_STRING (Struct, Type0, BiosVersion);
+ PRINT_STRUCT_VALUE_H (Struct, Type0, BiosSegment);
+ PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
- DisplayBiosCharacteristics (ReadUnaligned64 ((UINT64 *) (UINTN) &(Struct->Type0->BiosCharacteristics)), Option);
+ DisplayBiosCharacteristics (ReadUnaligned64 ((UINT64 *)(UINTN)&(Struct->Type0->BiosCharacteristics)), Option);
- if (Struct->Hdr->Length > 0x12) {
- DisplayBiosCharacteristicsExt1 (Struct->Type0->BIOSCharacteristicsExtensionBytes[0], Option);
- }
- if (Struct->Hdr->Length > 0x13) {
- DisplayBiosCharacteristicsExt2 (Struct->Type0->BIOSCharacteristicsExtensionBytes[1], Option);
- }
+ if (Struct->Hdr->Length > 0x12) {
+ DisplayBiosCharacteristicsExt1 (Struct->Type0->BIOSCharacteristicsExtensionBytes[0], Option);
+ }
- if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x14)) {
- PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMajorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMinorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMajorRelease);
- PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMinorRelease);
- }
- if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x18)) {
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTENDED_BIOS_SIZE),
- gShellDebug1HiiHandle,
- Struct->Type0->ExtendedBiosSize.Size,
- (Struct->Type0->ExtendedBiosSize.Unit == 0x0) ? L"MB": L"GB"
- );
- }
- break;
+ if (Struct->Hdr->Length > 0x13) {
+ DisplayBiosCharacteristicsExt2 (Struct->Type0->BIOSCharacteristicsExtensionBytes[1], Option);
+ }
- //
- // System Information (Type 1)
- //
- case 1:
- PRINT_PENDING_STRING (Struct, Type1, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type1, ProductName);
- PRINT_PENDING_STRING (Struct, Type1, Version);
- PRINT_PENDING_STRING (Struct, Type1, SerialNumber);
- PRINT_BIT_FIELD (Struct, Type1, Uuid, 16);
- DisplaySystemWakeupType (Struct->Type1->WakeUpType, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x19)) {
- PRINT_PENDING_STRING (Struct, Type1, SKUNumber);
- PRINT_PENDING_STRING (Struct, Type1, Family);
- }
+ if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x14)) {
+ PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMajorRelease);
+ PRINT_STRUCT_VALUE (Struct, Type0, SystemBiosMinorRelease);
+ PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMajorRelease);
+ PRINT_STRUCT_VALUE (Struct, Type0, EmbeddedControllerFirmwareMinorRelease);
+ }
- break;
+ if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x18)) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTENDED_BIOS_SIZE),
+ gShellDebug1HiiHandle,
+ Struct->Type0->ExtendedBiosSize.Size,
+ (Struct->Type0->ExtendedBiosSize.Unit == 0x0) ? L"MB" : L"GB"
+ );
+ }
- //
- // Baseboard Information (Type 2)
- //
- case 2:
- PRINT_PENDING_STRING (Struct, Type2, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type2, ProductName);
- PRINT_PENDING_STRING (Struct, Type2, Version);
- PRINT_PENDING_STRING (Struct, Type2, SerialNumber);
- if (Struct->Hdr->Length > 0x8) {
- PRINT_PENDING_STRING (Struct, Type2, AssetTag);
- DisplayBaseBoardFeatureFlags (*(UINT8 *) &Struct->Type2->FeatureFlag, Option);
- PRINT_PENDING_STRING (Struct, Type2, LocationInChassis);
- PRINT_STRUCT_VALUE_H (Struct, Type2, ChassisHandle);
- DisplayBaseBoardBoardType (Struct->Type2->BoardType, Option);
- }
- break;
-
- //
- // System Enclosure (Type 3)
- //
- case 3:
- PRINT_PENDING_STRING (Struct, Type3, Manufacturer);
- PRINT_STRUCT_VALUE (Struct, Type3, Type);
- DisplaySystemEnclosureType (Struct->Type3->Type, Option);
- PRINT_PENDING_STRING (Struct, Type3, Version);
- PRINT_PENDING_STRING (Struct, Type3, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type3, AssetTag);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOTUP_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->BootupState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->PowerSupplyState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (Struct->Type3->ThermalState, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS), gShellDebug1HiiHandle);
- DisplaySESecurityStatus (Struct->Type3->SecurityStatus, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x3)) {
- if (Struct->Hdr->Length > 0xD) {
- PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4);
+ break;
+
+ //
+ // System Information (Type 1)
+ //
+ case 1:
+ PRINT_PENDING_STRING (Struct, Type1, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type1, ProductName);
+ PRINT_PENDING_STRING (Struct, Type1, Version);
+ PRINT_PENDING_STRING (Struct, Type1, SerialNumber);
+ PRINT_BIT_FIELD (Struct, Type1, Uuid, 16);
+ DisplaySystemWakeupType (Struct->Type1->WakeUpType, Option);
+ if (AE_SMBIOS_VERSION (0x2, 0x4) && (Struct->Hdr->Length > 0x19)) {
+ PRINT_PENDING_STRING (Struct, Type1, SKUNumber);
+ PRINT_PENDING_STRING (Struct, Type1, Family);
}
- if (Struct->Hdr->Length > 0x11) {
- PRINT_STRUCT_VALUE (Struct, Type3, Height);
+
+ break;
+
+ //
+ // Baseboard Information (Type 2)
+ //
+ case 2:
+ PRINT_PENDING_STRING (Struct, Type2, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type2, ProductName);
+ PRINT_PENDING_STRING (Struct, Type2, Version);
+ PRINT_PENDING_STRING (Struct, Type2, SerialNumber);
+ if (Struct->Hdr->Length > 0x8) {
+ PRINT_PENDING_STRING (Struct, Type2, AssetTag);
+ DisplayBaseBoardFeatureFlags (*(UINT8 *)&Struct->Type2->FeatureFlag, Option);
+ PRINT_PENDING_STRING (Struct, Type2, LocationInChassis);
+ PRINT_STRUCT_VALUE_H (Struct, Type2, ChassisHandle);
+ DisplayBaseBoardBoardType (Struct->Type2->BoardType, Option);
}
- if (Struct->Hdr->Length > 0x12) {
- PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords);
+
+ break;
+
+ //
+ // System Enclosure (Type 3)
+ //
+ case 3:
+ PRINT_PENDING_STRING (Struct, Type3, Manufacturer);
+ PRINT_STRUCT_VALUE (Struct, Type3, Type);
+ DisplaySystemEnclosureType (Struct->Type3->Type, Option);
+ PRINT_PENDING_STRING (Struct, Type3, Version);
+ PRINT_PENDING_STRING (Struct, Type3, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type3, AssetTag);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOTUP_STATE), gShellDebug1HiiHandle);
+ DisplaySystemEnclosureStatus (Struct->Type3->BootupState, Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE), gShellDebug1HiiHandle);
+ DisplaySystemEnclosureStatus (Struct->Type3->PowerSupplyState, Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE), gShellDebug1HiiHandle);
+ DisplaySystemEnclosureStatus (Struct->Type3->ThermalState, Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS), gShellDebug1HiiHandle);
+ DisplaySESecurityStatus (Struct->Type3->SecurityStatus, Option);
+ if (AE_SMBIOS_VERSION (0x2, 0x3)) {
+ if (Struct->Hdr->Length > 0xD) {
+ PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4);
+ }
+
+ if (Struct->Hdr->Length > 0x11) {
+ PRINT_STRUCT_VALUE (Struct, Type3, Height);
+ }
+
+ if (Struct->Hdr->Length > 0x12) {
+ PRINT_STRUCT_VALUE (Struct, Type3, NumberofPowerCords);
+ }
+
+ if (Struct->Hdr->Length > 0x13) {
+ PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);
+ }
+
+ if (Struct->Hdr->Length > 0x14) {
+ PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength);
+ }
+
+ if (Struct->Hdr->Length > 0x15) {
+ for (Index = 0; Index < Struct->Type3->ContainedElementCount; Index++) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
+ for (Index2 = 0; Index2 < Struct->Type3->ContainedElementRecordLength; Index2++) {
+ Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->ContainedElementRecordLength) + Index2]);
+ }
+
+ Print (L"\n");
+ }
+ }
}
- if (Struct->Hdr->Length > 0x13) {
- PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementCount);
+
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
+ if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength))) {
+ PRINT_SMBIOS_STRING (Struct, Buffer[0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength)], SKUNumber);
+ }
+ }
+
+ break;
+
+ //
+ // Processor Information (Type 4)
+ //
+ case 4:
+ PRINT_SMBIOS_STRING (Struct, Struct->Type4->Socket, SocketDesignation)
+ DisplayProcessorType (Struct->Type4->ProcessorType, Option);
+ if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x28) &&
+ (Struct->Type4->ProcessorFamily == 0xFE))
+ {
+ //
+ // Get family from ProcessorFamily2 field
+ //
+ DisplayProcessorFamily2 (Struct->Type4->ProcessorFamily2, Option);
+ } else {
+ DisplayProcessorFamily (Struct->Type4->ProcessorFamily, Option);
}
- if (Struct->Hdr->Length > 0x14) {
- PRINT_STRUCT_VALUE (Struct, Type3, ContainedElementRecordLength);
+
+ PRINT_PENDING_STRING (Struct, Type4, ProcessorManufacturer);
+ PRINT_BIT_FIELD (Struct, Type4, ProcessorId, 8);
+ PRINT_PENDING_STRING (Struct, Type4, ProcessorVersion);
+ DisplayProcessorVoltage (*(UINT8 *)&(Struct->Type4->Voltage), Option);
+ PRINT_STRUCT_VALUE (Struct, Type4, ExternalClock);
+ PRINT_STRUCT_VALUE (Struct, Type4, MaxSpeed);
+ PRINT_STRUCT_VALUE (Struct, Type4, CurrentSpeed);
+ DisplayProcessorStatus (Struct->Type4->Status, Option);
+ DisplayProcessorUpgrade (Struct->Type4->ProcessorUpgrade, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L1CacheHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L2CacheHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L3CacheHandle);
+ if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0x20)) {
+ PRINT_PENDING_STRING (Struct, Type4, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type4, AssetTag);
+ PRINT_PENDING_STRING (Struct, Type4, PartNumber);
}
- if (Struct->Hdr->Length > 0x15) {
- for (Index = 0; Index < Struct->Type3->ContainedElementCount; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONTAINED_ELEMENT), gShellDebug1HiiHandle, Index+1);
- for (Index2 = 0; Index2< Struct->Type3->ContainedElementRecordLength; Index2++) {
- Print (L"%02X ", Buffer[0x15 + (Index * Struct->Type3->ContainedElementRecordLength) + Index2]);
- }
- Print (L"\n");
- }
+
+ if (AE_SMBIOS_VERSION (0x2, 0x5) && (Struct->Hdr->Length > 0x23)) {
+ PRINT_STRUCT_VALUE (Struct, Type4, CoreCount);
+ PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount);
+ PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount);
+ DisplayProcessorCharacteristics (Struct->Type4->ProcessorCharacteristics, Option);
}
- }
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
- if (Struct->Hdr->Length > (0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength))) {
- PRINT_SMBIOS_STRING (Struct, Buffer[0x15 + (Struct->Type3->ContainedElementCount * Struct->Type3->ContainedElementRecordLength)], SKUNumber);
+
+ if ((SmbiosMajorVersion >= 0x3) && (Struct->Hdr->Length > 0x2A)) {
+ PRINT_STRUCT_VALUE (Struct, Type4, CoreCount2);
+ PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount2);
+ PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount2);
}
- }
- break;
- //
- // Processor Information (Type 4)
- //
- case 4:
- PRINT_SMBIOS_STRING (Struct, Struct->Type4->Socket, SocketDesignation)
- DisplayProcessorType (Struct->Type4->ProcessorType, Option);
- if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x28) &&
- (Struct->Type4->ProcessorFamily == 0xFE)) {
- //
- // Get family from ProcessorFamily2 field
- //
- DisplayProcessorFamily2 (Struct->Type4->ProcessorFamily2, Option);
- } else {
- DisplayProcessorFamily (Struct->Type4->ProcessorFamily, Option);
- }
- PRINT_PENDING_STRING (Struct, Type4, ProcessorManufacturer);
- PRINT_BIT_FIELD (Struct, Type4, ProcessorId, 8);
- PRINT_PENDING_STRING (Struct, Type4, ProcessorVersion);
- DisplayProcessorVoltage (*(UINT8 *) &(Struct->Type4->Voltage), Option);
- PRINT_STRUCT_VALUE (Struct, Type4, ExternalClock);
- PRINT_STRUCT_VALUE (Struct, Type4, MaxSpeed);
- PRINT_STRUCT_VALUE (Struct, Type4, CurrentSpeed);
- DisplayProcessorStatus (Struct->Type4->Status, Option);
- DisplayProcessorUpgrade (Struct->Type4->ProcessorUpgrade, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L1CacheHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L2CacheHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type4, L3CacheHandle);
- if (AE_SMBIOS_VERSION (0x2, 0x3) && (Struct->Hdr->Length > 0x20)) {
- PRINT_PENDING_STRING (Struct, Type4, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type4, AssetTag);
- PRINT_PENDING_STRING (Struct, Type4, PartNumber);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x5) && (Struct->Hdr->Length > 0x23)) {
- PRINT_STRUCT_VALUE (Struct, Type4, CoreCount);
- PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount);
- PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount);
- DisplayProcessorCharacteristics (Struct->Type4->ProcessorCharacteristics, Option);
- }
- if ((SmbiosMajorVersion >= 0x3) && (Struct->Hdr->Length > 0x2A)) {
- PRINT_STRUCT_VALUE (Struct, Type4, CoreCount2);
- PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount2);
- PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount2);
- }
- break;
+ break;
- //
- // Memory Controller Information (Type 5)
- //
- case 5:
+ //
+ // Memory Controller Information (Type 5)
+ //
+ case 5:
{
- UINT8 SlotNum;
+ UINT8 SlotNum;
SlotNum = Struct->Type5->AssociatedMemorySlotNum;
DisplayMcErrorDetectMethod (Struct->Type5->ErrDetectMethod, Option);
- DisplayMcErrorCorrectCapability (*(UINT8 *) &(Struct->Type5->ErrCorrectCapability), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRT), gShellDebug1HiiHandle);
+ DisplayMcErrorCorrectCapability (*(UINT8 *)&(Struct->Type5->ErrCorrectCapability), Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRT), gShellDebug1HiiHandle);
DisplayMcInterleaveSupport (Struct->Type5->SupportInterleave, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CURRENT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CURRENT), gShellDebug1HiiHandle);
DisplayMcInterleaveSupport (Struct->Type5->CurrentInterleave, Option);
DisplayMaxMemoryModuleSize (Struct->Type5->MaxMemoryModuleSize, SlotNum, Option);
- DisplayMcMemorySpeeds (*(UINT16 *) &(Struct->Type5->SupportSpeed), Option);
+ DisplayMcMemorySpeeds (*(UINT16 *)&(Struct->Type5->SupportSpeed), Option);
DisplayMmMemoryType (Struct->Type5->SupportMemoryType, Option);
DisplayMemoryModuleVoltage (Struct->Type5->MemoryModuleVoltage, Option);
PRINT_STRUCT_VALUE (Struct, Type5, AssociatedMemorySlotNum);
//
// According to SMBIOS Specification, offset 0x0F
//
- DisplayMemoryModuleConfigHandles ((UINT16 *) (&Buffer[0x0F]), SlotNum, Option);
+ DisplayMemoryModuleConfigHandles ((UINT16 *)(&Buffer[0x0F]), SlotNum, Option);
DisplayMcErrorCorrectCapability (Buffer[0x0F + 2 * SlotNum], Option);
+ break;
}
- break;
-
- //
- // Memory Module Information (Type 6)
- //
- case 6:
- PRINT_PENDING_STRING (Struct, Type6, SocketDesignation);
- DisplayMmBankConnections (Struct->Type6->BankConnections, Option);
- PRINT_STRUCT_VALUE (Struct, Type6, CurrentSpeed);
- DisplayMmMemoryType (*(UINT16 *) &(Struct->Type6->CurrentMemoryType), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INSTALLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->InstalledSize), Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (*(UINT8 *) &(Struct->Type6->EnabledSize), Option);
- DisplayMmErrorStatus (Struct->Type6->ErrorStatus, Option);
- break;
-
- //
- // Cache Information (Type 7)
- //
- case 7:
- PRINT_PENDING_STRING (Struct, Type7, SocketDesignation);
- DisplayCacheConfiguration (Struct->Type7->CacheConfiguration, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize);
- PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize);
- PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType);
- PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType);
- DisplayCacheSRAMType (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type7->CurrentSRAMType)), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed);
- DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);
- DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);
- DisplayCacheAssociativity (Struct->Type7->Associativity, Option);
- if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x13)) {
- PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize2);
- PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize2);
- }
- break;
- //
- // Port Connector Information (Type 8)
- //
- case 8:
- PRINT_PENDING_STRING (Struct, Type8, InternalReferenceDesignator);
- Print (L"Internal ");
- DisplayPortConnectorType (Struct->Type8->InternalConnectorType, Option);
- PRINT_PENDING_STRING (Struct, Type8, ExternalReferenceDesignator);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTERNAL), gShellDebug1HiiHandle);
- DisplayPortConnectorType (Struct->Type8->ExternalConnectorType, Option);
- DisplayPortType (Struct->Type8->PortType, Option);
- break;
+ //
+ // Memory Module Information (Type 6)
+ //
+ case 6:
+ PRINT_PENDING_STRING (Struct, Type6, SocketDesignation);
+ DisplayMmBankConnections (Struct->Type6->BankConnections, Option);
+ PRINT_STRUCT_VALUE (Struct, Type6, CurrentSpeed);
+ DisplayMmMemoryType (*(UINT16 *)&(Struct->Type6->CurrentMemoryType), Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INSTALLED), gShellDebug1HiiHandle);
+ DisplayMmMemorySize (*(UINT8 *)&(Struct->Type6->InstalledSize), Option);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
+ DisplayMmMemorySize (*(UINT8 *)&(Struct->Type6->EnabledSize), Option);
+ DisplayMmErrorStatus (Struct->Type6->ErrorStatus, Option);
+ break;
- //
- // System Slots (Type 9)
- //
- case 9:
+ //
+ // Cache Information (Type 7)
+ //
+ case 7:
+ PRINT_PENDING_STRING (Struct, Type7, SocketDesignation);
+ DisplayCacheConfiguration (Struct->Type7->CacheConfiguration, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType);
+ DisplayCacheSRAMType (ReadUnaligned16 ((UINT16 *)(UINTN)&(Struct->Type7->CurrentSRAMType)), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed);
+ DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);
+ DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);
+ DisplayCacheAssociativity (Struct->Type7->Associativity, Option);
+ if (AE_SMBIOS_VERSION (0x3, 0x1) && (Struct->Hdr->Length > 0x13)) {
+ PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize2);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize2);
+ }
+
+ break;
+
+ //
+ // Port Connector Information (Type 8)
+ //
+ case 8:
+ PRINT_PENDING_STRING (Struct, Type8, InternalReferenceDesignator);
+ Print (L"Internal ");
+ DisplayPortConnectorType (Struct->Type8->InternalConnectorType, Option);
+ PRINT_PENDING_STRING (Struct, Type8, ExternalReferenceDesignator);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTERNAL), gShellDebug1HiiHandle);
+ DisplayPortConnectorType (Struct->Type8->ExternalConnectorType, Option);
+ DisplayPortType (Struct->Type8->PortType, Option);
+ break;
+
+ //
+ // System Slots (Type 9)
+ //
+ case 9:
{
MISC_SLOT_PEER_GROUP *PeerGroupPtr;
UINT8 PeerGroupCount;
@@ -566,100 +609,107 @@ SmbiosPrintStructure (
Struct->Type9->SlotID,
Struct->Type9->SlotType,
Option
- );
- DisplaySlotCharacteristics1 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics1), Option);
- DisplaySlotCharacteristics2 (*(UINT8 *) &(Struct->Type9->SlotCharacteristics2), Option);
+ );
+ DisplaySlotCharacteristics1 (*(UINT8 *)&(Struct->Type9->SlotCharacteristics1), Option);
+ DisplaySlotCharacteristics2 (*(UINT8 *)&(Struct->Type9->SlotCharacteristics2), Option);
if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0xD)) {
PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
}
+
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
if (Struct->Hdr->Length > 0x11) {
PRINT_STRUCT_VALUE (Struct, Type9, DataBusWidth);
}
+
if (Struct->Hdr->Length > 0x12) {
PRINT_STRUCT_VALUE (Struct, Type9, PeerGroupingCount);
PeerGroupCount = Struct->Type9->PeerGroupingCount;
PeerGroupPtr = Struct->Type9->PeerGroups;
for (Index = 0; Index < PeerGroupCount; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_PEER_GROUPS), gShellDebug1HiiHandle, Index + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SEGMENT_GROUP_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].SegmentGroupNum);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BUS_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].BusNum);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_FUNC_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].DevFuncNum);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, PeerGroupPtr[Index].DataBusWidth);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_PEER_GROUPS), gShellDebug1HiiHandle, Index + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SEGMENT_GROUP_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].SegmentGroupNum);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BUS_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].BusNum);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_FUNC_NUM), gShellDebug1HiiHandle, PeerGroupPtr[Index].DevFuncNum);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DATA_BUS_WIDTH), gShellDebug1HiiHandle, PeerGroupPtr[Index].DataBusWidth);
}
}
}
+
+ break;
}
- break;
- //
- // On Board Devices Information (Type 10)
- //
- case 10:
+ //
+ // On Board Devices Information (Type 10)
+ //
+ case 10:
{
- UINTN NumOfDevice;
+ UINTN NumOfDevice;
NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_STRUCTURE)) / (2 * sizeof (UINT8));
for (Index = 0; Index < NumOfDevice; Index++) {
- ShellPrintEx(-1,-1,(((Struct->Type10->Device[Index].DeviceType) & 0x80) != 0) ? L"Device Enabled\n": L"Device Disabled\n");
+ ShellPrintEx (-1, -1, (((Struct->Type10->Device[Index].DeviceType) & 0x80) != 0) ? L"Device Enabled\n" : L"Device Disabled\n");
DisplayOnboardDeviceTypes ((Struct->Type10->Device[Index].DeviceType) & 0x7F, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,L"%a\n",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle);
+ ShellPrintEx (-1, -1, L"%a\n", LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString));
}
- }
- break;
- //
- // Oem Strings (Type 11)
- //
- case 11:
- PRINT_STRUCT_VALUE (Struct, Type11, StringCount);
- for (Index = 1; Index <= Struct->Type11->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
+ break;
}
- break;
- //
- // System Configuration Options (Type 12)
- //
- case 12:
- PRINT_STRUCT_VALUE (Struct, Type12, StringCount);
- for (Index = 1; Index <= Struct->Type12->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
- }
- break;
+ //
+ // Oem Strings (Type 11)
+ //
+ case 11:
+ PRINT_STRUCT_VALUE (Struct, Type11, StringCount);
+ for (Index = 1; Index <= Struct->Type11->StringCount; Index++) {
+ ShellPrintEx (-1, -1, L"%a\n", LibGetSmbiosString (Struct, Index));
+ }
- //
- // BIOS Language Information (Type 13)
- //
- case 13:
- PRINT_STRUCT_VALUE (Struct, Type13, InstallableLanguages);
- PRINT_STRUCT_VALUE (Struct, Type13, Flags);
- PRINT_BIT_FIELD (Struct, Type13, Reserved, 15);
- PRINT_PENDING_STRING (Struct, Type13, CurrentLanguages);
- break;
+ break;
- //
- // Group Associations (Type 14)
- //
- case 14:
+ //
+ // System Configuration Options (Type 12)
+ //
+ case 12:
+ PRINT_STRUCT_VALUE (Struct, Type12, StringCount);
+ for (Index = 1; Index <= Struct->Type12->StringCount; Index++) {
+ ShellPrintEx (-1, -1, L"%a\n", LibGetSmbiosString (Struct, Index));
+ }
+
+ break;
+
+ //
+ // BIOS Language Information (Type 13)
+ //
+ case 13:
+ PRINT_STRUCT_VALUE (Struct, Type13, InstallableLanguages);
+ PRINT_STRUCT_VALUE (Struct, Type13, Flags);
+ PRINT_BIT_FIELD (Struct, Type13, Reserved, 15);
+ PRINT_PENDING_STRING (Struct, Type13, CurrentLanguages);
+ break;
+
+ //
+ // Group Associations (Type 14)
+ //
+ case 14:
{
- UINT8 NumOfItem;
+ UINT8 NumOfItem;
NumOfItem = (Struct->Type14->Hdr.Length - 5) / 3;
PRINT_PENDING_STRING (Struct, Type14, GroupName);
for (Index = 0; Index < NumOfItem; Index++) {
- ShellPrintEx(-1,-1,L"ItemType %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemType);
- ShellPrintEx(-1,-1,L"ItemHandle %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemHandle);
+ ShellPrintEx (-1, -1, L"ItemType %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemType);
+ ShellPrintEx (-1, -1, L"ItemHandle %u: %u\n", Index + 1, Struct->Type14->Group[Index].ItemHandle);
}
+
+ break;
}
- break;
- //
- // System Event Log (Type 15)
- //
- case 15:
+ //
+ // System Event Log (Type 15)
+ //
+ case 15:
{
EVENT_LOG_TYPE *Ptr;
UINT8 Count;
@@ -684,29 +734,33 @@ SmbiosPrintStructure (
// Display all Event Log type descriptors supported by system
//
for (Index = 0; Index < Count; Index++, Ptr++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRTED_EVENT), gShellDebug1HiiHandle, Index + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRTED_EVENT), gShellDebug1HiiHandle, Index + 1);
DisplaySELTypes (Ptr->LogType, Option);
DisplaySELVarDataFormatType (Ptr->DataFormatType, Option);
}
if (Option >= SHOW_DETAIL) {
switch (Struct->Type15->AccessMethod) {
- case 03:
- AccessMethodAddress = (UINT8 *) (UINTN) (Struct->Type15->AccessMethodAddress);
- break;
-
- case 00:
- case 01:
- case 02:
- case 04:
- default:
- ShellPrintHiiEx(-1,-1,NULL,
- STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACCESS_METHOD_NOT_SUPOPRTED),
- gShellDebug1HiiHandle,
- Struct->Type15->AccessMethod
- );
- return EFI_UNSUPPORTED;
+ case 03:
+ AccessMethodAddress = (UINT8 *)(UINTN)(Struct->Type15->AccessMethodAddress);
+ break;
+
+ case 00:
+ case 01:
+ case 02:
+ case 04:
+ default:
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACCESS_METHOD_NOT_SUPOPRTED),
+ gShellDebug1HiiHandle,
+ Struct->Type15->AccessMethod
+ );
+ return EFI_UNSUPPORTED;
}
+
//
// Display Event Log Header
//
@@ -716,7 +770,7 @@ SmbiosPrintStructure (
DisplaySysEventLogHeader (
Struct->Type15->LogHeaderFormat,
AccessMethodAddress + Struct->Type15->LogHeaderStartOffset
- );
+ );
//
// Display all Event Log data
@@ -728,347 +782,359 @@ SmbiosPrintStructure (
AccessMethodAddress + Struct->Type15->LogDataStartOffset,
(UINT16)
(
- Struct->Type15->LogAreaLength -
- (Struct->Type15->LogDataStartOffset - Struct->Type15->LogHeaderStartOffset)
+ Struct->Type15->LogAreaLength -
+ (Struct->Type15->LogDataStartOffset - Struct->Type15->LogHeaderStartOffset)
)
- );
+ );
}
-
}
+
+ break;
}
- break;
-
- //
- // Physical Memory Array (Type 16)
- //
- case 16:
- DisplayPMALocation (Struct->Type16->Location, Option);
- DisplayPMAUse (Struct->Type16->Use, Option);
- DisplayPMAErrorCorrectionTypes (
- Struct->Type16->MemoryErrorCorrection,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type16, MaximumCapacity);
- PRINT_STRUCT_VALUE_H (Struct, Type16, MemoryErrorInformationHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type16, NumberOfMemoryDevices);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && Struct->Hdr->Length > 0xF) {
- PRINT_STRUCT_VALUE_LH (Struct, Type16, ExtendedMaximumCapacity);
- }
- break;
-
- //
- // Memory Device (Type 17)
- //
- case 17:
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type17, TotalWidth);
- PRINT_STRUCT_VALUE_H (Struct, Type17, DataWidth);
- PRINT_STRUCT_VALUE (Struct, Type17, Size);
- DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet);
- PRINT_PENDING_STRING (Struct, Type17, DeviceLocator);
- PRINT_PENDING_STRING (Struct, Type17, BankLocator);
- DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option);
- DisplayMemoryDeviceTypeDetail (ReadUnaligned16 ((UINT16 *) (UINTN) &(Struct->Type17->TypeDetail)), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type17, Speed);
- PRINT_PENDING_STRING (Struct, Type17, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type17, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type17, AssetTag);
- PRINT_PENDING_STRING (Struct, Type17, PartNumber);
- if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x1B)) {
- PRINT_STRUCT_VALUE_H (Struct, Type17, Attributes);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) {
- PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize);
- PRINT_STRUCT_VALUE_H (Struct, Type17, ConfiguredMemoryClockSpeed);
- }
- if (AE_SMBIOS_VERSION (0x2, 0x8) && (Struct->Hdr->Length > 0x22)) {
- PRINT_STRUCT_VALUE (Struct, Type17, MinimumVoltage);
- PRINT_STRUCT_VALUE (Struct, Type17, MaximumVoltage);
- PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredVoltage);
- }
- if (AE_SMBIOS_VERSION (0x3, 0x2)) {
- if (Struct->Hdr->Length > 0x28) {
- DisplayMemoryDeviceMemoryTechnology (Struct->Type17->MemoryTechnology, Option);
- DisplayMemoryDeviceMemoryOperatingModeCapability (Struct->Type17->MemoryOperatingModeCapability.Uint16, Option);
- PRINT_PENDING_STRING (Struct, Type17, FirmwareVersion);
- PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleManufacturerID);
- PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleProductID);
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerManufacturerID);
- PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerProductID);
+
+ //
+ // Physical Memory Array (Type 16)
+ //
+ case 16:
+ DisplayPMALocation (Struct->Type16->Location, Option);
+ DisplayPMAUse (Struct->Type16->Use, Option);
+ DisplayPMAErrorCorrectionTypes (
+ Struct->Type16->MemoryErrorCorrection,
+ Option
+ );
+ PRINT_STRUCT_VALUE_H (Struct, Type16, MaximumCapacity);
+ PRINT_STRUCT_VALUE_H (Struct, Type16, MemoryErrorInformationHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type16, NumberOfMemoryDevices);
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xF)) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type16, ExtendedMaximumCapacity);
}
- if (Struct->Hdr->Length > 0x34) {
- PRINT_STRUCT_VALUE_LH (Struct, Type17, NonVolatileSize);
+
+ break;
+
+ //
+ // Memory Device (Type 17)
+ //
+ case 17:
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, TotalWidth);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, DataWidth);
+ PRINT_STRUCT_VALUE (Struct, Type17, Size);
+ DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet);
+ PRINT_PENDING_STRING (Struct, Type17, DeviceLocator);
+ PRINT_PENDING_STRING (Struct, Type17, BankLocator);
+ DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option);
+ DisplayMemoryDeviceTypeDetail (ReadUnaligned16 ((UINT16 *)(UINTN)&(Struct->Type17->TypeDetail)), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, Speed);
+ PRINT_PENDING_STRING (Struct, Type17, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type17, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type17, AssetTag);
+ PRINT_PENDING_STRING (Struct, Type17, PartNumber);
+ if (AE_SMBIOS_VERSION (0x2, 0x6) && (Struct->Hdr->Length > 0x1B)) {
+ PRINT_STRUCT_VALUE_H (Struct, Type17, Attributes);
}
- if (Struct->Hdr->Length > 0x3C) {
- PRINT_STRUCT_VALUE_LH (Struct, Type17, VolatileSize);
+
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x1C)) {
+ PRINT_STRUCT_VALUE (Struct, Type17, ExtendedSize);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, ConfiguredMemoryClockSpeed);
}
- if (Struct->Hdr->Length > 0x44) {
- PRINT_STRUCT_VALUE_LH (Struct, Type17, CacheSize);
+
+ if (AE_SMBIOS_VERSION (0x2, 0x8) && (Struct->Hdr->Length > 0x22)) {
+ PRINT_STRUCT_VALUE (Struct, Type17, MinimumVoltage);
+ PRINT_STRUCT_VALUE (Struct, Type17, MaximumVoltage);
+ PRINT_STRUCT_VALUE (Struct, Type17, ConfiguredVoltage);
}
- if (Struct->Hdr->Length > 0x4C) {
- PRINT_STRUCT_VALUE_LH (Struct, Type17, LogicalSize);
+
+ if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+ if (Struct->Hdr->Length > 0x28) {
+ DisplayMemoryDeviceMemoryTechnology (Struct->Type17->MemoryTechnology, Option);
+ DisplayMemoryDeviceMemoryOperatingModeCapability (Struct->Type17->MemoryOperatingModeCapability.Uint16, Option);
+ PRINT_PENDING_STRING (Struct, Type17, FirmwareVersion);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleManufacturerID);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, ModuleProductID);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerManufacturerID);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemorySubsystemControllerProductID);
+ }
+
+ if (Struct->Hdr->Length > 0x34) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, NonVolatileSize);
+ }
+
+ if (Struct->Hdr->Length > 0x3C) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, VolatileSize);
+ }
+
+ if (Struct->Hdr->Length > 0x44) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, CacheSize);
+ }
+
+ if (Struct->Hdr->Length > 0x4C) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type17, LogicalSize);
+ }
}
- }
- break;
-
- //
- // 32-bit Memory Error Information (Type 18)
- //
- case 18:
- DisplayMemoryErrorType (Struct->Type18->ErrorType, Option);
- DisplayMemoryErrorGranularity (
- Struct->Type18->ErrorGranularity,
- Option
- );
- DisplayMemoryErrorOperation (Struct->Type18->ErrorOperation, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type18, VendorSyndrome);
- PRINT_STRUCT_VALUE_H (Struct, Type18, MemoryArrayErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type18, DeviceErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type18, ErrorResolution);
- break;
-
- //
- // Memory Array Mapped Address (Type 19)
- //
- case 19:
- PRINT_STRUCT_VALUE_H (Struct, Type19, StartingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xF)) {
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
- }
- break;
-
- //
- // Memory Device Mapped Address (Type 20)
- //
- case 20:
- PRINT_STRUCT_VALUE_H (Struct, Type20, StartingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type20, EndingAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryArrayMappedAddressHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type20, PartitionRowPosition);
- PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavePosition);
- PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavedDataDepth);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
- }
- break;
-
- //
- // Built-in Pointing Device (Type 21)
- //
- case 21:
- DisplayPointingDeviceType (Struct->Type21->Type, Option);
- DisplayPointingDeviceInterface (Struct->Type21->Interface, Option);
- PRINT_STRUCT_VALUE (Struct, Type21, NumberOfButtons);
- break;
-
- //
- // Portable Battery (Type 22)
- //
- case 22:
- PRINT_PENDING_STRING (Struct, Type22, Location);
- PRINT_PENDING_STRING (Struct, Type22, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type22, ManufactureDate);
- PRINT_PENDING_STRING (Struct, Type22, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type22, DeviceName);
- DisplayPBDeviceChemistry (
- Struct->Type22->DeviceChemistry,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type22, DeviceCapacity);
- PRINT_STRUCT_VALUE_H (Struct, Type22, DesignVoltage);
- PRINT_PENDING_STRING (Struct, Type22, SBDSVersionNumber);
- PRINT_STRUCT_VALUE_H (Struct, Type22, MaximumErrorInBatteryData);
- PRINT_STRUCT_VALUE_H (Struct, Type22, SBDSSerialNumber);
- DisplaySBDSManufactureDate (
- Struct->Type22->SBDSManufactureDate,
- Option
- );
- PRINT_PENDING_STRING (Struct, Type22, SBDSDeviceChemistry);
- PRINT_STRUCT_VALUE_H (Struct, Type22, DesignCapacityMultiplier);
- PRINT_STRUCT_VALUE_H (Struct, Type22, OEMSpecific);
- break;
-
- //
- // System Reset (Type 23)
- //
- case 23:
- DisplaySystemResetCapabilities (
- Struct->Type23->Capabilities,
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type23, ResetCount);
- PRINT_STRUCT_VALUE_H (Struct, Type23, ResetLimit);
- PRINT_STRUCT_VALUE_H (Struct, Type23, TimerInterval);
- PRINT_STRUCT_VALUE_H (Struct, Type23, Timeout);
- break;
-
- //
- // Hardware Security (Type 24)
- //
- case 24:
- DisplayHardwareSecuritySettings (
- Struct->Type24->HardwareSecuritySettings,
- Option
- );
- break;
-
- //
- // System Power Controls (Type 25)
- //
- case 25:
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMonth);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnDayOfMonth);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnHour);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMinute);
- PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnSecond);
- break;
-
- //
- // Voltage Probe (Type 26)
- //
- case 26:
- PRINT_PENDING_STRING (Struct, Type26, Description);
- DisplayVPLocation (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option);
- DisplayVPStatus (*(UINT8 *) &(Struct->Type26->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type26, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type26, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type26, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type26, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type26, NominalValue);
- break;
-
- //
- // Cooling Device (Type 27)
- //
- case 27:
- PRINT_STRUCT_VALUE_H (Struct, Type27, TemperatureProbeHandle);
- DisplayCoolingDeviceStatus (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option);
- DisplayCoolingDeviceType (*(UINT8 *) &(Struct->Type27->DeviceTypeAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type27, CoolingUnitGroup);
- PRINT_STRUCT_VALUE_H (Struct, Type27, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type27, NominalSpeed);
- if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xE)) {
- PRINT_PENDING_STRING (Struct, Type27, Description);
- }
- break;
- //
- // Temperature Probe (Type 28)
- //
- case 28:
- PRINT_PENDING_STRING (Struct, Type28, Description);
- DisplayTemperatureProbeStatus (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option);
- DisplayTemperatureProbeLoc (*(UINT8 *) &(Struct->Type28->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type28, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type28, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type28, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type28, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type28, NominalValue);
- break;
+ break;
- //
- // Electrical Current Probe (Type 29)
- //
- case 29:
- PRINT_PENDING_STRING (Struct, Type29, Description);
- DisplayECPStatus (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option);
- DisplayECPLoc (*(UINT8 *) &(Struct->Type29->LocationAndStatus), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type29, MaximumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type29, MinimumValue);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Resolution);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Tolerance);
- PRINT_STRUCT_VALUE_H (Struct, Type29, Accuracy);
- PRINT_STRUCT_VALUE_H (Struct, Type29, OEMDefined);
- PRINT_STRUCT_VALUE_H (Struct, Type29, NominalValue);
- break;
+ //
+ // 32-bit Memory Error Information (Type 18)
+ //
+ case 18:
+ DisplayMemoryErrorType (Struct->Type18->ErrorType, Option);
+ DisplayMemoryErrorGranularity (
+ Struct->Type18->ErrorGranularity,
+ Option
+ );
+ DisplayMemoryErrorOperation (Struct->Type18->ErrorOperation, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, VendorSyndrome);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, MemoryArrayErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, DeviceErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, ErrorResolution);
+ break;
- //
- // Out-of-Band Remote Access (Type 30)
- //
- case 30:
- PRINT_PENDING_STRING (Struct, Type30, ManufacturerName);
- DisplayOBRAConnections (Struct->Type30->Connections, Option);
- break;
+ //
+ // Memory Array Mapped Address (Type 19)
+ //
+ case 19:
+ PRINT_STRUCT_VALUE_H (Struct, Type19, StartingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth);
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xF)) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
+ PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
+ }
- //
- // Boot Integrity Services (BIS) Entry Point (Type 31)
- //
- case 31:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE31), gShellDebug1HiiHandle);
- break;
+ break;
- //
- // System Boot Information (Type 32)
- //
- case 32:
- PRINT_BIT_FIELD (Struct, Type32, Reserved, 6);
- DisplaySystemBootStatus (Struct->Type32->BootStatus, Option);
- break;
+ //
+ // Memory Device Mapped Address (Type 20)
+ //
+ case 20:
+ PRINT_STRUCT_VALUE_H (Struct, Type20, StartingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, EndingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryArrayMappedAddressHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, PartitionRowPosition);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavePosition);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavedDataDepth);
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0x13)) {
+ PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedStartingAddress);
+ PRINT_STRUCT_VALUE_LH (Struct, Type19, ExtendedEndingAddress);
+ }
- //
- // 64-Bit Memory Error Information (Type 33)
- //
- case 33:
- DisplayMemoryErrorType (Struct->Type33->ErrorType, Option);
- DisplayMemoryErrorGranularity (
- Struct->Type33->ErrorGranularity,
- Option
- );
- DisplayMemoryErrorOperation (Struct->Type33->ErrorOperation, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type33, VendorSyndrome);
- PRINT_STRUCT_VALUE_LH (Struct, Type33, MemoryArrayErrorAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type33, DeviceErrorAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type33, ErrorResolution);
- break;
+ break;
- //
- // Management Device (Type 34)
- //
- case 34:
- PRINT_PENDING_STRING (Struct, Type34, Description);
- DisplayMDType (Struct->Type34->Type, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type34, Address);
- DisplayMDAddressType (Struct->Type34->AddressType, Option);
- break;
+ //
+ // Built-in Pointing Device (Type 21)
+ //
+ case 21:
+ DisplayPointingDeviceType (Struct->Type21->Type, Option);
+ DisplayPointingDeviceInterface (Struct->Type21->Interface, Option);
+ PRINT_STRUCT_VALUE (Struct, Type21, NumberOfButtons);
+ break;
- //
- // Management Device Component (Type 35)
- //
- case 35:
- PRINT_PENDING_STRING (Struct, Type35, Description);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ManagementDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ComponentHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type35, ThresholdHandle);
- break;
+ //
+ // Portable Battery (Type 22)
+ //
+ case 22:
+ PRINT_PENDING_STRING (Struct, Type22, Location);
+ PRINT_PENDING_STRING (Struct, Type22, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type22, ManufactureDate);
+ PRINT_PENDING_STRING (Struct, Type22, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type22, DeviceName);
+ DisplayPBDeviceChemistry (
+ Struct->Type22->DeviceChemistry,
+ Option
+ );
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DeviceCapacity);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DesignVoltage);
+ PRINT_PENDING_STRING (Struct, Type22, SBDSVersionNumber);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, MaximumErrorInBatteryData);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, SBDSSerialNumber);
+ DisplaySBDSManufactureDate (
+ Struct->Type22->SBDSManufactureDate,
+ Option
+ );
+ PRINT_PENDING_STRING (Struct, Type22, SBDSDeviceChemistry);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DesignCapacityMultiplier);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, OEMSpecific);
+ break;
- //
- // Management Device Threshold Data (Type 36)
- //
- case 36:
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdCritical);
- PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonRecoverable);
- PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonRecoverable);
- break;
+ //
+ // System Reset (Type 23)
+ //
+ case 23:
+ DisplaySystemResetCapabilities (
+ Struct->Type23->Capabilities,
+ Option
+ );
+ PRINT_STRUCT_VALUE_H (Struct, Type23, ResetCount);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, ResetLimit);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, TimerInterval);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, Timeout);
+ break;
- //
- // Memory Channel (Type 37)
- //
- case 37:
+ //
+ // Hardware Security (Type 24)
+ //
+ case 24:
+ DisplayHardwareSecuritySettings (
+ Struct->Type24->HardwareSecuritySettings,
+ Option
+ );
+ break;
+
+ //
+ // System Power Controls (Type 25)
+ //
+ case 25:
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMonth);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnDayOfMonth);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnHour);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMinute);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnSecond);
+ break;
+
+ //
+ // Voltage Probe (Type 26)
+ //
+ case 26:
+ PRINT_PENDING_STRING (Struct, Type26, Description);
+ DisplayVPLocation (*(UINT8 *)&(Struct->Type26->LocationAndStatus), Option);
+ DisplayVPStatus (*(UINT8 *)&(Struct->Type26->LocationAndStatus), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, NominalValue);
+ break;
+
+ //
+ // Cooling Device (Type 27)
+ //
+ case 27:
+ PRINT_STRUCT_VALUE_H (Struct, Type27, TemperatureProbeHandle);
+ DisplayCoolingDeviceStatus (*(UINT8 *)&(Struct->Type27->DeviceTypeAndStatus), Option);
+ DisplayCoolingDeviceType (*(UINT8 *)&(Struct->Type27->DeviceTypeAndStatus), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, CoolingUnitGroup);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, NominalSpeed);
+ if (AE_SMBIOS_VERSION (0x2, 0x7) && (Struct->Hdr->Length > 0xE)) {
+ PRINT_PENDING_STRING (Struct, Type27, Description);
+ }
+
+ break;
+
+ //
+ // Temperature Probe (Type 28)
+ //
+ case 28:
+ PRINT_PENDING_STRING (Struct, Type28, Description);
+ DisplayTemperatureProbeStatus (*(UINT8 *)&(Struct->Type28->LocationAndStatus), Option);
+ DisplayTemperatureProbeLoc (*(UINT8 *)&(Struct->Type28->LocationAndStatus), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, NominalValue);
+ break;
+
+ //
+ // Electrical Current Probe (Type 29)
+ //
+ case 29:
+ PRINT_PENDING_STRING (Struct, Type29, Description);
+ DisplayECPStatus (*(UINT8 *)&(Struct->Type29->LocationAndStatus), Option);
+ DisplayECPLoc (*(UINT8 *)&(Struct->Type29->LocationAndStatus), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, NominalValue);
+ break;
+
+ //
+ // Out-of-Band Remote Access (Type 30)
+ //
+ case 30:
+ PRINT_PENDING_STRING (Struct, Type30, ManufacturerName);
+ DisplayOBRAConnections (Struct->Type30->Connections, Option);
+ break;
+
+ //
+ // Boot Integrity Services (BIS) Entry Point (Type 31)
+ //
+ case 31:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE31), gShellDebug1HiiHandle);
+ break;
+
+ //
+ // System Boot Information (Type 32)
+ //
+ case 32:
+ PRINT_BIT_FIELD (Struct, Type32, Reserved, 6);
+ DisplaySystemBootStatus (Struct->Type32->BootStatus, Option);
+ break;
+
+ //
+ // 64-Bit Memory Error Information (Type 33)
+ //
+ case 33:
+ DisplayMemoryErrorType (Struct->Type33->ErrorType, Option);
+ DisplayMemoryErrorGranularity (
+ Struct->Type33->ErrorGranularity,
+ Option
+ );
+ DisplayMemoryErrorOperation (Struct->Type33->ErrorOperation, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, VendorSyndrome);
+ PRINT_STRUCT_VALUE_LH (Struct, Type33, MemoryArrayErrorAddress);
+ PRINT_STRUCT_VALUE_LH (Struct, Type33, DeviceErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, ErrorResolution);
+ break;
+
+ //
+ // Management Device (Type 34)
+ //
+ case 34:
+ PRINT_PENDING_STRING (Struct, Type34, Description);
+ DisplayMDType (Struct->Type34->Type, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type34, Address);
+ DisplayMDAddressType (Struct->Type34->AddressType, Option);
+ break;
+
+ //
+ // Management Device Component (Type 35)
+ //
+ case 35:
+ PRINT_PENDING_STRING (Struct, Type35, Description);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ManagementDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ComponentHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ThresholdHandle);
+ break;
+
+ //
+ // Management Device Threshold Data (Type 36)
+ //
+ case 36:
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonRecoverable);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonRecoverable);
+ break;
+
+ //
+ // Memory Channel (Type 37)
+ //
+ case 37:
{
UINT8 Count;
MEMORY_DEVICE *Ptr;
@@ -1079,54 +1145,55 @@ SmbiosPrintStructure (
Count = Struct->Type37->MemoryDeviceCount;
Ptr = Struct->Type37->MemoryDevice;
for (Index = 0; Index < Count; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_DEVICE), gShellDebug1HiiHandle, Index + 1);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr[Index].DeviceLoad);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_HANDLE), gShellDebug1HiiHandle, Ptr[Index].DeviceHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_DEVICE), gShellDebug1HiiHandle, Index + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr[Index].DeviceLoad);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_HANDLE), gShellDebug1HiiHandle, Ptr[Index].DeviceHandle);
}
+
+ break;
}
- break;
- //
- // IPMI Device Information (Type 38)
- //
- case 38:
- DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision);
- PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress);
- PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);
- PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress);
- break;
+ //
+ // IPMI Device Information (Type 38)
+ //
+ case 38:
+ DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);
+ PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress);
+ break;
- //
- // System Power Supply (Type 39)
- //
- case 39:
- PRINT_STRUCT_VALUE_H (Struct, Type39, PowerUnitGroup);
- PRINT_PENDING_STRING (Struct, Type39, Location);
- PRINT_PENDING_STRING (Struct, Type39, DeviceName);
- PRINT_PENDING_STRING (Struct, Type39, Manufacturer);
- PRINT_PENDING_STRING (Struct, Type39, SerialNumber);
- PRINT_PENDING_STRING (Struct, Type39, AssetTagNumber);
- PRINT_PENDING_STRING (Struct, Type39, ModelPartNumber);
- PRINT_PENDING_STRING (Struct, Type39, RevisionLevel);
- PRINT_STRUCT_VALUE_H (Struct, Type39, MaxPowerCapacity);
- DisplaySPSCharacteristics (
- *(UINT16 *) &(Struct->Type39->PowerSupplyCharacteristics),
- Option
- );
- PRINT_STRUCT_VALUE_H (Struct, Type39, InputVoltageProbeHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type39, CoolingDeviceHandle);
- PRINT_STRUCT_VALUE_H (Struct, Type39, InputCurrentProbeHandle);
- break;
+ //
+ // System Power Supply (Type 39)
+ //
+ case 39:
+ PRINT_STRUCT_VALUE_H (Struct, Type39, PowerUnitGroup);
+ PRINT_PENDING_STRING (Struct, Type39, Location);
+ PRINT_PENDING_STRING (Struct, Type39, DeviceName);
+ PRINT_PENDING_STRING (Struct, Type39, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type39, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type39, AssetTagNumber);
+ PRINT_PENDING_STRING (Struct, Type39, ModelPartNumber);
+ PRINT_PENDING_STRING (Struct, Type39, RevisionLevel);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, MaxPowerCapacity);
+ DisplaySPSCharacteristics (
+ *(UINT16 *)&(Struct->Type39->PowerSupplyCharacteristics),
+ Option
+ );
+ PRINT_STRUCT_VALUE_H (Struct, Type39, InputVoltageProbeHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, CoolingDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, InputCurrentProbeHandle);
+ break;
- //
- // Additional Information (Type 40)
- //
- case 40:
+ //
+ // Additional Information (Type 40)
+ //
+ case 40:
{
- UINT8 NumberOfEntries;
- UINT8 EntryLength;
- ADDITIONAL_INFORMATION_ENTRY *Entries;
+ UINT8 NumberOfEntries;
+ UINT8 EntryLength;
+ ADDITIONAL_INFORMATION_ENTRY *Entries;
EntryLength = 0;
Entries = Struct->Type40->AdditionalInfoEntries;
@@ -1136,78 +1203,80 @@ SmbiosPrintStructure (
for (Index = 0; Index < NumberOfEntries; Index++) {
EntryLength = Entries->EntryLength;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTRYLEN), gShellDebug1HiiHandle, EntryLength);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDHANDLE), gShellDebug1HiiHandle, Entries->ReferencedHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDOFFSET), gShellDebug1HiiHandle, Entries->ReferencedOffset);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTRYLEN), gShellDebug1HiiHandle, EntryLength);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDHANDLE), gShellDebug1HiiHandle, Entries->ReferencedHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDOFFSET), gShellDebug1HiiHandle, Entries->ReferencedOffset);
PRINT_SMBIOS_STRING (Struct, Entries->EntryString, String);
PRINT_SMBIOS_BIT_FIELD (Struct, Entries->Value, Value, EntryLength - 5);
- Entries = (ADDITIONAL_INFORMATION_ENTRY *) ((UINT8 *)Entries + EntryLength);
+ Entries = (ADDITIONAL_INFORMATION_ENTRY *)((UINT8 *)Entries + EntryLength);
}
+
+ break;
}
- break;
- //
- // Onboard Devices Extended Information (Type 41)
- //
- case 41:
- PRINT_PENDING_STRING (Struct, Type41, ReferenceDesignation);
- ShellPrintEx(-1,-1,(((Struct->Type41->DeviceType) & 0x80) != 0) ? L"Device Enabled\n": L"Device Disabled\n");
- DisplayOnboardDeviceTypes ((Struct->Type41->DeviceType) & 0x7F, Option);
- PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceTypeInstance);
- PRINT_STRUCT_VALUE_H (Struct, Type41, SegmentGroupNum);
- PRINT_STRUCT_VALUE_H (Struct, Type41, BusNum);
- PRINT_STRUCT_VALUE_H (Struct, Type41, DevFuncNum);
- break;
+ //
+ // Onboard Devices Extended Information (Type 41)
+ //
+ case 41:
+ PRINT_PENDING_STRING (Struct, Type41, ReferenceDesignation);
+ ShellPrintEx (-1, -1, (((Struct->Type41->DeviceType) & 0x80) != 0) ? L"Device Enabled\n" : L"Device Disabled\n");
+ DisplayOnboardDeviceTypes ((Struct->Type41->DeviceType) & 0x7F, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceTypeInstance);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, SegmentGroupNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, BusNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, DevFuncNum);
+ break;
- //
- // Management Controller Host Interface (Type 42)
- //
- case 42:
- DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
- if (AE_SMBIOS_VERSION (0x3, 0x2)) {
- PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceTypeSpecificDataLength);
- PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
- }
- break;
+ //
+ // Management Controller Host Interface (Type 42)
+ //
+ case 42:
+ DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
+ if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+ PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceTypeSpecificDataLength);
+ PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
+ }
- //
- // TPM Device (Type 43)
- //
- case 43:
- PRINT_BIT_FIELD (Struct, Type43, VendorID, 4);
- PRINT_STRUCT_VALUE_H (Struct, Type43, MajorSpecVersion);
- PRINT_STRUCT_VALUE_H (Struct, Type43, MinorSpecVersion);
- PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion1);
- PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion2);
- PRINT_PENDING_STRING (Struct, Type43, Description);
- DisplayTpmDeviceCharacteristics (ReadUnaligned64 ((UINT64 *) (UINTN) &(Struct->Type43->Characteristics)), Option);
- PRINT_STRUCT_VALUE_H (Struct, Type43, OemDefined);
- break;
+ break;
- //
- // Processor Additional Information (Type 44)
- //
- case 44:
- DisplayProcessorArchitectureType (Struct->Type44->ProcessorSpecificBlock.ProcessorArchType, Option);
- break;
+ //
+ // TPM Device (Type 43)
+ //
+ case 43:
+ PRINT_BIT_FIELD (Struct, Type43, VendorID, 4);
+ PRINT_STRUCT_VALUE_H (Struct, Type43, MajorSpecVersion);
+ PRINT_STRUCT_VALUE_H (Struct, Type43, MinorSpecVersion);
+ PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion1);
+ PRINT_STRUCT_VALUE_H (Struct, Type43, FirmwareVersion2);
+ PRINT_PENDING_STRING (Struct, Type43, Description);
+ DisplayTpmDeviceCharacteristics (ReadUnaligned64 ((UINT64 *)(UINTN)&(Struct->Type43->Characteristics)), Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type43, OemDefined);
+ break;
- //
- // Inactive (Type 126)
- //
- case 126:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INACTIVE_STRUCT), gShellDebug1HiiHandle);
- break;
+ //
+ // Processor Additional Information (Type 44)
+ //
+ case 44:
+ DisplayProcessorArchitectureType (Struct->Type44->ProcessorSpecificBlock.ProcessorArchType, Option);
+ break;
- //
- // End-of-Table (Type 127)
- //
- case 127:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THIS_STRUCT_END_TABLE), gShellDebug1HiiHandle);
- break;
+ //
+ // Inactive (Type 126)
+ //
+ case 126:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INACTIVE_STRUCT), gShellDebug1HiiHandle);
+ break;
+
+ //
+ // End-of-Table (Type 127)
+ //
+ case 127:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THIS_STRUCT_END_TABLE), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE_UNDEFINED), gShellDebug1HiiHandle);
- break;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_TYPE_UNDEFINED), gShellDebug1HiiHandle);
+ break;
}
return EFI_SUCCESS;
@@ -1228,7 +1297,7 @@ DisplayBiosCharacteristics (
//
// Print header
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR), gShellDebug1HiiHandle);
//
// print option
//
@@ -1240,137 +1309,138 @@ DisplayBiosCharacteristics (
// are designed not to deal with UINT64
//
if (BIT (Chara, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN_BIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN_BIT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ISA_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ISA_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MSA_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MSA_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EISA_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EISA_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PCI_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PCI_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 8) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PC_CARD_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PC_CARD_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 9) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PLUG_PLAY_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PLUG_PLAY_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 10) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_APM_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_APM_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 11) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_UPGRADEABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_UPGRADEABLE), gShellDebug1HiiHandle);
}
if (BIT (Chara, 12) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SHADOWING), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SHADOWING), gShellDebug1HiiHandle);
}
if (BIT (Chara, 13) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VESA_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VESA_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 14) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ECSD_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ECSD_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 15) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_CD_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_CD_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 16) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SELECTED_BOOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SELECTED_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 17) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_ROM_SOCKETED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_ROM_SOCKETED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 18) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_PC_CARD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_PC_CARD), gShellDebug1HiiHandle);
}
if (BIT (Chara, 19) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EDD_ENHANCED_DRIVER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EDD_ENHANCED_DRIVER), gShellDebug1HiiHandle);
}
if (BIT (Chara, 20) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_NEC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_NEC), gShellDebug1HiiHandle);
}
if (BIT (Chara, 21) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_TOSHIBA), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_TOSHIBA), gShellDebug1HiiHandle);
}
if (BIT (Chara, 22) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FLOPPY_SERVICES_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FLOPPY_SERVICES_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 23) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_POINT_TWO_MB), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_POINT_TWO_MB), gShellDebug1HiiHandle);
}
if (BIT (Chara, 24) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_720_KB), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_720_KB), gShellDebug1HiiHandle);
}
if (BIT (Chara, 25) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TWO_POINT_EIGHT_EIGHT_MB), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TWO_POINT_EIGHT_EIGHT_MB), gShellDebug1HiiHandle);
}
if (BIT (Chara, 26) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINT_SCREEN_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINT_SCREEN_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 27) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_SERV_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_SERV_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 28) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SERIAL_SERVICES_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SERIAL_SERVICES_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 29) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINTER_SERVICES_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINTER_SERVICES_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 30) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONO_VIDEO_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONO_VIDEO_SUPPORT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 31) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NEC_PC_98), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NEC_PC_98), gShellDebug1HiiHandle);
}
+
//
// Just print the Reserved
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_32_47), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_48_64), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_32_47), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_48_64), gShellDebug1HiiHandle);
}
/**
@@ -1381,11 +1451,11 @@ DisplayBiosCharacteristics (
**/
VOID
DisplayBiosCharacteristicsExt1 (
- IN UINT8 Byte1,
- IN UINT8 Option
+ IN UINT8 Byte1,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION), gShellDebug1HiiHandle);
//
// Print option
//
@@ -1395,35 +1465,35 @@ DisplayBiosCharacteristicsExt1 (
// check bit and print
//
if (BIT (Byte1, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACPI_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACPI_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USB_LEGACY_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USB_LEGACY_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AGP_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AGP_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_I2O_BOOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_I2O_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LS_120_BOOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LS_120_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ATAPI_ZIP_DRIVE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ATAPI_ZIP_DRIVE), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_1394_BOOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_1394_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Byte1, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMART_BATTERY_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMART_BATTERY_SUPPORTED), gShellDebug1HiiHandle);
}
}
@@ -1435,41 +1505,44 @@ DisplayBiosCharacteristicsExt1 (
**/
VOID
DisplayBiosCharacteristicsExt2 (
- IN UINT8 byte2,
- IN UINT8 Option
+ IN UINT8 byte2,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION_2), gShellDebug1HiiHandle);
//
// Print option
//
PRINT_INFO_OPTION (byte2, Option);
if (BIT (byte2, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_BOOT_SPEC_SUPP), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_BOOT_SPEC_SUPP), gShellDebug1HiiHandle);
}
if (BIT (byte2, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FUNCTION_KEY_INIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FUNCTION_KEY_INIT), gShellDebug1HiiHandle);
}
if (AE_SMBIOS_VERSION (0x2, 0x4)) {
if (BIT (byte2, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLE_TAR_CONT_DIST), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLE_TAR_CONT_DIST), gShellDebug1HiiHandle);
}
+
if (AE_SMBIOS_VERSION (0x2, 0x7)) {
if (BIT (byte2, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UEFI_SPEC_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UEFI_SPEC_SUPPORT), gShellDebug1HiiHandle);
}
+
if (BIT (byte2, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VIRTUAL_MACHINE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VIRTUAL_MACHINE), gShellDebug1HiiHandle);
}
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 5);
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 5);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 3);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 3);
}
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 2);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle, 2);
}
}
@@ -1481,14 +1554,14 @@ DisplayBiosCharacteristicsExt2 (
**/
VOID
DisplayProcessorFamily (
- UINT8 Family,
- UINT8 Option
+ UINT8 Family,
+ UINT8 Option
)
{
//
// Print prompt message
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
//
// Print option
//
@@ -1498,802 +1571,802 @@ DisplayProcessorFamily (
// Use switch to check
//
switch (Family) {
- case 0x01:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER), gShellDebug1HiiHandle);
- break;
-
- case 0x02:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 0x01:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER), gShellDebug1HiiHandle);
+ break;
- case 0x03:
- Print (L"8086\n");
- break;
+ case 0x02:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
- case 0x04:
- Print (L"80286\n");
- break;
+ case 0x03:
+ Print (L"8086\n");
+ break;
- case 0x05:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL386_PROCESSOR), gShellDebug1HiiHandle);
- break;
+ case 0x04:
+ Print (L"80286\n");
+ break;
- case 0x06:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL486_PROCESSOR), gShellDebug1HiiHandle);
- break;
+ case 0x05:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL386_PROCESSOR), gShellDebug1HiiHandle);
+ break;
- case 0x07:
- Print (L"8087\n");
- break;
+ case 0x06:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL486_PROCESSOR), gShellDebug1HiiHandle);
+ break;
- case 0x08:
- Print (L"80287\n");
- break;
+ case 0x07:
+ Print (L"8087\n");
+ break;
- case 0x09:
- Print (L"80387\n");
- break;
+ case 0x08:
+ Print (L"80287\n");
+ break;
- case 0x0A:
- Print (L"80487\n");
- break;
+ case 0x09:
+ Print (L"80387\n");
+ break;
- case 0x0B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x0A:
+ Print (L"80487\n");
+ break;
- case 0x0C:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PRO_PROC), gShellDebug1HiiHandle);
- break;
+ case 0x0B:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x0D:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_II_PROC), gShellDebug1HiiHandle);
- break;
+ case 0x0C:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PRO_PROC), gShellDebug1HiiHandle);
+ break;
- case 0x0E:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_MMX), gShellDebug1HiiHandle);
- break;
+ case 0x0D:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_II_PROC), gShellDebug1HiiHandle);
+ break;
- case 0x0F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CELERON_PROC), gShellDebug1HiiHandle);
- break;
+ case 0x0E:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_PROC_MMX), gShellDebug1HiiHandle);
+ break;
- case 0x10:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_XEON_PROC), gShellDebug1HiiHandle);
- break;
+ case 0x0F:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CELERON_PROC), gShellDebug1HiiHandle);
+ break;
- case 0x11:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_PROC), gShellDebug1HiiHandle);
- break;
+ case 0x10:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_XEON_PROC), gShellDebug1HiiHandle);
+ break;
- case 0x12:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_M1_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x11:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_PROC), gShellDebug1HiiHandle);
+ break;
- case 0x13:
- Print (L"M2 Family\n");
- break;
+ case 0x12:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_M1_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x14:
- Print (L"Intel Celeron M\n");
- break;
+ case 0x13:
+ Print (L"M2 Family\n");
+ break;
- case 0x15:
- Print (L"Intel Pentium 4 HT\n");
- break;
+ case 0x14:
+ Print (L"Intel Celeron M\n");
+ break;
- case 0x18:
- Print (L"AMD Duron\n");
- break;
+ case 0x15:
+ Print (L"Intel Pentium 4 HT\n");
+ break;
- case 0x19:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_K5_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x18:
+ Print (L"AMD Duron\n");
+ break;
- case 0x1A:
- Print (L"K6 Family\n");
- break;
+ case 0x19:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_K5_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x1B:
- Print (L"K6-2\n");
- break;
+ case 0x1A:
+ Print (L"K6 Family\n");
+ break;
- case 0x1C:
- Print (L"K6-3\n");
- break;
+ case 0x1B:
+ Print (L"K6-2\n");
+ break;
- case 0x1D:
- Print (L"AMD Althon Processor Family\n");
- break;
+ case 0x1C:
+ Print (L"K6-3\n");
+ break;
- case 0x1E:
- Print (L"AMD 29000 Family\n");
- break;
+ case 0x1D:
+ Print (L"AMD Althon Processor Family\n");
+ break;
- case 0x1F:
- Print (L"K6-2+\n");
- break;
+ case 0x1E:
+ Print (L"AMD 29000 Family\n");
+ break;
- case 0x20:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x1F:
+ Print (L"K6-2+\n");
+ break;
- case 0x21:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_601), gShellDebug1HiiHandle);
- break;
+ case 0x20:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x22:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603), gShellDebug1HiiHandle);
- break;
+ case 0x21:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_601), gShellDebug1HiiHandle);
+ break;
- case 0x23:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603_PLUS), gShellDebug1HiiHandle);
- break;
+ case 0x22:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603), gShellDebug1HiiHandle);
+ break;
- case 0x24:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_604), gShellDebug1HiiHandle);
- break;
+ case 0x23:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_603_PLUS), gShellDebug1HiiHandle);
+ break;
- case 0x25:
- Print (L"Power PC 620\n");
- break;
+ case 0x24:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_PC_604), gShellDebug1HiiHandle);
+ break;
- case 0x26:
- Print (L"Power PC 704\n");
- break;
+ case 0x25:
+ Print (L"Power PC 620\n");
+ break;
- case 0x27:
- Print (L"Power PC 750\n");
- break;
+ case 0x26:
+ Print (L"Power PC 704\n");
+ break;
- case 0x28:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO), gShellDebug1HiiHandle);
- break;
+ case 0x27:
+ Print (L"Power PC 750\n");
+ break;
- case 0x29:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0x28:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO), gShellDebug1HiiHandle);
+ break;
- case 0x2A:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_SOLO_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0x29:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_DUO_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0x2B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_ATOM), gShellDebug1HiiHandle);
- break;
+ case 0x2A:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_SOLO_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0x2C:
- Print (L"Intel(R) Core(TM) M processor\n");
- break;
+ case 0x2B:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_ATOM), gShellDebug1HiiHandle);
+ break;
- case 0x2D:
- Print (L"Intel(R) Core(TM) m3 processor\n");
- break;
+ case 0x2C:
+ Print (L"Intel(R) Core(TM) M processor\n");
+ break;
- case 0x2E:
- Print (L"Intel(R) Core(TM) m5 processor\n");
- break;
+ case 0x2D:
+ Print (L"Intel(R) Core(TM) m3 processor\n");
+ break;
- case 0x2F:
- Print (L"Intel(R) Core(TM) m7 processor\n");
- break;
+ case 0x2E:
+ Print (L"Intel(R) Core(TM) m5 processor\n");
+ break;
- case 0x30:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ALPHA_FAMILY_2), gShellDebug1HiiHandle);
- break;
+ case 0x2F:
+ Print (L"Intel(R) Core(TM) m7 processor\n");
+ break;
- case 0x31:
- Print (L"Alpha 21064\n");
- break;
+ case 0x30:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ALPHA_FAMILY_2), gShellDebug1HiiHandle);
+ break;
- case 0x32:
- Print (L"Alpha 21066\n");
- break;
+ case 0x31:
+ Print (L"Alpha 21064\n");
+ break;
- case 0x33:
- Print (L"Alpha 21164\n");
- break;
+ case 0x32:
+ Print (L"Alpha 21066\n");
+ break;
- case 0x34:
- Print (L"Alpha 21164PC\n");
- break;
+ case 0x33:
+ Print (L"Alpha 21164\n");
+ break;
- case 0x35:
- Print (L"Alpha 21164a\n");
- break;
+ case 0x34:
+ Print (L"Alpha 21164PC\n");
+ break;
- case 0x36:
- Print (L"Alpha 21264\n");
- break;
+ case 0x35:
+ Print (L"Alpha 21164a\n");
+ break;
- case 0x37:
- Print (L"Alpha 21364\n");
- break;
+ case 0x36:
+ Print (L"Alpha 21264\n");
+ break;
- case 0x38:
- Print (L"AMD Turion II Ultra Dual-Core Mobile M Processor Family\n");
- break;
+ case 0x37:
+ Print (L"Alpha 21364\n");
+ break;
- case 0x39:
- Print (L"AMD Turion II Dual-Core Mobile M Processor Family\n");
- break;
+ case 0x38:
+ Print (L"AMD Turion II Ultra Dual-Core Mobile M Processor Family\n");
+ break;
- case 0x3A:
- Print (L"AMD Althon II Dual-Core M Processor Family\n");
- break;
+ case 0x39:
+ Print (L"AMD Turion II Dual-Core Mobile M Processor Family\n");
+ break;
- case 0x3B:
- Print (L"AMD Opteron 6100 Series Processor\n");
- break;
+ case 0x3A:
+ Print (L"AMD Althon II Dual-Core M Processor Family\n");
+ break;
- case 0x3C:
- Print (L"AMD Opteron 4100 Series Processor\n");
- break;
+ case 0x3B:
+ Print (L"AMD Opteron 6100 Series Processor\n");
+ break;
- case 0x3D:
- Print (L"AMD Opteron 6200 Series Processor\n");
- break;
+ case 0x3C:
+ Print (L"AMD Opteron 4100 Series Processor\n");
+ break;
- case 0x3E:
- Print (L"AMD Opteron 4200 Series Processor\n");
- break;
+ case 0x3D:
+ Print (L"AMD Opteron 6200 Series Processor\n");
+ break;
- case 0x3F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_FX_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x3E:
+ Print (L"AMD Opteron 4200 Series Processor\n");
+ break;
- case 0x40:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MIPS_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x3F:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_FX_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x41:
- Print (L"MIPS R4000\n");
- break;
+ case 0x40:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MIPS_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x42:
- Print (L"MIPS R4200\n");
- break;
+ case 0x41:
+ Print (L"MIPS R4000\n");
+ break;
- case 0x43:
- Print (L"MIPS R4400\n");
- break;
+ case 0x42:
+ Print (L"MIPS R4200\n");
+ break;
- case 0x44:
- Print (L"MIPS R4600\n");
- break;
+ case 0x43:
+ Print (L"MIPS R4400\n");
+ break;
- case 0x45:
- Print (L"MIPS R10000\n");
- break;
+ case 0x44:
+ Print (L"MIPS R4600\n");
+ break;
- case 0x46:
- Print (L"AMD C-Series Processor\n");
- break;
+ case 0x45:
+ Print (L"MIPS R10000\n");
+ break;
- case 0x47:
- Print (L"AMD E-Series Processor\n");
- break;
+ case 0x46:
+ Print (L"AMD C-Series Processor\n");
+ break;
- case 0x48:
- Print (L"AMD A-Series Processor\n");
- break;
+ case 0x47:
+ Print (L"AMD E-Series Processor\n");
+ break;
- case 0x49:
- Print (L"AMD G-Series Processor\n");
- break;
+ case 0x48:
+ Print (L"AMD A-Series Processor\n");
+ break;
- case 0x4A:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_Z_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x49:
+ Print (L"AMD G-Series Processor\n");
+ break;
- case 0x4B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_R_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x4A:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_Z_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x4C:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_4300_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x4B:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_R_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x4D:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_6300_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x4C:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_4300_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x4E:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3300_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x4D:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_6300_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x4F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_FIREPRO_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0x4E:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3300_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x50:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SPARC_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x4F:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_FIREPRO_SERIES), gShellDebug1HiiHandle);
+ break;
- case 0x51:
- Print (L"SuperSparc\n");
- break;
+ case 0x50:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SPARC_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x52:
- Print (L"microSparc II\n");
- break;
+ case 0x51:
+ Print (L"SuperSparc\n");
+ break;
- case 0x53:
- Print (L"microSparc IIep\n");
- break;
+ case 0x52:
+ Print (L"microSparc II\n");
+ break;
- case 0x54:
- Print (L"UltraSparc\n");
- break;
+ case 0x53:
+ Print (L"microSparc IIep\n");
+ break;
- case 0x55:
- Print (L"UltraSparc II\n");
- break;
+ case 0x54:
+ Print (L"UltraSparc\n");
+ break;
- case 0x56:
- Print (L"UltraSparcIIi\n");
- break;
+ case 0x55:
+ Print (L"UltraSparc II\n");
+ break;
- case 0x57:
- Print (L"UltraSparcIII\n");
- break;
+ case 0x56:
+ Print (L"UltraSparcIIi\n");
+ break;
- case 0x58:
- Print (L"UltraSparcIIIi\n");
- break;
+ case 0x57:
+ Print (L"UltraSparcIII\n");
+ break;
- case 0x60:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_68040_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x58:
+ Print (L"UltraSparcIIIi\n");
+ break;
- case 0x61:
- Print (L"68xx\n");
- break;
+ case 0x60:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_68040_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x62:
- Print (L"68000\n");
- break;
+ case 0x61:
+ Print (L"68xx\n");
+ break;
- case 0x63:
- Print (L"68010\n");
- break;
+ case 0x62:
+ Print (L"68000\n");
+ break;
- case 0x64:
- Print (L"68020\n");
- break;
+ case 0x63:
+ Print (L"68010\n");
+ break;
- case 0x65:
- Print (L"68030\n");
- break;
+ case 0x64:
+ Print (L"68020\n");
+ break;
- case 0x66:
- Print (L"AMD Athlon(TM) X4 Quad-Core Processor Family\n");
- break;
+ case 0x65:
+ Print (L"68030\n");
+ break;
- case 0x67:
- Print (L"AMD Opteron(TM) X1000 Series Processor\n");
- break;
+ case 0x66:
+ Print (L"AMD Athlon(TM) X4 Quad-Core Processor Family\n");
+ break;
- case 0x68:
- Print (L"AMD Opteron(TM) X2000 Series APU\n");
- break;
+ case 0x67:
+ Print (L"AMD Opteron(TM) X1000 Series Processor\n");
+ break;
- case 0x69:
- Print (L"AMD Opteron(TM) A-Series Processor\n");
- break;
+ case 0x68:
+ Print (L"AMD Opteron(TM) X2000 Series APU\n");
+ break;
- case 0x6A:
- Print (L"AMD Opteron(TM) X3000 Series APU\n");
- break;
+ case 0x69:
+ Print (L"AMD Opteron(TM) A-Series Processor\n");
+ break;
- case 0x6B:
- Print (L"AMD Zen Processor Family\n");
- break;
+ case 0x6A:
+ Print (L"AMD Opteron(TM) X3000 Series APU\n");
+ break;
- case 0x70:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HOBBIT_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x6B:
+ Print (L"AMD Zen Processor Family\n");
+ break;
- case 0x78:
- Print (L"Crusoe TM5000\n");
- break;
+ case 0x70:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HOBBIT_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x79:
- Print (L"Crusoe TM3000\n");
- break;
+ case 0x78:
+ Print (L"Crusoe TM5000\n");
+ break;
- case 0x7A:
- Print (L"Efficeon TM8000\n");
- break;
+ case 0x79:
+ Print (L"Crusoe TM3000\n");
+ break;
- case 0x80:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WEITEK), gShellDebug1HiiHandle);
- break;
+ case 0x7A:
+ Print (L"Efficeon TM8000\n");
+ break;
- case 0x82:
- Print (L"Itanium\n");
- break;
+ case 0x80:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WEITEK), gShellDebug1HiiHandle);
+ break;
- case 0x83:
- Print (L"AMD Athlon64\n");
- break;
+ case 0x82:
+ Print (L"Itanium\n");
+ break;
- case 0x84:
- Print (L"AMD Opteron\n");
- break;
+ case 0x83:
+ Print (L"AMD Athlon64\n");
+ break;
- case 0x85:
- Print (L"AMD Sempron\n");
- break;
+ case 0x84:
+ Print (L"AMD Opteron\n");
+ break;
- case 0x86:
- Print (L"AMD Turion64 Mobile\n");
- break;
+ case 0x85:
+ Print (L"AMD Sempron\n");
+ break;
- case 0x87:
- Print (L"Dual-Core AMD Opteron\n");
- break;
+ case 0x86:
+ Print (L"AMD Turion64 Mobile\n");
+ break;
- case 0x88:
- Print (L"AMD Athlon 64X2 DualCore\n");
- break;
+ case 0x87:
+ Print (L"Dual-Core AMD Opteron\n");
+ break;
- case 0x89:
- Print (L"AMD Turion 64X2 Mobile\n");
- break;
+ case 0x88:
+ Print (L"AMD Athlon 64X2 DualCore\n");
+ break;
- case 0x8A:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0x89:
+ Print (L"AMD Turion 64X2 Mobile\n");
+ break;
- case 0x8B:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_THIRD_GENERATION), gShellDebug1HiiHandle);
- break;
+ case 0x8A:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0x8C:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_FX_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0x8B:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_THIRD_GENERATION), gShellDebug1HiiHandle);
+ break;
- case 0x8D:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X4_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0x8C:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_FX_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0x8E:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X2_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0x8D:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X4_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0x8F:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_X2_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0x8E:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_X2_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0x90:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PA_RISC_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x8F:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_X2_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0x91:
- Print (L"PA-RISC 8500\n");
- break;
+ case 0x90:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PA_RISC_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0x92:
- Print (L"PA-RISC 8000\n");
- break;
+ case 0x91:
+ Print (L"PA-RISC 8500\n");
+ break;
- case 0x93:
- Print (L"PA-RISC 7300LC\n");
- break;
+ case 0x92:
+ Print (L"PA-RISC 8000\n");
+ break;
- case 0x94:
- Print (L"PA-RISC 7200\n");
- break;
+ case 0x93:
+ Print (L"PA-RISC 7300LC\n");
+ break;
- case 0x95:
- Print (L"PA-RISC 7100LC\n");
- break;
+ case 0x94:
+ Print (L"PA-RISC 7200\n");
+ break;
- case 0x96:
- Print (L"PA-RISC 7100\n");
- break;
+ case 0x95:
+ Print (L"PA-RISC 7100LC\n");
+ break;
- case 0xA0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_V30_FAMILY), gShellDebug1HiiHandle);
- break;
+ case 0x96:
+ Print (L"PA-RISC 7100\n");
+ break;
- case 0xA1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3200_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_V30_FAMILY), gShellDebug1HiiHandle);
+ break;
- case 0xA2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3200_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_LV_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5000_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_ULV_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_LV_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_ULV_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xA9:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA8:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7100_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xA9:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xAA:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAC:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xAB:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAD:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xAC:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7200_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAE:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xAD:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7300_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xAF:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xAE:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xB0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_XEON), gShellDebug1HiiHandle);
- break;
+ case 0xAF:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7400_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xB1:
- Print (L"Pentium III Processorwith Intel SpeedStep Technology\n");
- break;
+ case 0xB0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PENTIUM_III_XEON), gShellDebug1HiiHandle);
+ break;
- case 0xB2:
- Print (L"Pentium 4 processor\n");
- break;
+ case 0xB1:
+ Print (L"Pentium III Processorwith Intel SpeedStep Technology\n");
+ break;
- case 0xB3:
- Print (L"Intel Xeon Processor\n");
- break;
+ case 0xB2:
+ Print (L"Pentium 4 processor\n");
+ break;
- case 0xB4:
- Print (L"AS400 Family\n");
- break;
+ case 0xB3:
+ Print (L"Intel Xeon Processor\n");
+ break;
- case 0xB5:
- Print (L"Intel Xeon processor MP\n");
- break;
+ case 0xB4:
+ Print (L"AS400 Family\n");
+ break;
- case 0xB6:
- Print (L"AMD Althon XP Processor Family\n");
- break;
+ case 0xB5:
+ Print (L"Intel Xeon processor MP\n");
+ break;
- case 0xB7:
- Print (L"AMD Althon MP Promcessor Family\n");
- break;
+ case 0xB6:
+ Print (L"AMD Althon XP Processor Family\n");
+ break;
- case 0xB8:
- Print (L"Intel Itanium 2 processor\n");
- break;
+ case 0xB7:
+ Print (L"AMD Althon MP Promcessor Family\n");
+ break;
- case 0xB9:
- Print (L"Intel Penium M processor\n");
- break;
+ case 0xB8:
+ Print (L"Intel Itanium 2 processor\n");
+ break;
- case 0xBA:
- Print (L"Intel Celeron D processor\n");
- break;
+ case 0xB9:
+ Print (L"Intel Penium M processor\n");
+ break;
- case 0xBB:
- Print (L"Intel Pentium D processor\n");
- break;
+ case 0xBA:
+ Print (L"Intel Celeron D processor\n");
+ break;
- case 0xBC:
- Print (L"Intel Pentium Processor Extreme Edition\n");
- break;
+ case 0xBB:
+ Print (L"Intel Pentium D processor\n");
+ break;
- case 0xBD:
- Print (L"Intel Core Solo Processor\n");
- break;
+ case 0xBC:
+ Print (L"Intel Pentium Processor Extreme Edition\n");
+ break;
- case 0xBF:
- Print (L"Intel Core 2 Duo Processor\n");
- break;
+ case 0xBD:
+ Print (L"Intel Core Solo Processor\n");
+ break;
- case 0xC0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO), gShellDebug1HiiHandle);
- break;
+ case 0xBF:
+ Print (L"Intel Core 2 Duo Processor\n");
+ break;
- case 0xC1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
- break;
+ case 0xC0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO), gShellDebug1HiiHandle);
+ break;
- case 0xC2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_QUAD), gShellDebug1HiiHandle);
- break;
+ case 0xC1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
+ break;
- case 0xC3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
- break;
+ case 0xC2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_QUAD), gShellDebug1HiiHandle);
+ break;
- case 0xC4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_DUO_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0xC3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_EXTREME), gShellDebug1HiiHandle);
+ break;
- case 0xC5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0xC4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_DUO_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0xC6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_I7), gShellDebug1HiiHandle);
- break;
+ case 0xC5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE2_SOLO_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0xC7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CELERON_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xC6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CORE_I7), gShellDebug1HiiHandle);
+ break;
- case 0xC8:
- Print (L"IBM 390\n");
- break;
+ case 0xC7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_CELERON_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xC9:
- Print (L"G4\n");
- break;
+ case 0xC8:
+ Print (L"IBM 390\n");
+ break;
- case 0xCA:
- Print (L"G5\n");
- break;
+ case 0xC9:
+ Print (L"G4\n");
+ break;
- case 0xCB:
- Print (L"G6\n");
- break;
+ case 0xCA:
+ Print (L"G5\n");
+ break;
- case 0xCC:
- Print (L"zArchitecture\n");
- break;
+ case 0xCB:
+ Print (L"G6\n");
+ break;
- case 0xCD:
- Print (L"Intel Core i5 processor\n");
- break;
+ case 0xCC:
+ Print (L"zArchitecture\n");
+ break;
- case 0xCE:
- Print (L"Intel Core i3 processor\n");
- break;
+ case 0xCD:
+ Print (L"Intel Core i5 processor\n");
+ break;
- case 0xCF:
- Print (L"Intel Core i9 processor\n");
- break;
+ case 0xCE:
+ Print (L"Intel Core i3 processor\n");
+ break;
- case 0xD2:
- Print (L"ViaC7M\n");
- break;
+ case 0xCF:
+ Print (L"Intel Core i9 processor\n");
+ break;
- case 0xD3:
- Print (L"ViaC7D\n");
- break;
+ case 0xD2:
+ Print (L"ViaC7M\n");
+ break;
- case 0xD4:
- Print (L"ViaC7\n");
- break;
+ case 0xD3:
+ Print (L"ViaC7D\n");
+ break;
- case 0xD5:
- Print (L"Eden\n");
- break;
+ case 0xD4:
+ Print (L"ViaC7\n");
+ break;
- case 0xD6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_MULTI_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xD5:
+ Print (L"Eden\n");
+ break;
- case 0xD7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xD6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_MULTI_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xD8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xD7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xDA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xD8:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_3_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xDB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xDA:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xDD:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xDB:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_5_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xDE:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xDD:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xDF:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xDE:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xE0:
- Print (L"Multi-Core Intel Xeon processor 3400 Series\n");
- break;
+ case 0xDF:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INTEL_XEON_7_SERIES_MULTI_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xE4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3000_SERIES), gShellDebug1HiiHandle);
- break;
+ case 0xE0:
+ Print (L"Multi-Core Intel Xeon processor 3400 Series\n");
+ break;
- case 0xE5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_II), gShellDebug1HiiHandle);
- break;
+ case 0xE4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_OPTERON_3000_SERIES), gShellDebug1HiiHandle);
+ break;
+ case 0xE5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_II), gShellDebug1HiiHandle);
+ break;
- case 0xE6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_EMBEDDED_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xE6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_EMBEDDED_OPTERON_QUAD_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xE7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_TRIPLE_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xE7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_PHENOM_TRIPLE_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xE8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_ULTRA_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0xE8:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_ULTRA_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0xE9:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
- break;
+ case 0xE9:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_TURION_DUAL_CORE_MOBILE), gShellDebug1HiiHandle);
+ break;
- case 0xEA:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_DUAL_CORE), gShellDebug1HiiHandle);
- break;
+ case 0xEA:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_ATHLON_DUAL_CORE), gShellDebug1HiiHandle);
+ break;
- case 0xEB:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_SI), gShellDebug1HiiHandle);
- break;
+ case 0xEB:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AMD_SEMPRON_SI), gShellDebug1HiiHandle);
+ break;
- case 0xEC:
- Print (L"AMD Phenom II Processor Family\n");
- break;
+ case 0xEC:
+ Print (L"AMD Phenom II Processor Family\n");
+ break;
- case 0xED:
- Print (L"AMD Althon II Processor Family\n");
- break;
+ case 0xED:
+ Print (L"AMD Althon II Processor Family\n");
+ break;
- case 0xEE:
- Print (L"Six-Core AMD Opteron Processor Family\n");
- break;
+ case 0xEE:
+ Print (L"Six-Core AMD Opteron Processor Family\n");
+ break;
- case 0xEF:
- Print (L"AMD Sempron M Processor Family\n");
- break;
+ case 0xEF:
+ Print (L"AMD Sempron M Processor Family\n");
+ break;
- case 0xFA:
- Print (L"i860\n");
- break;
+ case 0xFA:
+ Print (L"i860\n");
+ break;
- case 0xFB:
- Print (L"i960\n");
- break;
+ case 0xFB:
+ Print (L"i960\n");
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
}
+
//
// end switch
//
@@ -2307,14 +2380,14 @@ DisplayProcessorFamily (
**/
VOID
DisplayProcessorFamily2 (
- IN UINT16 Family2,
- IN UINT8 Option
+ IN UINT16 Family2,
+ IN UINT8 Option
)
{
//
// Print prompt message
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROCESSOR_FAMILY), gShellDebug1HiiHandle);
//
// Print option
@@ -2386,9 +2459,8 @@ DisplayProcessorFamily2 (
break;
default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
}
-
}
/**
@@ -2415,47 +2487,48 @@ DisplayProcessorFamily2 (
**/
VOID
DisplayProcessorVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_INFO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_INFO), gShellDebug1HiiHandle);
//
// Print option
//
PRINT_INFO_OPTION (Voltage, Option);
if (BIT (Voltage, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_CURRENT_VOLTAGE), gShellDebug1HiiHandle, (Voltage - 0x80));
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_CURRENT_VOLTAGE), gShellDebug1HiiHandle, (Voltage - 0x80));
} else {
if (BIT (Voltage, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_5V_SUPOPRTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_5V_SUPOPRTED), gShellDebug1HiiHandle);
}
if (BIT (Voltage, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_33V_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_33V_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Voltage, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_29V_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_29V_SUPPORTED), gShellDebug1HiiHandle);
}
+
//
// check the reserved zero bits:
//
if (BIT (Voltage, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
}
if (BIT (Voltage, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
}
if (BIT (Voltage, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
}
if (BIT (Voltage, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT6_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT6_NOT_ZERO), gShellDebug1HiiHandle);
}
}
}
@@ -2482,60 +2555,62 @@ Bits 2:0 CPU Status
**/
VOID
DisplayProcessorStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
if (BIT (Status, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT7_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT7_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (Status, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT5_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (Status, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (Status, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT3_NOT_ZERO), gShellDebug1HiiHandle);
}
+
//
// Check BIT 6
//
if (BIT (Status, 6) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_POPULATED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_POPULATED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_UNPOPULATED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_UNPOPULATED), gShellDebug1HiiHandle);
}
+
//
// Check BITs 2:0
//
switch (Status & 0x07) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_ENABLED), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_ENABLED), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_USER), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_USER), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DIABLED_BY_BIOS), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DIABLED_BY_BIOS), gShellDebug1HiiHandle);
+ break;
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_IDLE), gShellDebug1HiiHandle);
- break;
+ case 4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_IDLE), gShellDebug1HiiHandle);
+ break;
- case 7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHERS), gShellDebug1HiiHandle);
- break;
+ case 7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHERS), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
}
}
@@ -2548,22 +2623,23 @@ DisplayProcessorStatus (
**/
VOID
DisplayMaxMemoryModuleSize (
- IN UINT8 Size,
- IN UINT8 SlotNum,
- IN UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
)
{
- UINTN MaxSize;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE_LARGEST_MEM), gShellDebug1HiiHandle);
+ UINTN MaxSize;
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SIZE_LARGEST_MEM), gShellDebug1HiiHandle);
//
// MaxSize is determined by follow formula
//
- MaxSize = (UINTN) 1 << Size;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize);
+ MaxSize = (UINTN)1 << Size;
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize);
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_AMOUNT_MEM), gShellDebug1HiiHandle);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize, SlotNum, MaxSize * SlotNum);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MAX_AMOUNT_MEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_MB), gShellDebug1HiiHandle, MaxSize, SlotNum, MaxSize * SlotNum);
}
}
@@ -2576,25 +2652,26 @@ DisplayMaxMemoryModuleSize (
**/
VOID
DisplayMemoryModuleConfigHandles (
- IN UINT16 *Handles,
- IN UINT8 SlotNum,
- IN UINT8 Option
+ IN UINT16 *Handles,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
)
{
- UINT8 Index;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_CONTROLLED), gShellDebug1HiiHandle, SlotNum);
+ UINT8 Index;
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_CONTROLLED), gShellDebug1HiiHandle, SlotNum);
if (Option >= SHOW_DETAIL) {
//
// No handle, Handles is INVALID.
//
if (SlotNum == 0) {
- return ;
+ return;
}
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_LIST_CONTROLLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLES_LIST_CONTROLLED), gShellDebug1HiiHandle);
for (Index = 0; Index < SlotNum; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLE), gShellDebug1HiiHandle, Index + 1, Handles[Index]);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HANDLE), gShellDebug1HiiHandle, Index + 1, Handles[Index]);
}
}
}
@@ -2607,14 +2684,14 @@ DisplayMemoryModuleConfigHandles (
**/
VOID
DisplayMmBankConnections (
- IN UINT8 BankConnections,
- IN UINT8 Option
+ IN UINT8 BankConnections,
+ IN UINT8 Option
)
{
- UINT8 High;
- UINT8 Low;
+ UINT8 High;
+ UINT8 Low;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_CONNECTIONS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_CONNECTIONS), gShellDebug1HiiHandle);
//
// Print option
//
@@ -2623,19 +2700,19 @@ DisplayMmBankConnections (
//
// Divide it to high and low
//
- High = (UINT8) (BankConnections & 0xF0);
- Low = (UINT8) (BankConnections & 0x0F);
+ High = (UINT8)(BankConnections & 0xF0);
+ Low = (UINT8)(BankConnections & 0x0F);
if (High != 0xF) {
if (Low != 0xF) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS), gShellDebug1HiiHandle, High, Low, High, Low);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS), gShellDebug1HiiHandle, High, Low, High, Low);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, High, High);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, High, High);
}
} else {
if (Low != 0xF) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, Low, Low);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BANK_RAS_2), gShellDebug1HiiHandle, Low, Low);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BANKS_CONNECTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BANKS_CONNECTED), gShellDebug1HiiHandle);
}
}
}
@@ -2656,12 +2733,13 @@ DisplayMmBankConnections (
**/
VOID
DisplayMmMemorySize (
- IN UINT8 Size,
- IN UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 Option
)
{
- UINT8 Value;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEMORY_SIZE), gShellDebug1HiiHandle);
+ UINT8 Value;
+
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEMORY_SIZE), gShellDebug1HiiHandle);
//
// Print option
//
@@ -2670,21 +2748,21 @@ DisplayMmMemorySize (
//
// Get the low bits(0-6 bit)
//
- Value = (UINT8) (Size & 0x7F);
+ Value = (UINT8)(Size & 0x7F);
if (Value == 0x7D) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE_NOT_DETERMINABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE_NOT_DETERMINABLE), gShellDebug1HiiHandle);
} else if (Value == 0x7E) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MODULE_INSTALLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MODULE_INSTALLED), gShellDebug1HiiHandle);
} else if (Value == 0x7F) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_INSTALLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_INSTALLED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE), gShellDebug1HiiHandle, 1 << Value);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE), gShellDebug1HiiHandle, 1 << Value);
}
if (BIT (Size, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_DOUBLE_BANK), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_DOUBLE_BANK), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_SINGLE_BANK), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_SINGLE_BANK), gShellDebug1HiiHandle);
}
}
@@ -2718,91 +2796,90 @@ Bits 2:0 Cache Level
**/
VOID
DisplayCacheConfiguration (
- IN UINT16 CacheConfiguration,
- IN UINT8 Option
+ IN UINT16 CacheConfiguration,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_CONFIGURATION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_CONFIGURATION), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (CacheConfiguration, Option);
if (BIT (CacheConfiguration, 15) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT15_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT15_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 14) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT14_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT14_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 13) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT13_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT13_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 12) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT12_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT12_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 11) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT11_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT11_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 10) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT10_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT10_NOT_ZERO), gShellDebug1HiiHandle);
} else if (BIT (CacheConfiguration, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIT4_NOT_ZERO), gShellDebug1HiiHandle);
}
//
// Check BITs 9:8
//
switch ((CacheConfiguration & 0x300) >> 8) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_THROUGH), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_THROUGH), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_BACK), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_WRITE_BACK), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_VARIES_WITH_MEM_ADDR), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_VARIES_WITH_MEM_ADDR), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
//
// Check BIT 7
//
if (BIT (CacheConfiguration, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
}
//
// Check BITs 6:5
//
switch ((CacheConfiguration & 0x60) >> 5) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_INTERNAL), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_INTERNAL), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_EXTERNAL), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_EXTERNAL), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
//
// Check BIT 3
//
if (BIT (CacheConfiguration, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_SOCKETED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_SOCKETED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_NOT_SOCKETED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_NOT_SOCKETED), gShellDebug1HiiHandle);
}
-
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_LEVEL), gShellDebug1HiiHandle, (CacheConfiguration & 0x07) + 1);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CACHE_LEVEL), gShellDebug1HiiHandle, (CacheConfiguration & 0x07) + 1);
}
/**
@@ -2826,64 +2903,66 @@ DisplaySystemSlotId (
//
DisplaySystemSlotType (SlotType, Option);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_ID), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SLOT_ID), gShellDebug1HiiHandle);
//
// print option
//
PRINT_INFO_OPTION (SlotType, Option);
switch (SlotType) {
- //
- // Slot Type: MCA
- //
- case 0x04:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN), gShellDebug1HiiHandle);
- if (SlotId > 0 && SlotId < 15) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
- }
- break;
+ //
+ // Slot Type: MCA
+ //
+ case 0x04:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN), gShellDebug1HiiHandle);
+ if ((SlotId > 0) && (SlotId < 15)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
+ }
- //
- // EISA
- //
- case 0x05:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_EISA_NUM), gShellDebug1HiiHandle);
- if (SlotId > 0 && SlotId < 15) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
- }
- break;
+ break;
- //
- // Slot Type: PCI
- //
- case 0x06:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- break;
+ //
+ // EISA
+ //
+ case 0x05:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_EISA_NUM), gShellDebug1HiiHandle);
+ if ((SlotId > 0) && (SlotId < 15)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D), gShellDebug1HiiHandle, SlotId);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15), gShellDebug1HiiHandle);
+ }
- //
- // PCMCIA
- //
- case 0x07:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IDENTIFIES_ADAPTER_NUM), gShellDebug1HiiHandle, SlotId);
- break;
+ break;
- //
- // Slot Type: PCI-E
- //
- case 0xA5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- break;
+ //
+ // Slot Type: PCI
+ //
+ case 0x06:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
+ break;
- default:
- if ((SlotType >= 0x0E && SlotType <= 0x12) || (SlotType >= 0xA6 && SlotType <= 0xB6)){
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
- } else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID), gShellDebug1HiiHandle);
- }
+ //
+ // PCMCIA
+ //
+ case 0x07:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IDENTIFIES_ADAPTER_NUM), gShellDebug1HiiHandle, SlotId);
+ break;
+
+ //
+ // Slot Type: PCI-E
+ //
+ case 0xA5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
+ break;
+
+ default:
+ if (((SlotType >= 0x0E) && (SlotType <= 0x12)) || ((SlotType >= 0xA6) && (SlotType <= 0xB6))) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VALUE_PRESENT), gShellDebug1HiiHandle, SlotId);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_SLOT_ID), gShellDebug1HiiHandle);
+ }
}
}
@@ -2895,11 +2974,11 @@ DisplaySystemSlotId (
**/
VOID
DisplaySystemBootStatus (
- IN UINT8 Parameter,
- IN UINT8 Option
+ IN UINT8 Parameter,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_BOOT_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_BOOT_STATUS), gShellDebug1HiiHandle);
//
// Print option
//
@@ -2909,31 +2988,31 @@ DisplaySystemBootStatus (
// Check value and print
//
if (Parameter == 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_ERRORS_DETECTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_ERRORS_DETECTED), gShellDebug1HiiHandle);
} else if (Parameter == 1) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BOOTABLE_MEDIA), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NO_BOOTABLE_MEDIA), gShellDebug1HiiHandle);
} else if (Parameter == 2) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NORMAL_OP_SYSTEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NORMAL_OP_SYSTEM), gShellDebug1HiiHandle);
} else if (Parameter == 3) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_DETECTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_DETECTED), gShellDebug1HiiHandle);
} else if (Parameter == 4) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM), gShellDebug1HiiHandle);
} else if (Parameter == 5) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USER_REQUESTED_BOOT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USER_REQUESTED_BOOT), gShellDebug1HiiHandle);
} else if (Parameter == 6) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_SECURITY_VIOLATION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_SECURITY_VIOLATION), gShellDebug1HiiHandle);
} else if (Parameter == 7) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PREV_REQ_IMAGE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PREV_REQ_IMAGE), gShellDebug1HiiHandle);
} else if (Parameter == 8) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER), gShellDebug1HiiHandle);
- } else if (Parameter >= 9 && Parameter <= 127) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FUTURE_ASSIGNMENT), gShellDebug1HiiHandle);
- } else if (Parameter >= 128 && Parameter <= 191) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VENDOR_OEM_SPECIFIC), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER), gShellDebug1HiiHandle);
+ } else if ((Parameter >= 9) && (Parameter <= 127)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FUTURE_ASSIGNMENT), gShellDebug1HiiHandle);
+ } else if ((Parameter >= 128) && (Parameter <= 191)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VENDOR_OEM_SPECIFIC), gShellDebug1HiiHandle);
} else if (Parameter >= 192) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRODUCT_SPEC_IMPLMENTATION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRODUCT_SPEC_IMPLMENTATION), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle);
}
}
@@ -2956,11 +3035,11 @@ DisplaySBDSManufactureDate (
IN UINT8 Option
)
{
- UINTN Day;
- UINTN Month;
- UINTN Year;
+ UINTN Day;
+ UINTN Month;
+ UINTN Year;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SBDS_MANUFACTURE_DATE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SBDS_MANUFACTURE_DATE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Date, Option);
//
// Print date
@@ -2968,8 +3047,7 @@ DisplaySBDSManufactureDate (
Day = Date & 0x001F;
Month = (Date & 0x01E0) >> 5;
Year = ((Date & 0xFE00) >> 9) + 1980;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONTH_DAY_YEAR), gShellDebug1HiiHandle, Day, Month, Year);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONTH_DAY_YEAR), gShellDebug1HiiHandle, Day, Month, Year);
}
/**
@@ -2999,73 +3077,77 @@ Identifies the system-reset capabilities for the system.
**/
VOID
DisplaySystemResetCapabilities (
- IN UINT8 Reset,
- IN UINT8 Option
+ IN UINT8 Reset,
+ IN UINT8 Option
)
{
- UINTN Temp;
+ UINTN Temp;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_RESET_CAPABILITIES), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_RESET_CAPABILITIES), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Reset, Option);
//
// Check reserved bits 7:6
//
if ((Reset & 0xC0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO), gShellDebug1HiiHandle);
}
+
//
// Watch dog
//
if (BIT (Reset, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WATCHDOG_TIMER_2), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_NOT_CONTAIN_TIMER), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_NOT_CONTAIN_TIMER), gShellDebug1HiiHandle);
}
+
//
// Boot Option on Limit
//
Temp = (Reset & 0x18) >> 3;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION_LIMIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION_LIMIT), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT), gShellDebug1HiiHandle);
+ break;
}
+
//
// Boot Option
//
Temp = (Reset & 0x06) >> 1;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_OPTION), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OP_SYSTEM_2), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_UTIL), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DO_NOT_REBOOT), gShellDebug1HiiHandle);
+ break;
}
+
//
// Reset enable flag
//
@@ -3108,102 +3190,105 @@ Bits 1:0 Front Panel Reset Status, one of:
**/
VOID
DisplayHardwareSecuritySettings (
- IN UINT8 Settings,
- IN UINT8 Option
+ IN UINT8 Settings,
+ IN UINT8 Option
)
{
- UINTN Temp;
+ UINTN Temp;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HARDWARE_SECURITY_SET), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_HARDWARE_SECURITY_SET), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Settings, Option);
//
// Power-on Password Status
//
Temp = (Settings & 0xC0) >> 6;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_ON_PASSWORD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_ON_PASSWORD), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
+
//
// Keyboard Password Status
//
Temp = (Settings & 0x30) >> 4;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_PASSWORD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_PASSWORD), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
+
//
// Administrator Password Status
//
Temp = (Settings & 0x0C) >> 2;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ADMIN_PASSWORD_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ADMIN_PASSWORD_STATUS), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
+
//
// Front Panel Reset Status
//
Temp = Settings & 0x3;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FRONT_PANEL_RESET), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FRONT_PANEL_RESET), gShellDebug1HiiHandle);
switch (Temp) {
- case 0:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
- break;
+ case 0:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DISABLED), gShellDebug1HiiHandle);
+ break;
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED_NEWLINE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_IMPLEMENTED), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
}
}
@@ -3215,34 +3300,36 @@ DisplayHardwareSecuritySettings (
**/
VOID
DisplayOBRAConnections (
- IN UINT8 Connections,
- IN UINT8 Option
+ IN UINT8 Connections,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONNECTIONS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONNECTIONS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Connections, Option);
//
// Check reserved bits 7:2
//
if ((Connections & 0xFC) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RESERVED_ZERO_2), gShellDebug1HiiHandle);
}
+
//
// Outbound Connection
//
if (BIT (Connections, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OUTBOUND_CONN_ENABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OUTBOUND_CONN_ENABLED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTUBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTUBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
}
+
//
// Inbound Connection
//
if (BIT (Connections, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOIUND_CONN_ENABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOIUND_CONN_ENABLED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
}
}
@@ -3258,144 +3345,150 @@ DisplaySPSCharacteristics (
IN UINT8 Option
)
{
- UINTN Temp;
+ UINTN Temp;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_CHAR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_CHAR), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Characteristics, Option);
//
// Check reserved bits 15:14
//
if ((Characteristics & 0xC000) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_15_14_RSVD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_15_14_RSVD), gShellDebug1HiiHandle);
}
+
//
// Bits 13:10 - DMTF Power Supply Type
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TYPE), gShellDebug1HiiHandle);
Temp = (Characteristics & 0x1C00) >> 10;
switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LINEAR), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LINEAR), gShellDebug1HiiHandle);
+ break;
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SWITCHING), gShellDebug1HiiHandle);
- break;
+ case 4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SWITCHING), gShellDebug1HiiHandle);
+ break;
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BATTERY), gShellDebug1HiiHandle);
- break;
+ case 5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BATTERY), gShellDebug1HiiHandle);
+ break;
- case 6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UPS), gShellDebug1HiiHandle);
- break;
+ case 6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UPS), gShellDebug1HiiHandle);
+ break;
- case 7:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONVERTER), gShellDebug1HiiHandle);
- break;
+ case 7:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONVERTER), gShellDebug1HiiHandle);
+ break;
- case 8:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_REGULATOR), gShellDebug1HiiHandle);
- break;
+ case 8:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_REGULATOR), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_2), gShellDebug1HiiHandle);
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_2), gShellDebug1HiiHandle);
}
+
//
// Bits 9:7 - Status
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STATUS_DASH), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STATUS_DASH), gShellDebug1HiiHandle);
Temp = (Characteristics & 0x380) >> 7;
switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OK), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OK), gShellDebug1HiiHandle);
+ break;
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NON_CRITICAL), gShellDebug1HiiHandle);
- break;
+ case 4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NON_CRITICAL), gShellDebug1HiiHandle);
+ break;
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CRITICAL_POWER_SUPPLY), gShellDebug1HiiHandle);
- break;
+ case 5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CRITICAL_POWER_SUPPLY), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED), gShellDebug1HiiHandle);
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED), gShellDebug1HiiHandle);
}
+
//
// Bits 6:3 - DMTF Input Voltage Range Switching
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INPUT_VOLTAGE_RANGE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INPUT_VOLTAGE_RANGE), gShellDebug1HiiHandle);
Temp = (Characteristics & 0x78) >> 3;
switch (Temp) {
- case 1:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
- break;
+ case 1:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
+ break;
- case 2:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
- break;
+ case 2:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN), gShellDebug1HiiHandle);
+ break;
- case 3:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MANUAL), gShellDebug1HiiHandle);
- break;
+ case 3:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MANUAL), gShellDebug1HiiHandle);
+ break;
- case 4:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AUTO_SWITCH), gShellDebug1HiiHandle);
- break;
+ case 4:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AUTO_SWITCH), gShellDebug1HiiHandle);
+ break;
- case 5:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WIDE_RANGE), gShellDebug1HiiHandle);
- break;
+ case 5:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_WIDE_RANGE), gShellDebug1HiiHandle);
+ break;
- case 6:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_APPLICABLE), gShellDebug1HiiHandle);
- break;
+ case 6:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NOT_APPLICABLE), gShellDebug1HiiHandle);
+ break;
- default:
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_3), gShellDebug1HiiHandle);
- break;
+ default:
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_3), gShellDebug1HiiHandle);
+ break;
}
+
//
// Power supply is unplugged from the wall
//
if (BIT (Characteristics, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_UNPLUGGED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_UNPLUGGED), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PLUGGED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PLUGGED), gShellDebug1HiiHandle);
}
+
//
// Power supply is present
//
if (BIT (Characteristics, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PRESENT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_PRESENT), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_PRESENT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_PRESENT), gShellDebug1HiiHandle);
}
+
//
// hot replaceable
//
if (BIT (Characteristics, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_REPLACE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_REPLACE), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_REPLACE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_NOT_REPLACE), gShellDebug1HiiHandle);
}
}
@@ -3414,7 +3507,7 @@ DisplayTpmDeviceCharacteristics (
//
// Print header
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR), gShellDebug1HiiHandle);
//
// print option
//
@@ -3426,31 +3519,31 @@ DisplayTpmDeviceCharacteristics (
// are designed not to deal with UINT64
//
if (BIT (Chara, 0) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
if (BIT (Chara, 1) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
+
if (BIT (Chara, 2) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
}
if (BIT (Chara, 3) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_FWU), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_FWU), gShellDebug1HiiHandle);
}
if (BIT (Chara, 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_PLAT_SW), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_PLAT_SW), gShellDebug1HiiHandle);
}
if (BIT (Chara, 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_OEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_OEM), gShellDebug1HiiHandle);
}
//
// Just print the Reserved
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_06_63), gShellDebug1HiiHandle);
-
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_06_63), gShellDebug1HiiHandle);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index fd219773de..8ecec693ad 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -22,8 +22,8 @@ extern UINT8 SmbiosMinorVersion;
//
// SHOW_ALL: WaitEnter() not wait input.
//
-#define SHOW_ALL 0x04
-#define SHOW_STATISTICS 0x05
+#define SHOW_ALL 0x04
+#define SHOW_STATISTICS 0x05
#define AS_UINT16(pData) (*((UINT16 *) pData))
#define AS_UINT32(pData) (*((UINT32 *) pData))
@@ -89,8 +89,8 @@ DisplayBiosCharacteristics (
**/
VOID
DisplayBiosCharacteristicsExt1 (
- IN UINT8 Byte1,
- IN UINT8 Option
+ IN UINT8 Byte1,
+ IN UINT8 Option
);
/**
@@ -101,8 +101,8 @@ DisplayBiosCharacteristicsExt1 (
**/
VOID
DisplayBiosCharacteristicsExt2 (
- IN UINT8 Byte2,
- IN UINT8 Option
+ IN UINT8 Byte2,
+ IN UINT8 Option
);
/**
@@ -113,8 +113,8 @@ DisplayBiosCharacteristicsExt2 (
**/
VOID
DisplayProcessorFamily (
- UINT8 Family,
- UINT8 Option
+ UINT8 Family,
+ UINT8 Option
);
/**
@@ -125,8 +125,8 @@ DisplayProcessorFamily (
**/
VOID
DisplayProcessorFamily2 (
- IN UINT16 Family2,
- IN UINT8 Option
+ IN UINT16 Family2,
+ IN UINT8 Option
);
/**
@@ -153,8 +153,8 @@ DisplayProcessorFamily2 (
**/
VOID
DisplayProcessorVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
);
/**
@@ -179,8 +179,8 @@ Bits 2:0 CPU Status
**/
VOID
DisplayProcessorStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
/**
@@ -192,9 +192,9 @@ DisplayProcessorStatus (
**/
VOID
DisplayMaxMemoryModuleSize (
- IN UINT8 Size,
- IN UINT8 SlotNum,
- IN UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
);
/**
@@ -206,9 +206,9 @@ DisplayMaxMemoryModuleSize (
**/
VOID
DisplayMemoryModuleConfigHandles (
- IN UINT16 *Handles,
- IN UINT8 SlotNum,
- IN UINT8 Option
+ IN UINT16 *Handles,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
);
/**
@@ -219,8 +219,8 @@ DisplayMemoryModuleConfigHandles (
**/
VOID
DisplayMmBankConnections (
- IN UINT8 BankConnections,
- IN UINT8 Option
+ IN UINT8 BankConnections,
+ IN UINT8 Option
);
/**
@@ -239,8 +239,8 @@ DisplayMmBankConnections (
**/
VOID
DisplayMmMemorySize (
- IN UINT8 Size,
- IN UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 Option
);
/**
@@ -273,8 +273,8 @@ Bits 2:0 Cache Level
**/
VOID
DisplayCacheConfiguration (
- IN UINT16 CacheConfiguration,
- IN UINT8 Option
+ IN UINT16 CacheConfiguration,
+ IN UINT8 Option
);
/**
@@ -339,8 +339,8 @@ DisplaySBDSManufactureDate (
**/
VOID
DisplaySystemResetCapabilities (
- IN UINT8 Reset,
- IN UINT8 Option
+ IN UINT8 Reset,
+ IN UINT8 Option
);
/**
@@ -375,8 +375,8 @@ DisplaySystemResetCapabilities (
**/
VOID
DisplayHardwareSecuritySettings (
- IN UINT8 Settings,
- IN UINT8 Option
+ IN UINT8 Settings,
+ IN UINT8 Option
);
/**
@@ -387,8 +387,8 @@ DisplayHardwareSecuritySettings (
**/
VOID
DisplayOBRAConnections (
- IN UINT8 Connections,
- IN UINT8 Option
+ IN UINT8 Connections,
+ IN UINT8 Option
);
/**
@@ -399,8 +399,8 @@ DisplayOBRAConnections (
**/
VOID
DisplaySystemBootStatus (
- IN UINT8 Parameter,
- IN UINT8 Option
+ IN UINT8 Parameter,
+ IN UINT8 Option
);
/**
@@ -435,7 +435,8 @@ DisplayTpmDeviceCharacteristics (
**/
VOID
DisplayProcessorArchitectureType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
+
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index c312a7f8f2..c4a6acb167 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -643,7 +643,6 @@ TABLE_ITEM ProcessorCharacteristicsTable[] = {
}
};
-
TABLE_ITEM McErrorDetectMethodTable[] = {
{
0x01,
@@ -2690,7 +2689,6 @@ TABLE_ITEM MemoryDeviceMemoryOperatingModeCapabilityTable[] = {
}
};
-
TABLE_ITEM MemoryErrorTypeTable[] = {
{
0x01,
@@ -3570,7 +3568,6 @@ TABLE_ITEM StructureTypeInfoTable[] = {
},
};
-
/**
Given a table and a Key, return the responding info.
@@ -3597,32 +3594,33 @@ TABLE_ITEM StructureTypeInfoTable[] = {
**/
UINT8
QueryTable (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT8 Key,
- IN OUT CHAR16 *Info,
- IN UINTN InfoLen
+ IN TABLE_ITEM *Table,
+ IN UINTN Number,
+ IN UINT8 Key,
+ IN OUT CHAR16 *Info,
+ IN UINTN InfoLen
)
{
- UINTN Index;
+ UINTN Index;
//
// High byte and Low byte of word
//
- UINT8 High;
- UINT8 Low;
+ UINT8 High;
+ UINT8 Low;
for (Index = 0; Index < Number; Index++) {
- High = (UINT8) (Table[Index].Key >> 8);
- Low = (UINT8) (Table[Index].Key & 0x00FF);
+ High = (UINT8)(Table[Index].Key >> 8);
+ Low = (UINT8)(Table[Index].Key & 0x00FF);
//
// Check if Key is in the range
// or if Key == Value in the table
//
- if ((High > Low && Key >= Low && Key <= High)
- || (Table[Index].Key == Key)) {
+ if ( ((High > Low) && (Key >= Low) && (Key <= High))
+ || (Table[Index].Key == Key))
+ {
StrnCpyS (Info, InfoLen, Table[Index].Info, InfoLen - 1);
- StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen(Info));
+ StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen (Info));
return Key;
}
}
@@ -3640,26 +3638,26 @@ QueryTable (
**/
VOID
PrintBitsInfo (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT32 Bits
+ IN TABLE_ITEM *Table,
+ IN UINTN Number,
+ IN UINT32 Bits
)
{
//
// Get certain bit of 'Value':
//
-#define BIT(Value, bit) ((Value) & ((UINT32) 1) << (bit))
+ #define BIT(Value, bit) ((Value) & ((UINT32) 1) << (bit))
//
// Clear certain bit of 'Value':
//
-#define CLR_BIT(Value, bit) ((Value) -= (BIT (Value, bit)))
+ #define CLR_BIT(Value, bit) ((Value) -= (BIT (Value, bit)))
- UINTN Index;
- UINT32 Value;
- BOOLEAN FirstInfo;
+ UINTN Index;
+ UINT32 Value;
+ BOOLEAN FirstInfo;
FirstInfo = TRUE;
- Value = Bits;
+ Value = Bits;
//
// query the table and print information
//
@@ -3671,6 +3669,7 @@ PrintBitsInfo (
//
Print (L" | ");
}
+
Print (Table[Index].Info);
FirstInfo = FALSE;
@@ -3685,19 +3684,23 @@ PrintBitsInfo (
// There is no any info if FirstInfo is still TRUE.
//
if (FirstInfo) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_NO_INFO), gShellDebug1HiiHandle);
}
if (Value != 0) {
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_BITS_SET),
gShellDebug1HiiHandle,
Value
- );
+ );
}
Print (L"\n");
}
+
//
// //////////////////////////////////////////////////////////////////
//
@@ -3730,11 +3733,11 @@ PrintBitsInfo (
**/
VOID
DisplaySystemWakeupType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_WAKEUP_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_WAKEUP_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (SystemWakeupTypeTable, Type);
}
@@ -3747,11 +3750,11 @@ DisplaySystemWakeupType (
**/
VOID
DisplayBaseBoardFeatureFlags (
- IN UINT8 FeatureFlags,
- IN UINT8 Option
+ IN UINT8 FeatureFlags,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_FEATURE_FLAGS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_FEATURE_FLAGS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (FeatureFlags, Option);
PRINT_BITS_INFO (BaseBoardFeatureFlagsTable, FeatureFlags);
}
@@ -3763,12 +3766,12 @@ DisplayBaseBoardFeatureFlags (
@param[in] Option The optional information.
**/
VOID
-DisplayBaseBoardBoardType(
- IN UINT8 Type,
- IN UINT8 Option
+DisplayBaseBoardBoardType (
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_BOARD_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BASE_BOARD_BOARD_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (BaseBoardBoardTypeTable, Type);
}
@@ -3781,11 +3784,11 @@ DisplayBaseBoardBoardType(
**/
VOID
DisplaySystemEnclosureType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
//
// query table and print info
@@ -3793,7 +3796,7 @@ DisplaySystemEnclosureType (
PRINT_TABLE_ITEM (SystemEnclosureTypeTable, Type);
if (BIT (Type, 7) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CHASSIS_LOCK_PRESENT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CHASSIS_LOCK_PRESENT), gShellDebug1HiiHandle);
}
}
@@ -3805,11 +3808,11 @@ DisplaySystemEnclosureType (
**/
VOID
DisplaySystemEnclosureStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (SystemEnclosureStatusTable, Status);
}
@@ -3822,11 +3825,11 @@ DisplaySystemEnclosureStatus (
**/
VOID
DisplaySESecurityStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_SECURITY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_SECURITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (SESecurityStatusTable, Status);
}
@@ -3839,11 +3842,11 @@ DisplaySESecurityStatus (
**/
VOID
DisplayProcessorType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (ProcessorTypeTable, Type);
}
@@ -3856,11 +3859,11 @@ DisplayProcessorType (
**/
VOID
DisplayProcessorUpgrade (
- IN UINT8 Upgrade,
- IN UINT8 Option
+ IN UINT8 Upgrade,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_UPDATE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_UPDATE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Upgrade, Option);
PRINT_TABLE_ITEM (ProcessorUpgradeTable, Upgrade);
}
@@ -3873,11 +3876,11 @@ DisplayProcessorUpgrade (
**/
VOID
DisplayProcessorCharacteristics (
- IN UINT16 Type,
- IN UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_CHARACTERISTICS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_CHARACTERISTICS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_BITS_INFO (ProcessorCharacteristicsTable, Type);
}
@@ -3890,11 +3893,11 @@ DisplayProcessorCharacteristics (
**/
VOID
DisplayMcErrorDetectMethod (
- IN UINT8 Method,
- IN UINT8 Option
+ IN UINT8 Method,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DETECTMETHOD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DETECTMETHOD), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Method, Option);
PRINT_TABLE_ITEM (McErrorDetectMethodTable, Method);
}
@@ -3907,11 +3910,11 @@ DisplayMcErrorDetectMethod (
**/
VOID
DisplayMcErrorCorrectCapability (
- IN UINT8 Capability,
- IN UINT8 Option
+ IN UINT8 Capability,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CORRECT_CAPABILITY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CORRECT_CAPABILITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Capability, Option);
PRINT_BITS_INFO (McErrorCorrectCapabilityTable, Capability);
}
@@ -3924,11 +3927,11 @@ DisplayMcErrorCorrectCapability (
**/
VOID
DisplayMcInterleaveSupport (
- IN UINT8 Support,
- IN UINT8 Option
+ IN UINT8 Support,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_INTERLEAVE_SUPPORT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_INTERLEAVE_SUPPORT), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Support, Option);
PRINT_TABLE_ITEM (McInterleaveSupportTable, Support);
}
@@ -3945,7 +3948,7 @@ DisplayMcMemorySpeeds (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MEMORY_SPEED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MEMORY_SPEED), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Speed, Option);
PRINT_BITS_INFO (McMemorySpeedsTable, Speed);
}
@@ -3958,11 +3961,11 @@ DisplayMcMemorySpeeds (
**/
VOID
DisplayMemoryModuleVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_REQUIRED_VOLTAGES), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_REQUIRED_VOLTAGES), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Voltage, Option);
PRINT_BITS_INFO (MemoryModuleVoltageTable, Voltage);
}
@@ -3979,7 +3982,7 @@ DisplayMmMemoryType (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_BITS_INFO (MmMemoryTypeTable, Type);
}
@@ -3992,11 +3995,11 @@ DisplayMmMemoryType (
**/
VOID
DisplayMmErrorStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_ERROR_STATUS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_ERROR_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_BITS_INFO (MmErrorStatusTable, Status);
}
@@ -4013,9 +4016,9 @@ DisplayCacheSRAMType (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SRAM_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION ((UINT8) Type, Option);
- PRINT_BITS_INFO (CacheSRAMTypeTable, (UINT8) Type);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SRAM_TYPE), gShellDebug1HiiHandle);
+ PRINT_INFO_OPTION ((UINT8)Type, Option);
+ PRINT_BITS_INFO (CacheSRAMTypeTable, (UINT8)Type);
}
/**
@@ -4026,11 +4029,11 @@ DisplayCacheSRAMType (
**/
VOID
DisplayCacheErrCorrectingType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ERROR_CORRECTING), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ERROR_CORRECTING), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (CacheErrCorrectingTypeTable, Type);
}
@@ -4043,11 +4046,11 @@ DisplayCacheErrCorrectingType (
**/
VOID
DisplayCacheSystemCacheType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SYSTEM_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SYSTEM_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (CacheSystemCacheTypeTable, Type);
}
@@ -4060,11 +4063,11 @@ DisplayCacheSystemCacheType (
**/
VOID
DisplayCacheAssociativity (
- IN UINT8 Associativity,
- IN UINT8 Option
+ IN UINT8 Associativity,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ASSOCIATIVITY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ASSOCIATIVITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Associativity, Option);
PRINT_TABLE_ITEM (CacheAssociativityTable, Associativity);
}
@@ -4077,11 +4080,11 @@ DisplayCacheAssociativity (
**/
VOID
DisplayPortConnectorType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_CONNECTOR_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_CONNECTOR_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PortConnectorTypeTable, Type);
}
@@ -4094,11 +4097,11 @@ DisplayPortConnectorType (
**/
VOID
DisplayPortType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PortTypeTable, Type);
}
@@ -4111,11 +4114,11 @@ DisplayPortType (
**/
VOID
DisplaySystemSlotType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (SystemSlotTypeTable, Type);
}
@@ -4128,11 +4131,11 @@ DisplaySystemSlotType (
**/
VOID
DisplaySystemSlotDataBusWidth (
- IN UINT8 Width,
- IN UINT8 Option
+ IN UINT8 Width,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_DATA), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_DATA), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Width, Option);
PRINT_TABLE_ITEM (SystemSlotDataBusWidthTable, Width);
}
@@ -4145,11 +4148,11 @@ DisplaySystemSlotDataBusWidth (
**/
VOID
DisplaySystemSlotCurrentUsage (
- IN UINT8 Usage,
- IN UINT8 Option
+ IN UINT8 Usage,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_CURRENT_USAGE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_CURRENT_USAGE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Usage, Option);
PRINT_TABLE_ITEM (SystemSlotCurrentUsageTable, Usage);
}
@@ -4162,11 +4165,11 @@ DisplaySystemSlotCurrentUsage (
**/
VOID
DisplaySystemSlotLength (
- IN UINT8 Length,
- IN UINT8 Option
+ IN UINT8 Length,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_LENGTH), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_LENGTH), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Length, Option);
PRINT_TABLE_ITEM (SystemSlotLengthTable, Length);
}
@@ -4179,11 +4182,11 @@ DisplaySystemSlotLength (
**/
VOID
DisplaySlotCharacteristics1 (
- IN UINT8 Chara1,
- IN UINT8 Option
+ IN UINT8 Chara1,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Chara1, Option);
PRINT_BITS_INFO (SlotCharacteristics1Table, Chara1);
}
@@ -4196,11 +4199,11 @@ DisplaySlotCharacteristics1 (
**/
VOID
DisplaySlotCharacteristics2 (
- IN UINT8 Chara2,
- IN UINT8 Option
+ IN UINT8 Chara2,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS_2), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS_2), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Chara2, Option);
PRINT_BITS_INFO (SlotCharacteristics2Table, Chara2);
}
@@ -4213,11 +4216,11 @@ DisplaySlotCharacteristics2 (
**/
VOID
DisplayOnboardDeviceTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (OnboardDeviceTypesTable, Type);
}
@@ -4230,11 +4233,11 @@ DisplayOnboardDeviceTypes (
**/
VOID
DisplaySELTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (SELTypesTable, Type);
}
@@ -4247,11 +4250,11 @@ DisplaySELTypes (
**/
VOID
DisplaySELVarDataFormatType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (SELVarDataFormatTypeTable, Type);
}
@@ -4268,7 +4271,7 @@ DisplayPostResultsBitmapDw1 (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_BITMAP), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_BITMAP), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_BITS_INFO (PostResultsBitmapDw1Table, Key);
}
@@ -4285,7 +4288,7 @@ DisplayPostResultsBitmapDw2 (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_SECOND_DWORD), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_SECOND_DWORD), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_BITS_INFO (PostResultsBitmapDw2Table, Key);
}
@@ -4302,27 +4305,27 @@ DisplaySELSysManagementTypes (
IN UINT8 Option
)
{
- UINT8 Temp;
+ UINT8 Temp;
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_TYPES), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_TYPES), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (SMType, Option);
//
// Deal with wide range Value
//
if (SMType >= 0x80000000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_OEM_ASSIGNED), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_OEM_ASSIGNED), gShellDebug1HiiHandle);
} else if (SMType >= 0x00020000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
} else if (SMType >= 0x00010000) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_PROBE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_MANAGEMENT_PROBE), gShellDebug1HiiHandle);
} else if (SMType >= 0x31) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_RSVD_FOR_FUTURE_ASSIGN), gShellDebug1HiiHandle);
} else {
//
// Deal with One byte data
//
- Temp = (UINT8) (SMType & 0x3F);
+ Temp = (UINT8)(SMType & 0x3F);
PRINT_TABLE_ITEM (SELSysManagementTypesTable, Temp);
}
}
@@ -4335,11 +4338,11 @@ DisplaySELSysManagementTypes (
**/
VOID
DisplayPMALocation (
- IN UINT8 Location,
- IN UINT8 Option
+ IN UINT8 Location,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Location, Option);
PRINT_TABLE_ITEM (PMALocationTable, Location);
}
@@ -4352,11 +4355,11 @@ DisplayPMALocation (
**/
VOID
DisplayPMAUse (
- IN UINT8 Use,
- IN UINT8 Option
+ IN UINT8 Use,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_USE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_USE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Use, Option);
PRINT_TABLE_ITEM (PMAUseTable, Use);
}
@@ -4369,11 +4372,11 @@ DisplayPMAUse (
**/
VOID
DisplayPMAErrorCorrectionTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_ERROR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_ERROR), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PMAErrorCorrectionTypesTable, Type);
}
@@ -4386,11 +4389,11 @@ DisplayPMAErrorCorrectionTypes (
**/
VOID
DisplayMemoryDeviceFormFactor (
- IN UINT8 FormFactor,
- IN UINT8 Option
+ IN UINT8 FormFactor,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_FORM_FACTOR), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_FORM_FACTOR), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (FormFactor, Option);
PRINT_TABLE_ITEM (MemoryDeviceFormFactorTable, FormFactor);
}
@@ -4403,11 +4406,11 @@ DisplayMemoryDeviceFormFactor (
**/
VOID
DisplayMemoryDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (MemoryDeviceTypeTable, Type);
}
@@ -4424,7 +4427,7 @@ DisplayMemoryDeviceTypeDetail (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE_DETAIL), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE_DETAIL), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Para, Option);
PRINT_BITS_INFO (MemoryDeviceTypeDetailTable, Para);
}
@@ -4441,7 +4444,7 @@ DisplayMemoryDeviceMemoryTechnology (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_MEMORY_TECHNOLOGY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_MEMORY_TECHNOLOGY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Para, Option);
PRINT_TABLE_ITEM (MemoryDeviceMemoryTechnologyTable, Para);
}
@@ -4458,7 +4461,7 @@ DisplayMemoryDeviceMemoryOperatingModeCapability (
IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_MEM_OPER_MODE_CAPA), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_MEM_OPER_MODE_CAPA), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Para, Option);
PRINT_BITS_INFO (MemoryDeviceMemoryOperatingModeCapabilityTable, Para);
}
@@ -4471,11 +4474,11 @@ DisplayMemoryDeviceMemoryOperatingModeCapability (
**/
VOID
DisplayMemoryErrorType (
- IN UINT8 ErrorType,
- IN UINT8 Option
+ IN UINT8 ErrorType,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_INFO), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_INFO), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (ErrorType, Option);
PRINT_TABLE_ITEM (MemoryErrorTypeTable, ErrorType);
}
@@ -4488,11 +4491,11 @@ DisplayMemoryErrorType (
**/
VOID
DisplayMemoryErrorGranularity (
- IN UINT8 Granularity,
- IN UINT8 Option
+ IN UINT8 Granularity,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_GRANULARITY), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_GRANULARITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Granularity, Option);
PRINT_TABLE_ITEM (MemoryErrorGranularityTable, Granularity);
}
@@ -4505,11 +4508,11 @@ DisplayMemoryErrorGranularity (
**/
VOID
DisplayMemoryErrorOperation (
- IN UINT8 Operation,
- IN UINT8 Option
+ IN UINT8 Operation,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_OP), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_OP), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Operation, Option);
PRINT_TABLE_ITEM (MemoryErrorOperationTable, Operation);
}
@@ -4522,11 +4525,11 @@ DisplayMemoryErrorOperation (
**/
VOID
DisplayPointingDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PointingDeviceTypeTable, Type);
}
@@ -4539,11 +4542,11 @@ DisplayPointingDeviceType (
**/
VOID
DisplayPointingDeviceInterface (
- IN UINT8 Interface,
- IN UINT8 Option
+ IN UINT8 Interface,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_INTERFACE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_INTERFACE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Interface, Option);
PRINT_TABLE_ITEM (PointingDeviceInterfaceTable, Interface);
}
@@ -4556,11 +4559,11 @@ DisplayPointingDeviceInterface (
**/
VOID
DisplayPBDeviceChemistry (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORTABLE_BATT_DEV_CHEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORTABLE_BATT_DEV_CHEM), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (PBDeviceChemistryTable, Key);
}
@@ -4573,14 +4576,14 @@ DisplayPBDeviceChemistry (
**/
VOID
DisplayVPLocation (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Loc;
+ UINT8 Loc;
- Loc = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
+ Loc = (UINT8)((Key & 0xE0) >> 5);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Loc, Option);
PRINT_TABLE_ITEM (VPLocationTable, Loc);
}
@@ -4593,14 +4596,14 @@ DisplayVPLocation (
**/
VOID
DisplayVPStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Status;
+ UINT8 Status;
- Status = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_STATUS), gShellDebug1HiiHandle);
+ Status = (UINT8)(Key & 0x1F);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (VPStatusTable, Status);
}
@@ -4613,14 +4616,14 @@ DisplayVPStatus (
**/
VOID
DisplayCoolingDeviceStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Status;
+ UINT8 Status;
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_STATUS), gShellDebug1HiiHandle);
+ Status = (UINT8)((Key & 0xE0) >> 5);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (CoolingDeviceStatusTable, Status);
}
@@ -4633,14 +4636,14 @@ DisplayCoolingDeviceStatus (
**/
VOID
DisplayCoolingDeviceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Type;
+ UINT8 Type;
- Type = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_TYPE), gShellDebug1HiiHandle);
+ Type = (UINT8)(Key & 0x1F);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_COOLING_DEV_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (CoolingDeviceTypeTable, Type);
}
@@ -4653,14 +4656,14 @@ DisplayCoolingDeviceType (
**/
VOID
DisplayTemperatureProbeStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Status;
+ UINT8 Status;
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_TEMP_PROBE), gShellDebug1HiiHandle);
+ Status = (UINT8)((Key & 0xE0) >> 5);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_TEMP_PROBE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (TemperatureProbeStatusTable, Status);
}
@@ -4673,14 +4676,14 @@ DisplayTemperatureProbeStatus (
**/
VOID
DisplayTemperatureProbeLoc (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Loc;
+ UINT8 Loc;
- Loc = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
+ Loc = (UINT8)(Key & 0x1F);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_VOLTAGE_PROBE_LOC), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Loc, Option);
PRINT_TABLE_ITEM (TemperatureProbeLocTable, Loc);
}
@@ -4693,14 +4696,14 @@ DisplayTemperatureProbeLoc (
**/
VOID
DisplayECPStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Status;
+ UINT8 Status;
- Status = (UINT8) ((Key & 0xE0) >> 5);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_STATUS), gShellDebug1HiiHandle);
+ Status = (UINT8)((Key & 0xE0) >> 5);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (ECPStatusTable, Status);
}
@@ -4713,14 +4716,14 @@ DisplayECPStatus (
**/
VOID
DisplayECPLoc (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- UINT8 Loc;
+ UINT8 Loc;
- Loc = (UINT8) (Key & 0x1F);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_LOC), gShellDebug1HiiHandle);
+ Loc = (UINT8)(Key & 0x1F);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ELEC_PROBE_LOC), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Loc, Option);
PRINT_TABLE_ITEM (ECPLocTable, Loc);
}
@@ -4733,11 +4736,11 @@ DisplayECPLoc (
**/
VOID
DisplayMDType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (MDTypeTable, Key);
}
@@ -4750,11 +4753,11 @@ DisplayMDType (
**/
VOID
DisplayMDAddressType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_ADDR_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_ADDR_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (MDAddressTypeTable, Key);
}
@@ -4767,11 +4770,11 @@ DisplayMDAddressType (
**/
VOID
DisplayMemoryChannelType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CHANNEL_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CHANNEL_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (MemoryChannelTypeTable, Key);
}
@@ -4784,11 +4787,11 @@ DisplayMemoryChannelType (
**/
VOID
DisplayIPMIDIBMCInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BMC_INTERFACE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BMC_INTERFACE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (IPMIDIBMCInterfaceTypeTable, Key);
}
@@ -4801,11 +4804,11 @@ DisplayIPMIDIBMCInterfaceType (
**/
VOID
DisplayMCHostInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MC_HOST_INTERFACE_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MC_HOST_INTERFACE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (MCHostInterfaceTypeTable, Key);
}
@@ -4818,11 +4821,11 @@ DisplayMCHostInterfaceType (
**/
VOID
DisplayProcessorArchitectureType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
- ShellPrintHiiEx (-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROCESSOR_ARCH_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROCESSOR_ARCH_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (ProcessorArchitectureTypesTable, Key);
}
@@ -4835,14 +4838,14 @@ DisplayProcessorArchitectureType (
**/
VOID
DisplayStructureTypeInfo (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
//
// display
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_STRUCT_TYPE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_STRUCT_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (StructureTypeInfoTable, Key);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
index 756009b2f2..5111d35f63 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
@@ -12,11 +12,11 @@
#include <IndustryStandard/SmBios.h>
-#define QUERY_TABLE_UNFOUND 0xFF
+#define QUERY_TABLE_UNFOUND 0xFF
typedef struct TABLE_ITEM {
- UINT16 Key;
- CHAR16 *Info;
+ UINT16 Key;
+ CHAR16 *Info;
} TABLE_ITEM;
//
@@ -59,11 +59,11 @@ typedef struct TABLE_ITEM {
**/
UINT8
QueryTable (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT8 Key,
- IN OUT CHAR16 *Info,
- IN UINTN InfoLen
+ IN TABLE_ITEM *Table,
+ IN UINTN Number,
+ IN UINT8 Key,
+ IN OUT CHAR16 *Info,
+ IN UINTN InfoLen
);
/**
@@ -74,8 +74,8 @@ QueryTable (
**/
VOID
DisplayStructureTypeInfo (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -86,8 +86,8 @@ DisplayStructureTypeInfo (
**/
VOID
DisplaySystemWakeupType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -98,8 +98,8 @@ DisplaySystemWakeupType (
**/
VOID
DisplayBaseBoardFeatureFlags (
- IN UINT8 FeatureFlags,
- IN UINT8 Option
+ IN UINT8 FeatureFlags,
+ IN UINT8 Option
);
/**
@@ -109,9 +109,9 @@ DisplayBaseBoardFeatureFlags (
@param[in] Option The optional information.
**/
VOID
-DisplayBaseBoardBoardType(
- IN UINT8 Type,
- IN UINT8 Option
+DisplayBaseBoardBoardType (
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -122,8 +122,8 @@ DisplayBaseBoardBoardType(
**/
VOID
DisplaySystemEnclosureType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -134,8 +134,8 @@ DisplaySystemEnclosureType (
**/
VOID
DisplaySystemEnclosureStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
/**
@@ -146,8 +146,8 @@ DisplaySystemEnclosureStatus (
**/
VOID
DisplaySESecurityStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
;
@@ -159,8 +159,8 @@ DisplaySESecurityStatus (
**/
VOID
DisplayProcessorType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -171,8 +171,8 @@ DisplayProcessorType (
**/
VOID
DisplayProcessorUpgrade (
- IN UINT8 Upgrade,
- IN UINT8 Option
+ IN UINT8 Upgrade,
+ IN UINT8 Option
);
/**
@@ -183,8 +183,8 @@ DisplayProcessorUpgrade (
**/
VOID
DisplayProcessorCharacteristics (
- IN UINT16 Type,
- IN UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
);
/**
@@ -195,8 +195,8 @@ DisplayProcessorCharacteristics (
**/
VOID
DisplayMcErrorDetectMethod (
- IN UINT8 Method,
- IN UINT8 Option
+ IN UINT8 Method,
+ IN UINT8 Option
);
/**
@@ -207,8 +207,8 @@ DisplayMcErrorDetectMethod (
**/
VOID
DisplayMcErrorCorrectCapability (
- IN UINT8 Capability,
- IN UINT8 Option
+ IN UINT8 Capability,
+ IN UINT8 Option
);
/**
@@ -219,8 +219,8 @@ DisplayMcErrorCorrectCapability (
**/
VOID
DisplayMcInterleaveSupport (
- IN UINT8 Support,
- IN UINT8 Option
+ IN UINT8 Support,
+ IN UINT8 Option
);
/**
@@ -243,8 +243,8 @@ DisplayMcMemorySpeeds (
**/
VOID
DisplayMemoryModuleVoltage (
- IN UINT8 Voltage,
- IN UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
);
/**
@@ -267,8 +267,8 @@ DisplayMmMemoryType (
**/
VOID
DisplayMmErrorStatus (
- IN UINT8 Status,
- IN UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
/**
@@ -291,8 +291,8 @@ DisplayCacheSRAMType (
**/
VOID
DisplayCacheErrCorrectingType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -303,8 +303,8 @@ DisplayCacheErrCorrectingType (
**/
VOID
DisplayCacheSystemCacheType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -315,8 +315,8 @@ DisplayCacheSystemCacheType (
**/
VOID
DisplayCacheAssociativity (
- IN UINT8 Associativity,
- IN UINT8 Option
+ IN UINT8 Associativity,
+ IN UINT8 Option
);
/**
@@ -327,8 +327,8 @@ DisplayCacheAssociativity (
**/
VOID
DisplayPortConnectorType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -339,8 +339,8 @@ DisplayPortConnectorType (
**/
VOID
DisplayPortType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -351,8 +351,8 @@ DisplayPortType (
**/
VOID
DisplaySystemSlotType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -363,8 +363,8 @@ DisplaySystemSlotType (
**/
VOID
DisplaySystemSlotDataBusWidth (
- IN UINT8 Width,
- IN UINT8 Option
+ IN UINT8 Width,
+ IN UINT8 Option
);
/**
@@ -375,8 +375,8 @@ DisplaySystemSlotDataBusWidth (
**/
VOID
DisplaySystemSlotCurrentUsage (
- IN UINT8 Usage,
- IN UINT8 Option
+ IN UINT8 Usage,
+ IN UINT8 Option
);
/**
@@ -387,8 +387,8 @@ DisplaySystemSlotCurrentUsage (
**/
VOID
DisplaySystemSlotLength (
- IN UINT8 Length,
- IN UINT8 Option
+ IN UINT8 Length,
+ IN UINT8 Option
);
/**
@@ -399,8 +399,8 @@ DisplaySystemSlotLength (
**/
VOID
DisplaySlotCharacteristics1 (
- IN UINT8 Chara1,
- IN UINT8 Option
+ IN UINT8 Chara1,
+ IN UINT8 Option
);
/**
@@ -411,8 +411,8 @@ DisplaySlotCharacteristics1 (
**/
VOID
DisplaySlotCharacteristics2 (
- IN UINT8 Chara2,
- IN UINT8 Option
+ IN UINT8 Chara2,
+ IN UINT8 Option
);
/**
@@ -423,8 +423,8 @@ DisplaySlotCharacteristics2 (
**/
VOID
DisplayOnboardDeviceTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -435,8 +435,8 @@ DisplayOnboardDeviceTypes (
**/
VOID
DisplaySELTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -447,8 +447,8 @@ DisplaySELTypes (
**/
VOID
DisplaySELVarDataFormatType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -495,8 +495,8 @@ DisplaySELSysManagementTypes (
**/
VOID
DisplayPMALocation (
- IN UINT8 Location,
- IN UINT8 Option
+ IN UINT8 Location,
+ IN UINT8 Option
);
/**
@@ -507,8 +507,8 @@ DisplayPMALocation (
**/
VOID
DisplayPMAUse (
- IN UINT8 Use,
- IN UINT8 Option
+ IN UINT8 Use,
+ IN UINT8 Option
);
/**
@@ -519,8 +519,8 @@ DisplayPMAUse (
**/
VOID
DisplayPMAErrorCorrectionTypes (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -531,8 +531,8 @@ DisplayPMAErrorCorrectionTypes (
**/
VOID
DisplayMemoryDeviceFormFactor (
- IN UINT8 FormFactor,
- IN UINT8 Option
+ IN UINT8 FormFactor,
+ IN UINT8 Option
);
/**
@@ -543,8 +543,8 @@ DisplayMemoryDeviceFormFactor (
**/
VOID
DisplayMemoryDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -591,8 +591,8 @@ DisplayMemoryDeviceMemoryOperatingModeCapability (
**/
VOID
DisplayMemoryErrorType (
- IN UINT8 ErrorType,
- IN UINT8 Option
+ IN UINT8 ErrorType,
+ IN UINT8 Option
);
/**
@@ -603,8 +603,8 @@ DisplayMemoryErrorType (
**/
VOID
DisplayMemoryErrorGranularity (
- IN UINT8 Granularity,
- IN UINT8 Option
+ IN UINT8 Granularity,
+ IN UINT8 Option
);
/**
@@ -615,8 +615,8 @@ DisplayMemoryErrorGranularity (
**/
VOID
DisplayMemoryErrorOperation (
- IN UINT8 Operation,
- IN UINT8 Option
+ IN UINT8 Operation,
+ IN UINT8 Option
);
/**
@@ -627,8 +627,8 @@ DisplayMemoryErrorOperation (
**/
VOID
DisplayPointingDeviceType (
- IN UINT8 Type,
- IN UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
/**
@@ -639,8 +639,8 @@ DisplayPointingDeviceType (
**/
VOID
DisplayPointingDeviceInterface (
- IN UINT8 Interface,
- IN UINT8 Option
+ IN UINT8 Interface,
+ IN UINT8 Option
);
/**
@@ -651,8 +651,8 @@ DisplayPointingDeviceInterface (
**/
VOID
DisplayPBDeviceChemistry (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -663,8 +663,8 @@ DisplayPBDeviceChemistry (
**/
VOID
DisplayVPLocation (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -675,8 +675,8 @@ DisplayVPLocation (
**/
VOID
DisplayVPStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -687,8 +687,8 @@ DisplayVPStatus (
**/
VOID
DisplayCoolingDeviceStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -699,8 +699,8 @@ DisplayCoolingDeviceStatus (
**/
VOID
DisplayCoolingDeviceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -711,8 +711,8 @@ DisplayCoolingDeviceType (
**/
VOID
DisplayTemperatureProbeStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -723,8 +723,8 @@ DisplayTemperatureProbeStatus (
**/
VOID
DisplayTemperatureProbeLoc (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -735,8 +735,8 @@ DisplayTemperatureProbeLoc (
**/
VOID
DisplayECPStatus (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -747,8 +747,8 @@ DisplayECPStatus (
**/
VOID
DisplayECPLoc (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -759,8 +759,8 @@ DisplayECPLoc (
**/
VOID
DisplayMDType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -771,8 +771,8 @@ DisplayMDType (
**/
VOID
DisplayMDAddressType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -783,8 +783,8 @@ DisplayMDAddressType (
**/
VOID
DisplayMemoryChannelType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -795,8 +795,8 @@ DisplayMemoryChannelType (
**/
VOID
DisplayIPMIDIBMCInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
/**
@@ -807,8 +807,8 @@ DisplayIPMIDIBMCInterfaceType (
**/
VOID
DisplayMCHostInterfaceType (
- IN UINT8 Key,
- IN UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
index 955ec83715..e9360beb23 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
@@ -13,9 +13,9 @@
#include "PrintInfo.h"
#include "QueryTable.h"
-UINT8 gShowType = SHOW_DETAIL;
-STATIC STRUCTURE_STATISTICS *mStatisticsTable = NULL;
-STATIC STRUCTURE_STATISTICS *mSmbios64BitStatisticsTable = NULL;
+UINT8 gShowType = SHOW_DETAIL;
+STATIC STRUCTURE_STATISTICS *mStatisticsTable = NULL;
+STATIC STRUCTURE_STATISTICS *mSmbios64BitStatisticsTable = NULL;
UINT8 SmbiosMajorVersion;
UINT8 SmbiosMinorVersion;
@@ -23,13 +23,13 @@ UINT8 SmbiosMinorVersion;
UINTN mNumberOfSmbios64BitStructures;
UINTN mSmbios64BitTableLength;
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-t", TypeValue},
- {L"-h", TypeValue},
- {L"-s", TypeFlag},
- {L"-a", TypeFlag},
- {NULL, TypeMax}
- };
+STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+ { L"-t", TypeValue },
+ { L"-h", TypeValue },
+ { L"-s", TypeFlag },
+ { L"-a", TypeFlag },
+ { NULL, TypeMax }
+};
/**
Function for 'smbiosview' command.
@@ -44,16 +44,16 @@ ShellCommandRunSmbiosView (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- UINT8 StructType;
- UINT16 StructHandle;
- EFI_STATUS Status;
- EFI_STATUS Status1;
- EFI_STATUS Status2;
- BOOLEAN RandomView;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
+ UINT8 StructType;
+ UINT16 StructHandle;
+ EFI_STATUS Status;
+ EFI_STATUS Status1;
+ EFI_STATUS Status2;
+ BOOLEAN RandomView;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *Temp;
mStatisticsTable = NULL;
mSmbios64BitStatisticsTable = NULL;
@@ -61,56 +61,56 @@ ShellCommandRunSmbiosView (
ShellStatus = SHELL_SUCCESS;
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam);
- FreePool(ProblemParam);
+ if (EFI_ERROR (Status)) {
+ if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam != NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam);
+ FreePool (ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- ASSERT(FALSE);
+ ASSERT (FALSE);
}
} else {
- if (ShellCommandLineGetCount(Package) > 1) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
+ if (ShellCommandLineGetCount (Package) > 1) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t");
+ } else if (ShellCommandLineGetFlag (Package, L"-t") && (ShellCommandLineGetValue (Package, L"-t") == NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t");
ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h");
+ } else if (ShellCommandLineGetFlag (Package, L"-h") && (ShellCommandLineGetValue (Package, L"-h") == NULL)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h");
ShellStatus = SHELL_INVALID_PARAMETER;
} else if (
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-s")) ||
- (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-a")) ||
- (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-s")) ||
- (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) ||
- (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a"))
- ) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
+ (ShellCommandLineGetFlag (Package, L"-t") && ShellCommandLineGetFlag (Package, L"-h")) ||
+ (ShellCommandLineGetFlag (Package, L"-t") && ShellCommandLineGetFlag (Package, L"-s")) ||
+ (ShellCommandLineGetFlag (Package, L"-t") && ShellCommandLineGetFlag (Package, L"-a")) ||
+ (ShellCommandLineGetFlag (Package, L"-h") && ShellCommandLineGetFlag (Package, L"-s")) ||
+ (ShellCommandLineGetFlag (Package, L"-h") && ShellCommandLineGetFlag (Package, L"-a")) ||
+ (ShellCommandLineGetFlag (Package, L"-s") && ShellCommandLineGetFlag (Package, L"-a"))
+ )
+ {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
-
//
// Init Lib
//
Status1 = LibSmbiosInit ();
Status2 = LibSmbios64BitInit ();
if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
- StructType = STRUCTURE_TYPE_RANDOM;
- RandomView = TRUE;
+ StructType = STRUCTURE_TYPE_RANDOM;
+ RandomView = TRUE;
- Temp = ShellCommandLineGetValue(Package, L"-t");
+ Temp = ShellCommandLineGetValue (Package, L"-t");
if (Temp != NULL) {
- StructType = (UINT8) ShellStrToUintn (Temp);
+ StructType = (UINT8)ShellStrToUintn (Temp);
}
- if (ShellCommandLineGetFlag(Package, L"-a")) {
+ if (ShellCommandLineGetFlag (Package, L"-a")) {
gShowType = SHOW_ALL;
}
@@ -118,14 +118,15 @@ ShellCommandRunSmbiosView (
//
// Initialize the StructHandle to be the first handle
//
- StructHandle = INVALID_HANDLE;
+ StructHandle = INVALID_HANDLE;
LibGetSmbiosStructure (&StructHandle, NULL, NULL);
- Temp = ShellCommandLineGetValue(Package, L"-h");
+ Temp = ShellCommandLineGetValue (Package, L"-h");
if (Temp != NULL) {
RandomView = FALSE;
- StructHandle = (UINT16) ShellStrToUintn(Temp);
+ StructHandle = (UINT16)ShellStrToUintn (Temp);
}
+
//
// build statistics table
//
@@ -135,11 +136,12 @@ ShellCommandRunSmbiosView (
goto Done;
}
- if (ShellCommandLineGetFlag(Package, L"-s")) {
+ if (ShellCommandLineGetFlag (Package, L"-s")) {
Status = DisplayStatisticsTable (SHOW_DETAIL);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
ShellStatus = SHELL_NOT_FOUND;
}
+
goto Show64Bit;
}
@@ -147,7 +149,7 @@ ShellCommandRunSmbiosView (
// Show SMBIOS structure information
//
Status = SMBiosView (StructType, StructHandle, gShowType, RandomView);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
@@ -163,23 +165,25 @@ Show64Bit:
ShellStatus = SHELL_NOT_FOUND;
goto Done;
}
+
//
// Initialize the StructHandle to be the first handle
//
- StructHandle = INVALID_HANDLE;
+ StructHandle = INVALID_HANDLE;
LibGetSmbios64BitStructure (&StructHandle, NULL, NULL);
- Temp = ShellCommandLineGetValue(Package, L"-h");
+ Temp = ShellCommandLineGetValue (Package, L"-h");
if (Temp != NULL) {
RandomView = FALSE;
- StructHandle = (UINT16) ShellStrToUintn(Temp);
+ StructHandle = (UINT16)ShellStrToUintn (Temp);
}
- if (ShellCommandLineGetFlag(Package, L"-s")) {
+ if (ShellCommandLineGetFlag (Package, L"-s")) {
Status = DisplaySmbios64BitStatisticsTable (SHOW_DETAIL);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
ShellStatus = SHELL_NOT_FOUND;
}
+
goto Done;
}
@@ -187,12 +191,13 @@ Show64Bit:
// Show SMBIOS structure information
//
Status = SMBios64View (StructType, StructHandle, gShowType, RandomView);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR (Status)) {
ShellStatus = SHELL_NOT_FOUND;
}
}
}
}
+
Done:
//
// Release resources
@@ -237,16 +242,16 @@ Done:
**/
EFI_STATUS
SMBiosView (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
+ IN UINT8 QueryType,
+ IN UINT16 QueryHandle,
+ IN UINT8 Option,
+ IN BOOLEAN RandomView
)
{
- UINT16 Handle;
- UINT8 *Buffer;
- UINT16 Length;
- UINTN Index;
+ UINT16 Handle;
+ UINT8 *Buffer;
+ UINT16 Length;
+ UINTN Index;
SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
@@ -254,7 +259,7 @@ SMBiosView (
SMBiosTable = NULL;
LibSmbiosGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_BAD_BUFFER_SIZE;
}
@@ -267,43 +272,43 @@ SMBiosView (
SmbiosMajorVersion = SMBiosTable->MajorVersion;
SmbiosMinorVersion = SMBiosTable->MinorVersion;
- ShellPrintEx(-1,-1,L"=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND), gShellDebug1HiiHandle);
+ ShellPrintEx (-1, -1, L"=========================================================\n");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND), gShellDebug1HiiHandle);
if (QueryType == STRUCTURE_TYPE_RANDOM) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE_RANDOM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE_RANDOM), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), gShellDebug1HiiHandle, QueryType);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), gShellDebug1HiiHandle, QueryType);
}
if (RandomView) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), gShellDebug1HiiHandle, QueryHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), gShellDebug1HiiHandle, QueryHandle);
}
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,GetShowTypeString (gShowType));
- ShellPrintEx(-1,-1,L"\n\n");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE), gShellDebug1HiiHandle);
+ ShellPrintEx (-1, -1, GetShowTypeString (gShowType));
+ ShellPrintEx (-1, -1, L"\n\n");
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
- return Status;
- }
-*/
+ return Status;
+ }
+ */
//
// Searching and display structure info
//
- Handle = QueryHandle;
+ Handle = QueryHandle;
for (Index = 0; Index < SMBiosTable->NumberOfSmbiosStructures; Index++) {
//
// if reach the end of table, break..
@@ -311,6 +316,7 @@ SMBiosView (
if (Handle == INVALID_HANDLE) {
break;
}
+
//
// handle then point to the next!
//
@@ -325,62 +331,67 @@ SMBiosView (
// if QueryType!=Random, but Hdr->Type==QueryType, also print it.
// only if QueryType != Random and Hdr->Type != QueryType, skiped it.
//
- if (QueryType != STRUCTURE_TYPE_RANDOM && SmbiosStruct.Hdr->Type != QueryType) {
+ if ((QueryType != STRUCTURE_TYPE_RANDOM) && (SmbiosStruct.Hdr->Type != QueryType)) {
continue;
}
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintEx (-1, -1, L"\n=========================================================\n");
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT),
gShellDebug1HiiHandle,
SmbiosStruct.Hdr->Type,
SmbiosStruct.Hdr->Handle
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
//
// Addr of structure in structure in table
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN) Buffer);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN)Buffer);
DumpHex (0, 0, Length, Buffer);
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
- return Status;
- }
-*/
+ return Status;
+ }
+ */
if (gShowType != SHOW_NONE) {
//
// Print structure information
//
SmbiosPrintStructure (&SmbiosStruct, gShowType);
- ShellPrintEx(-1,-1,L"\n");
-
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
-*/
+ ShellPrintEx (-1, -1, L"\n");
+
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
+
+ return Status;
+ }
+ */
}
+
if (!RandomView) {
break;
}
+
//
// Support Execution Interrupt.
//
@@ -389,7 +400,7 @@ SMBiosView (
}
}
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
+ ShellPrintEx (-1, -1, L"\n=========================================================\n");
return EFI_SUCCESS;
}
@@ -410,10 +421,10 @@ SMBiosView (
**/
EFI_STATUS
SMBios64View (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
+ IN UINT8 QueryType,
+ IN UINT16 QueryHandle,
+ IN UINT8 Option,
+ IN BOOLEAN RandomView
)
{
UINT16 Handle;
@@ -426,7 +437,7 @@ SMBios64View (
SMBiosTable = NULL;
LibSmbios64BitGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_BAD_BUFFER_SIZE;
}
@@ -439,43 +450,43 @@ SMBios64View (
SmbiosMajorVersion = SMBiosTable->MajorVersion;
SmbiosMinorVersion = SMBiosTable->MinorVersion;
- ShellPrintEx(-1,-1,L"=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND), gShellDebug1HiiHandle);
+ ShellPrintEx (-1, -1, L"=========================================================\n");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERY_STRUCT_COND), gShellDebug1HiiHandle);
if (QueryType == STRUCTURE_TYPE_RANDOM) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE_RANDOM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE_RANDOM), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), gShellDebug1HiiHandle, QueryType);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYTYPE), gShellDebug1HiiHandle, QueryType);
}
if (RandomView) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE_RANDOM), gShellDebug1HiiHandle);
} else {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), gShellDebug1HiiHandle, QueryHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_QUERYHANDLE), gShellDebug1HiiHandle, QueryHandle);
}
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,GetShowTypeString (gShowType));
- ShellPrintEx(-1,-1,L"\n\n");
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE), gShellDebug1HiiHandle);
+ ShellPrintEx (-1, -1, GetShowTypeString (gShowType));
+ ShellPrintEx (-1, -1, L"\n\n");
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
- return Status;
- }
-*/
+ return Status;
+ }
+ */
//
// Searching and display structure info
//
- Handle = QueryHandle;
+ Handle = QueryHandle;
for (Index = 0; Index < mNumberOfSmbios64BitStructures; Index++) {
//
// if reach the end of table, break..
@@ -483,6 +494,7 @@ SMBios64View (
if (Handle == INVALID_HANDLE) {
break;
}
+
//
// handle then point to the next!
//
@@ -497,62 +509,67 @@ SMBios64View (
// if QueryType!=Random, but Hdr->Type==QueryType, also print it.
// only if QueryType != Random and Hdr->Type != QueryType, skiped it.
//
- if (QueryType != STRUCTURE_TYPE_RANDOM && SmbiosStruct.Hdr->Type != QueryType) {
+ if ((QueryType != STRUCTURE_TYPE_RANDOM) && (SmbiosStruct.Hdr->Type != QueryType)) {
continue;
}
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
- ShellPrintHiiEx(-1,-1,NULL,
+ ShellPrintEx (-1, -1, L"\n=========================================================\n");
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT),
gShellDebug1HiiHandle,
SmbiosStruct.Hdr->Type,
SmbiosStruct.Hdr->Handle
- );
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
+ );
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
//
// Addr of structure in structure in table
//
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN) Buffer);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ADDR), gShellDebug1HiiHandle, (UINTN)Buffer);
DumpHex (0, 0, Length, Buffer);
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
- return Status;
- }
-*/
+ return Status;
+ }
+ */
if (gShowType != SHOW_NONE) {
//
// Print structure information
//
SmbiosPrintStructure (&SmbiosStruct, gShowType);
- ShellPrintEx(-1,-1,L"\n");
-
-/*
- //
- // Get internal commands, such as change options.
- //
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
-
- return Status;
- }
-*/
+ ShellPrintEx (-1, -1, L"\n");
+
+ /*
+ //
+ // Get internal commands, such as change options.
+ //
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
+
+ return Status;
+ }
+ */
}
+
if (!RandomView) {
break;
}
+
//
// Support Execution Interrupt.
//
@@ -561,7 +578,7 @@ SMBios64View (
}
}
- ShellPrintEx(-1,-1,L"\n=========================================================\n");
+ ShellPrintEx (-1, -1, L"\n=========================================================\n");
return EFI_SUCCESS;
}
@@ -578,11 +595,11 @@ InitSmbiosTableStatistics (
VOID
)
{
- UINT16 Handle;
- UINT8 *Buffer;
- UINT16 Length;
- UINT16 Offset;
- UINT16 Index;
+ UINT16 Handle;
+ UINT8 *Buffer;
+ UINT16 Length;
+ UINT16 Offset;
+ UINT16 Index;
SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
@@ -591,14 +608,15 @@ InitSmbiosTableStatistics (
SMBiosTable = NULL;
LibSmbiosGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_NOT_FOUND;
}
if (CompareMem (SMBiosTable->AnchorString, "_SM_", 4) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SMBIOS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SMBIOS_TABLE), gShellDebug1HiiHandle);
return EFI_INVALID_PARAMETER;
}
+
//
// Allocate memory to mStatisticsTable
//
@@ -607,14 +625,14 @@ InitSmbiosTableStatistics (
mStatisticsTable = NULL;
}
- mStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (SMBiosTable->NumberOfSmbiosStructures * sizeof (STRUCTURE_STATISTICS));
+ mStatisticsTable = (STRUCTURE_STATISTICS *)AllocateZeroPool (SMBiosTable->NumberOfSmbiosStructures * sizeof (STRUCTURE_STATISTICS));
if (mStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
return EFI_OUT_OF_RESOURCES;
}
- Offset = 0;
+ Offset = 0;
StatisticsPointer = mStatisticsTable;
//
@@ -629,6 +647,7 @@ InitSmbiosTableStatistics (
if (Handle == INVALID_HANDLE) {
break;
}
+
//
// After LibGetSmbiosStructure(), handle then point to the next!
//
@@ -647,9 +666,9 @@ InitSmbiosTableStatistics (
StatisticsPointer->Length = Length;
StatisticsPointer->Addr = Offset;
- Offset = (UINT16) (Offset + Length);
+ Offset = (UINT16)(Offset + Length);
- StatisticsPointer = &mStatisticsTable[Index];
+ StatisticsPointer = &mStatisticsTable[Index];
}
return EFI_SUCCESS;
@@ -664,15 +683,15 @@ InitSmbiosTableStatistics (
**/
EFI_STATUS
CalculateSmbios64BitStructureCountAndLength (
- SMBIOS_TABLE_3_0_ENTRY_POINT *Smbios64EntryPoint,
- UINTN *NumberOfSmbios64Structures,
- UINTN *Smbios64TableLength
-)
+ SMBIOS_TABLE_3_0_ENTRY_POINT *Smbios64EntryPoint,
+ UINTN *NumberOfSmbios64Structures,
+ UINTN *Smbios64TableLength
+ )
{
- SMBIOS_STRUCTURE_POINTER Smbios;
- UINT8 *Raw;
+ SMBIOS_STRUCTURE_POINTER Smbios;
+ UINT8 *Raw;
- *Smbios64TableLength = 0;
+ *Smbios64TableLength = 0;
*NumberOfSmbios64Structures = 0;
Smbios.Raw = (UINT8 *)(UINTN)(Smbios64EntryPoint->TableAddress);
@@ -690,11 +709,11 @@ CalculateSmbios64BitStructureCountAndLength (
//
// Walk to next structure
//
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
+ LibGetSmbiosString (&Smbios, (UINT16)(-1));
//
// Length = Next structure head - this structure head
//
- (*Smbios64TableLength) += ((UINTN) Smbios.Raw - (UINTN) Raw);
+ (*Smbios64TableLength) += ((UINTN)Smbios.Raw - (UINTN)Raw);
if ((*Smbios64TableLength) > Smbios64EntryPoint->TableMaximumSize) {
//
// The actual table length exceeds maximum table size,
@@ -702,6 +721,7 @@ CalculateSmbios64BitStructureCountAndLength (
//
return EFI_INVALID_PARAMETER;
}
+
(*NumberOfSmbios64Structures)++;
}
}
@@ -716,12 +736,12 @@ InitSmbios64BitTableStatistics (
VOID
)
{
- UINT16 Handle;
- UINT8 *Buffer;
- UINT16 Length;
- UINT16 Offset;
- UINT16 Index;
- EFI_STATUS Status;
+ UINT16 Handle;
+ UINT8 *Buffer;
+ UINT16 Length;
+ UINT16 Offset;
+ UINT16 Index;
+ EFI_STATUS Status;
SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable;
STRUCTURE_STATISTICS *StatisticsPointer;
@@ -729,14 +749,15 @@ InitSmbios64BitTableStatistics (
SMBiosTable = NULL;
LibSmbios64BitGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_NOT_FOUND;
}
if (CompareMem (SMBiosTable->AnchorString, "_SM3_", 5) != 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SMBIOS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_SMBIOS_TABLE), gShellDebug1HiiHandle);
return EFI_INVALID_PARAMETER;
}
+
//
// Allocate memory to mSmbios64BitStatisticsTable
//
@@ -744,6 +765,7 @@ InitSmbios64BitTableStatistics (
FreePool (mSmbios64BitStatisticsTable);
mSmbios64BitStatisticsTable = NULL;
}
+
//
// Calculate number of smbios structures
//
@@ -752,14 +774,14 @@ InitSmbios64BitTableStatistics (
return EFI_INVALID_PARAMETER;
}
- mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS));
+ mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *)AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS));
if (mSmbios64BitStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
return EFI_OUT_OF_RESOURCES;
}
- Offset = 0;
+ Offset = 0;
StatisticsPointer = mSmbios64BitStatisticsTable;
//
@@ -774,6 +796,7 @@ InitSmbios64BitTableStatistics (
if (Handle == INVALID_HANDLE) {
break;
}
+
//
// After LibGetSmbios64BitStructure(), handle then point to the next!
//
@@ -792,9 +815,9 @@ InitSmbios64BitTableStatistics (
StatisticsPointer->Length = Length;
StatisticsPointer->Addr = Offset;
- Offset = (UINT16) (Offset + Length);
+ Offset = (UINT16)(Offset + Length);
- StatisticsPointer = &mSmbios64BitStatisticsTable[Index];
+ StatisticsPointer = &mSmbios64BitStatisticsTable[Index];
}
return EFI_SUCCESS;
@@ -809,28 +832,29 @@ InitSmbios64BitTableStatistics (
**/
EFI_STATUS
DisplayStatisticsTable (
- IN UINT8 Option
+ IN UINT8 Option
)
{
- UINTN Index;
- UINTN Num;
- STRUCTURE_STATISTICS *StatisticsPointer;
- SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
+ UINTN Index;
+ UINTN Num;
+ STRUCTURE_STATISTICS *StatisticsPointer;
+ SMBIOS_TABLE_ENTRY_POINT *SMBiosTable;
SMBiosTable = NULL;
if (Option < SHOW_OUTLINE) {
return EFI_SUCCESS;
}
+
//
// display EPS information firstly
//
LibSmbiosGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_UNSUPPORTED;
}
- ShellPrintEx(-1,-1,L"\n============================================================\n");
+ ShellPrintEx (-1, -1, L"\n============================================================\n");
SmbiosPrintEPSInfo (SMBiosTable, Option);
if (Option < SHOW_NORMAL) {
@@ -838,43 +862,44 @@ DisplayStatisticsTable (
}
if (mStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_STATS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_STATS), gShellDebug1HiiHandle);
return EFI_NOT_FOUND;
}
- ShellPrintEx(-1,-1,L"============================================================\n");
+ ShellPrintEx (-1, -1, L"============================================================\n");
StatisticsPointer = &mStatisticsTable[0];
- Num = SMBiosTable->NumberOfSmbiosStructures;
+ Num = SMBiosTable->NumberOfSmbiosStructures;
//
// display statistics table content
//
for (Index = 1; Index <= Num; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
}
- ShellPrintEx(-1,-1,L"\n");
+ ShellPrintEx (-1, -1, L"\n");
StatisticsPointer = &mStatisticsTable[Index];
-/*
- //
- // Display 20 lines and wait for a page break
- //
- if (Index % 20 == 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTER_CONTINUE), gShellDebug1HiiHandle);
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
- return Status;
- }
- }
-*/
+ /*
+ //
+ // Display 20 lines and wait for a page break
+ //
+ if (Index % 20 == 0) {
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTER_CONTINUE), gShellDebug1HiiHandle);
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
+
+ return Status;
+ }
+ }
+ */
}
return EFI_SUCCESS;
@@ -889,28 +914,29 @@ DisplayStatisticsTable (
**/
EFI_STATUS
DisplaySmbios64BitStatisticsTable (
- IN UINT8 Option
+ IN UINT8 Option
)
{
- UINTN Index;
- UINTN Num;
- STRUCTURE_STATISTICS *StatisticsPointer;
- SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable;
+ UINTN Index;
+ UINTN Num;
+ STRUCTURE_STATISTICS *StatisticsPointer;
+ SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable;
SMBiosTable = NULL;
if (Option < SHOW_OUTLINE) {
return EFI_SUCCESS;
}
+
//
// display EPS information firstly
//
LibSmbios64BitGetEPS (&SMBiosTable);
if (SMBiosTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_TABLE), gShellDebug1HiiHandle);
return EFI_UNSUPPORTED;
}
- ShellPrintEx(-1,-1,L"\n============================================================\n");
+ ShellPrintEx (-1, -1, L"\n============================================================\n");
Smbios64BitPrintEPSInfo (SMBiosTable, Option);
if (Option < SHOW_NORMAL) {
@@ -918,43 +944,44 @@ DisplaySmbios64BitStatisticsTable (
}
if (mSmbios64BitStatisticsTable == NULL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_STATS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_CANNOT_ACCESS_STATS), gShellDebug1HiiHandle);
return EFI_NOT_FOUND;
}
- ShellPrintEx(-1,-1,L"============================================================\n");
+ ShellPrintEx (-1, -1, L"============================================================\n");
StatisticsPointer = &mSmbios64BitStatisticsTable[0];
- Num = mNumberOfSmbios64BitStructures;
+ Num = mNumberOfSmbios64BitStructures;
//
// display statistics table content
//
for (Index = 1; Index <= Num; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
}
- ShellPrintEx(-1,-1,L"\n");
+ ShellPrintEx (-1, -1, L"\n");
StatisticsPointer = &mSmbios64BitStatisticsTable[Index];
-/*
- //
- // Display 20 lines and wait for a page break
- //
- if (Index % 20 == 0) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTER_CONTINUE), gShellDebug1HiiHandle);
- Status = WaitEnter ();
- if (EFI_ERROR (Status)) {
- if (Status == EFI_ABORTED) {
- return EFI_SUCCESS;
- }
- return Status;
- }
- }
-*/
+ /*
+ //
+ // Display 20 lines and wait for a page break
+ //
+ if (Index % 20 == 0) {
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTER_CONTINUE), gShellDebug1HiiHandle);
+ Status = WaitEnter ();
+ if (EFI_ERROR (Status)) {
+ if (Status == EFI_ABORTED) {
+ return EFI_SUCCESS;
+ }
+
+ return Status;
+ }
+ }
+ */
}
return EFI_SUCCESS;
@@ -969,31 +996,29 @@ DisplaySmbios64BitStatisticsTable (
**/
CHAR16 *
GetShowTypeString (
- UINT8 ShowType
+ UINT8 ShowType
)
{
//
// show type
//
switch (ShowType) {
+ case SHOW_NONE:
+ return L"SHOW_NONE";
- case SHOW_NONE:
- return L"SHOW_NONE";
-
- case SHOW_OUTLINE:
- return L"SHOW_OUTLINE";
+ case SHOW_OUTLINE:
+ return L"SHOW_OUTLINE";
- case SHOW_NORMAL:
- return L"SHOW_NORMAL";
+ case SHOW_NORMAL:
+ return L"SHOW_NORMAL";
- case SHOW_DETAIL:
- return L"SHOW_DETAIL";
+ case SHOW_DETAIL:
+ return L"SHOW_DETAIL";
- case SHOW_ALL:
- return L"SHOW_ALL";
+ case SHOW_ALL:
+ return L"SHOW_ALL";
- default:
- return L"Undefined type";
+ default:
+ return L"Undefined type";
}
}
-
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
index b0e03e9d65..0e53093a04 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
@@ -9,15 +9,15 @@
#ifndef _SMBIOS_VIEW_H_
#define _SMBIOS_VIEW_H_
-#define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE
-#define STRUCTURE_TYPE_INVALID (UINT8) 0xFF
+#define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE
+#define STRUCTURE_TYPE_INVALID (UINT8) 0xFF
typedef struct {
- UINT16 Index;
- UINT8 Type;
- UINT16 Handle;
- UINT16 Addr; // offset from table head
- UINT16 Length; // total structure length
+ UINT16 Index;
+ UINT8 Type;
+ UINT16 Handle;
+ UINT16 Addr; // offset from table head
+ UINT16 Length; // total structure length
} STRUCTURE_STATISTICS;
/**
@@ -34,10 +34,10 @@ typedef struct {
**/
EFI_STATUS
SMBiosView (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
+ IN UINT8 QueryType,
+ IN UINT16 QueryHandle,
+ IN UINT8 Option,
+ IN BOOLEAN RandomView
);
/**
@@ -54,10 +54,10 @@ SMBiosView (
**/
EFI_STATUS
SMBios64View (
- IN UINT8 QueryType,
- IN UINT16 QueryHandle,
- IN UINT8 Option,
- IN BOOLEAN RandomView
+ IN UINT8 QueryType,
+ IN UINT16 QueryHandle,
+ IN UINT8 Option,
+ IN BOOLEAN RandomView
);
/**
@@ -89,7 +89,7 @@ InitSmbios64BitTableStatistics (
**/
EFI_STATUS
DisplayStatisticsTable (
- IN UINT8 Option
+ IN UINT8 Option
);
/**
@@ -101,7 +101,7 @@ DisplayStatisticsTable (
**/
EFI_STATUS
DisplaySmbios64BitStatisticsTable (
- IN UINT8 Option
+ IN UINT8 Option
);
/**
@@ -111,9 +111,9 @@ DisplaySmbios64BitStatisticsTable (
@return A pointer to a string representing the ShowType (or 'undefined type' if not known).
**/
-CHAR16*
+CHAR16 *
GetShowTypeString (
- UINT8 ShowType
+ UINT8 ShowType
);
extern UINT8 gShowType;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
index f918867f47..c3682eeae4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c
@@ -9,8 +9,8 @@
#include "UefiShellDebug1CommandsLib.h"
#include <Library/BcfgCommandLib.h>
-STATIC CONST CHAR16 mFileName[] = L"Debug1Commands";
-EFI_HII_HANDLE gShellDebug1HiiHandle = NULL;
+STATIC CONST CHAR16 mFileName[] = L"Debug1Commands";
+EFI_HII_HANDLE gShellDebug1HiiHandle = NULL;
/**
Gets the debug file name. This will be used if HII is not working.
@@ -18,7 +18,7 @@ EFI_HII_HANDLE gShellDebug1HiiHandle = NULL;
@retval NULL No file is available.
@return The NULL-terminated filename to get help from.
**/
-CONST CHAR16*
+CONST CHAR16 *
EFIAPI
ShellCommandGetManFileNameDebug1 (
VOID
@@ -46,7 +46,7 @@ UefiShellDebug1CommandsLibConstructor (
//
// check our bit of the profiles mask
//
- if ((PcdGet8(PcdShellProfileMask) & BIT1) == 0) {
+ if ((PcdGet8 (PcdShellProfileMask) & BIT1) == 0) {
return (EFI_SUCCESS);
}
@@ -61,27 +61,27 @@ UefiShellDebug1CommandsLibConstructor (
//
// install our shell command handlers that are always installed
//
- ShellCommandRegisterCommandName(L"setsize", ShellCommandRunSetSize , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETSIZE) );
- ShellCommandRegisterCommandName(L"comp", ShellCommandRunComp , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_COMP) );
- ShellCommandRegisterCommandName(L"mode", ShellCommandRunMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MODE) );
- ShellCommandRegisterCommandName(L"memmap", ShellCommandRunMemMap , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MEMMAP) );
- ShellCommandRegisterCommandName(L"eficompress", ShellCommandRunEfiCompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFICOMPRESS) );
- ShellCommandRegisterCommandName(L"efidecompress", ShellCommandRunEfiDecompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFIDCOMPRESS) );
- ShellCommandRegisterCommandName(L"dmem", ShellCommandRunDmem , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMEM) );
- ShellCommandRegisterCommandName(L"loadpcirom", ShellCommandRunLoadPciRom , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_LOAD_PCI_ROM) );
- ShellCommandRegisterCommandName(L"mm", ShellCommandRunMm , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MM) );
- ShellCommandRegisterCommandName(L"setvar", ShellCommandRunSetVar , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETVAR) );
- ShellCommandRegisterCommandName(L"sermode", ShellCommandRunSerMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SERMODE) );
- ShellCommandRegisterCommandName(L"pci", ShellCommandRunPci , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_PCI) );
- ShellCommandRegisterCommandName(L"smbiosview", ShellCommandRunSmbiosView , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SMBIOSVIEW) );
- ShellCommandRegisterCommandName(L"dmpstore", ShellCommandRunDmpStore , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMPSTORE) );
- ShellCommandRegisterCommandName(L"dblk", ShellCommandRunDblk , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DBLK) );
- ShellCommandRegisterCommandName(L"edit", ShellCommandRunEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EDIT) );
- ShellCommandRegisterCommandName(L"hexedit", ShellCommandRunHexEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_HEXEDIT) );
-
- ShellCommandRegisterAlias(L"dmem", L"mem");
-
- BcfgLibraryRegisterBcfgCommand(ImageHandle, SystemTable, L"Debug1");
+ ShellCommandRegisterCommandName (L"setsize", ShellCommandRunSetSize, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_SETSIZE));
+ ShellCommandRegisterCommandName (L"comp", ShellCommandRunComp, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_COMP));
+ ShellCommandRegisterCommandName (L"mode", ShellCommandRunMode, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_MODE));
+ ShellCommandRegisterCommandName (L"memmap", ShellCommandRunMemMap, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_MEMMAP));
+ ShellCommandRegisterCommandName (L"eficompress", ShellCommandRunEfiCompress, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_EFICOMPRESS));
+ ShellCommandRegisterCommandName (L"efidecompress", ShellCommandRunEfiDecompress, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_EFIDCOMPRESS));
+ ShellCommandRegisterCommandName (L"dmem", ShellCommandRunDmem, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_DMEM));
+ ShellCommandRegisterCommandName (L"loadpcirom", ShellCommandRunLoadPciRom, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_LOAD_PCI_ROM));
+ ShellCommandRegisterCommandName (L"mm", ShellCommandRunMm, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_MM));
+ ShellCommandRegisterCommandName (L"setvar", ShellCommandRunSetVar, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_SETVAR));
+ ShellCommandRegisterCommandName (L"sermode", ShellCommandRunSerMode, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_SERMODE));
+ ShellCommandRegisterCommandName (L"pci", ShellCommandRunPci, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_PCI));
+ ShellCommandRegisterCommandName (L"smbiosview", ShellCommandRunSmbiosView, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_SMBIOSVIEW));
+ ShellCommandRegisterCommandName (L"dmpstore", ShellCommandRunDmpStore, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_DMPSTORE));
+ ShellCommandRegisterCommandName (L"dblk", ShellCommandRunDblk, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_DBLK));
+ ShellCommandRegisterCommandName (L"edit", ShellCommandRunEdit, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_EDIT));
+ ShellCommandRegisterCommandName (L"hexedit", ShellCommandRunHexEdit, ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN (STR_GET_HELP_HEXEDIT));
+
+ ShellCommandRegisterAlias (L"dmem", L"mem");
+
+ BcfgLibraryRegisterBcfgCommand (ImageHandle, SystemTable, L"Debug1");
return (EFI_SUCCESS);
}
@@ -100,14 +100,13 @@ UefiShellDebug1CommandsLibDestructor (
)
{
if (gShellDebug1HiiHandle != NULL) {
- HiiRemovePackages(gShellDebug1HiiHandle);
+ HiiRemovePackages (gShellDebug1HiiHandle);
}
- BcfgLibraryUnregisterBcfgCommand(ImageHandle, SystemTable);
+ BcfgLibraryUnregisterBcfgCommand (ImageHandle, SystemTable);
return (EFI_SUCCESS);
}
-
/**
Function returns a system configuration table that is stored in the
EFI System Table based on the provided GUID.
@@ -120,11 +119,12 @@ UefiShellDebug1CommandsLibDestructor (
**/
EFI_STATUS
GetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
+ IN EFI_GUID *TableGuid,
+ IN OUT VOID **Table
)
{
- UINTN Index;
+ UINTN Index;
+
ASSERT (Table != NULL);
for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
@@ -146,13 +146,13 @@ GetSystemConfigurationTable (
**/
VOID
EditorClearLine (
- IN UINTN Row,
- IN UINTN LastCol,
- IN UINTN LastRow
+ IN UINTN Row,
+ IN UINTN LastCol,
+ IN UINTN LastRow
)
{
- UINTN Col;
- CHAR16 Line[200];
+ UINTN Col;
+ CHAR16 Line[200];
if (Row == 0) {
Row = 1;
@@ -180,7 +180,7 @@ EditorClearLine (
//
// print out the blank line
//
- ShellPrintEx ((INT32) Col - 1, (INT32) Row - 1, Line);
+ ShellPrintEx ((INT32)Col - 1, (INT32)Row - 1, Line);
}
}
@@ -194,13 +194,13 @@ EditorClearLine (
**/
BOOLEAN
IsValidFileNameChar (
- IN CONST CHAR16 Ch
+ IN CONST CHAR16 Ch
)
{
//
// See if there are any illegal characters within the name
//
- if (Ch < 0x20 || Ch == L'\"' || Ch == L'*' || Ch == L'/' || Ch == L'<' || Ch == L'>' || Ch == L'?' || Ch == L'|') {
+ if ((Ch < 0x20) || (Ch == L'\"') || (Ch == L'*') || (Ch == L'/') || (Ch == L'<') || (Ch == L'>') || (Ch == L'?') || (Ch == L'|')) {
return FALSE;
}
@@ -217,25 +217,25 @@ IsValidFileNameChar (
**/
BOOLEAN
IsValidFileName (
- IN CONST CHAR16 *Name
+ IN CONST CHAR16 *Name
)
{
-
- UINTN Index;
- UINTN Len;
+ UINTN Index;
+ UINTN Len;
//
// check the length of Name
//
for (Len = 0, Index = StrLen (Name) - 1; Index + 1 != 0; Index--, Len++) {
- if (Name[Index] == '\\' || Name[Index] == ':') {
+ if ((Name[Index] == '\\') || (Name[Index] == ':')) {
break;
}
}
- if (Len == 0 || Len > 255) {
+ if ((Len == 0) || (Len > 255)) {
return FALSE;
}
+
//
// check whether any char in Name not appears in valid file name char
//
@@ -258,14 +258,14 @@ IsValidFileName (
**/
CHAR16 *
EditGetDefaultFileName (
- IN CONST CHAR16 *Extension
+ IN CONST CHAR16 *Extension
)
{
- EFI_STATUS Status;
- UINTN Suffix;
- CHAR16 *FileNameTmp;
+ EFI_STATUS Status;
+ UINTN Suffix;
+ CHAR16 *FileNameTmp;
- Suffix = 0;
+ Suffix = 0;
do {
FileNameTmp = CatSPrint (NULL, L"NewFile%d.%s", Suffix, Extension);
@@ -311,27 +311,27 @@ EditGetDefaultFileName (
**/
EFI_STATUS
ReadFileIntoBuffer (
- IN CONST CHAR16 *FileName,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL,
- OUT BOOLEAN *ReadOnly
+ IN CONST CHAR16 *FileName,
+ OUT VOID **Buffer,
+ OUT UINTN *BufferSize OPTIONAL,
+ OUT BOOLEAN *ReadOnly
)
{
- VOID *InternalBuffer;
- UINTN FileSize;
- SHELL_FILE_HANDLE FileHandle;
- BOOLEAN CreateFile;
- EFI_STATUS Status;
- EFI_FILE_INFO *Info;
-
- InternalBuffer = NULL;
- FileSize = 0;
- FileHandle = NULL;
- CreateFile = FALSE;
- Status = EFI_SUCCESS;
- Info = NULL;
-
- if (FileName == NULL || Buffer == NULL || ReadOnly == NULL) {
+ VOID *InternalBuffer;
+ UINTN FileSize;
+ SHELL_FILE_HANDLE FileHandle;
+ BOOLEAN CreateFile;
+ EFI_STATUS Status;
+ EFI_FILE_INFO *Info;
+
+ InternalBuffer = NULL;
+ FileSize = 0;
+ FileHandle = NULL;
+ CreateFile = FALSE;
+ Status = EFI_SUCCESS;
+ Info = NULL;
+
+ if ((FileName == NULL) || (Buffer == NULL) || (ReadOnly == NULL)) {
return (EFI_INVALID_PARAMETER);
}
@@ -340,13 +340,13 @@ ReadFileIntoBuffer (
//
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (!EFI_ERROR(Status)) {
- ASSERT(CreateFile == FALSE);
+ if (!EFI_ERROR (Status)) {
+ ASSERT (CreateFile == FALSE);
if (FileHandle == NULL) {
return EFI_LOAD_ERROR;
}
- Info = ShellGetFileInfo(FileHandle);
+ Info = ShellGetFileInfo (FileHandle);
if (Info->Attribute & EFI_FILE_DIRECTORY) {
FreePool (Info);
@@ -358,10 +358,11 @@ ReadFileIntoBuffer (
} else {
*ReadOnly = FALSE;
}
+
//
// get file size
//
- FileSize = (UINTN) Info->FileSize;
+ FileSize = (UINTN)Info->FileSize;
FreePool (Info);
} else if (Status == EFI_NOT_FOUND) {
@@ -379,10 +380,12 @@ ReadFileIntoBuffer (
if (Status == EFI_WARN_DELETE_FAILURE) {
Status = EFI_ACCESS_DENIED;
}
+
if (EFI_ERROR (Status)) {
return Status;
}
}
+
//
// file doesn't exist, so set CreateFile to TRUE and can't be read-only
//
@@ -401,21 +404,23 @@ ReadFileIntoBuffer (
if (InternalBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
//
// read file into InternalBuffer
//
Status = ShellReadFile (FileHandle, &FileSize, InternalBuffer);
- ShellCloseFile(&FileHandle);
+ ShellCloseFile (&FileHandle);
FileHandle = NULL;
if (EFI_ERROR (Status)) {
SHELL_FREE_NON_NULL (InternalBuffer);
return EFI_LOAD_ERROR;
}
}
+
*Buffer = InternalBuffer;
if (BufferSize != NULL) {
*BufferSize = FileSize;
}
- return (EFI_SUCCESS);
+ return (EFI_SUCCESS);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
index 082d488cb2..e738b34490 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
@@ -51,8 +51,7 @@
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
-
-extern EFI_HII_HANDLE gShellDebug1HiiHandle;
+extern EFI_HII_HANDLE gShellDebug1HiiHandle;
/**
Function returns a system configuration table that is stored in the
@@ -66,8 +65,8 @@ extern EFI_HII_HANDLE gShellDebug1HiiHandle;
**/
EFI_STATUS
GetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
+ IN EFI_GUID *TableGuid,
+ IN OUT VOID **Table
);
/**
@@ -313,9 +312,9 @@ ShellCommandRunHexEdit (
**/
VOID
EditorClearLine (
- IN UINTN Row,
- IN UINTN LastCol,
- IN UINTN LastRow
+ IN UINTN Row,
+ IN UINTN LastCol,
+ IN UINTN LastRow
);
/**
@@ -328,7 +327,7 @@ EditorClearLine (
**/
BOOLEAN
IsValidFileName (
- IN CONST CHAR16 *Name
+ IN CONST CHAR16 *Name
);
/**
@@ -341,7 +340,7 @@ IsValidFileName (
**/
CHAR16 *
EditGetDefaultFileName (
- IN CONST CHAR16 *Extension
+ IN CONST CHAR16 *Extension
);
/**
@@ -368,10 +367,10 @@ EditGetDefaultFileName (
**/
EFI_STATUS
ReadFileIntoBuffer (
- IN CONST CHAR16 *FileName,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL,
- OUT BOOLEAN *ReadOnly
+ IN CONST CHAR16 *FileName,
+ OUT VOID **Buffer,
+ OUT UINTN *BufferSize OPTIONAL,
+ OUT BOOLEAN *ReadOnly
);
#endif