ARM Packages: Removed trailing spaces
Trailing spaces create issue/warning when generating/applying patches. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <ronald.cron@arm.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15833 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
committed by
oliviermartin
parent
62d441fb17
commit
3402aac7d9
@@ -25,7 +25,7 @@
|
||||
Argv[0] - "%CommandName%"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
|
@@ -32,7 +32,7 @@ EBL_COMMAND_TABLE *mCmdTable[EBL_MAX_COMMAND_COUNT];
|
||||
|
||||
@param chr one Ascii character
|
||||
|
||||
@return The uppercase value of Ascii character
|
||||
@return The uppercase value of Ascii character
|
||||
|
||||
**/
|
||||
STATIC
|
||||
@@ -55,11 +55,11 @@ AsciiToUpper (
|
||||
FirstString is identical to SecondString, then 0 is returned. Otherwise, the
|
||||
value returned is the first mismatched Unicode character in SecondString
|
||||
subtracted from the first mismatched Unicode character in FirstString.
|
||||
|
||||
@param FirstString Pointer to a Null-terminated ASCII string.
|
||||
|
||||
@param FirstString Pointer to a Null-terminated ASCII string.
|
||||
@param SecondString Pointer to a Null-terminated ASCII string.
|
||||
@param Length Max length to compare.
|
||||
|
||||
|
||||
@retval 0 FirstString is identical to SecondString using case insensitive
|
||||
comparisons.
|
||||
@retval !=0 FirstString is not identical to SecondString using case
|
||||
@@ -85,15 +85,15 @@ AsciiStrniCmp (
|
||||
SecondString++;
|
||||
Length--;
|
||||
}
|
||||
|
||||
|
||||
return AsciiToUpper (*FirstString) - AsciiToUpper (*SecondString);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Add a command to the mCmdTable. If there is no free space in the command
|
||||
table ASSERT. The mCmdTable is maintained in alphabetical order and the
|
||||
Add a command to the mCmdTable. If there is no free space in the command
|
||||
table ASSERT. The mCmdTable is maintained in alphabetical order and the
|
||||
new entry is inserted into its sorted position.
|
||||
|
||||
@param Entry Command Entry to add to the CmdTable
|
||||
@@ -124,7 +124,7 @@ EblAddCommand (
|
||||
if (AsciiStriCmp (mCmdTable[Count - 1]->Name, Entry->Name) <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mCmdTable[Count] = mCmdTable[Count - 1];
|
||||
}
|
||||
mCmdTable[Count] = (EBL_COMMAND_TABLE *)Entry;
|
||||
@@ -135,7 +135,7 @@ EblAddCommand (
|
||||
|
||||
|
||||
/**
|
||||
Add an set of commands to the command table. Most commonly used on static
|
||||
Add an set of commands to the command table. Most commonly used on static
|
||||
array of commands.
|
||||
|
||||
@param EntryArray Pointer to array of command entries
|
||||
@@ -167,7 +167,7 @@ EBL_ADD_COMMAND_PROTOCOL gEblAddCommand = {
|
||||
|
||||
|
||||
/**
|
||||
Return the best matching command for the passed in command name. The match
|
||||
Return the best matching command for the passed in command name. The match
|
||||
does not have to be exact, it just needs to be unique. This enables commands
|
||||
to be shortened to the smallest set of starting characters that is unique.
|
||||
|
||||
@@ -193,9 +193,9 @@ EblGetCommand (
|
||||
if (Str != NULL) {
|
||||
// If the command includes a trailing . command extension skip it for the match.
|
||||
// Example: hexdump.4
|
||||
Length = (UINTN)(Str - CommandName);
|
||||
Length = (UINTN)(Str - CommandName);
|
||||
}
|
||||
|
||||
|
||||
for (Index = 0, BestMatchCount = 0, Match = NULL; Index < mCmdTableNextFreeIndex; Index++) {
|
||||
if (AsciiStriCmp (mCmdTable[Index]->Name, CommandName) == 0) {
|
||||
// match a command exactly
|
||||
@@ -226,30 +226,30 @@ CountNewLines (
|
||||
)
|
||||
{
|
||||
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
|
||||
List out help information on all the commands or print extended information
|
||||
about a specific passed in command.
|
||||
|
||||
Argv[0] - "help"
|
||||
Argv[1] - Command to display help about
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -281,7 +281,7 @@ EblHelpCmd (
|
||||
}
|
||||
}
|
||||
} else if (Argv[1] != NULL) {
|
||||
// Print specific help
|
||||
// Print specific help
|
||||
for (Index = 0, CurrentRow = 0; Index < mCmdTableNextFreeIndex; Index++) {
|
||||
if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) {
|
||||
Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help;
|
||||
@@ -306,7 +306,7 @@ EblHelpCmd (
|
||||
Argv[0] - "exit"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_ABORTED
|
||||
@@ -326,14 +326,14 @@ EblExitCmd (
|
||||
UINT32 DescriptorVersion;
|
||||
UINTN Pages;
|
||||
|
||||
if (Argc > 1) {
|
||||
if (Argc > 1) {
|
||||
if (AsciiStriCmp (Argv[1], "efi") != 0) {
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
} else if (Argc == 1) {
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
|
||||
MemoryMap = NULL;
|
||||
MemoryMapSize = 0;
|
||||
do {
|
||||
@@ -348,7 +348,7 @@ EblExitCmd (
|
||||
|
||||
Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;
|
||||
MemoryMap = AllocatePages (Pages);
|
||||
|
||||
|
||||
//
|
||||
// Get System MemoryMap
|
||||
//
|
||||
@@ -375,9 +375,9 @@ EblExitCmd (
|
||||
// At this point it is very dangerous to do things EFI as most of EFI is now gone.
|
||||
// This command is useful if you are working with a debugger as it will shutdown
|
||||
// DMA and other things that could break a soft resets.
|
||||
//
|
||||
//
|
||||
CpuDeadLoop ();
|
||||
|
||||
|
||||
// Should never get here, but makes the compiler happy
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
@@ -385,8 +385,8 @@ EblExitCmd (
|
||||
|
||||
/**
|
||||
Update the screen by decrementing the timeout value.
|
||||
This AsciiPrint has to match the AsciiPrint in
|
||||
EblPauseCmd.
|
||||
This AsciiPrint has to match the AsciiPrint in
|
||||
EblPauseCmd.
|
||||
|
||||
@param ElaspedTime Current timeout value remaining
|
||||
|
||||
@@ -410,7 +410,7 @@ EblPauseCallback (
|
||||
Argv[1] - timeout value is decimal seconds
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS Timeout expired with no input
|
||||
@@ -445,7 +445,7 @@ EblPauseCmd (
|
||||
Argv[0] - "break"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -471,7 +471,7 @@ EblBreakPointCmd (
|
||||
Argv[1] - warm or shutdown reset type
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -496,7 +496,7 @@ EblResetCmd (
|
||||
case 's':
|
||||
ResetType = EfiResetShutdown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gRT->ResetSystem (ResetType, EFI_SUCCESS, 0, NULL);
|
||||
return EFI_SUCCESS;
|
||||
@@ -511,7 +511,7 @@ EblResetCmd (
|
||||
Argv[1] - on or off
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -524,7 +524,7 @@ EblPageCmd (
|
||||
)
|
||||
{
|
||||
if (Argc <= 1) {
|
||||
// toggle setting
|
||||
// toggle setting
|
||||
gPageBreak = (gPageBreak) ? FALSE : TRUE;
|
||||
} else {
|
||||
// use argv to set the value
|
||||
@@ -581,7 +581,7 @@ GetBytes (
|
||||
}
|
||||
if (Bytes >= 2) {
|
||||
Result = (Result << 8) + *Address++;
|
||||
}
|
||||
}
|
||||
if (Bytes >= 3) {
|
||||
Result = (Result << 8) + *Address++;
|
||||
}
|
||||
@@ -611,7 +611,7 @@ OutputData (
|
||||
AsciiPrint ("%08x: ", Offset);
|
||||
for (Line = 0; (Line < 0x10) && (Address < EndAddress);) {
|
||||
Bytes = EndAddress - Address;
|
||||
|
||||
|
||||
switch (Width) {
|
||||
case 4:
|
||||
if (Bytes >= 4) {
|
||||
@@ -667,7 +667,7 @@ OutputData (
|
||||
Blanks[Spaces] = '\0';
|
||||
|
||||
AsciiPrint(Blanks);
|
||||
|
||||
|
||||
Blanks[Spaces] = ' ';
|
||||
}
|
||||
|
||||
@@ -682,15 +682,15 @@ OutputData (
|
||||
if (Length % Width != 0) {
|
||||
AsciiPrint ("%08x\n", Offset);
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
See if command contains .# where # is a number. Return # as the Width
|
||||
or 1 as the default Width for commands.
|
||||
|
||||
or 1 as the default Width for commands.
|
||||
|
||||
Example hexdump.4 returns a width of 4.
|
||||
|
||||
@param Argv Argv[0] is the command name
|
||||
@@ -706,7 +706,7 @@ WidthFromCommandName (
|
||||
{
|
||||
CHAR8 *Str;
|
||||
UINTN Width;
|
||||
|
||||
|
||||
//Hexdump.2 HexDump.4 mean use a different width
|
||||
Str = AsciiStrStr (Argv, ".");
|
||||
if (Str != NULL) {
|
||||
@@ -728,13 +728,13 @@ WidthFromCommandName (
|
||||
Toggle page break global. This turns on and off prompting to Quit or hit any
|
||||
key to continue when a command is about to scroll the screen with its output
|
||||
|
||||
Argv[0] - "hexdump"[.#] # is optional 1,2, or 4 for width
|
||||
Argv[1] - Device or File to dump.
|
||||
Argv[0] - "hexdump"[.#] # is optional 1,2, or 4 for width
|
||||
Argv[1] - Device or File to dump.
|
||||
Argv[2] - Optional offset to start dumping
|
||||
Argv[3] - Optional number of bytes to dump
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -757,7 +757,7 @@ EblHexdumpCmd (
|
||||
if ((Argc < 2) || (Argc > 4)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
Width = WidthFromCommandName (Argv[0], 1);
|
||||
if ((Width != 1) && (Width != 2) && (Width != 4)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -778,13 +778,13 @@ EblHexdumpCmd (
|
||||
// Make sure size includes the part of the file we have skipped
|
||||
Size += Offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Status = EfiSeek (File, Offset, EfiSeekStart);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
for (; Offset + HEXDUMP_CHUNK <= Size; Offset += Chunk) {
|
||||
Chunk = HEXDUMP_CHUNK;
|
||||
Status = EfiRead (File, Location, &Chunk);
|
||||
@@ -801,7 +801,7 @@ EblHexdumpCmd (
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Any left over?
|
||||
if (Offset < Size) {
|
||||
Chunk = Size - Offset;
|
||||
@@ -894,7 +894,7 @@ EblInitializeCmdTable (
|
||||
{
|
||||
|
||||
EblAddCommands (mCmdTemplate, sizeof (mCmdTemplate)/sizeof (EBL_COMMAND_TABLE));
|
||||
|
||||
|
||||
gBS->InstallProtocolInterface (
|
||||
&gExternalCmdHandle,
|
||||
&gEfiEblAddCommandProtocolGuid,
|
||||
|
@@ -40,22 +40,22 @@ GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gFvFileType[] = {
|
||||
|
||||
/**
|
||||
Perform a dir on a device. The device must support Simple File System Protocol
|
||||
or the FV protocol.
|
||||
or the FV protocol.
|
||||
|
||||
Argv[0] - "dir"
|
||||
Argv[1] - Device Name:path. Path is optional
|
||||
Argv[1] - Device Name:path. Path is optional
|
||||
Argv[2] - Optional filename to match on. A leading * means match substring
|
||||
Argv[3] - Optional FV file type
|
||||
|
||||
dir fs1:\efi ; perform a dir on fs1: device in the efi directory
|
||||
dir fs1:\efi *.efi; perform a dir on fs1: device in the efi directory but
|
||||
dir fs1:\efi *.efi; perform a dir on fs1: device in the efi directory but
|
||||
only print out files that contain the string *.efi
|
||||
dir fv1:\ ; perform a dir on fv1: device in the efi directory
|
||||
dir fv1:\ ; perform a dir on fv1: device in the efi directory
|
||||
NOTE: fv devices do not contain subdirs
|
||||
dir fv1:\ * PEIM ; will match all files of type PEIM
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -71,7 +71,7 @@ EblDirCmd (
|
||||
EFI_OPEN_FILE *File;
|
||||
EFI_FILE_INFO *DirInfo;
|
||||
UINTN ReadSize;
|
||||
UINTN CurrentRow;
|
||||
UINTN CurrentRow;
|
||||
CHAR16 *MatchSubString;
|
||||
EFI_STATUS GetNextFileStatus;
|
||||
UINTN Key;
|
||||
@@ -151,11 +151,11 @@ EblDirCmd (
|
||||
do {
|
||||
Type = SearchType;
|
||||
GetNextFileStatus = Fv->GetNextFile (
|
||||
Fv,
|
||||
Fv,
|
||||
&Key,
|
||||
&Type,
|
||||
&NameGuid,
|
||||
&Attributes,
|
||||
&Type,
|
||||
&NameGuid,
|
||||
&Attributes,
|
||||
&Size
|
||||
);
|
||||
if (!EFI_ERROR (GetNextFileStatus)) {
|
||||
@@ -165,7 +165,7 @@ EblDirCmd (
|
||||
Size = 0;
|
||||
Status = Fv->ReadFile (
|
||||
Fv,
|
||||
&NameGuid,
|
||||
&NameGuid,
|
||||
Section,
|
||||
&Size,
|
||||
&Type,
|
||||
@@ -173,10 +173,10 @@ EblDirCmd (
|
||||
&AuthenticationStatus
|
||||
);
|
||||
if (!((Status == EFI_BUFFER_TOO_SMALL) || !EFI_ERROR (Status))) {
|
||||
// EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid
|
||||
// EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid
|
||||
Size = 0;
|
||||
}
|
||||
|
||||
|
||||
TypeStr = (Type <= EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) ? gFvFileType[Type] : "UNKNOWN";
|
||||
|
||||
// read the UI seciton to do a name match.
|
||||
@@ -208,12 +208,12 @@ 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
|
||||
|
||||
@@ -233,7 +233,7 @@ EblDirCmd (
|
||||
if (UnicodeFileName[0] == '*') {
|
||||
MatchSubString = &UnicodeFileName[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File->FsFileHandle->SetPosition (File->FsFileHandle, 0);
|
||||
for (CurrentRow = 0;;) {
|
||||
@@ -247,7 +247,7 @@ EblDirCmd (
|
||||
if (DirInfo == NULL) {
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
// Read the data
|
||||
Status = File->FsFileHandle->Read (File->FsFileHandle, &ReadSize, DirInfo);
|
||||
if ((EFI_ERROR (Status)) || (ReadSize == 0)) {
|
||||
@@ -256,7 +256,7 @@ EblDirCmd (
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (MatchSubString != NULL) {
|
||||
if (StrStr (&DirInfo->FileName[0], MatchSubString) == NULL) {
|
||||
// does not match *name argument, so skip
|
||||
@@ -278,7 +278,7 @@ EblDirCmd (
|
||||
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
FreePool (DirInfo);
|
||||
}
|
||||
|
||||
@@ -297,10 +297,10 @@ Done:
|
||||
Change the Current Working Directory
|
||||
|
||||
Argv[0] - "cd"
|
||||
Argv[1] - Device Name:path. Path is optional
|
||||
Argv[1] - Device Name:path. Path is optional
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -314,8 +314,8 @@ EblCdCmd (
|
||||
{
|
||||
if (Argc <= 1) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return EfiSetCwd (Argv[1]);
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ VOID
|
||||
EblInitializeDirCmd (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
{
|
||||
if (FeaturePcdGet (PcdEmbeddedDirCmd)) {
|
||||
EblAddCommands (mCmdDirTemplate, sizeof (mCmdDirTemplate)/sizeof (EBL_COMMAND_TABLE));
|
||||
}
|
||||
|
@@ -18,13 +18,13 @@
|
||||
#define __EBL_H__
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/FirmwareVolume2.h>
|
||||
#include <Protocol/LoadFile.h>
|
||||
#include <Protocol/FirmwareVolumeBlock.h>
|
||||
#include <Protocol/PxeBaseCode.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
#include <Protocol/SimpleFileSystem.h>
|
||||
#include <Protocol/FirmwareVolume2.h>
|
||||
#include <Protocol/LoadFile.h>
|
||||
#include <Protocol/FirmwareVolumeBlock.h>
|
||||
#include <Protocol/PxeBaseCode.h>
|
||||
#include <Protocol/LoadedImage.h>
|
||||
#include <Protocol/EblAddCommand.h>
|
||||
#include <Protocol/PciIo.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PrintLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@@ -190,7 +190,7 @@ OutputData (
|
||||
IN UINTN Width,
|
||||
IN UINTN Offset
|
||||
);
|
||||
|
||||
|
||||
UINTN
|
||||
WidthFromCommandName (
|
||||
IN CHAR8 *Argv,
|
||||
|
@@ -44,43 +44,43 @@
|
||||
Ebl.h
|
||||
Network.c
|
||||
Variable.c
|
||||
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||
EmbeddedPkg/EmbeddedPkg.dec
|
||||
|
||||
|
||||
[LibraryClasses]
|
||||
DebugLib
|
||||
UefiLib
|
||||
UefiApplicationEntryPoint
|
||||
UefiBootServicesTableLib
|
||||
UefiRuntimeServicesTableLib
|
||||
BaseMemoryLib
|
||||
MemoryAllocationLib
|
||||
DevicePathLib
|
||||
IoLib
|
||||
PrintLib
|
||||
PcdLib
|
||||
EfiFileLib
|
||||
DebugLib
|
||||
UefiLib
|
||||
UefiApplicationEntryPoint
|
||||
UefiBootServicesTableLib
|
||||
UefiRuntimeServicesTableLib
|
||||
BaseMemoryLib
|
||||
MemoryAllocationLib
|
||||
DevicePathLib
|
||||
IoLib
|
||||
PrintLib
|
||||
PcdLib
|
||||
EfiFileLib
|
||||
HobLib
|
||||
BaseLib
|
||||
BaseLib
|
||||
EblCmdLib
|
||||
EblNetworkLib
|
||||
|
||||
[LibraryClasses.ARM]
|
||||
SemihostLib
|
||||
|
||||
[Protocols.common]
|
||||
gEfiFirmwareVolume2ProtocolGuid
|
||||
gEfiFirmwareVolumeBlockProtocolGuid
|
||||
gEfiBlockIoProtocolGuid
|
||||
|
||||
[Protocols.common]
|
||||
gEfiFirmwareVolume2ProtocolGuid
|
||||
gEfiFirmwareVolumeBlockProtocolGuid
|
||||
gEfiBlockIoProtocolGuid
|
||||
gEfiSimpleFileSystemProtocolGuid
|
||||
gEfiLoadFileProtocolGuid
|
||||
gEfiLoadedImageProtocolGuid
|
||||
gEfiPxeBaseCodeProtocolGuid
|
||||
gEfiLoadFileProtocolGuid
|
||||
gEfiLoadedImageProtocolGuid
|
||||
gEfiPxeBaseCodeProtocolGuid
|
||||
gEfiEblAddCommandProtocolGuid
|
||||
gEfiDiskIoProtocolGuid
|
||||
gEfiPciIoProtocolGuid
|
||||
|
@@ -157,23 +157,23 @@ EblPrintLoadFileInfo (
|
||||
|
||||
if (File->DevicePath != NULL) {
|
||||
// Try to print out the MAC address
|
||||
for (DevicePathNode = File->DevicePath;
|
||||
!IsDevicePathEnd (DevicePathNode);
|
||||
for (DevicePathNode = File->DevicePath;
|
||||
!IsDevicePathEnd (DevicePathNode);
|
||||
DevicePathNode = NextDevicePathNode (DevicePathNode)) {
|
||||
|
||||
|
||||
if ((DevicePathType (DevicePathNode) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (DevicePathNode) == MSG_MAC_ADDR_DP)) {
|
||||
MacAddr = (MAC_ADDR_DEVICE_PATH *)DevicePathNode;
|
||||
|
||||
|
||||
HwAddressSize = sizeof (EFI_MAC_ADDRESS);
|
||||
if (MacAddr->IfType == 0x01 || MacAddr->IfType == 0x00) {
|
||||
HwAddressSize = 6;
|
||||
}
|
||||
|
||||
|
||||
AsciiPrint ("MAC ");
|
||||
for (Index = 0; Index < HwAddressSize; Index++) {
|
||||
AsciiPrint ("%02x", MacAddr->MacAddress.Addr[Index] & 0xff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ EblPrintLoadFileInfo (
|
||||
|
||||
|
||||
/**
|
||||
Dump information about devices in the system.
|
||||
Dump information about devices in the system.
|
||||
|
||||
fv: PI Firmware Volume
|
||||
fs: EFI Simple File System
|
||||
@@ -195,7 +195,7 @@ EblPrintLoadFileInfo (
|
||||
Argv[0] - "device"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -249,7 +249,7 @@ EblDeviceCmd (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Max = EfiGetDeviceCounts (EfiOpenLoadFile);
|
||||
if (Max != 0) {
|
||||
AsciiPrint ("LoadFile Devices: (usually network)\n");
|
||||
@@ -266,7 +266,7 @@ EblDeviceCmd (
|
||||
|
||||
|
||||
/**
|
||||
Start an EFI image (PE32+ with EFI defined entry point).
|
||||
Start an EFI image (PE32+ with EFI defined entry point).
|
||||
|
||||
Argv[0] - "start"
|
||||
Argv[1] - device name and path
|
||||
@@ -278,7 +278,7 @@ EblDeviceCmd (
|
||||
start LoadFile0: ; load an FV via a PXE boot
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -308,7 +308,7 @@ EblStartCmd (
|
||||
|
||||
File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0);
|
||||
if (File == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DevicePath = File->DevicePath;
|
||||
@@ -328,7 +328,7 @@ EblStartCmd (
|
||||
|
||||
FreePool (Buffer);
|
||||
}
|
||||
|
||||
|
||||
EfiClose (File);
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
@@ -337,7 +337,7 @@ EblStartCmd (
|
||||
// We don't pass Argv[0] to the EFI Application (it's name) just the args
|
||||
Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&ImageInfo);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
ImageInfo->LoadOptionsSize = (UINT32)AsciiStrSize (Argv[2]);
|
||||
ImageInfo->LoadOptions = AllocatePool (ImageInfo->LoadOptionsSize);
|
||||
AsciiStrCpy (ImageInfo->LoadOptions, Argv[2]);
|
||||
@@ -354,7 +354,7 @@ EblStartCmd (
|
||||
/**
|
||||
Load a Firmware Volume (FV) into memory from a device. This causes drivers in
|
||||
the FV to be dispatched if the dependencies of the drivers are met.
|
||||
|
||||
|
||||
Argv[0] - "loadfv"
|
||||
Argv[1] - device name and path
|
||||
|
||||
@@ -363,7 +363,7 @@ EblStartCmd (
|
||||
loadfv LoadFile0: ; load an FV via a PXE boot
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -388,7 +388,7 @@ EblLoadFvCmd (
|
||||
|
||||
File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0);
|
||||
if (File == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (File->Type == EfiOpenMemoryBuffer) {
|
||||
@@ -401,25 +401,25 @@ EblLoadFvCmd (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Status = gDS->ProcessFirmwareVolume (FvStart, FvSize, &FvHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool (FvStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Perform an EFI connect to connect devices that follow the EFI driver model.
|
||||
Perform an EFI connect to connect devices that follow the EFI driver model.
|
||||
If it is a PI system also call the dispatcher in case a new FV was made
|
||||
available by one of the connect EFI drivers (this is not a common case).
|
||||
|
||||
|
||||
Argv[0] - "connect"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -451,11 +451,11 @@ EblConnectCmd (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
for (Index = 0; Index < HandleCount; Index++) {
|
||||
gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Given we disconnect our console we should go and do a connect now
|
||||
//
|
||||
@@ -537,11 +537,11 @@ CHAR8 *gMemMapType[] = {
|
||||
|
||||
/**
|
||||
Dump out the EFI memory map
|
||||
|
||||
|
||||
Argv[0] - "memmap"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -569,7 +569,7 @@ EblMemMapCmd (
|
||||
ZeroMem (PageCount, sizeof (PageCount));
|
||||
|
||||
AsciiPrint ("EFI Memory Map\n");
|
||||
|
||||
|
||||
// First call is to figure out how big the buffer needs to be
|
||||
MemMapSize = 0;
|
||||
MemMap = NULL;
|
||||
@@ -593,7 +593,7 @@ EblMemMapCmd (
|
||||
MemMap = NEXT_MEMORY_DESCRIPTOR (MemMap, DescriptorSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (Index = 0, TotalMemory = 0; Index < EfiMaxMemoryType; Index++) {
|
||||
if (PageCount[Index] != 0) {
|
||||
AsciiPrint ("\n %a %,7ld Pages (%,14ld)", gMemMapType[Index], PageCount[Index], LShiftU64 (PageCount[Index], 12));
|
||||
@@ -630,27 +630,27 @@ EblMemMapCmd (
|
||||
/**
|
||||
Load a file into memory and optionally jump to it. A load address can be
|
||||
specified or automatically allocated. A quoted command line can optionally
|
||||
be passed into the image.
|
||||
be passed into the image.
|
||||
|
||||
Argv[0] - "go"
|
||||
Argv[1] - Device Name:path for the file to load
|
||||
Argv[2] - Address to load to or '*' if the load address will be allocated
|
||||
Argv[3] - Optional Entry point to the image. Image will be called if present
|
||||
Argv[4] - "" string that will be passed as Argc & Argv to EntryPoint. Needs
|
||||
Argv[4] - "" string that will be passed as Argc & Argv to EntryPoint. Needs
|
||||
to include the command name
|
||||
|
||||
go fv1:\EblCmdX 0x10000 0x10010 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX
|
||||
from FV1 to location 0x10000 and call the entry point at 0x10010 passing
|
||||
go fv1:\EblCmdX 0x10000 0x10010 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX
|
||||
from FV1 to location 0x10000 and call the entry point at 0x10010 passing
|
||||
in "EblCmdX Arg2 Arg3 Arg4" as the arguments.
|
||||
|
||||
go fv0:\EblCmdX * 0x10 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX from FS0
|
||||
go fv0:\EblCmdX * 0x10 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX from FS0
|
||||
to location allocated by this command and call the entry point at offset 0x10
|
||||
passing in "EblCmdX Arg2 Arg3 Arg4" as the arguments.
|
||||
|
||||
go fv1:\EblCmdX 0x10000; Load EblCmdX to address 0x10000 and return
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -669,7 +669,7 @@ EblGoCmd (
|
||||
EBL_COMMMAND EntryPoint;
|
||||
UINTN EntryPointArgc;
|
||||
CHAR8 *EntryPointArgv[MAX_ARGS];
|
||||
|
||||
|
||||
|
||||
if (Argc <= 2) {
|
||||
// device name and laod address are required
|
||||
@@ -686,7 +686,7 @@ EblGoCmd (
|
||||
if (Argv[2][0] == '*') {
|
||||
// * Means allocate the buffer
|
||||
Status = EfiReadAllocatePool (File, &Address, &Size);
|
||||
|
||||
|
||||
// EntryPoint is relative to the start of the image
|
||||
EntryPoint = (EBL_COMMMAND)((UINTN)EntryPoint + (UINTN)Address);
|
||||
|
||||
@@ -709,7 +709,7 @@ EblGoCmd (
|
||||
EntryPointArgc = 1;
|
||||
EntryPointArgv[0] = File->FileName;
|
||||
}
|
||||
|
||||
|
||||
Status = EntryPoint (EntryPointArgc, EntryPointArgv);
|
||||
}
|
||||
}
|
||||
@@ -741,7 +741,7 @@ EblFileCopyCmd (
|
||||
if (Argc < 3) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
DestFileName = Argv[2];
|
||||
FileNameLen = AsciiStrLen (DestFileName);
|
||||
|
||||
@@ -788,7 +788,7 @@ EblFileCopyCmd (
|
||||
AsciiPrint("Source file open error.\n");
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
Destination = EfiOpen(DestFileName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0);
|
||||
if (Destination == NULL) {
|
||||
AsciiPrint("Destination file open error.\n");
|
||||
@@ -799,12 +799,12 @@ EblFileCopyCmd (
|
||||
if (Buffer == NULL) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
Size = EfiTell(Source, NULL);
|
||||
|
||||
for (Offset = 0; Offset + FILE_COPY_CHUNK <= Size; Offset += Chunk) {
|
||||
Chunk = FILE_COPY_CHUNK;
|
||||
|
||||
|
||||
Status = EfiRead(Source, Buffer, &Chunk);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("Read file error %r\n", Status);
|
||||
@@ -815,13 +815,13 @@ EblFileCopyCmd (
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("Write file error %r\n", Status);
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Any left over?
|
||||
if (Offset < Size) {
|
||||
Chunk = Size - Offset;
|
||||
|
||||
|
||||
Status = EfiRead(Source, Buffer, &Chunk);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("Read file error %r\n", Status);
|
||||
@@ -832,7 +832,7 @@ EblFileCopyCmd (
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("Write file error %r\n", Status);
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -854,11 +854,11 @@ Exit:
|
||||
FreePool (DestFileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Buffer != NULL) {
|
||||
FreePool(Buffer);
|
||||
}
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -877,17 +877,17 @@ EblFileDiffCmd (
|
||||
UINTN Size2;
|
||||
UINTN Offset;
|
||||
UINTN Chunk = FILE_COPY_CHUNK;
|
||||
|
||||
|
||||
if (Argc != 3) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
||||
File1 = EfiOpen(Argv[1], EFI_FILE_MODE_READ, 0);
|
||||
if (File1 == NULL) {
|
||||
AsciiPrint("File 1 open error.\n");
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
||||
File2 = EfiOpen(Argv[2], EFI_FILE_MODE_READ, 0);
|
||||
if (File2 == NULL) {
|
||||
AsciiPrint("File 2 open error.\n");
|
||||
@@ -906,15 +906,15 @@ EblFileDiffCmd (
|
||||
if (Buffer1 == NULL) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
Buffer2 = AllocatePool(FILE_COPY_CHUNK);
|
||||
if (Buffer2 == NULL) {
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
for (Offset = 0; Offset + FILE_COPY_CHUNK <= Size1; Offset += Chunk) {
|
||||
Chunk = FILE_COPY_CHUNK;
|
||||
|
||||
|
||||
Status = EfiRead(File1, Buffer1, &Chunk);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("File 1 read error\n");
|
||||
@@ -926,17 +926,17 @@ EblFileDiffCmd (
|
||||
AsciiPrint("File 2 read error\n");
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
if (CompareMem(Buffer1, Buffer2, Chunk) != 0) {
|
||||
AsciiPrint("Files differ.\n");
|
||||
goto Exit;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Any left over?
|
||||
if (Offset < Size1) {
|
||||
Chunk = Size1 - Offset;
|
||||
|
||||
|
||||
Status = EfiRead(File1, Buffer1, &Chunk);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("File 1 read error\n");
|
||||
@@ -947,9 +947,9 @@ EblFileDiffCmd (
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("File 2 read error\n");
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (CompareMem(Buffer1, Buffer2, Chunk) != 0) {
|
||||
AsciiPrint("Files differ.\n");
|
||||
} else {
|
||||
@@ -963,22 +963,22 @@ Exit:
|
||||
AsciiPrint("File 1 close error %r\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (File2 != NULL) {
|
||||
Status = EfiClose(File2);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("File 2 close error %r\n", Status);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Buffer1 != NULL) {
|
||||
FreePool(Buffer1);
|
||||
}
|
||||
|
||||
|
||||
if (Buffer2 != NULL) {
|
||||
FreePool(Buffer2);
|
||||
}
|
||||
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -998,25 +998,25 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mCmdDeviceTemplate[] =
|
||||
},
|
||||
{
|
||||
"go",
|
||||
" dev:path loadaddress entrypoint args; load to given address and jump in",
|
||||
" dev:path loadaddress entrypoint args; load to given address and jump in",
|
||||
NULL,
|
||||
EblGoCmd
|
||||
},
|
||||
{
|
||||
"loadfv",
|
||||
" devname; Load PI FV from device",
|
||||
" devname; Load PI FV from device",
|
||||
NULL,
|
||||
EblLoadFvCmd
|
||||
},
|
||||
{
|
||||
"start",
|
||||
" path; EFI Boot Device:filepath. fs1:\\EFI\\BOOT.EFI",
|
||||
" path; EFI Boot Device:filepath. fs1:\\EFI\\BOOT.EFI",
|
||||
NULL,
|
||||
EblStartCmd
|
||||
},
|
||||
{
|
||||
"memmap",
|
||||
"; dump EFI memory map",
|
||||
"; dump EFI memory map",
|
||||
NULL,
|
||||
EblMemMapCmd
|
||||
},
|
||||
|
@@ -87,7 +87,7 @@
|
||||
**/
|
||||
|
||||
#include "Ebl.h"
|
||||
// BugBug: Autogen does not allow this to be included currently
|
||||
// BugBug: Autogen does not allow this to be included currently
|
||||
//#include <EdkModulePkg/Include/EdkDxe.h>
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED char *mHobResourceType[] = {
|
||||
@@ -109,7 +109,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED char *mHobResourceType[] = {
|
||||
Argv[0] - "hob"
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -129,9 +129,9 @@ EblHobCmd (
|
||||
CurrentRow = 0;
|
||||
for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {
|
||||
if (Hob.Header->HobType == EFI_HOB_TYPE_HANDOFF) {
|
||||
AsciiPrint ("PHIT HOB Ver %x Boot Mode %02x Top %lx Bottom %lx\n",
|
||||
Hob.HandoffInformationTable->Version,
|
||||
Hob.HandoffInformationTable->BootMode,
|
||||
AsciiPrint ("PHIT HOB Ver %x Boot Mode %02x Top %lx Bottom %lx\n",
|
||||
Hob.HandoffInformationTable->Version,
|
||||
Hob.HandoffInformationTable->BootMode,
|
||||
Hob.HandoffInformationTable->EfiMemoryTop,
|
||||
Hob.HandoffInformationTable->EfiMemoryBottom
|
||||
);
|
||||
@@ -140,7 +140,7 @@ EblHobCmd (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
AsciiPrint (" Free Top %lx Free Bottom %lx End Of HOB %lx\n",
|
||||
AsciiPrint (" Free Top %lx Free Bottom %lx End Of HOB %lx\n",
|
||||
Hob.HandoffInformationTable->EfiFreeMemoryTop,
|
||||
Hob.HandoffInformationTable->EfiFreeMemoryBottom,
|
||||
Hob.HandoffInformationTable->EfiEndOfHobList
|
||||
@@ -149,9 +149,9 @@ EblHobCmd (
|
||||
} else if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION) {
|
||||
// mod(%) on array index is just to prevent buffer overrun
|
||||
AsciiPrint ("Mem Alloc HOB %a %g %08lx:%lx\n",
|
||||
(Hob.MemoryAllocation->AllocDescriptor.MemoryType < EfiMaxMemoryType) ? gMemMapType[Hob.MemoryAllocation->AllocDescriptor.MemoryType] : "ILLEGAL TYPE",
|
||||
&Hob.MemoryAllocation->AllocDescriptor.Name,
|
||||
Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress,
|
||||
(Hob.MemoryAllocation->AllocDescriptor.MemoryType < EfiMaxMemoryType) ? gMemMapType[Hob.MemoryAllocation->AllocDescriptor.MemoryType] : "ILLEGAL TYPE",
|
||||
&Hob.MemoryAllocation->AllocDescriptor.Name,
|
||||
Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress,
|
||||
Hob.MemoryAllocation->AllocDescriptor.MemoryLength
|
||||
);
|
||||
if (CompareGuid (&gEfiHobMemoryAllocModuleGuid, &Hob.MemoryAllocation->AllocDescriptor.Name)) {
|
||||
@@ -163,9 +163,9 @@ EblHobCmd (
|
||||
} else if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {
|
||||
AsciiPrint ("Resource HOB %a %g %08lx:%lx\n Attributes: %08x\n",
|
||||
(Hob.ResourceDescriptor->ResourceType < EFI_RESOURCE_MAX_MEMORY_TYPE) ? mHobResourceType[Hob.ResourceDescriptor->ResourceType] : mHobResourceType[EFI_RESOURCE_MAX_MEMORY_TYPE],
|
||||
&Hob.ResourceDescriptor->Owner,
|
||||
Hob.ResourceDescriptor->PhysicalStart,
|
||||
Hob.ResourceDescriptor->ResourceLength,
|
||||
&Hob.ResourceDescriptor->Owner,
|
||||
Hob.ResourceDescriptor->PhysicalStart,
|
||||
Hob.ResourceDescriptor->ResourceLength,
|
||||
Hob.ResourceDescriptor->ResourceAttribute
|
||||
);
|
||||
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
|
||||
@@ -179,16 +179,16 @@ EblHobCmd (
|
||||
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
AsciiPrint (" %a 0x%08x\n",
|
||||
(EfiMemoryTypeInformation->Type < EfiMaxMemoryType) ? gMemMapType[EfiMemoryTypeInformation->Type] : "END ",
|
||||
AsciiPrint (" %a 0x%08x\n",
|
||||
(EfiMemoryTypeInformation->Type < EfiMaxMemoryType) ? gMemMapType[EfiMemoryTypeInformation->Type] : "END ",
|
||||
EfiMemoryTypeInformation->NumberOfPages
|
||||
);
|
||||
}
|
||||
}
|
||||
} else if (Hob.Header->HobType == EFI_HOB_TYPE_FV) {
|
||||
AsciiPrint ("FV HOB %08lx:%08lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->Length);
|
||||
AsciiPrint ("FV HOB %08lx:%08lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->Length);
|
||||
} else if (Hob.Header->HobType == EFI_HOB_TYPE_CPU) {
|
||||
AsciiPrint ("CPU HOB: Mem %x IO %x\n", Hob.Cpu->SizeOfMemorySpace, Hob.Cpu->SizeOfIoSpace);
|
||||
AsciiPrint ("CPU HOB: Mem %x IO %x\n", Hob.Cpu->SizeOfMemorySpace, Hob.Cpu->SizeOfIoSpace);
|
||||
} else if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_POOL) {
|
||||
AsciiPrint ("Mem Pool HOB:\n");
|
||||
/* Not in PI
|
||||
@@ -199,7 +199,7 @@ EblHobCmd (
|
||||
|
||||
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
Module Name: HwDebug.c
|
||||
|
||||
Commands useful for debugging hardware.
|
||||
Commands useful for debugging hardware.
|
||||
|
||||
**/
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
md 0x123445678 ; Dump 0x20 1 byte quantities starting at 0x123445678
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -63,7 +63,7 @@ EblMdCmd (
|
||||
OutputData (Address, Length, Width, (UINTN)Address);
|
||||
|
||||
Address += Length;
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ EblMdCmd (
|
||||
mf 0x123445678 ; Start at 0x123445678 and write 00 (4 byte) to the next 1 byte
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -119,7 +119,7 @@ EblMfillCmd (
|
||||
MmioWrite8 (Address, (UINT8)Data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ CHAR8 *gPciSerialClassCodes[] = {
|
||||
Argv[3] - func
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -195,13 +195,13 @@ EblPciCmd (
|
||||
CHAR8 *Str;
|
||||
UINTN ThisBus;
|
||||
|
||||
|
||||
|
||||
BusArg = (Argc > 1) ? AsciiStrDecimalToUintn (Argv[1]) : 0;
|
||||
DevArg = (Argc > 2) ? AsciiStrDecimalToUintn (Argv[2]) : 0;
|
||||
FuncArg = (Argc > 3) ? AsciiStrDecimalToUintn (Argv[3]) : 0;
|
||||
|
||||
Header = &PciHeader;
|
||||
|
||||
|
||||
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiPciIoProtocolGuid, NULL, &HandleCount, &HandleBuffer);
|
||||
if (EFI_ERROR (Status)) {
|
||||
AsciiPrint ("No PCI devices found in the system\n");
|
||||
@@ -224,7 +224,7 @@ EblPciCmd (
|
||||
Status = Pci->Pci.Read (Pci, EfiPciIoWidthUint32, 0, sizeof (PciHeader)/sizeof (UINT32), &PciHeader);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Hdr = &PciHeader.Bridge.Hdr;
|
||||
|
||||
|
||||
if (Hdr->ClassCode[2] < sizeof (gPciDevClass)/sizeof (VOID *)) {
|
||||
Str = gPciDevClass[Hdr->ClassCode[2]];
|
||||
if (Hdr->ClassCode[2] == PCI_CLASS_SERIAL) {
|
||||
@@ -239,7 +239,7 @@ EblPciCmd (
|
||||
AsciiPrint (" 0x%04x 0x%04x %a 0x%02x", Hdr->VendorId, Hdr->DeviceId, Str, Hdr->ClassCode[1]);
|
||||
}
|
||||
if (Seg != 0) {
|
||||
// Only print Segment if it is non zero. If you only have one PCI segment it is
|
||||
// Only print Segment if it is non zero. If you only have one PCI segment it is
|
||||
// redundent to print it out
|
||||
AsciiPrint (" Seg:%d", Seg);
|
||||
}
|
||||
@@ -254,20 +254,20 @@ EblPciCmd (
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Pci->GetLocation (Pci, &Seg, &Bus, &Dev, &Func);
|
||||
if ((Bus == BusArg) && (Dev == DevArg) && (Func == FuncArg)) {
|
||||
// Only print Segment if it is non zero. If you only have one PCI segment it is
|
||||
// Only print Segment if it is non zero. If you only have one PCI segment it is
|
||||
// redundant to print it out
|
||||
if (Seg != 0) {
|
||||
AsciiPrint ("Seg:%d ", Seg);
|
||||
}
|
||||
AsciiPrint ("Bus:%d Dev:%d Func:%d ", Bus, Dev, Func);
|
||||
|
||||
|
||||
Status = Pci->Pci.Read (Pci, EfiPciIoWidthUint32, 0, sizeof (PciHeader)/sizeof (UINT32), Header);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Hdr = &PciHeader.Bridge.Hdr;
|
||||
if (IS_PCI_BRIDGE (&PciHeader.Bridge)) {
|
||||
Bridge = &PciHeader.Bridge.Bridge;
|
||||
AsciiPrint (
|
||||
"PCI Bridge. Bus Primary %d Secondary %d Subordinate %d\n",
|
||||
"PCI Bridge. Bus Primary %d Secondary %d Subordinate %d\n",
|
||||
Bridge->PrimaryBus, Bridge->SecondaryBus, Bridge->SubordinateBus
|
||||
);
|
||||
AsciiPrint (" Bar 0: 0x%08x Bar 1: 0x%08x\n", Bridge->Bar[0], Bridge->Bar[1]);
|
||||
@@ -283,14 +283,14 @@ EblPciCmd (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AsciiPrint ("\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FreePool (HandleBuffer);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@
|
||||
ior 0x3f8 ;Do a 8-bit IO Read from 0x3f8
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -81,7 +81,7 @@ EblIoReadCmd (
|
||||
iow 0x3f8 af ;Do an 8-bit IO write of af to 0x3f8
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -104,7 +104,7 @@ EblIoWriteCmd (
|
||||
Port = AsciiStrHexToUintn (Argv[1]);
|
||||
Data = AsciiStrHexToUintn (Argv[2]);
|
||||
Width = WidthFromCommandName (Argv[0], 1);
|
||||
|
||||
|
||||
if (Width == 1) {
|
||||
IoWrite8 (Port, (UINT8)Data);
|
||||
} else if (Width == 2) {
|
||||
|
@@ -31,13 +31,13 @@ UINTN gScreenRows;
|
||||
// Global to turn on/off breaking commands with prompts before they scroll the screen
|
||||
BOOLEAN gPageBreak = TRUE;
|
||||
|
||||
VOID
|
||||
VOID
|
||||
RingBufferIncrement (
|
||||
IN INTN *Value
|
||||
)
|
||||
{
|
||||
*Value = *Value + 1;
|
||||
|
||||
|
||||
if (*Value >= MAX_CMD_HISTORY) {
|
||||
*Value = 0;
|
||||
}
|
||||
@@ -49,14 +49,14 @@ RingBufferDecrement (
|
||||
)
|
||||
{
|
||||
*Value = *Value - 1;
|
||||
|
||||
|
||||
if (*Value < 0) {
|
||||
*Value = MAX_CMD_HISTORY - 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Save this command in the circular history buffer. Older commands are
|
||||
Save this command in the circular history buffer. Older commands are
|
||||
overwritten with newer commands.
|
||||
|
||||
@param Cmd Command line to archive the history of.
|
||||
@@ -71,7 +71,7 @@ SetCmdHistory (
|
||||
{
|
||||
// Don't bother adding empty commands to the list
|
||||
if (AsciiStrLen(Cmd) != 0) {
|
||||
|
||||
|
||||
// First entry
|
||||
if (mCmdHistoryStart == -1) {
|
||||
mCmdHistoryStart = 0;
|
||||
@@ -79,19 +79,19 @@ SetCmdHistory (
|
||||
} else {
|
||||
// Record the new command at the next index
|
||||
RingBufferIncrement(&mCmdHistoryStart);
|
||||
|
||||
|
||||
// If the next index runs into the end index, shuffle end back by one
|
||||
if (mCmdHistoryStart == mCmdHistoryEnd) {
|
||||
RingBufferIncrement(&mCmdHistoryEnd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Copy the new command line into the ring buffer
|
||||
AsciiStrnCpy(&mCmdHistory[mCmdHistoryStart][0], Cmd, MAX_CMD_LINE);
|
||||
}
|
||||
|
||||
|
||||
// Reset the command history for the next up arrow press
|
||||
mCmdHistoryCurrent = mCmdHistoryStart;
|
||||
mCmdHistoryCurrent = mCmdHistoryStart;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,41 +110,41 @@ GetCmdHistory (
|
||||
)
|
||||
{
|
||||
CHAR8 *HistoricalCommand = NULL;
|
||||
|
||||
|
||||
// No history yet?
|
||||
if (mCmdHistoryCurrent == -1) {
|
||||
HistoricalCommand = mCmdBlank;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
if (Direction == SCAN_UP) {
|
||||
HistoricalCommand = &mCmdHistory[mCmdHistoryCurrent][0];
|
||||
|
||||
|
||||
// if we just echoed the last command, hang out there, don't wrap around
|
||||
if (mCmdHistoryCurrent == mCmdHistoryEnd) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
// otherwise, back up by one
|
||||
RingBufferDecrement(&mCmdHistoryCurrent);
|
||||
|
||||
|
||||
} else if (Direction == SCAN_DOWN) {
|
||||
|
||||
|
||||
// if we last echoed the start command, put a blank prompt out
|
||||
if (mCmdHistoryCurrent == mCmdHistoryStart) {
|
||||
HistoricalCommand = mCmdBlank;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
// otherwise increment the current pointer and return that command
|
||||
RingBufferIncrement(&mCmdHistoryCurrent);
|
||||
RingBufferIncrement(&mCmdHistoryCurrent);
|
||||
|
||||
|
||||
HistoricalCommand = &mCmdHistory[mCmdHistoryCurrent][0];
|
||||
RingBufferDecrement(&mCmdHistoryCurrent);
|
||||
}
|
||||
|
||||
Exit:
|
||||
Exit:
|
||||
return HistoricalCommand;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ ParseArguments (
|
||||
} else if (*Char != ' ') {
|
||||
Argv[Arg++] = Char;
|
||||
LookingForArg = FALSE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Looking for the terminator of an Argv[] entry
|
||||
if (!InQuote && (*Char == ' ')) {
|
||||
@@ -214,7 +214,7 @@ ParseArguments (
|
||||
*Char = '\0';
|
||||
InQuote = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*Argc = Arg;
|
||||
@@ -236,7 +236,7 @@ ParseArguments (
|
||||
|
||||
@param Key EFI Key information returned
|
||||
@param TimeoutInSec Number of seconds to wait to timeout
|
||||
@param CallBack Callback called every second during the timeout wait
|
||||
@param CallBack Callback called every second during the timeout wait
|
||||
|
||||
@return EFI_SUCCESS Key was returned
|
||||
@return EFI_TIMEOUT If the TimoutInSec expired
|
||||
@@ -275,15 +275,15 @@ EblGetCharKey (
|
||||
if (WaitCount == 2) {
|
||||
gBS->CloseEvent (WaitList[1]);
|
||||
}
|
||||
return EFI_SUCCESS;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// Periodic 1 sec timer signaled
|
||||
// Periodic 1 sec timer signaled
|
||||
TimeoutInSec--;
|
||||
if (CallBack != NULL) {
|
||||
// Call the users callback function if registered
|
||||
// Call the users callback function if registered
|
||||
CallBack (TimeoutInSec);
|
||||
}
|
||||
if (TimeoutInSec == 0) {
|
||||
@@ -294,7 +294,7 @@ EblGetCharKey (
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ EblGetCharKey (
|
||||
If the use hits Q to quit return TRUE else for any other key return FALSE.
|
||||
PrefixNewline is used to figure out if a newline is needed before the prompt
|
||||
string. This depends on the last print done before calling this function.
|
||||
CurrentRow is updated by one on a call or set back to zero if a prompt is
|
||||
CurrentRow is updated by one on a call or set back to zero if a prompt is
|
||||
needed.
|
||||
|
||||
@param CurrentRow Used to figure out if its the end of the page and updated
|
||||
@@ -349,7 +349,7 @@ EblAnyKeyToContinueQtoQuit (
|
||||
|
||||
|
||||
/**
|
||||
Set the text color of the EFI Console. If a zero is passed in reset to
|
||||
Set the text color of the EFI Console. If a zero is passed in reset to
|
||||
default text/background color.
|
||||
|
||||
@param Attribute For text and background color
|
||||
@@ -372,12 +372,12 @@ EblSetTextColor (
|
||||
/**
|
||||
Collect the keyboard input for a cmd line. Carriage Return, New Line, or ESC
|
||||
terminates the command line. You can edit the command line via left arrow,
|
||||
delete and backspace and they all back up and erase the command line.
|
||||
delete and backspace and they all back up and erase the command line.
|
||||
No edit of command line is possible without deletion at this time!
|
||||
The up arrow and down arrow fill Cmd with information from the history
|
||||
The up arrow and down arrow fill Cmd with information from the history
|
||||
buffer.
|
||||
|
||||
@param Cmd Command line to return
|
||||
@param Cmd Command line to return
|
||||
@param CmdMaxSize Maximum size of Cmd
|
||||
|
||||
@return The Status of EblGetCharKey()
|
||||
@@ -462,9 +462,9 @@ EblPrintStartupBanner (
|
||||
|
||||
/**
|
||||
Send null requests to all removable media block IO devices so the a media add/remove/change
|
||||
can be detected in real before we execute a command.
|
||||
can be detected in real before we execute a command.
|
||||
|
||||
This is mainly due to the fact that the FAT driver does not do this today so you can get stale
|
||||
This is mainly due to the fact that the FAT driver does not do this today so you can get stale
|
||||
dir commands after an SD Card has been removed.
|
||||
**/
|
||||
VOID
|
||||
@@ -521,7 +521,7 @@ EblPrompt (
|
||||
commands returns an error.
|
||||
|
||||
@param CmdLine Command Line to process.
|
||||
@param MaxCmdLineSize MaxSize of the Command line
|
||||
@param MaxCmdLineSize MaxSize of the Command line
|
||||
|
||||
@return EFI status of the Command
|
||||
|
||||
@@ -559,17 +559,17 @@ ProcessCmdLine (
|
||||
}
|
||||
} else {
|
||||
AsciiPrint ("The command '%a' is not supported.\n", Argv[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Embedded Boot Loader (EBL) - A simple EFI command line application for embedded
|
||||
Embedded Boot Loader (EBL) - A simple EFI command line application for embedded
|
||||
devices. PcdEmbeddedAutomaticBootCommand is a complied in command line that
|
||||
gets executed automatically. The ; separator allows multiple commands
|
||||
for each command line.
|
||||
@@ -585,7 +585,7 @@ EFIAPI
|
||||
EdkBootLoaderEntry (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR8 CmdLine[MAX_CMD_LINE];
|
||||
@@ -605,7 +605,7 @@ EdkBootLoaderEntry (
|
||||
EblInitializeExternalCmd ();
|
||||
EblInitializeNetworkCmd();
|
||||
EblInitializeVariableCmds ();
|
||||
|
||||
|
||||
if (gST->ConOut == NULL) {
|
||||
DEBUG((EFI_D_ERROR,"Error: No Console Output\n"));
|
||||
return EFI_NOT_READY;
|
||||
@@ -628,29 +628,29 @@ EdkBootLoaderEntry (
|
||||
gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &gScreenColumns, &gScreenRows);
|
||||
|
||||
EblPrintStartupBanner ();
|
||||
|
||||
|
||||
// Parse command line and handle commands separated by ;
|
||||
// The loop prints the prompt gets user input and saves history
|
||||
|
||||
|
||||
// Look for a variable with a default command line, otherwise use the Pcd
|
||||
ZeroMem(&VendorGuid, sizeof(EFI_GUID));
|
||||
|
||||
Status = gRT->GetVariable(CommandLineVariableName, &VendorGuid, NULL, &CommandLineVariableSize, CommandLineVariable);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
CommandLineVariable = AllocatePool(CommandLineVariableSize);
|
||||
|
||||
|
||||
Status = gRT->GetVariable(CommandLineVariableName, &VendorGuid, NULL, &CommandLineVariableSize, CommandLineVariable);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
UnicodeStrToAsciiStr(CommandLineVariable, CmdLine);
|
||||
}
|
||||
|
||||
|
||||
FreePool(CommandLineVariable);
|
||||
}
|
||||
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiStrCpy (CmdLine, (CHAR8 *)PcdGetPtr (PcdEmbeddedAutomaticBootCommand));
|
||||
}
|
||||
|
||||
|
||||
for (;;) {
|
||||
Status = ProcessCmdLine (CmdLine, MAX_CMD_LINE);
|
||||
if (Status == EFI_ABORTED) {
|
||||
|
@@ -28,7 +28,7 @@ ParseIp (
|
||||
Address->v4.Addr[2] = (UINT8)AsciiStrDecimalToUintn (String);
|
||||
String = AsciiStrStr(String, ".") + 1;
|
||||
Address->v4.Addr[3] = (UINT8)AsciiStrDecimalToUintn (String);
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -41,28 +41,28 @@ EblIpCmd (
|
||||
EFI_STATUS Status = EFI_INVALID_PARAMETER;
|
||||
EFI_MAC_ADDRESS Mac;
|
||||
EFI_IP_ADDRESS Ip;
|
||||
|
||||
if (Argc == 1) {
|
||||
|
||||
if (Argc == 1) {
|
||||
// Get current IP/MAC
|
||||
|
||||
|
||||
// Get current MAC address
|
||||
Status = EblGetCurrentMacAddress (&Mac);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
AsciiPrint ("MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", Mac.Addr[0], Mac.Addr[1], Mac.Addr[2], Mac.Addr[3], Mac.Addr[4], Mac.Addr[5]);
|
||||
|
||||
|
||||
// Get current IP address
|
||||
Status = EblGetCurrentIpAddress (&Ip);
|
||||
if (EFI_ERROR(Status)) {
|
||||
AsciiPrint("IP Address is not configured.\n");
|
||||
Status = EFI_SUCCESS;
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
||||
AsciiPrint("IP Address: %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);
|
||||
|
||||
|
||||
} else if ((Argv[1][0] == 'r') && (Argc == 2)) {
|
||||
// Get new address via dhcp
|
||||
Status = EblPerformDHCP (TRUE);
|
||||
@@ -72,10 +72,10 @@ EblIpCmd (
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
||||
Status = EblSetStationIp (&Ip, NULL);
|
||||
}
|
||||
|
||||
|
||||
Exit:
|
||||
return Status;
|
||||
}
|
||||
|
@@ -21,13 +21,13 @@
|
||||
|
||||
/**
|
||||
Execute the passed in file like a series of commands. The ; can be used on
|
||||
a single line to indicate multiple commands per line. The Ascii text file
|
||||
can contain any number of lines. The following line termination forms are
|
||||
a single line to indicate multiple commands per line. The Ascii text file
|
||||
can contain any number of lines. The following line termination forms are
|
||||
supported:
|
||||
LF : Unix, Mac OS X*, BeOS
|
||||
CR+LF: MS-DOS*, Microsoft Windows*
|
||||
CR : Commodore, Apple II, and really Mac OS
|
||||
LF+CR: for simplicity and completeness
|
||||
LF+CR: for simplicity and completeness
|
||||
|
||||
Argv[0] - "script"
|
||||
Argv[1] - Device Name:path for the file to load
|
||||
@@ -35,7 +35,7 @@
|
||||
script fv1:\script.txt
|
||||
|
||||
@param Argc Number of command arguments in Argv
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
@param Argv Array of strings that represent the parsed command line.
|
||||
Argv[0] is the command name
|
||||
|
||||
@return EFI_SUCCESS
|
||||
@@ -54,8 +54,8 @@ EblScriptCmd (
|
||||
CHAR8 *Ptr;
|
||||
CHAR8 *ScanPtr;
|
||||
UINTN CmdLineSize;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (Argc < 2) {
|
||||
// file name required
|
||||
@@ -85,15 +85,15 @@ EblScriptCmd (
|
||||
CmdLineSize++;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Status = ProcessCmdLine (Ptr, CmdLineSize);
|
||||
}
|
||||
|
||||
|
||||
FreePool (Address);
|
||||
}
|
||||
|
||||
|
||||
EfiClose (File);
|
||||
return Status;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ EblScriptCmd (
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mScriptTemplate[] = {
|
||||
{
|
||||
"script",
|
||||
" device:path; load an ascii file and execute it like commands",
|
||||
" device:path; load an ascii file and execute it like commands",
|
||||
NULL,
|
||||
EblScriptCmd
|
||||
}
|
||||
|
@@ -1,14 +1,14 @@
|
||||
/** @file
|
||||
*
|
||||
* Copyright (c) 2011, ARM Limited. All rights reserved.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are licensed and made available under the terms and conditions of the BSD License
|
||||
* which accompanies this distribution. The full text of the license may be found at
|
||||
* http://opensource.org/licenses/bsd-license.php
|
||||
*
|
||||
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
* This program and the accompanying materials
|
||||
* are licensed and made available under the terms and conditions of the BSD License
|
||||
* which accompanies this distribution. The full text of the license may be found at
|
||||
* http://opensource.org/licenses/bsd-license.php
|
||||
*
|
||||
* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
*
|
||||
**/
|
||||
|
||||
@@ -113,7 +113,7 @@ EblSetCmd (
|
||||
AsciiPrint("Variable name is missing.\n");
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
// Check if it is a valid variable setting
|
||||
AsciiValue = AsciiStrStr (AsciiVariableSetting,"=");
|
||||
if (AsciiValue == NULL) {
|
||||
|
Reference in New Issue
Block a user