diff options
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib')
29 files changed, 1436 insertions, 87 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c index e94236d..26d6653 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c @@ -280,7 +280,13 @@ ShellCommandRunComp ( ShellStatus = SHELL_INVALID_PARAMETER;
} else {
TempParam = ShellCommandLineGetRawValue (Package, 1);
- ASSERT (TempParam != NULL);
+ if (TempParam == NULL) {
+ ASSERT (TempParam != NULL);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"comp", TempParam);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Exit;
+ }
+
FileName1 = ShellFindFilePath (TempParam);
if (FileName1 == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
@@ -294,7 +300,13 @@ ShellCommandRunComp ( }
TempParam = ShellCommandLineGetRawValue (Package, 2);
- ASSERT (TempParam != NULL);
+ if (TempParam == NULL) {
+ ASSERT (TempParam != NULL);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"comp", TempParam);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Exit;
+ }
+
FileName2 = ShellFindFilePath (TempParam);
if (FileName2 == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
@@ -367,7 +379,7 @@ ShellCommandRunComp ( }
if (ShellStatus == SHELL_SUCCESS) {
- while (DiffPointNumber < DifferentCount) {
+ while ((UINT64)DiffPointNumber < DifferentCount) {
DataSizeFromFile1 = 1;
DataSizeFromFile2 = 1;
OneByteFromFile1 = 0;
@@ -499,6 +511,7 @@ ShellCommandRunComp ( ShellCommandLineFreeVarList (Package);
}
+Exit:
SHELL_FREE_NON_NULL (FileName1);
SHELL_FREE_NON_NULL (FileName2);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c index 5329b55..a9aa483 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dblk.c @@ -111,6 +111,8 @@ ShellCommandRunDblk ( UINT64 BlockCount;
EFI_DEVICE_PATH_PROTOCOL *DevPath;
+ Lba = 0;
+ BlockCount = 0;
ShellStatus = SHELL_SUCCESS;
Status = EFI_SUCCESS;
@@ -186,7 +188,7 @@ ShellCommandRunDblk ( //
// do the work if we have a valid block identifier
//
- if (gEfiShellProtocol->GetDevicePathFromMap (BlockName) == NULL) {
+ if ((BlockName == NULL) || (gEfiShellProtocol->GetDevicePathFromMap (BlockName) == NULL)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c index 046cfd5..37bccea 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c @@ -192,6 +192,8 @@ GetImageExecutionInfo ( ptr = (CHAR8 *)ExecInfoTablePtr + 1;
+ Status = EFI_NOT_FOUND;
+
for (Image = 0; Image < *NumberOfImages; Image++, ptr += InfoPtr->InfoSize) {
InfoPtr = (EFI_IMAGE_EXECUTION_INFO *)ptr;
ImagePath = (CHAR16 *)(InfoPtr + 1);
@@ -287,6 +289,7 @@ DisplayConformanceProfiles ( UINTN Profile;
EFI_CONFORMANCE_PROFILES_TABLE *ConfProfTable;
+ Status = EFI_SUCCESS;
ShellStatus = SHELL_SUCCESS;
if (Address != 0) {
@@ -488,6 +491,11 @@ ShellCommandRunDmem ( continue;
}
+ if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gFdtTableGuid)) {
+ DtbTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
+ continue;
+ }
+
if (CompareGuid (&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMemoryAttributesTableGuid)) {
MemoryAttributesTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue;
@@ -571,19 +579,19 @@ ShellCommandRunDmem ( HiiDatabaseExportBufferAddress,
ConformanceProfileTableAddress
);
- }
- if (ShellCommandLineGetFlag (Package, L"-verbose")) {
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
- }
+ if (ShellCommandLineGetFlag (Package, L"-verbose")) {
+ if (ShellStatus == SHELL_SUCCESS) {
+ ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
+ }
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
- }
+ if (ShellStatus == SHELL_SUCCESS) {
+ ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
+ }
- if (ShellStatus == SHELL_SUCCESS) {
- ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress);
+ if (ShellStatus == SHELL_SUCCESS) {
+ ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress);
+ }
}
}
} else {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c index 975db0a..b81099c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c @@ -448,7 +448,11 @@ CascadeProcessVariables ( StrnCatGrow (&FoundVarName, &NameSize, PrevName, 0);
} else {
FoundVarName = AllocateZeroPool (sizeof (CHAR16));
- NameSize = sizeof (CHAR16);
+ if (FoundVarName == NULL) {
+ return (SHELL_OUT_OF_RESOURCES);
+ }
+
+ NameSize = sizeof (CHAR16);
}
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c index f5edc1b..144007a 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c @@ -101,8 +101,14 @@ ShellCommandRunEdit ( //
if (ShellCommandLineGetCount (Package) == 2) {
TempParam = ShellCommandLineGetRawValue (Package, 1);
- ASSERT (TempParam != NULL);
- FileBufferSetFileName (TempParam);
+ if (TempParam == NULL) {
+ ASSERT (TempParam != NULL);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"edit");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ 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)) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c index 088030d..119cf37 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/FileBuffer.c @@ -478,6 +478,7 @@ FileBufferPrintLine ( {
CHAR16 *Buffer;
UINTN Limit;
+ UINTN PadLength;
CHAR16 *PrintLine;
CHAR16 *PrintLine2;
UINTN BufLen;
@@ -496,8 +497,9 @@ FileBufferPrintLine ( PrintLine = AllocatePool (BufLen);
if (PrintLine != NULL) {
StrnCpyS (PrintLine, BufLen/sizeof (CHAR16), Buffer, MIN (Limit, MainEditor.ScreenSize.Column));
- for (Limit = StrLen (PrintLine); Limit < MainEditor.ScreenSize.Column; Limit++) {
- PrintLine[Limit] = L' ';
+ if (StrLen (PrintLine) < MainEditor.ScreenSize.Column) {
+ PadLength = MainEditor.ScreenSize.Column - StrLen (PrintLine);
+ SetMem16 (&PrintLine[StrLen (PrintLine)], PadLength * sizeof (CHAR16), L' ');
}
PrintLine[MainEditor.ScreenSize.Column] = CHAR_NULL;
@@ -3104,17 +3106,13 @@ FileBufferReplace ( // set replace into it
//
Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
+ CopyMem (Buffer, Replace, ReplaceLen * sizeof (CHAR16));
}
if (ReplaceLen < SearchLen) {
Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
+ CopyMem (Buffer, Replace, ReplaceLen * sizeof (CHAR16));
Buffer += ReplaceLen;
Gap = SearchLen - ReplaceLen;
@@ -3130,9 +3128,7 @@ FileBufferReplace ( if (ReplaceLen == SearchLen) {
Buffer = FileBuffer.CurrentLine->Buffer + FileBuffer.FilePosition.Column - 1;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = Replace[Index];
- }
+ CopyMem (Buffer, Replace, ReplaceLen * sizeof (CHAR16));
}
FileBuffer.CurrentLine->Size += (ReplaceLen - SearchLen);
@@ -3322,9 +3318,7 @@ FileBufferReplaceAll ( // set replace into it
//
Buffer = Line->Buffer + Position;
- for (Index = 0; Index < ReplaceLen; Index++) {
- Buffer[Index] = ReplaceStr[Index];
- }
+ CopyMem (Buffer, ReplaceStr, ReplaceLen * sizeof (CHAR16));
Line->Size += (ReplaceLen - SearchLen);
Column += ReplaceLen;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c index 58beaaf..f3ea384 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c @@ -1378,7 +1378,9 @@ MainCommandDisplayHelp ( //
for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) {
InfoString = HiiGetString (gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL);
- ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
+ if (InfoString != NULL) {
+ ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
+ }
}
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c index 3284f0c..c9eace1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EditMenuBar.c @@ -107,6 +107,9 @@ MenuBarRefresh ( //
for (Item = MenuItems; Item != NULL && Item->Function != NULL; Item++) {
NameString = HiiGetString (gShellDebug1HiiHandle, Item->NameToken, NULL);
+ if (NameString == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
Width = MAX ((StrLen (NameString) + 6), 20);
if (((Col + Width) > LastCol)) {
@@ -115,6 +118,10 @@ MenuBarRefresh ( }
FunctionKeyString = HiiGetString (gShellDebug1HiiHandle, Item->FunctionKeyToken, NULL);
+ if (FunctionKeyString == NULL) {
+ FreePool (NameString);
+ return EFI_INVALID_PARAMETER;
+ }
ShellPrintEx ((INT32)(Col) - 1, (INT32)(Row) - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c index d581a33..ea190d0 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c @@ -48,6 +48,7 @@ ShellCommandRunEfiCompress ( InShellFileHandle = NULL;
OutShellFileHandle = NULL;
InBuffer = NULL;
+ Package = NULL;
//
// initialize the shell lib (we must be in non-auto-init...)
@@ -79,10 +80,16 @@ ShellCommandRunEfiCompress ( ShellStatus = SHELL_INVALID_PARAMETER;
} else {
TempParam = ShellCommandLineGetRawValue (Package, 1);
- ASSERT (TempParam != NULL);
+ if (TempParam == NULL) {
+ ASSERT (TempParam != NULL);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"eficompress");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Exit;
+ }
+
InFileName = ShellFindFilePath (TempParam);
OutFileName = ShellCommandLineGetRawValue (Package, 2);
- if (InFileName == NULL) {
+ if ((InFileName == NULL) || (OutFileName == NULL)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
@@ -150,6 +157,11 @@ ShellCommandRunEfiCompress ( ShellCommandLineFreeVarList (Package);
}
+Exit:
+ if ((ShellStatus != SHELL_SUCCESS) && (Package != NULL)) {
+ ShellCommandLineFreeVarList (Package);
+ }
+
if (InShellFileHandle != NULL) {
gEfiShellProtocol->CloseFile (InShellFileHandle);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c index 72f8c08..37f19a1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiDecompress.c @@ -85,10 +85,16 @@ ShellCommandRunEfiDecompress ( ShellStatus = SHELL_INVALID_PARAMETER;
} else {
TempParam = ShellCommandLineGetRawValue (Package, 1);
- ASSERT (TempParam != NULL);
+ if (TempParam == NULL) {
+ ASSERT (TempParam != NULL);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"efidecompress");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
InFileName = ShellFindFilePath (TempParam);
OutFileName = ShellCommandLineGetRawValue (Package, 2);
- if (InFileName == NULL) {
+ if ((InFileName == NULL) || (OutFileName == NULL)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
@@ -112,13 +118,25 @@ ShellCommandRunEfiDecompress ( if (ShellStatus == SHELL_SUCCESS) {
Status = FileHandleGetSize (InFileHandle, &Temp64Bit);
- ASSERT_EFI_ERROR (Status);
- if (!EFI_ERROR (Status)) {
- ASSERT (Temp64Bit <= (UINT32)(-1));
- InSize = (UINTN)Temp64Bit;
- InBuffer = AllocateZeroPool (InSize);
+ 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) {
+ //
+ // Limit the File Size to UINT32, even though calls accept UINTN.
+ // 32 bits = 4gb.
+ //
+ Status = SafeUint64ToUint32 (Temp64Bit, (UINT32 *)&InSize);
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ ShellStatus = SHELL_BAD_BUFFER_SIZE;
+ goto Done;
}
+ InBuffer = AllocateZeroPool (InSize);
if (InBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {
@@ -166,6 +184,8 @@ ShellCommandRunEfiDecompress ( }
}
+Done:
+
ShellCommandLineFreeVarList (Package);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c index be77e31..d38726b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c @@ -142,9 +142,8 @@ HBufferImageBackup ( VOID
)
{
- HBufferImageBackupVar.MousePosition = HBufferImage.MousePosition;
-
- HBufferImageBackupVar.BufferPosition = HBufferImage.BufferPosition;
+ CopyMem (&HBufferImageBackupVar.MousePosition, &HBufferImage.MousePosition, sizeof (HBufferImage.MousePosition));
+ CopyMem (&HBufferImageBackupVar.BufferPosition, &HBufferImage.BufferPosition, sizeof (HBufferImage.BufferPosition));
HBufferImageBackupVar.Modified = HBufferImage.Modified;
@@ -569,7 +568,7 @@ HBufferImageRestoreMousePosition ( //
// backup the old screen attributes
//
- Orig = HMainEditor.ColorAttributes;
+ CopyMem (&Orig, &HMainEditor.ColorAttributes, sizeof (Orig));
New.Data = 0;
New.Colors.Foreground = Orig.Colors.Background & 0xF;
New.Colors.Background = Orig.Colors.Foreground & 0x7;
@@ -1955,17 +1954,13 @@ HBufferImageDeleteCharacterFromBuffer ( // pass deleted buffer out
//
if (DeleteBuffer != NULL) {
- for (Index = 0; Index < Count; Index++) {
- DeleteBuffer[Index] = BufferPtr[Pos + Index];
- }
+ CopyMem (&DeleteBuffer[0], &BufferPtr[Pos], Count);
}
//
// delete the part from Pos
//
- for (Index = Pos; Index < Size - Count; Index++) {
- BufferPtr[Index] = BufferPtr[Index + Count];
- }
+ CopyMem (&BufferPtr[Pos], &BufferPtr[Pos + Count], Size - Count - Pos);
Size -= Count;
@@ -2069,16 +2064,12 @@ HBufferImageAddCharacterToBuffer ( //
// get a place to add
//
- for (Index = (INTN)(Size + Count - 1); Index >= (INTN)Pos; Index--) {
- BufferPtr[Index] = BufferPtr[Index - Count];
- }
+ CopyMem (&BufferPtr[Pos], &BufferPtr[Pos - Count], Size - Pos + Count);
//
// add the buffer
//
- for (Index = (INTN)0; Index < (INTN)Count; Index++) {
- BufferPtr[Index + Pos] = AddBuffer[Index];
- }
+ CopyMem (&BufferPtr[Pos], AddBuffer, Count);
Size += Count;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c index d8818dd..3b18241 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c @@ -371,6 +371,10 @@ HFileImageSave ( // set status string
//
Str = CatSPrint (NULL, L"%d Lines Written", NumLines);
+ if (Str == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
StatusBarSetStatusString (Str);
FreePool (Str);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c index 0eb917a..51e4ae2 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c @@ -115,7 +115,11 @@ HMainCommandDisplayHelp ( ,
NULL
);
- ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
+ if (InfoString != NULL) {
+ ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
+ } else {
+ ASSERT (FALSE);
+ }
}
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c index 852d6dc..40260ea 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/LoadPciRom.c @@ -302,6 +302,11 @@ LoadEfiDriversFromRomImage ( );
if (!EFI_ERROR (Status)) {
DecompressedImageBuffer = AllocateZeroPool (DestinationSize);
+ if (DecompressedImageBuffer == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"loadpcirom");
+ return EFI_OUT_OF_RESOURCES;
+ }
+
if (ImageBuffer != NULL) {
Scratch = AllocateZeroPool (ScratchSize);
if (Scratch != NULL) {
@@ -333,6 +338,11 @@ LoadEfiDriversFromRomImage ( //
UnicodeSPrint (RomFileName, sizeof (RomFileName), L"%s[%d]", FileName, ImageIndex);
FilePath = FileDevicePath (NULL, RomFileName);
+ if (FilePath == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
+ SHELL_FREE_NON_NULL (DecompressedImageBuffer);
+ return EFI_OUT_OF_RESOURCES;
+ }
Status = gBS->LoadImage (
TRUE,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c index a089953..3f4cada 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/MemMap.c @@ -214,7 +214,13 @@ ShellCommandRunMemMap ( if (Status == EFI_BUFFER_TOO_SMALL) {
Size += SIZE_1KB;
Descriptors = AllocateZeroPool (Size);
- Status = gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
+ if (Descriptors == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"memmap");
+ ShellCommandLineFreeVarList (Package);
+ return SHELL_OUT_OF_RESOURCES;
+ }
+
+ Status = gBS->GetMemoryMap (&Size, Descriptors, &MapKey, &ItemSize, &Version);
}
if (EFI_ERROR (Status)) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c index b75e2f4..cff2c9d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c @@ -537,7 +537,13 @@ ShellCommandRunMm ( goto Done;
}
- Temp = ShellCommandLineGetRawValue (Package, 1);
+ Temp = ShellCommandLineGetRawValue (Package, 1);
+ if (Temp == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mm", L"NULL");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
Status = ShellConvertStringToUint64 (Temp, &Address, TRUE, FALSE);
if (EFI_ERROR (Status)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mm", Temp);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c index d907ddd..c0e2886 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mode.c @@ -67,14 +67,20 @@ ShellCommandRunMode ( ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount (Package) == 3) {
Temp = ShellCommandLineGetRawValue (Package, 1);
- if (!ShellIsHexOrDecimalNumber (Temp, FALSE, FALSE)) {
+ if (Temp == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else 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)) {
+ if (Temp == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else if (!ShellIsHexOrDecimalNumber (Temp, FALSE, FALSE)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c index 9362273..72b6e88 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c @@ -5765,7 +5765,7 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation ( )
{
CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *Header;
- UINT8 LinkCount;
+ UINT32 LinkCount;
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *)HeaderAddress;
@@ -5780,7 +5780,7 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation ( Header->DpaStatus,
Header->DpaControl
);
- for (LinkCount = 0; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX (Header) + 1; LinkCount++) {
+ for (LinkCount = 0; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX (Header) + (UINT32)1; LinkCount++) {
ShellPrintHiiEx (
-1,
-1,
@@ -6127,6 +6127,959 @@ PrintInterpretedExtendedCompatibilitySecondary ( }
/**
+ Function to interpret and print out the ATS structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityAts (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ATS *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ATS *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ATS),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint16,
+ Header->Control.Uint16
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_ATS),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the SR-IOV structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilitySriov (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST SR_IOV_CAPABILITY_REGISTER *Header;
+
+ Header = (SR_IOV_CAPABILITY_REGISTER *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_SRIOV),
+ gShellDebug1HiiHandle,
+ Header->Capability,
+ Header->Control,
+ Header->Status,
+ Header->InitialVFs,
+ Header->TotalVFs,
+ Header->NumVFs,
+ Header->FunctionDependencyLink,
+ Header->FirstVFOffset,
+ Header->VFStride,
+ Header->VFDeviceID,
+ Header->SupportedPageSize,
+ Header->SystemPageSize
+ );
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_SRIOV_BARS),
+ gShellDebug1HiiHandle,
+ Header->VFBar[0],
+ Header->VFBar[1],
+ Header->VFBar[2],
+ Header->VFBar[3],
+ Header->VFBar[4],
+ Header->VFBar[5],
+ Header->VFMigrationStateArrayOffset
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (SR_IOV_CAPABILITY_REGISTER),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the PRI structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityPri (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_PRI *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_PRI *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PRI),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint32,
+ Header->Control.Uint32,
+ Header->Status.Uint32
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_PRI),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the PASID structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityPasid (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PASID),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint16,
+ Header->Control.Uint16
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_PASID),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the L1 PM Substates structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityL1PmSubstates (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_L1_PM_SUBSTATES *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_L1_PM_SUBSTATES *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_L1_PM_SUBSTATES),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint32,
+ Header->Control1.Uint32,
+ Header->Control2.Uint32
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_L1_PM_SUBSTATES),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Designated Vendor-Specific structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityDesignatedVendorSpecific (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DESIGNATED_VENDOR_SPECIFIC *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DESIGNATED_VENDOR_SPECIFIC *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DESIGNATED_VENDOR_SPECIFIC),
+ gShellDebug1HiiHandle,
+ Header->DesignatedVendorSpecificHeader1.Bits.DvsecVendorId,
+ Header->DesignatedVendorSpecificHeader1.Bits.DvsecRevision,
+ Header->DesignatedVendorSpecificHeader2.Bits.DvsecId,
+ Header->DesignatedVendorSpecificHeader1.Bits.DvsecLength
+ );
+
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN Size;
+
+ if (NextCapOffset == 0) {
+ // The DVSEC length field plus the PCI Express header
+ Size = sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER) +
+ Header->DesignatedVendorSpecificHeader1.Bits.DvsecLength;
+ } else {
+ Size = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ }
+
+ // Dump the entire structure including the variable-length vendor specific data
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ Size,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the VF Resizable BAR structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityVfResizableBar (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VF_RESIZABLE_BAR *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VF_RESIZABLE_BAR *)HeaderAddress;
+
+ // Calculate how many entries exist
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN TotalSize;
+ UINTN HeaderSize = sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER);
+ UINTN EntrySize = sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_VF_RESIZABLE_BAR_ENTRY);
+ UINTN EntryCount;
+
+ if (NextCapOffset == 0) {
+ // The VF Resizable BAR capability has at least one entry by definition
+ EntryCount = 1;
+ TotalSize = HeaderSize + (EntryCount * EntrySize);
+ } else {
+ // Calculate size based on offset to next capability
+ TotalSize = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ // Calculate number of entries (usable size divided by entry size)
+ EntryCount = (TotalSize - HeaderSize) / EntrySize;
+ // Ensure we have at least one entry
+ if (EntryCount == 0) {
+ EntryCount = 1;
+ }
+ }
+
+ // Print header
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_HEADER),
+ gShellDebug1HiiHandle
+ );
+
+ // Print each entry
+ for (UINTN Index = 0; Index < EntryCount; Index++) {
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_ENTRY),
+ gShellDebug1HiiHandle,
+ Index,
+ Header->Capability[Index].VfResizableBarCapability.Uint32,
+ Header->Capability[Index].VfResizableBarControl.Uint32
+ );
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_DETAILS),
+ gShellDebug1HiiHandle,
+ Header->Capability[Index].VfResizableBarCapability.Bits.VfBarSizeCapability,
+ Header->Capability[Index].VfResizableBarControl.Bits.VfBarIndex,
+ Header->Capability[Index].VfResizableBarControl.Bits.VfResizableBarNumber,
+ Header->Capability[Index].VfResizableBarControl.Bits.VfBarSize,
+ Header->Capability[Index].VfResizableBarControl.Bits.VfBarSizeCapability
+ );
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ HeaderSize + EntryCount * EntrySize,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Data Link Feature structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityDataLinkFeature (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_LINK_FEATURE *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_LINK_FEATURE *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DATA_LINK_FEATURE),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint32,
+ Header->Control.Uint32
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_LINK_FEATURE),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Physical Layer 16.0 GT/s structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityPhysicalLayer16 (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ // Cast to the proper structure type
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_16_0 *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_16_0 *)HeaderAddress;
+
+ // Print the basic capability information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_16),
+ gShellDebug1HiiHandle,
+ Header->Capablities.Uint32,
+ Header->Control.Uint32,
+ Header->Status.Uint32
+ );
+
+ // Print detailed status bits
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_16_STATUS),
+ gShellDebug1HiiHandle,
+ Header->Status.Bits.EqualizationComplete,
+ Header->Status.Bits.EqualizationPhase1Success,
+ Header->Status.Bits.EqualizationPhase2Success,
+ Header->Status.Bits.EqualizationPhase3Success,
+ Header->Status.Bits.LinkEqualizationRequest
+ );
+
+ // Print data parity status registers
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_16_PARITY),
+ gShellDebug1HiiHandle,
+ Header->LocalDataParityMismatchStatus,
+ Header->FirstRetimerDataParityMismatchStatus,
+ Header->SecondRetimerDataParityMismatchStatus
+ );
+
+ // Calculate the size for DumpHex
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN Size;
+
+ if (NextCapOffset == 0) {
+ UINTN SpecMaxLanes = 16;
+
+ Size = PCI_EXPRESS_REG_PHYSICAL_LAYER_16_0_LANE_EQUALIZATION_CONTROL_OFFSET +
+ (SpecMaxLanes * sizeof (PCI_EXPRESS_REG_PHYSICAL_LAYER_16_0_LANE_EQUALIZATION_CONTROL));
+ } else {
+ // Calculate size based on offset to next capability
+ Size = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ Size,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Lane Margining at the Receiver structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityLaneMargining (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_LANE_MARGINING_AT_RECEIVER *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LANE_MARGINING_AT_RECEIVER *)HeaderAddress;
+
+ // Print raw register values
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LANE_MARGINING),
+ gShellDebug1HiiHandle,
+ Header->Capability.Uint8,
+ Header->Control.Uint8,
+ Header->Status.Uint8,
+ Header->ErrorCounter
+ );
+
+ // Print decoded capability information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LANE_MARGINING_CAPABILITY),
+ gShellDebug1HiiHandle,
+ Header->Capability.Bits.MaxLaneNumber
+ );
+
+ // Print decoded control information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LANE_MARGINING_CONTROL),
+ gShellDebug1HiiHandle,
+ Header->Control.Bits.LaneNumber,
+ Header->Control.Bits.RcvErrorCounterSelect,
+ Header->Control.Bits.LaneMarginStepSelect
+ );
+
+ // Print decoded status information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LANE_MARGINING_STATUS),
+ gShellDebug1HiiHandle,
+ Header->Status.Bits.MaxLanesReceivingTestPattern
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_LANE_MARGINING_AT_RECEIVER),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Physical Layer 32.0 GT/s structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityPhysicalLayer32 (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ // Use the proper structure definition from the header file
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_32_0 *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_32_0 *)HeaderAddress;
+
+ // Print the basic capability information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_32),
+ gShellDebug1HiiHandle,
+ Header->Capablities.Uint32,
+ Header->Control.Uint32,
+ Header->Status.Uint32
+ );
+
+ // Print capabilities details
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_CAPABILITIES),
+ gShellDebug1HiiHandle,
+ Header->Capablities.Bits.EqualizationByPassToHighestRateSupport,
+ Header->Capablities.Bits.NoEqualizationNeededSupport,
+ Header->Capablities.Bits.ModifiedTSUsageMode0Support,
+ Header->Capablities.Bits.ModifiedTSUsageMode1Support,
+ Header->Capablities.Bits.ModifiedTSUsageMode2Support
+ );
+
+ // Print control details
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_CONTROL),
+ gShellDebug1HiiHandle,
+ Header->Control.Bits.EqualizationByPassToHighestRateDisable,
+ Header->Control.Bits.NoEqualizationNeededDisable,
+ Header->Control.Bits.ModifiedTSUsageModeSelected
+ );
+
+ // Print status details
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_STATUS),
+ gShellDebug1HiiHandle,
+ Header->Status.Bits.EqualizationComplete,
+ Header->Status.Bits.EqualizationPhase1Success,
+ Header->Status.Bits.EqualizationPhase2Success,
+ Header->Status.Bits.EqualizationPhase3Success,
+ Header->Status.Bits.LinkEqualizationRequest,
+ Header->Status.Bits.ModifiedTSRcvd,
+ Header->Status.Bits.RcvdEnhancedLinkControl,
+ Header->Status.Bits.TransmitterPrecodingOn,
+ Header->Status.Bits.TransmitterPrecodeRequest,
+ Header->Status.Bits.NoEqualizationNeededRcvd
+ );
+
+ // Print Modified TS Data
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_TS_DATA),
+ gShellDebug1HiiHandle,
+ Header->RcvdModifiedTs1Data.Uint32,
+ Header->RcvdModifiedTs2Data.Uint32,
+ Header->TransModifiedTs1Data.Uint32,
+ Header->TransModifiedTs2Data.Uint32
+ );
+
+ // Calculate the size for DumpHex
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN Size;
+
+ if (NextCapOffset == 0) {
+ UINTN SpecMaxLanes = 16;
+
+ Size = PCI_EXPRESS_REG_PHYSICAL_LAYER_32_0_LANE_EQUALIZATION_CONTROL_OFFSET +
+ (SpecMaxLanes * sizeof (PCI_EXPRESS_REG_PHYSICAL_LAYER_32_0_LANE_EQUALIZATION_CONTROL));
+ } else {
+ // Calculate size based on offset to next capability
+ Size = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ Size,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Alternate Protocol structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityAlternateProtocol (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ALTERNATE_PROTOCOL *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ALTERNATE_PROTOCOL *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ALTERNATE_PROTOCOL),
+ gShellDebug1HiiHandle,
+ Header->AltProtocolCapability,
+ Header->AltProtocolStatus,
+ Header->AltProtocolControl
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_ALTERNATE_PROTOCOL),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Data Object Exchange structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityDataObjectExchange (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_OBJECT_EXCHANGE *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_OBJECT_EXCHANGE *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DATA_OBJECT_EXCHANGE),
+ gShellDebug1HiiHandle,
+ Header->DoeCapabilities,
+ Header->DoeControl,
+ Header->DoeStatus
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_DATA_OBJECT_EXCHANGE),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Device 3 structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityDevice3 (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_DEVICE3 *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DEVICE3 *)HeaderAddress;
+
+ // Print raw register values
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DEVICE3),
+ gShellDebug1HiiHandle,
+ Header->Capabilities.Uint32,
+ Header->Control.Uint32,
+ Header->Status.Uint32
+ );
+
+ // Print detailed capability information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DEVICE3_CAPABILITY),
+ gShellDebug1HiiHandle,
+ Header->Capabilities.Bits.DmwrRequestRouting,
+ Header->Capabilities.Bits.FourteenBitTagCompleter,
+ Header->Capabilities.Bits.FourteenBitTagRequester,
+ Header->Capabilities.Bits.ReceiverL0p,
+ Header->Capabilities.Bits.PortL0pExitLatencyLatency,
+ Header->Capabilities.Bits.RetimerL0pExit
+ );
+
+ // Print detailed control information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DEVICE3_CONTROL),
+ gShellDebug1HiiHandle,
+ Header->Control.Bits.DmwrRequesterEnable,
+ Header->Control.Bits.DmwrEgressBlocking,
+ Header->Control.Bits.FourteenBitTagRequesterEnable,
+ Header->Control.Bits.L0pEnable,
+ Header->Control.Bits.TargetLinkWidth
+ );
+
+ // Print detailed status information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DEVICE3_STATUS),
+ gShellDebug1HiiHandle,
+ Header->Status.Bits.InitialLinkWidth,
+ Header->Status.Bits.SegmentCaptured,
+ Header->Status.Bits.RemoteL0pSupported
+ );
+
+ // Calculate the size for DumpHex
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN Size;
+
+ if (NextCapOffset == 0) {
+ // If this is the last capability, use the fixed size of the structure
+ Size = sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_DEVICE3);
+ } else {
+ // Calculate size based on offset to next capability
+ Size = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ Size,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Integrity and Data Encryption structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityIntegrityEncryption (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_INTEGRITY_DATA_ENCRYPTION *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTEGRITY_DATA_ENCRYPTION *)HeaderAddress;
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_INTEGRITY_ENCRYPTION),
+ gShellDebug1HiiHandle,
+ Header->IdeCapabilities,
+ Header->IdeControl,
+ Header->IdeStatus
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTEGRITY_DATA_ENCRYPTION),
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Physical Layer 64.0 GT/s structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityPhysicalLayer64 (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_64_0 *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_PHYSICAL_LAYER_64_0 *)HeaderAddress;
+
+ // Print the basic capability information
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_64),
+ gShellDebug1HiiHandle,
+ Header->Capablities.Uint32,
+ Header->Control.Uint32,
+ Header->Status.Uint32
+ );
+
+ // Print detailed status bits
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_PHYSICAL_LAYER_64_STATUS),
+ gShellDebug1HiiHandle,
+ Header->Status.Bits.EqualizationComplete,
+ Header->Status.Bits.EqualizationPhase1Success,
+ Header->Status.Bits.EqualizationPhase2Success,
+ Header->Status.Bits.EqualizationPhase3Success,
+ Header->Status.Bits.LinkEqualizationRequest,
+ Header->Status.Bits.TransmitterPrecodingOn,
+ Header->Status.Bits.TransmitterPrecodeRequest,
+ Header->Status.Bits.NoEqualizationNeededRcvd
+ );
+
+ // Calculate the size for DumpHex
+ UINT32 NextCapOffset = HeaderAddress->NextCapabilityOffset;
+ UINTN Size;
+
+ if (NextCapOffset == 0) {
+ UINTN SpecMaxLanes = 16;
+
+ Size = PCI_EXPRESS_REG_PHYSICAL_LAYER_64_0_LANE_EQUALIZATION_CONTROL_OFFSET +
+ (SpecMaxLanes * sizeof (PCI_EXPRESS_REG_PHYSICAL_LAYER_64_0_LANE_EQUALIZATION_CONTROL));
+ } else {
+ // Calculate size based on offset to next capability
+ Size = NextCapOffset - (((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress) & 0xFFF);
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ Size,
+ (VOID *)(HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Flit Logging structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+
+ @retval EFI_SUCCESS The function completed successfully.
+**/
+EFI_STATUS
+PrintInterpretedExtendedCompatibilityFlitLogging (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_FLIT_LOGGING *Header;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_FLIT_LOGGING *)HeaderAddress;
+
+ // Print the Flit Logging capability details
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_PCI_EXT_FLIT_LOGGING),
+ gShellDebug1HiiHandle,
+ Header->FlitLoggingCapabilities,
+ Header->FlitLoggingControl,
+ Header->FlitLoggingStatus,
+ Header->FlitMask,
+ Header->FlitErrorData1,
+ Header->FlitErrorData2,
+ Header->FlitErrorData3
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8 *)HeaderAddress - (UINT8 *)HeadersBaseAddress),
+ sizeof (PCI_EXPRESS_EXTENDED_CAPABILITIES_FLIT_LOGGING),
+ (VOID *)(HeaderAddress)
+ );
+
+ return EFI_SUCCESS;
+}
+
+/**
Display Pcie extended capability details
@param[in] HeadersBaseAddress The address of all the extended capability headers.
@@ -6179,6 +7132,40 @@ PrintPciExtendedCapabilityDetails ( return PrintInterpretedExtendedCompatibilityTph (HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_SECONDARY_PCIE_ID:
return PrintInterpretedExtendedCompatibilitySecondary (HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_ATS_ID:
+ return PrintInterpretedExtendedCompatibilityAts (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_SRIOV_ID:
+ return PrintInterpretedExtendedCompatibilitySriov (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_PRI_ID:
+ return PrintInterpretedExtendedCompatibilityPri (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_PASID_ID:
+ return PrintInterpretedExtendedCompatibilityPasid (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_L1_PM_SUBSTATES_ID:
+ return PrintInterpretedExtendedCompatibilityL1PmSubstates (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_DESIGNATED_VENDOR_SPECIFIC_ID:
+ return PrintInterpretedExtendedCompatibilityDesignatedVendorSpecific (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_VF_RESIZABLE_BAR_ID:
+ return PrintInterpretedExtendedCompatibilityVfResizableBar (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_DATA_LINK_FEATURE_ID:
+ return PrintInterpretedExtendedCompatibilityDataLinkFeature (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_PHYSICAL_LAYER_16_0_ID:
+ return PrintInterpretedExtendedCompatibilityPhysicalLayer16 (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_LANE_MARGINING_AT_RECEIVER_ID:
+ return PrintInterpretedExtendedCompatibilityLaneMargining (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_PHYSICAL_LAYER_32_0_ID:
+ return PrintInterpretedExtendedCompatibilityPhysicalLayer32 (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_ALTERNATE_PROTOCOL_ID:
+ return PrintInterpretedExtendedCompatibilityAlternateProtocol (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_DATA_OBJECT_EXCHANGE_ID:
+ return PrintInterpretedExtendedCompatibilityDataObjectExchange (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_DEVICE3_ID:
+ return PrintInterpretedExtendedCompatibilityDevice3 (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_INTEGRITY_DATA_ENCRYPTION_ID:
+ return PrintInterpretedExtendedCompatibilityIntegrityEncryption (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_PHYSICAL_LAYER_64_0_ID:
+ return PrintInterpretedExtendedCompatibilityPhysicalLayer64 (HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_FLIT_LOGGING_ID:
+ return PrintInterpretedExtendedCompatibilityFlitLogging (HeaderAddress, HeadersBaseAddress);
default:
ShellPrintEx (
-1,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c index 99cc448..a33343d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c @@ -288,7 +288,13 @@ ShellCommandRunSerMode ( goto Done;
}
- Temp = ShellCommandLineGetRawValue (Package, 5);
+ Temp = ShellCommandLineGetRawValue (Package, 5);
+ if (Temp == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
Value = ShellStrToUintn (Temp);
switch (Value) {
case 0:
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c index e5bacde..79c3aaa 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetSize.c @@ -62,7 +62,11 @@ ShellCommandRunSetSize ( NewSize = 0;
} else {
Temp1 = ShellCommandLineGetRawValue (Package, 1);
- if (!ShellIsHexOrDecimalNumber (Temp1, FALSE, FALSE)) {
+ if (Temp1 == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setsize");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ NewSize = 0;
+ } else if (!ShellIsHexOrDecimalNumber (Temp1, FALSE, FALSE)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER;
NewSize = 0;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c index 61788d1..9f8dee2 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c @@ -285,7 +285,10 @@ GetVariableDataFromParameter ( for (Index = 2; Index < ShellCommandLineGetCount (Package); Index++) {
TempData = ShellCommandLineGetRawValue (Package, Index);
- ASSERT (TempData != NULL);
+ if (TempData == NULL) {
+ ASSERT (TempData != NULL);
+ return EFI_INVALID_PARAMETER;
+ }
if (TempData[0] != L'=') {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", TempData);
@@ -401,11 +404,23 @@ ShellCommandRunSetVar ( ShellStatus = SHELL_INVALID_PARAMETER;
} else {
VariableName = ShellCommandLineGetRawValue (Package, 1);
+ if (VariableName == NULL) {
+ ShellCommandLineFreeVarList (Package);
+ return SHELL_INVALID_PARAMETER;
+ }
+
if (!ShellCommandLineGetFlag (Package, L"-guid")) {
CopyGuid (&Guid, &gEfiGlobalVariableGuid);
} else {
StringGuid = ShellCommandLineGetValue (Package, L"-guid");
- RStatus = StrToGuid (StringGuid, &Guid);
+ if (StringGuid != NULL) {
+ RStatus = StrToGuid (StringGuid, &Guid);
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
+ ShellCommandLineFreeVarList (Package);
+ return SHELL_INVALID_PARAMETER;
+ }
+
if (RETURN_ERROR (RStatus) || (StringGuid[GUID_STRING_LENGTH] != L'\0')) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -419,6 +434,12 @@ ShellCommandRunSetVar ( Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
Buffer = AllocateZeroPool (Size);
+ if (Buffer == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"setvar");
+ ShellCommandLineFreeVarList (Package);
+ return SHELL_OUT_OF_RESOURCES;
+ }
+
Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
}
@@ -440,6 +461,12 @@ ShellCommandRunSetVar ( Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
if (Status == EFI_BUFFER_TOO_SMALL) {
Buffer = AllocateZeroPool (Size);
+ if (Buffer == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"setvar");
+ ShellCommandLineFreeVarList (Package);
+ return SHELL_OUT_OF_RESOURCES;
+ }
+
Status = gRT->GetVariable ((CHAR16 *)VariableName, &Guid, &Attributes, &Size, Buffer);
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index 5c4413c..bf68eb1 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -7,6 +7,7 @@ (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023 Apple Inc. All rights reserved.<BR>
Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -520,10 +521,14 @@ SmbiosPrintStructure ( ShellPrintEx (-1, -1, L"Thread Count 2: %u\n", Struct->Type4->ThreadCount2);
}
- if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct->Hdr->Length > 0x2E)) {
+ if (AE_SMBIOS_VERSION (0x3, 0x6) && (Struct->Hdr->Length > 0x30)) {
ShellPrintEx (-1, -1, L"Thread Enabled: %u\n", Struct->Type4->ThreadEnabled);
}
+ if (AE_SMBIOS_VERSION (0x3, 0x8) && (Struct->Hdr->Length > 0x32)) {
+ ShellPrintEx (-1, -1, L"Socket Type: %a\n", LibGetSmbiosString (Struct, Struct->Type4->SocketType));
+ }
+
break;
//
@@ -672,7 +677,7 @@ SmbiosPrintStructure ( {
UINTN NumOfDevice;
NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_STRUCTURE)) / (2 * sizeof (UINT8));
- for (Index = 0; Index < NumOfDevice; Index++) {
+ for (Index = 0; (UINTN)Index < NumOfDevice; Index++) {
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);
@@ -1290,8 +1295,43 @@ SmbiosPrintStructure ( case 42:
DisplayMCHostInterfaceType (Struct->Type42->InterfaceType, Option);
if (AE_SMBIOS_VERSION (0x3, 0x2)) {
+ UINT32 DataValue = 0;
PRINT_STRUCT_VALUE_H (Struct, Type42, InterfaceTypeSpecificDataLength);
- PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
+ if (Struct->Type42->InterfaceTypeSpecificDataLength < 4) {
+ ShellPrintEx (-1, -1, L"WARNING: InterfaceTypeSpecificDataLength should be >= 4.\n");
+ }
+
+ ShellPrintEx (-1, -1, L"InterfaceTypeSpecificData\n");
+ // Decode and interpret InterfaceTypeSpecificData based on the InterfaceType
+ switch (Struct->Type42->InterfaceType) {
+ case MCHostInterfaceTypeOemDefined:
+ // The first four bytes are the vendor ID (MSB first), as assigned by the Internet Assigned Numbers Authority (IANA) as "Enterprise Number".
+ // See https://www.iana.org/assignments/enterprise-numbers.txt
+ ShellPrintEx (-1, -1, L"Vendor ID (IANA Enterprise Number): %d", (UINT32)*(Struct->Type42->InterfaceTypeSpecificData));
+ break;
+
+ // As defined in MCTP Host Interface Specification, DSP0256
+ case MCHostInterfaceTypeMMBI:
+ // For MCTP interface type of MMBI; this defines the pointer to the MMBI capability descriptor, as defined in DSP0282, Section 7.1
+ DataValue = *(UINT32 *)Struct->Type42->InterfaceTypeSpecificData;
+ ShellPrintEx (-1, -1, L"Pointer to MMBI capability descriptor: 0x%x\n", DataValue);
+ break;
+
+ case MCHostInterfaceTypeI2C_SMBUS:
+ case MCHostInterfaceTypeI3C:
+ case MCHostInterfaceTypeKCS:
+ // switch case fall through
+ // For MCTP interface type of I2C, I3C, KCS; this value is reserved and must be 0
+ DataValue = *(UINT32 *)Struct->Type42->InterfaceTypeSpecificData;
+ ShellPrintEx (-1, -1, L"For Interface type I2C, I3C or KCS, InterfaceTypeSpecificData is reserved and must be 0.\n");
+ ShellPrintEx (-1, -1, L"Actual value is : 0x%x\n", DataValue);
+ break;
+
+ default:
+ // The decoding is not defined for these values in SMBIOS 3.8.0. The value is dumped
+ PRINT_BIT_FIELD (Struct, Type42, InterfaceTypeSpecificData, Struct->Type42->InterfaceTypeSpecificDataLength);
+ break;
+ }
}
break;
@@ -2419,6 +2459,10 @@ DisplayProcessorFamily ( Print (L"Intel Core i9 processor\n");
break;
+ case 0xD0:
+ Print (L"Intel Xeon D Processor\n");
+ break;
+
case 0xD2:
Print (L"ViaC7M\n");
break;
@@ -2569,6 +2613,10 @@ DisplayProcessorFamily2 ( Print (L"ARMv8\n");
break;
+ case 0x102:
+ Print (L"ARMv9\n");
+ break;
+
case 0x104:
Print (L"SH-3\n");
break;
@@ -2861,7 +2909,7 @@ DisplayProcessorStatus ( break;
case 3:
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DIABLED_BY_BIOS), gShellDebug1HiiHandle);
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_BIOS), gShellDebug1HiiHandle);
break;
case 4:
@@ -2963,7 +3011,7 @@ DisplayMmBankConnections ( //
// Divide it to high and low
//
- High = (UINT8)(BankConnections & 0xF0);
+ High = (UINT8)((BankConnections & 0xF0)>>4);
Low = (UINT8)(BankConnections & 0x0F);
if (High != 0xF) {
if (Low != 0xF) {
@@ -3173,7 +3221,7 @@ DisplaySystemSlotId ( //
case 0x04:
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN), gShellDebug1HiiHandle);
- if ((SlotId > 0) && (SlotId < 15)) {
+ 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);
@@ -3182,11 +3230,11 @@ DisplaySystemSlotId ( break;
//
- // EISA
+ // Slot Type: EISA
//
case 0x05:
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LOGICAL_EISA_NUM), gShellDebug1HiiHandle);
- if ((SlotId > 0) && (SlotId < 15)) {
+ 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);
@@ -3202,21 +3250,20 @@ DisplaySystemSlotId ( break;
//
- // PCMCIA
+ // Slot Type: PCMCIA
//
case 0x07:
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IDENTIFIES_ADAPTER_NUM), gShellDebug1HiiHandle, SlotId);
break;
//
- // Slot Type: PCI-E
+ // Slot Type: PCI 66MHz Capable, AGP, PCI-E, etc
//
- 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 <= 0xC4))) {
+ if (((SlotType >= 0x0E) && (SlotType <= 0x13)) ||
+ ((SlotType >= 0x1F) && (SlotType <= 0x25)) ||
+ ((SlotType >= 0xA5) && (SlotType <= 0xC6)))
+ {
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);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index 36f8739..30f4846 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c @@ -4,7 +4,7 @@ Copyright (c) 2005 - 2024, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -1924,7 +1924,7 @@ TABLE_ITEM SystemSlotHeightTable[] = { },
{
0x02,
- L" Unkown"
+ L" Unknown"
},
{
0x03,
@@ -2748,6 +2748,10 @@ TABLE_ITEM MemoryDeviceFormFactorTable[] = { {
MemoryFormFactorDie,
L" Die"
+ },
+ {
+ MemoryFormFactorCamm,
+ L" CAMM"
}
};
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c index 7e7eef3..982e20e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c @@ -790,7 +790,7 @@ InitSmbios64BitTableStatistics ( //
Handle = INVALID_HANDLE;
LibGetSmbios64BitStructure (&Handle, NULL, NULL);
- for (Index = 1; Index <= mNumberOfSmbios64BitStructures; Index++) {
+ for (Index = 1; (UINTN)Index <= mNumberOfSmbios64BitStructures; Index++) {
//
// If reach the end of table, break..
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni index d55af31..1f90e40 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni @@ -5,6 +5,7 @@ // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
// (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
// Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+// Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Module Name:
@@ -279,7 +280,7 @@ #string STR_SMBIOSVIEW_PRINTINFO_CPU_SOCKET_UNPOPULATED #language en-US "CPU Socket Unpopulated\r\n"
#string STR_SMBIOSVIEW_PRINTINFO_CPU_ENABLED #language en-US "CPU Enabled\r\n"
#string STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_USER #language en-US "CPU Disabled by User via BIOS Setup\r\n"
-#string STR_SMBIOSVIEW_PRINTINFO_CPU_DIABLED_BY_BIOS #language en-US "CPU Disabled By BIOS (POST Error)\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_CPU_DISABLED_BY_BIOS #language en-US "CPU Disabled By BIOS (POST Error)\r\n"
#string STR_SMBIOSVIEW_PRINTINFO_CPU_IDLE #language en-US "CPU is Idle, waiting to be enabled\r\n"
#string STR_SMBIOSVIEW_PRINTINFO_OTHERS #language en-US "Others\r\n"
#string STR_SMBIOSVIEW_PRINTINFO_RESERVED #language en-US "Reserved\r\n"
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c index a1a0559..d61a61e 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.c @@ -269,6 +269,10 @@ EditGetDefaultFileName ( do {
FileNameTmp = CatSPrint (NULL, L"NewFile%d.%s", Suffix, Extension);
+ if (FileNameTmp == NULL) {
+ ASSERT (FileNameTmp != NULL);
+ return NULL;
+ }
//
// after that filename changed to path
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h index e738b34..35768db 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h @@ -50,6 +50,7 @@ #include <Library/DevicePathLib.h>
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
+#include <Library/SafeIntLib.h>
extern EFI_HII_HANDLE gShellDebug1HiiHandle;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf index 140e9dc..0f4068d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf @@ -96,6 +96,7 @@ MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
MdeModulePkg/MdeModulePkg.dec
+ EmbeddedPkg/EmbeddedPkg.dec
[LibraryClasses]
MemoryAllocationLib
@@ -111,6 +112,7 @@ SortLib
PrintLib
BcfgCommandLib
+ SafeIntLib
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize ## CONSUMES
@@ -143,3 +145,4 @@ gEfiConfProfilesUefiSpecGuid ## SOMETIMES_CONSUMES ## GUID
gEfiConfProfilesEbbrSpec21Guid ## SOMETIMES_CONSUMES ## GUID
gEfiConfProfilesEbbrSpec22Guid ## SOMETIMES_CONSUMES ## GUID
+ gFdtTableGuid ## SOMETIMES_CONSUMES ## SystemTable
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni index 6ef923e..211ea74 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni @@ -411,6 +411,176 @@ " LinkControl3 %08x\r\n"
" LaneErrorStatus %08x\r\n"
" EqualizationControl:\r\n"
+#string STR_PCI_EXT_CAP_INTEGRITY_ENCRYPTION #language en-US " Integrity and Data Encryption Capability\r\n"
+ " IdeCapabilities %08x\r\n"
+ " IdeControl %04x\r\n"
+ " IdeStatus %04x\r\n"
+#string STR_PCI_EXT_CAP_ATS #language en-US " Address Translation Services (ATS) Capability\r\n"
+ " AtsCapability %04x\r\n"
+ " AtsControl %04x\r\n"
+#string STR_PCI_EXT_CAP_SRIOV #language en-US " Single Root I/O Virtualization (SR-IOV) Capability\r\n"
+ " SriovCapability %04x\r\n"
+ " SriovControl %04x\r\n"
+ " SriovStatus %04x\r\n"
+ " InitialVFs %04x\r\n"
+ " TotalVFs %04x\r\n"
+ " NumVFs %04x\r\n"
+ " FunctionDependencyLink %04x\r\n"
+ " FirstVfOffset %04x\r\n"
+ " VfStride %04x\r\n"
+ " VfDeviceId %04x\r\n"
+ " SupportedPageSizes %08x\r\n"
+ " SystemPageSize %08x\r\n"
+#string STR_PCI_EXT_CAP_SRIOV_BARS #language en-US " VF BAR Information:\r\n"
+ " VF BAR0 %08x\r\n"
+ " VF BAR1 %08x\r\n"
+ " VF BAR2 %08x\r\n"
+ " VF BAR3 %08x\r\n"
+ " VF BAR4 %08x\r\n"
+ " VF BAR5 %08x\r\n"
+ " VF Migration State Offset %08x\r\n"
+#string STR_PCI_EXT_CAP_PRI #language en-US " Page Request Interface (PRI) Capability\r\n"
+ " PriControl %04x\r\n"
+ " PriStatus %04x\r\n"
+ " PriMaxRequestedPages %08x\r\n"
+#string STR_PCI_EXT_CAP_PASID #language en-US " Process Address Space ID (PASID) Capability\r\n"
+ " PasidCapability %04x\r\n"
+ " PasidControl %04x\r\n"
+ " PasidMaxValue %08x\r\n"
+#string STR_PCI_EXT_CAP_L1_PM_SUBSTATES #language en-US " L1 PM Substates Capability\r\n"
+ " L1PmSubstatesCapability %08x\r\n"
+ " L1PmSubstatesControl1 %08x\r\n"
+ " L1PmSubstatesControl2 %08x\r\n"
+#string STR_PCI_EXT_CAP_DESIGNATED_VENDOR_SPECIFIC #language en-US " Designated Vendor Specific Extended Capability\r\n"
+ " DVSEC Vendor ID: %04x\r\n"
+ " DVSEC Revision: %x\r\n"
+ " DVSEC ID: %04x\r\n"
+ " DVSEC Length: %x\r\n"
+#string STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_HEADER #language en-US " VF Resizable BAR Extended Capability\r\n"
+#string STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_ENTRY #language en-US " Entry[%d]:\r\n"
+ " VfResizableBarCapability %08x\r\n"
+ " VfResizableBarControl %08x\r\n"
+#string STR_PCI_EXT_CAP_VF_RESIZABLE_BAR_DETAILS #language en-US " Detailed Information:\r\n"
+ " VfBarSizeCapability %07x\r\n"
+ " VfBarIndex %01x\r\n"
+ " VfResizableBarNumber %01x\r\n"
+ " VfBarSize %02x\r\n"
+ " VfBarSizeCapability (Ctrl) %04x\r\n"
+#string STR_PCI_EXT_CAP_DATA_LINK_FEATURE #language en-US " Data Link Feature Capability\r\n"
+ " DataLinkFeatureCapability %08x\r\n"
+ " DataLinkFeatureControl %08x\r\n"
+ " DataLinkFeatureStatus %08x\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_16 #language en-US " Physical Layer 16.0 GT/s Extended Capability\r\n"
+ " Capabilities: %08x\r\n"
+ " Control: %08x\r\n"
+ " Status: %08x\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_16_STATUS #language en-US " Physical Layer 16.0 Status Details:\r\n"
+ " Equalization Complete: %d\r\n"
+ " Equalization Phase 1 Success: %d\r\n"
+ " Equalization Phase 2 Success: %d\r\n"
+ " Equalization Phase 3 Success: %d\r\n"
+ " Link Equalization Request: %d\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_16_PARITY #language en-US " Physical Layer 16.0 Parity Status:\r\n"
+ " Local Data Parity Mismatch: %08x\r\n"
+ " First Retimer Parity Mismatch: %08x\r\n"
+ " Second Retimer Parity Mismatch: %08x\r\n"
+#string STR_PCI_EXT_CAP_LANE_MARGINING #language en-US " Lane Margining at Receiver Extended Capability\r\n"
+ " Capability: %02x\r\n"
+ " Control: %02x\r\n"
+ " Status: %02x\r\n"
+ " Error Counter: %08x\r\n"
+#string STR_PCI_EXT_CAP_LANE_MARGINING_CAPABILITY #language en-US " Lane Margining Capability Details:\r\n"
+ " Max Lane Number: %d\r\n"
+#string STR_PCI_EXT_CAP_LANE_MARGINING_CONTROL #language en-US " Lane Margining Control Details:\r\n"
+ " Lane Number: %d\r\n"
+ " Rcv Error Counter Select: %d\r\n"
+ " Lane Margin Step Select: %d\r\n"
+#string STR_PCI_EXT_CAP_LANE_MARGINING_STATUS #language en-US " Lane Margining Status Details:\r\n"
+ " Max Lanes Receiving Test Pattern: %d\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_32 #language en-US " Physical Layer 32.0 GT/s Extended Capability\r\n"
+ " Capabilities: %08x\r\n"
+ " Control: %08x\r\n"
+ " Status: %08x\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_CAPABILITIES #language en-US " Physical Layer 32.0 GT/s Capabilities Details:\r\n"
+ " Equalization Bypass Support: %d\r\n"
+ " No Equalization Needed Support: %d\r\n"
+ " TS Usage Mode 0 Support: %d\r\n"
+ " TS Usage Mode 1 Support: %d\r\n"
+ " TS Usage Mode 2 Support: %d\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_CONTROL #language en-US " Physical Layer 32.0 GT/s Control Details:\r\n"
+ " Equalization Bypass Disable: %d\r\n"
+ " No Equalization Needed Disable: %d\r\n"
+ " TS Usage Mode Selected: %d\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_STATUS #language en-US " Physical Layer 32.0 GT/s Status Details:\r\n"
+ " Equalization Complete: %d\r\n"
+ " Equalization Phase 1 Success: %d\r\n"
+ " Equalization Phase 2 Success: %d\r\n"
+ " Equalization Phase 3 Success: %d\r\n"
+ " Link Equalization Request: %d\r\n"
+ " Modified TS Received: %d\r\n"
+ " Received Enhanced Link Control: %d\r\n"
+ " Transmitter Precoding On: %d\r\n"
+ " Transmitter Precode Request: %d\r\n"
+ " No Equalization Needed Received: %d\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_32_TS_DATA #language en-US " Physical Layer 32.0 GT/s TS Data:\r\n"
+ " Received Modified TS Data 1: %08x\r\n"
+ " Received Modified TS Data 2: %08x\r\n"
+ " Transmit Modified TS Data 1: %08x\r\n"
+ " Transmit Modified TS Data 2: %08x\r\n"
+#string STR_PCI_EXT_CAP_ALTERNATE_PROTOCOL #language en-US " Alternate Protocol Capability\r\n"
+ " AlternateProtocolCapability %08x\r\n"
+ " AlternateProtocolStatus %08x\r\n"
+ " AlternateProtocolControl %08x\r\n"
+#string STR_PCI_EXT_CAP_DATA_OBJECT_EXCHANGE #language en-US " Data Object Exchange Capability\r\n"
+ " DataObjectExchangeCapability %08x\r\n"
+ " DataObjectExchangeControl %08x\r\n"
+ " DataObjectExchangeStatus %08x\r\n"
+#string STR_PCI_EXT_CAP_DEVICE3 #language en-US " Device 3 Extended Capability\r\n"
+ " Capabilities: %08x\r\n"
+ " Control: %08x\r\n"
+ " Status: %08x\r\n"
+#string STR_PCI_EXT_CAP_DEVICE3_CAPABILITY #language en-US " Device 3 Capability Details:\r\n"
+ " DMWR Request Routing: %d\r\n"
+ " 14-bit Tag Completer: %d\r\n"
+ " 14-bit Tag Requester: %d\r\n"
+ " Receiver L0p Support: %d\r\n"
+ " Port L0p Exit Latency: %d\r\n"
+ " Retimer L0p Exit: %d\r\n"
+#string STR_PCI_EXT_CAP_DEVICE3_CONTROL #language en-US " Device 3 Control Details:\r\n"
+ " DMWR Requester Enable: %d\r\n"
+ " DMWR Egress Blocking: %d\r\n"
+ " 14-bit Tag Requester Enable: %d\r\n"
+ " L0p Enable: %d\r\n"
+ " Target Link Width: %d\r\n"
+#string STR_PCI_EXT_CAP_DEVICE3_STATUS #language en-US " Device 3 Status Details:\r\n"
+ " Initial Link Width: %d\r\n"
+ " Segment Captured: %d\r\n"
+ " Remote L0p Supported: %d\r\n"
+#string STR_PCI_EXT_CAP_INTEGRITY_ENCRYPTION #language en-US " Integrity and Data Encryption Capability\r\n"
+ " IdeCapabilities %08x\r\n"
+ " IdeControl %08x\r\n"
+ " IdeStatus %08x\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_64 #language en-US " Physical Layer 64.0 GT/s Extended Capability\r\n"
+ " Capabilities: %08x\r\n"
+ " Control: %08x\r\n"
+ " Status: %08x\r\n"
+#string STR_PCI_EXT_CAP_PHYSICAL_LAYER_64_STATUS #language en-US " Physical Layer 64.0 GT/s Status Details:\r\n"
+ " Equalization Complete: %d\r\n"
+ " Equalization Phase 1 Success: %d\r\n"
+ " Equalization Phase 2 Success: %d\r\n"
+ " Equalization Phase 3 Success: %d\r\n"
+ " Link Equalization Request: %d\r\n"
+ " Transmitter Precoding On: %d\r\n"
+ " Transmitter Precode Request: %d\r\n"
+ " No Equalization Needed Received: %d\r\n"
+#string STR_PCI_EXT_FLIT_LOGGING #language en-US " FLIT Logging Capability\r\n"
+ " FlitLoggingCapabilities %08x\r\n"
+ " FlitLoggingControl %08x\r\n"
+ " FlitLoggingStatus %08x\r\n"
+ " FlitMask %08x\r\n"
+ " FlitErrorData1 %08x\r\n"
+ " FlitErrorData2 %08x\r\n"
+ " FlitErrorData3 %08x\r\n"
#string STR_DMPSTORE_SAVE #language en-US "Save variable to file: %H%s%N.\r\n"
#string STR_DMPSTORE_LOAD #language en-US "Load and set variables from file: %H%s%N.\r\n"
|