diff options
Diffstat (limited to 'EmbeddedPkg/Ebl')
-rw-r--r-- | EmbeddedPkg/Ebl/Command.c | 32 | ||||
-rw-r--r-- | EmbeddedPkg/Ebl/Dir.c | 16 | ||||
-rw-r--r-- | EmbeddedPkg/Ebl/HwDebug.c | 2 |
3 files changed, 43 insertions, 7 deletions
diff --git a/EmbeddedPkg/Ebl/Command.c b/EmbeddedPkg/Ebl/Command.c index 3efe6ee..9527cfe 100644 --- a/EmbeddedPkg/Ebl/Command.c +++ b/EmbeddedPkg/Ebl/Command.c @@ -220,6 +220,26 @@ EblGetCommand ( }
+UINTN
+CountNewLines (
+ IN CHAR8 *Str
+ )
+{
+ UINTN Count;
+
+ if (Str == NULL) {
+ return 0;
+ }
+
+ for (Count = 0; *Str != '\0'; Str++) {
+ if (Str[Count] == '\n') {
+ Count++;
+ }
+ }
+
+ return Count;
+}
+
/**
List out help information on all the commands or print extended information
@@ -243,16 +263,22 @@ EblHelpCmd ( {
UINTN Index;
CHAR8 *Ptr;
- UINTN CurrentRow;
+ UINTN CurrentRow = 0;
if (Argc == 1) {
// Print all the commands
AsciiPrint ("Embedded Boot Loader (EBL) commands (help command for more info):\n");
+ CurrentRow++;
for (Index = 0; Index < mCmdTableNextFreeIndex; Index++) {
EblSetTextColor (EFI_YELLOW);
AsciiPrint (" %a", mCmdTable[Index]->Name);
EblSetTextColor (0);
AsciiPrint ("%a\n", mCmdTable[Index]->HelpSummary);
+ // Handle multi line help summaries
+ CurrentRow += CountNewLines (mCmdTable[Index]->HelpSummary);
+ if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
+ break;
+ }
}
} else if (Argv[1] != NULL) {
// Print specific help
@@ -260,6 +286,8 @@ EblHelpCmd ( if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) {
Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help;
AsciiPrint ("%a%a\n", Argv[1], Ptr);
+ // Handle multi line help summaries
+ CurrentRow += CountNewLines (Ptr);
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
break;
}
@@ -847,7 +875,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdTemplate[] = },
{
"hexdump",
- "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex bytes at a given width",
+ "[.{1|2|4}] filename [Offset] [Size]; dump a file as hex .width",
NULL,
EblHexdumpCmd
}
diff --git a/EmbeddedPkg/Ebl/Dir.c b/EmbeddedPkg/Ebl/Dir.c index 126ef5d..2920d6a 100644 --- a/EmbeddedPkg/Ebl/Dir.c +++ b/EmbeddedPkg/Ebl/Dir.c @@ -90,6 +90,7 @@ EblDirCmd ( CHAR16 UnicodeFileName[MAX_CMD_LINE];
CHAR8 *Path;
CHAR8 *TypeStr;
+ UINTN TotalSize;
if (Argc <= 1) {
@@ -143,6 +144,7 @@ EblDirCmd ( }
}
+ TotalSize = 0;
Fv = File->Fv;
Key = 0;
CurrentRow = 0;
@@ -157,6 +159,7 @@ EblDirCmd ( &Size
);
if (!EFI_ERROR (GetNextFileStatus)) {
+ TotalSize += Size;
// Calculate size of entire file
Section = NULL;
Size = 0;
@@ -170,8 +173,8 @@ EblDirCmd ( &AuthenticationStatus
);
if (!((Status == EFI_BUFFER_TOO_SMALL) || !EFI_ERROR (Status))) {
- // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid
- Size = 0;
+ // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid
+ Size = 0;
}
TypeStr = (Type <= EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) ? gFvFileType[Type] : "UNKNOWN";
@@ -189,7 +192,7 @@ EblDirCmd ( );
if (!EFI_ERROR (Status)) {
if (StrStr (Section, MatchSubString) != NULL) {
- AsciiPrint ("%,6d %7a %g %s\n", Size, TypeStr, &NameGuid, Section);
+ AsciiPrint ("%,9d %7a %g %s\n", Size, TypeStr, &NameGuid, Section);
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
break;
}
@@ -197,7 +200,7 @@ EblDirCmd ( FreePool (Section);
} else {
if (*MatchSubString == '\0') {
- AsciiPrint ("%,6d %7a %g\n", Size, TypeStr, &NameGuid);
+ AsciiPrint ("%,9d %7a %g\n", Size, TypeStr, &NameGuid);
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
break;
}
@@ -206,6 +209,11 @@ EblDirCmd ( }
} while (!EFI_ERROR (GetNextFileStatus));
+ if (SearchType == EFI_FV_FILETYPE_ALL) {
+ AsciiPrint ("%,20d bytes in files %,d bytes free\n", TotalSize, File->FvSize - File->FvHeaderSize - TotalSize);
+ }
+
+
} else if ((File->Type == EfiOpenFileSystem) || (File->Type == EfiOpenBlockIo)) {
// Simple File System DIR
diff --git a/EmbeddedPkg/Ebl/HwDebug.c b/EmbeddedPkg/Ebl/HwDebug.c index b2ea9af..20f0a72 100644 --- a/EmbeddedPkg/Ebl/HwDebug.c +++ b/EmbeddedPkg/Ebl/HwDebug.c @@ -314,7 +314,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdHwDebugTemplate[] = },
{
"mfill",
- "[.{1|2|4}] Addr Len [data] [1|2|4]; Memory Fill Addr Len*(1|2|4) bytes of data(0)",
+ "[.{1|2|4}] Addr Len [data]; Memory Fill Addr Len*(1|2|4) bytes of data(0)",
NULL,
EblMfillCmd
},
|