mirror of https://github.com/acidanthera/audk.git
comp - add comments and add input verification
bcfg - updated for bugs. compress - rename for coding standards. add comments. dblk - add comments, input verification, and a header line dmem - add comments, add input verification, add system table info dmpstore - add comments eficompress - add comments and add input verification efidecompress - add comments and add input verification loadpcirom - add comments and more output messages memmap - add more output to exceed the spec. mm - move functions, add comments, add input verification. mode - add comment pci - add input verification. SerMode - add comments and add input verification setsize - add comments and add input verification setvar - add comments and add input verification smbiosview - add input verification. clarify error messages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11438 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2442e62af7
commit
3737ac2bc3
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for bcfg shell install1 function.
|
||||
Main file for bcfg shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -19,20 +19,20 @@
|
|||
#include <Library/DevicePathLib.h>
|
||||
|
||||
typedef enum {
|
||||
BCFG_TARGET_BOOT_ORDER = 0,
|
||||
BCFG_TARGET_DRIVER_ORDER = 1,
|
||||
BCFG_TARGET_MAX = 2
|
||||
BcfgTargetBootOrder = 0,
|
||||
BcfgTargetDriverOrder = 1,
|
||||
BcfgTargetMax = 2
|
||||
} BCFG_OPERATION_TARGET;
|
||||
|
||||
typedef enum {
|
||||
BCFG_TYPE_DUMP = 0,
|
||||
BCFG_TYPE_ADD = 1,
|
||||
BCFG_TYPE_ADDP = 2,
|
||||
BCFG_TYPE_ADDH = 3,
|
||||
BCFG_TYPE_RM = 4,
|
||||
BCFG_TYPE_MV = 5,
|
||||
BCFG_TYPE_OPT = 6,
|
||||
BCFG_TYPE_MAX = 7
|
||||
BcfgTypeDump = 0,
|
||||
BcfgTypeAdd = 1,
|
||||
BcfgTypeAddp = 2,
|
||||
BcfgTypeAddh = 3,
|
||||
BcfgTypeRm = 4,
|
||||
BcfgTypeMv = 5,
|
||||
BcfgTypeOpt = 6,
|
||||
BcfgTypeMax = 7
|
||||
} BCFG_OPERATION_TYPE;
|
||||
|
||||
typedef struct {
|
||||
|
@ -47,9 +47,25 @@ typedef struct {
|
|||
CONST CHAR16 *OptData;
|
||||
} BGFG_OPERATION;
|
||||
|
||||
/**
|
||||
Function to add a option.
|
||||
|
||||
@param[in] Position The position to add Target at.
|
||||
@param[in] File The file to make the target.
|
||||
@param[in] Desc The description text.
|
||||
@param[in] CurrentOrder The pointer to the current order of items.
|
||||
@param[in] OrderCount The number if items in CurrentOrder.
|
||||
@param[in] Target The info on the option to add.
|
||||
@param[in] UseHandle TRUE to use HandleNumber, FALSE to use File and Desc.
|
||||
@param[in] UsePath TRUE to convert to devicepath.
|
||||
@param[in] HandleNumber The handle number to add.
|
||||
|
||||
@retval SHELL_SUCCESS The operation was successful.
|
||||
@retval SHELL_INVALID_PARAMETER A parameter was invalid.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
BcfgAdd (
|
||||
BcfgAddDebug1(
|
||||
IN UINTN Position,
|
||||
IN CONST CHAR16 *File,
|
||||
IN CONST CHAR16 *Desc,
|
||||
|
@ -62,10 +78,14 @@ BcfgAdd (
|
|||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath, *FilePath, *FileNode, *DevPath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL *FileNode;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevPath;
|
||||
CHAR16 *Str;
|
||||
CONST CHAR16 *p;
|
||||
UINT8 *p8;
|
||||
CONST CHAR16 *StringWalker;
|
||||
UINT8 *TempByteBuffer;
|
||||
UINT8 *TempByteStart;
|
||||
EFI_SHELL_FILE_INFO *Arg;
|
||||
EFI_SHELL_FILE_INFO *FileList;
|
||||
CHAR16 OptionStr[40];
|
||||
|
@ -80,15 +100,21 @@ BcfgAdd (
|
|||
UINTN ChildControllerHandleCount;
|
||||
SHELL_STATUS ShellStatus;
|
||||
UINT16 *NewOrder;
|
||||
UINT64 Intermediate;
|
||||
|
||||
if (!UseHandle) {
|
||||
ASSERT(File != NULL);
|
||||
ASSERT(Desc != NULL);
|
||||
if (File == NULL || Desc == NULL) {
|
||||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
} else {
|
||||
ASSERT(HandleNumber != 0);
|
||||
if (HandleNumber == 0) {
|
||||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(Position <= (OrderCount+1));
|
||||
if (Position > OrderCount) {
|
||||
Position = OrderCount;
|
||||
}
|
||||
|
||||
Str = NULL;
|
||||
FilePath = NULL;
|
||||
|
@ -98,13 +124,10 @@ BcfgAdd (
|
|||
ShellStatus = SHELL_SUCCESS;
|
||||
TargetLocation = 0xFFFF;
|
||||
|
||||
// if (Position > 0) {
|
||||
// Position--;
|
||||
// }
|
||||
|
||||
if (UseHandle) {
|
||||
CurHandle = ConvertHandleIndexToHandle(StrHexToUintn(File));
|
||||
if (CurHandle == NULL) {
|
||||
Status = ShellConvertStringToUint64(File, &Intermediate, TRUE, FALSE);
|
||||
CurHandle = ConvertHandleIndexToHandle((UINTN)Intermediate);
|
||||
if (CurHandle == NULL || EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, File);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
|
@ -136,7 +159,7 @@ BcfgAdd (
|
|||
(VOID**)&FilePath);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellDebug1HiiHandle, StrHexToUintn(File));
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellDebug1HiiHandle, Intermediate);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
@ -146,10 +169,16 @@ BcfgAdd (
|
|||
//
|
||||
ShellOpenFileMetaArg ((CHAR16*)File, EFI_FILE_MODE_READ, &FileList);
|
||||
|
||||
//
|
||||
// If filename expanded to multiple names, fail
|
||||
//
|
||||
if (FileList == NULL || FileList->Link.ForwardLink != FileList->Link.BackLink) {
|
||||
if (FileList == NULL) {
|
||||
//
|
||||
// If filename matched nothing fail
|
||||
//
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (FileList->Link.ForwardLink != FileList->Link.BackLink) {
|
||||
//
|
||||
// If filename expanded to multiple names, fail
|
||||
//
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellDebug1HiiHandle, File);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
|
@ -166,7 +195,7 @@ BcfgAdd (
|
|||
// get the device path
|
||||
//
|
||||
DevicePath = mEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
|
||||
if (DevicePath != NULL) {
|
||||
if (DevicePath == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellDebug1HiiHandle, Arg->FullName);
|
||||
ShellStatus = SHELL_UNSUPPORTED;
|
||||
} else {
|
||||
|
@ -187,8 +216,8 @@ BcfgAdd (
|
|||
//
|
||||
// append the file
|
||||
//
|
||||
for(p=Arg->FullName; *p != CHAR_NULL && *p != ':'; p++);
|
||||
FileNode = FileDevicePath(NULL, p+1);
|
||||
for(StringWalker=Arg->FullName; *StringWalker != CHAR_NULL && *StringWalker != ':'; StringWalker++);
|
||||
FileNode = FileDevicePath(NULL, StringWalker+1);
|
||||
FilePath = AppendDevicePath(DevicePath, FileNode);
|
||||
FreePool(FileNode);
|
||||
} else {
|
||||
|
@ -207,7 +236,7 @@ BcfgAdd (
|
|||
// Find a free target ,a brute force implementation
|
||||
//
|
||||
Found = FALSE;
|
||||
for (TargetLocation=1; TargetLocation < 0xFFFF; TargetLocation++) {
|
||||
for (TargetLocation=0; TargetLocation < 0xFFFF; TargetLocation++) {
|
||||
Found = TRUE;
|
||||
for (Index=0; Index < OrderCount; Index++) {
|
||||
if (CurrentOrder[Index] == TargetLocation) {
|
||||
|
@ -235,32 +264,33 @@ BcfgAdd (
|
|||
DescSize = StrSize(Desc);
|
||||
FilePathSize = GetDevicePathSize (FilePath);
|
||||
|
||||
p8 = AllocatePool(sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize);
|
||||
*((UINT32 *) p8) = LOAD_OPTION_ACTIVE; // Attributes
|
||||
p8 += sizeof (UINT32);
|
||||
TempByteBuffer = AllocateZeroPool(sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize);
|
||||
TempByteStart = TempByteBuffer;
|
||||
*((UINT32 *) TempByteBuffer) = LOAD_OPTION_ACTIVE; // Attributes
|
||||
TempByteBuffer += sizeof (UINT32);
|
||||
|
||||
*((UINT16 *) p8) = (UINT16)FilePathSize; // FilePathListLength
|
||||
p8 += sizeof (UINT16);
|
||||
*((UINT16 *) TempByteBuffer) = (UINT16)FilePathSize; // FilePathListLength
|
||||
TempByteBuffer += sizeof (UINT16);
|
||||
|
||||
CopyMem (p8, Desc, DescSize);
|
||||
p8 += DescSize;
|
||||
CopyMem (p8, FilePath, FilePathSize);
|
||||
CopyMem (TempByteBuffer, Desc, DescSize);
|
||||
TempByteBuffer += DescSize;
|
||||
CopyMem (TempByteBuffer, FilePath, FilePathSize);
|
||||
|
||||
UnicodeSPrint (OptionStr, sizeof(OptionStr), L"%s%04x", Target == BCFG_TARGET_BOOT_ORDER?L"Boot":L"Driver", TargetLocation);
|
||||
UnicodeSPrint (OptionStr, sizeof(OptionStr), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", TargetLocation);
|
||||
Status = gRT->SetVariable (
|
||||
OptionStr,
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
sizeof(UINT32) + sizeof(UINT16) + DescSize + FilePathSize,
|
||||
p8
|
||||
TempByteStart
|
||||
);
|
||||
|
||||
FreePool(p8);
|
||||
FreePool(TempByteStart);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, OptionStr, Status);
|
||||
} else {
|
||||
NewOrder = AllocatePool((OrderCount+1)*sizeof(NewOrder[0]));
|
||||
NewOrder = AllocateZeroPool((OrderCount+1)*sizeof(NewOrder[0]));
|
||||
ASSERT(NewOrder != NULL);
|
||||
CopyMem(NewOrder, CurrentOrder, (OrderCount)*sizeof(NewOrder[0]));
|
||||
|
||||
|
@ -273,7 +303,7 @@ BcfgAdd (
|
|||
|
||||
NewOrder[Position] = (UINT16) TargetLocation;
|
||||
Status = gRT->SetVariable (
|
||||
Target == BCFG_TARGET_BOOT_ORDER?L"BootOrder":L"DriverOrder",
|
||||
Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder",
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
(OrderCount+1) * sizeof(UINT16),
|
||||
|
@ -283,7 +313,7 @@ BcfgAdd (
|
|||
FreePool(NewOrder);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BCFG_TARGET_BOOT_ORDER?L"BootOrder":L"DriverOrder", Status);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?L"BootOrder":L"DriverOrder", Status);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
Print (L"bcfg: Add %s as %x\n", OptionStr, Position);
|
||||
|
@ -317,9 +347,20 @@ BcfgAdd (
|
|||
return (ShellStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
Funciton to remove an item.
|
||||
|
||||
@param[in] Target The target item to move.
|
||||
@param[in] CurrentOrder The pointer to the current order of items.
|
||||
@param[in] OrderCount The number if items in CurrentOrder.
|
||||
@param[in] Location The current location of the Target.
|
||||
|
||||
@retval SHELL_SUCCESS The operation was successful.
|
||||
@retval SHELL_INVALID_PARAMETER A parameter was invalid.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
BcfgRemove(
|
||||
BcfgRemoveDebug1(
|
||||
IN CONST BCFG_OPERATION_TARGET Target,
|
||||
IN CONST UINT16 *CurrentOrder,
|
||||
IN CONST UINTN OrderCount,
|
||||
|
@ -332,7 +373,7 @@ BcfgRemove(
|
|||
UINTN LoopVar;
|
||||
UINTN NewCount;
|
||||
|
||||
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BCFG_TARGET_BOOT_ORDER?L"Boot":L"Driver", Location);
|
||||
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Location);
|
||||
Status = gRT->SetVariable(
|
||||
VariableName,
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
|
@ -343,7 +384,7 @@ BcfgRemove(
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, VariableName, Status);
|
||||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
NewOrder = AllocatePool(OrderCount*sizeof(CurrentOrder[0]));
|
||||
NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
|
||||
NewCount = OrderCount;
|
||||
CopyMem(NewOrder, CurrentOrder, OrderCount*sizeof(CurrentOrder[0]));
|
||||
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++){
|
||||
|
@ -353,7 +394,7 @@ BcfgRemove(
|
|||
}
|
||||
}
|
||||
Status = gRT->SetVariable(
|
||||
Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
NewCount*sizeof(NewOrder[0]),
|
||||
|
@ -361,15 +402,27 @@ BcfgRemove(
|
|||
FreePool(NewOrder);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
|
||||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
return (SHELL_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
Funciton to move a item to another location.
|
||||
|
||||
@param[in] Target The target item to move.
|
||||
@param[in] CurrentOrder The pointer to the current order of items.
|
||||
@param[in] OrderCount The number if items in CurrentOrder.
|
||||
@param[in] OldLocation The current location of the Target.
|
||||
@param[in] NewLocation The desired location of the Target.
|
||||
|
||||
@retval SHELL_SUCCESS The operation was successful.
|
||||
@retval SHELL_INVALID_PARAMETER A parameter was invalid.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
BcfgMove(
|
||||
BcfgMoveDebug1(
|
||||
IN CONST BCFG_OPERATION_TARGET Target,
|
||||
IN CONST UINT16 *CurrentOrder,
|
||||
IN CONST UINTN OrderCount,
|
||||
|
@ -381,7 +434,7 @@ BcfgMove(
|
|||
EFI_STATUS Status;
|
||||
UINT16 Temp;
|
||||
|
||||
NewOrder = AllocatePool(OrderCount*sizeof(CurrentOrder[0]));
|
||||
NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
|
||||
ASSERT(NewOrder != NULL);
|
||||
|
||||
Temp = CurrentOrder[OldLocation];
|
||||
|
@ -392,7 +445,7 @@ BcfgMove(
|
|||
|
||||
|
||||
Status = gRT->SetVariable(
|
||||
Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
OrderCount*sizeof(CurrentOrder[0]),
|
||||
|
@ -401,7 +454,7 @@ BcfgMove(
|
|||
FreePool(NewOrder);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellDebug1HiiHandle, Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder", Status);
|
||||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
return (SHELL_SUCCESS);
|
||||
|
@ -409,9 +462,32 @@ BcfgMove(
|
|||
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
BcfgDisplayDump(
|
||||
BcfgAddOptDebug1(
|
||||
IN CONST CHAR16 *OptData,
|
||||
IN CONST BCFG_OPERATION_TARGET Target
|
||||
)
|
||||
{
|
||||
ASSERT(OptData != NULL);
|
||||
return SHELL_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Function to dump the Bcfg information.
|
||||
|
||||
@param[in] Op The operation.
|
||||
@param[in] OrderCount How many to dump.
|
||||
@param[in] CurrentOrder The pointer to the current order of items.
|
||||
@param[in] VerboseOutput TRUE for extra output. FALSE otherwise.
|
||||
|
||||
@retval SHELL_SUCCESS The dump was successful.
|
||||
@retval SHELL_INVALID_PARAMETER A parameter was invalid.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
BcfgDisplayDumpDebug1(
|
||||
IN CONST CHAR16 *Op,
|
||||
IN CONST UINTN OrderCount,
|
||||
IN CONST UINTN OrderCount,
|
||||
IN CONST UINT16 *CurrentOrder,
|
||||
IN CONST BOOLEAN VerboseOutput
|
||||
)
|
||||
{
|
||||
|
@ -424,10 +500,15 @@ BcfgDisplayDump(
|
|||
CHAR16 *DevPathString;
|
||||
VOID *DevPath;
|
||||
|
||||
if (OrderCount == 0) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellDebug1HiiHandle);
|
||||
return (SHELL_SUCCESS);
|
||||
}
|
||||
|
||||
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
|
||||
Buffer = NULL;
|
||||
BufferSize = 0;
|
||||
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, LoopVar);
|
||||
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op, CurrentOrder[LoopVar]);
|
||||
|
||||
Status = gRT->GetVariable(
|
||||
VariableName,
|
||||
|
@ -436,7 +517,7 @@ BcfgDisplayDump(
|
|||
&BufferSize,
|
||||
Buffer);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
Buffer = AllocatePool(BufferSize);
|
||||
Buffer = AllocateZeroPool(BufferSize);
|
||||
Status = gRT->GetVariable(
|
||||
VariableName,
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
|
@ -450,7 +531,7 @@ BcfgDisplayDump(
|
|||
return (SHELL_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
DevPath = AllocatePool(*(UINT16*)(Buffer+4));
|
||||
DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));
|
||||
CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));
|
||||
DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);
|
||||
ShellPrintHiiEx(
|
||||
|
@ -459,6 +540,7 @@ BcfgDisplayDump(
|
|||
NULL,
|
||||
STRING_TOKEN(STR_BCFG_LOAD_OPTIONS),
|
||||
gShellDebug1HiiHandle,
|
||||
LoopVar,
|
||||
VariableName,
|
||||
(CHAR16*)(Buffer+6),
|
||||
DevPathString,
|
||||
|
@ -492,15 +574,20 @@ BcfgDisplayDump(
|
|||
return (SHELL_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
Function to initialize the BCFG operation structure.
|
||||
|
||||
@param[in] Struct The stuct to initialize.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
InitBcfgStruct(
|
||||
InitBcfgStructDebug1(
|
||||
IN BGFG_OPERATION *Struct
|
||||
)
|
||||
{
|
||||
ASSERT(Struct != NULL);
|
||||
Struct->Target = BCFG_TARGET_MAX;
|
||||
Struct->Type = BCFG_TYPE_MAX;
|
||||
Struct->Target = BcfgTargetMax;
|
||||
Struct->Type = BcfgTypeMax;
|
||||
Struct->Number1 = 0;
|
||||
Struct->Number2 = 0;
|
||||
Struct->HandleIndex = 0;
|
||||
|
@ -538,13 +625,14 @@ ShellCommandRunBcfg (
|
|||
CONST CHAR16 *CurrentParam;
|
||||
BGFG_OPERATION CurrentOperation;
|
||||
UINTN Length;
|
||||
UINT64 Intermediate;
|
||||
|
||||
Length = 0;
|
||||
ProblemParam = NULL;
|
||||
Package = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
|
||||
InitBcfgStruct(&CurrentOperation);
|
||||
InitBcfgStructDebug1(&CurrentOperation);
|
||||
|
||||
//
|
||||
// initialize the shell lib (we must be in non-auto-init...)
|
||||
|
@ -568,44 +656,51 @@ ShellCommandRunBcfg (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// Read in if we are doing -OPT
|
||||
//
|
||||
if (ShellCommandLineGetFlag(Package, L"-opt")) {
|
||||
CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt");
|
||||
if (CurrentOperation.OptData == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"-opt");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BcfgTypeOpt;
|
||||
}
|
||||
|
||||
//
|
||||
// small block to read the target of the operation
|
||||
//
|
||||
if (ShellCommandLineGetCount(Package) < 3) {
|
||||
if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) ||
|
||||
(ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt)
|
||||
){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) {
|
||||
CurrentOperation.Target = BCFG_TARGET_DRIVER_ORDER;
|
||||
CurrentOperation.Target = BcfgTargetDriverOrder;
|
||||
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) {
|
||||
CurrentOperation.Target = BCFG_TARGET_BOOT_ORDER;
|
||||
CurrentOperation.Target = BcfgTargetBootOrder;
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Read in if we are doing -OPT
|
||||
//
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BCFG_TARGET_MAX && ShellCommandLineGetFlag(Package, L"-opt")) {
|
||||
CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt");
|
||||
CurrentOperation.Type = BCFG_TYPE_OPT;
|
||||
}
|
||||
|
||||
//
|
||||
// Read in the boot or driver order environment variable (not needed for opt)
|
||||
//
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BCFG_TARGET_MAX && CurrentOperation.Type != BCFG_TYPE_OPT) {
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax && CurrentOperation.Type != BcfgTypeOpt) {
|
||||
Length = 0;
|
||||
Status = gRT->GetVariable(
|
||||
CurrentOperation.Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
NULL,
|
||||
&Length,
|
||||
CurrentOperation.Order);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
CurrentOperation.Order = AllocatePool(Length+(4*sizeof(CurrentOperation.Order[0])));
|
||||
CurrentOperation.Order = AllocateZeroPool(Length+(4*sizeof(CurrentOperation.Order[0])));
|
||||
Status = gRT->GetVariable(
|
||||
CurrentOperation.Target == BCFG_TARGET_BOOT_ORDER?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
CurrentOperation.Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder",
|
||||
(EFI_GUID*)&gEfiGlobalVariableGuid,
|
||||
NULL,
|
||||
&Length,
|
||||
|
@ -616,11 +711,11 @@ ShellCommandRunBcfg (
|
|||
//
|
||||
// large block to read the type of operation and verify parameter types for the info.
|
||||
//
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BCFG_TARGET_MAX) {
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax) {
|
||||
for (ParamNumber = 2 ; ParamNumber < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS; ParamNumber++) {
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ParamNumber);
|
||||
if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"dump") == 0) {
|
||||
CurrentOperation.Type = BCFG_TYPE_DUMP;
|
||||
CurrentOperation.Type = BcfgTypeDump;
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-v")) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"-v (without dump)");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -629,13 +724,14 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BCFG_TYPE_ADD;
|
||||
CurrentOperation.Type = BcfgTypeAdd;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number1 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number1 = (UINT16)Intermediate;
|
||||
ASSERT(CurrentOperation.FileName == NULL);
|
||||
CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
|
||||
ASSERT(CurrentOperation.Description == NULL);
|
||||
|
@ -646,13 +742,14 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BCFG_TYPE_ADDP;
|
||||
CurrentOperation.Type = BcfgTypeAddp;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number1 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number1 = (UINT16)Intermediate;
|
||||
ASSERT(CurrentOperation.FileName == NULL);
|
||||
CurrentOperation.FileName = StrnCatGrow(&CurrentOperation.FileName , NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
|
||||
ASSERT(CurrentOperation.Description == NULL);
|
||||
|
@ -663,19 +760,21 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BCFG_TYPE_ADDH;
|
||||
CurrentOperation.Type = BcfgTypeAddh;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number1 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number1 = (UINT16)Intermediate;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.HandleIndex = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.HandleIndex = (UINT16)Intermediate;
|
||||
ASSERT(CurrentOperation.Description == NULL);
|
||||
CurrentOperation.Description = StrnCatGrow(&CurrentOperation.Description, NULL, ShellCommandLineGetRawValue(Package, ++ParamNumber), 0);
|
||||
}
|
||||
|
@ -685,13 +784,14 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BCFG_TYPE_RM;
|
||||
CurrentOperation.Type = BcfgTypeRm;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number1 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number1 = (UINT16)Intermediate;
|
||||
if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellDebug1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -702,13 +802,14 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
CurrentOperation.Type = BCFG_TYPE_MV;
|
||||
CurrentOperation.Type = BcfgTypeMv;
|
||||
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
|
||||
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number1 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number1 = (UINT16)Intermediate;
|
||||
if (CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellDebug1HiiHandle, Length / sizeof(CurrentOperation.Order[0]));
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -718,7 +819,8 @@ ShellCommandRunBcfg (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, CurrentParam);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
CurrentOperation.Number2 = (UINT16)StrHexToUintn(CurrentParam);
|
||||
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
|
||||
CurrentOperation.Number2 = (UINT16)Intermediate;
|
||||
}
|
||||
if (CurrentOperation.Number2 == CurrentOperation.Number1
|
||||
||CurrentOperation.Number1 > (Length / sizeof(CurrentOperation.Order[0]))
|
||||
|
@ -734,47 +836,52 @@ ShellCommandRunBcfg (
|
|||
}
|
||||
}
|
||||
}
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BCFG_TARGET_MAX && CurrentOperation.Type < BCFG_TYPE_MAX) {
|
||||
if (ShellStatus == SHELL_SUCCESS && CurrentOperation.Target < BcfgTargetMax && CurrentOperation.Type < BcfgTypeMax) {
|
||||
//
|
||||
// we have all the info. Do the work
|
||||
//
|
||||
switch (CurrentOperation.Type) {
|
||||
case BCFG_TYPE_DUMP:
|
||||
ShellStatus = BcfgDisplayDump(
|
||||
CurrentOperation.Target == BCFG_TARGET_BOOT_ORDER?L"Boot":L"Driver",
|
||||
case BcfgTypeDump:
|
||||
ShellStatus = BcfgDisplayDumpDebug1(
|
||||
CurrentOperation.Target == BcfgTargetBootOrder?L"Boot":L"Driver",
|
||||
Length / sizeof(CurrentOperation.Order[0]),
|
||||
CurrentOperation.Order,
|
||||
ShellCommandLineGetFlag(Package, L"-v"));
|
||||
break;
|
||||
case BCFG_TYPE_MV:
|
||||
ShellStatus = BcfgMove(
|
||||
case BcfgTypeMv:
|
||||
ShellStatus = BcfgMoveDebug1(
|
||||
CurrentOperation.Target,
|
||||
CurrentOperation.Order,
|
||||
Length / sizeof(CurrentOperation.Order[0]),
|
||||
CurrentOperation.Number1,
|
||||
CurrentOperation.Number2);
|
||||
break;
|
||||
case BCFG_TYPE_RM:
|
||||
ShellStatus = BcfgRemove(
|
||||
case BcfgTypeRm:
|
||||
ShellStatus = BcfgRemoveDebug1(
|
||||
CurrentOperation.Target,
|
||||
CurrentOperation.Order,
|
||||
Length / sizeof(CurrentOperation.Order[0]),
|
||||
CurrentOperation.Number1);
|
||||
break;
|
||||
case BCFG_TYPE_ADD:
|
||||
case BCFG_TYPE_ADDP:
|
||||
case BCFG_TYPE_ADDH:
|
||||
ShellStatus = BcfgAdd(
|
||||
case BcfgTypeAdd:
|
||||
case BcfgTypeAddp:
|
||||
case BcfgTypeAddh:
|
||||
ShellStatus = BcfgAddDebug1(
|
||||
CurrentOperation.Number1,
|
||||
CurrentOperation.FileName,
|
||||
CurrentOperation.Description,
|
||||
CurrentOperation.Order,
|
||||
Length,
|
||||
Length / sizeof(CurrentOperation.Order[0]),
|
||||
CurrentOperation.Target,
|
||||
(BOOLEAN)(CurrentOperation.Type == BCFG_TYPE_ADDH),
|
||||
(BOOLEAN)(CurrentOperation.Type == BCFG_TYPE_ADDP),
|
||||
(BOOLEAN)(CurrentOperation.Type == BcfgTypeAddh),
|
||||
(BOOLEAN)(CurrentOperation.Type == BcfgTypeAddp),
|
||||
CurrentOperation.HandleIndex);
|
||||
break;
|
||||
case BCFG_TYPE_OPT:
|
||||
case BcfgTypeOpt:
|
||||
ShellStatus = BcfgAddOptDebug1(
|
||||
CurrentOperation.OptData,
|
||||
CurrentOperation.Target);
|
||||
break;
|
||||
default:
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Comp shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -14,6 +14,12 @@
|
|||
|
||||
#include "UefiShellDebug1CommandsLib.h"
|
||||
|
||||
/**
|
||||
Function for 'comp' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunComp (
|
||||
|
@ -83,24 +89,26 @@ ShellCommandRunComp (
|
|||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
FileName1 = ShellFindFilePath(ShellCommandLineGetRawValue(Package, 1));
|
||||
if (FileName1 == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1));
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
} else {
|
||||
Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
FileName2 = ShellFindFilePath(ShellCommandLineGetRawValue(Package, 2));
|
||||
Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
if (FileName2 == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2));
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
if (FileHandleIsDirectory(FileHandle1) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, FileName1);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (FileHandleIsDirectory(FileHandle2) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, FileName2);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_HEADER), gShellDebug1HiiHandle, FileName1, FileName2);
|
||||
|
@ -228,22 +236,19 @@ ShellCommandRunComp (
|
|||
ShellStatus = SHELL_NOT_EQUAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ErrorCount == 0) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_PASS), gShellDebug1HiiHandle);
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_FAIL), gShellDebug1HiiHandle);
|
||||
if (ErrorCount == 0) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_PASS), gShellDebug1HiiHandle);
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_COMP_FOOTER_FAIL), gShellDebug1HiiHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShellCommandLineFreeVarList (Package);
|
||||
}
|
||||
if (FileName1 != NULL) {
|
||||
FreePool(FileName1);
|
||||
}
|
||||
if (FileName2 != NULL) {
|
||||
FreePool(FileName2);
|
||||
}
|
||||
SHELL_FREE_NON_NULL(FileName1);
|
||||
SHELL_FREE_NON_NULL(FileName2);
|
||||
|
||||
if (FileHandle1 != NULL) {
|
||||
gEfiShellProtocol->CloseFile(FileHandle1);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Header file for compression routine.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -19,7 +19,7 @@
|
|||
The compression routine.
|
||||
|
||||
@param[in] SrcBuffer The buffer containing the source data.
|
||||
@param[in] SrcSizae Number of bytes in SrcBuffer.
|
||||
@param[in] SrcSize Number of bytes in SrcBuffer.
|
||||
@param[in] DstBuffer The buffer to put the compressed image in.
|
||||
@param[in,out] DstSize On input the size (in bytes) of DstBuffer, on
|
||||
return the number of bytes placed in DstBuffer.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Dblk shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -15,6 +15,15 @@
|
|||
#include "UefiShellDebug1CommandsLib.h"
|
||||
#include <Protocol/BlockIo.h>
|
||||
|
||||
/**
|
||||
Display blocks to the screen.
|
||||
|
||||
@param[in] DevPath The device path to get the blocks from.
|
||||
@param[in] Lba The Lba number to start from.
|
||||
@param[in] BlockCount How many blocks to display.
|
||||
|
||||
@retval SHELL_SUCCESS The display was successful.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
DisplayTheBlocks(
|
||||
|
@ -24,7 +33,6 @@ DisplayTheBlocks(
|
|||
)
|
||||
{
|
||||
EFI_BLOCK_IO_PROTOCOL *BlockIo;
|
||||
EFI_DEVICE_PATH_PROTOCOL *Copy;
|
||||
EFI_HANDLE BlockIoHandle;
|
||||
EFI_STATUS Status;
|
||||
SHELL_STATUS ShellStatus;
|
||||
|
@ -32,23 +40,38 @@ DisplayTheBlocks(
|
|||
UINTN BufferSize;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
Copy = (EFI_DEVICE_PATH_PROTOCOL *)DevPath;
|
||||
|
||||
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &Copy, &BlockIoHandle);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &((EFI_DEVICE_PATH_PROTOCOL *)DevPath), &BlockIoHandle);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return (SHELL_NOT_FOUND);
|
||||
}
|
||||
|
||||
Status = gBS->OpenProtocol(BlockIoHandle, &gEfiBlockIoProtocolGuid, (VOID**)&BlockIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return (SHELL_NOT_FOUND);
|
||||
}
|
||||
|
||||
BufferSize = BlockIo->Media->BlockSize * BlockCount;
|
||||
if (BufferSize > 0) {
|
||||
Buffer = AllocatePool(BufferSize);
|
||||
Buffer = AllocateZeroPool(BufferSize);
|
||||
} else {
|
||||
ShellPrintEx(-1,-1,L" BlockSize: 0x%08x, BlockCount: 0x%08x\r\n", BlockIo->Media->BlockSize, BlockCount);
|
||||
Buffer = NULL;
|
||||
}
|
||||
|
||||
Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer);
|
||||
if (!EFI_ERROR(Status) && Buffer != NULL) {
|
||||
ShellPrintHiiEx(
|
||||
-1,
|
||||
-1,
|
||||
NULL,
|
||||
STRING_TOKEN (STR_DBLK_HEADER),
|
||||
gShellDebug1HiiHandle,
|
||||
Lba,
|
||||
BufferSize,
|
||||
BlockIo
|
||||
);
|
||||
|
||||
DumpHex(2,0,BufferSize,Buffer);
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_READ_FAIL), gShellDebug1HiiHandle, L"BlockIo", Status);
|
||||
|
@ -63,6 +86,12 @@ DisplayTheBlocks(
|
|||
return (ShellStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
Function for 'dblk' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunDblk (
|
||||
|
@ -70,15 +99,16 @@ ShellCommandRunDblk (
|
|||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
CONST CHAR16 *BlockName;
|
||||
CONST CHAR16 *LbaString;
|
||||
CONST CHAR16 *BlockCountString;
|
||||
UINT64 Lba;
|
||||
UINT8 BlockCount;
|
||||
EFI_STATUS Status;
|
||||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
CONST CHAR16 *BlockName;
|
||||
CONST CHAR16 *LbaString;
|
||||
CONST CHAR16 *BlockCountString;
|
||||
UINT64 Lba;
|
||||
UINT64 BlockCount;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevPath;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
Status = EFI_SUCCESS;
|
||||
|
@ -122,26 +152,45 @@ ShellCommandRunDblk (
|
|||
if (LbaString == NULL) {
|
||||
Lba = 0;
|
||||
} else {
|
||||
Lba = (UINT64)StrHexToUintn(LbaString);
|
||||
if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, LbaString);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE);
|
||||
}
|
||||
|
||||
if (BlockCountString == NULL) {
|
||||
BlockCount = 1;
|
||||
} else {
|
||||
BlockCount = (UINT8)StrHexToUintn(BlockCountString);
|
||||
if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockCountString);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE);
|
||||
if (BlockCount > 0x10) {
|
||||
BlockCount = 0x10;
|
||||
} else if (BlockCount == 0) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockCountString);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// do the work if we have a valid block identifier
|
||||
//
|
||||
if (mEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
ShellStatus = DisplayTheBlocks(mEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, BlockCount);
|
||||
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
//
|
||||
// do the work if we have a valid block identifier
|
||||
//
|
||||
if (mEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, BlockName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
DevPath = (EFI_DEVICE_PATH_PROTOCOL*)mEfiShellProtocol->GetDevicePathFromMap(BlockName);
|
||||
if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, BlockName, L"BlockIo");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
ShellStatus = DisplayTheBlocks(mEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Dmem shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -14,8 +14,22 @@
|
|||
|
||||
#include "UefiShellDebug1CommandsLib.h"
|
||||
#include <Protocol/PciRootBridgeIo.h>
|
||||
#include <Guid/Acpi.h>
|
||||
#include <Guid/Mps.h>
|
||||
#include <Guid/SmBios.h>
|
||||
#include <Guid/SalSystemTable.h>
|
||||
|
||||
/**
|
||||
Make a printable character.
|
||||
|
||||
If Char is printable then return it, otherwise return a question mark.
|
||||
|
||||
@param[in] Char The character to make printable.
|
||||
|
||||
@return A printable character representing Char.
|
||||
**/
|
||||
CHAR16
|
||||
EFIAPI
|
||||
MakePrintable(
|
||||
IN CONST CHAR16 Char
|
||||
)
|
||||
|
@ -26,6 +40,12 @@ MakePrintable(
|
|||
return (Char);
|
||||
}
|
||||
|
||||
/**
|
||||
Display some Memory-Mapped-IO memory.
|
||||
|
||||
@param[in] Address The starting address to display.
|
||||
@param[in] Size The length of memory to display.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
DisplayMmioMemory(
|
||||
|
@ -66,6 +86,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
|||
{NULL, TypeMax}
|
||||
};
|
||||
|
||||
/**
|
||||
Function for 'dmem' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunDmem (
|
||||
|
@ -78,8 +104,14 @@ ShellCommandRunDmem (
|
|||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
VOID *Address;
|
||||
UINTN Size;
|
||||
UINT64 Size;
|
||||
CONST CHAR16 *Temp1;
|
||||
UINT64 AcpiTableAddress;
|
||||
UINT64 Acpi20TableAddress;
|
||||
UINT64 SalTableAddress;
|
||||
UINT64 SmbiosTableAddress;
|
||||
UINT64 MpsTableAddress;
|
||||
UINTN TableWalker;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
Status = EFI_SUCCESS;
|
||||
|
@ -108,26 +140,27 @@ ShellCommandRunDmem (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp1 == NULL) {
|
||||
Address = gST;
|
||||
Size = 512;
|
||||
if (ShellCommandLineGetCount(Package) > 3) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp1);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
Address = (VOID*)StrHexToUintn(Temp1);
|
||||
}
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 2);
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp1 == NULL) {
|
||||
Address = gST;
|
||||
Size = 512;
|
||||
} else {
|
||||
if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) {
|
||||
if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp1);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 2);
|
||||
if (Temp1 == NULL) {
|
||||
Size = 512;
|
||||
} else {
|
||||
Size = ShellStrToUintn(Temp1);
|
||||
if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp1);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -135,9 +168,54 @@ ShellCommandRunDmem (
|
|||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
if (!ShellCommandLineGetFlag(Package, L"-mmio")) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)Address, Size);
|
||||
DumpHex(2,0,Size,Address);
|
||||
DumpHex(2,0,(UINTN)Size,Address);
|
||||
if (Address == (VOID*)gST) {
|
||||
Acpi20TableAddress = 0;
|
||||
AcpiTableAddress = 0;
|
||||
SalTableAddress = 0;
|
||||
SmbiosTableAddress = 0;
|
||||
MpsTableAddress = 0;
|
||||
for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) {
|
||||
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
|
||||
Acpi20TableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;
|
||||
continue;
|
||||
}
|
||||
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
|
||||
AcpiTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;
|
||||
continue;
|
||||
}
|
||||
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) {
|
||||
SalTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;
|
||||
continue;
|
||||
}
|
||||
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
|
||||
SmbiosTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;
|
||||
continue;
|
||||
}
|
||||
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
|
||||
MpsTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,
|
||||
(UINT64)Address,
|
||||
gST->Hdr.HeaderSize,
|
||||
gST->Hdr.Revision,
|
||||
(UINT64)gST->ConIn,
|
||||
(UINT64)gST->ConOut,
|
||||
(UINT64)gST->StdErr,
|
||||
(UINT64)gST->RuntimeServices,
|
||||
(UINT64)gST->BootServices,
|
||||
SalTableAddress,
|
||||
AcpiTableAddress,
|
||||
Acpi20TableAddress,
|
||||
MpsTableAddress,
|
||||
SmbiosTableAddress
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShellStatus = DisplayMmioMemory(Address, Size);
|
||||
ShellStatus = DisplayMmioMemory(Address, (UINTN)Size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for DmpStore shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -25,6 +25,19 @@ STATIC CHAR16 *AttrType[] = {
|
|||
L"NV+RT+BS", // 111
|
||||
};
|
||||
|
||||
/**
|
||||
Function to display or delete variables.
|
||||
|
||||
@param[in] VariableName The variable name of the EFI variable (or NULL).
|
||||
@param[in] Guid The GUID of the variable set (or NULL).
|
||||
@param[in] Delete TRUE to delete, FALSE otherwise.
|
||||
|
||||
@retval SHELL_SUCCESS The operation was successful.
|
||||
@retval SHELL_OUT_OF_RESOURCES A memorty allocation failed.
|
||||
@retval SHELL_ABORTED The abort message was received.
|
||||
@retval SHELL_DEVICE_ERROR UEFI Variable Services returned an error.
|
||||
@retval SHELL_NOT_FOUND the Name/Guid pair could not be found.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ProcessVariables (
|
||||
|
@ -44,21 +57,26 @@ ProcessVariables (
|
|||
UINTN DataSize;
|
||||
UINT32 Atts;
|
||||
SHELL_STATUS ShellStatus;
|
||||
BOOLEAN Found;
|
||||
|
||||
Status = gRT->QueryVariableInfo(EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS|EFI_VARIABLE_NON_VOLATILE, &MaxStorSize, &RemStorSize, &MaxVarSize);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return (SHELL_DEVICE_ERROR);
|
||||
}
|
||||
|
||||
Found = FALSE;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
Size = PcdGet16(PcdShellFileOperationSize);
|
||||
FoundVarName = AllocatePool(Size);
|
||||
FoundVarName = AllocateZeroPool(Size);
|
||||
|
||||
if (FoundVarName == NULL) {
|
||||
return (SHELL_OUT_OF_RESOURCES);
|
||||
}
|
||||
FoundVarName[0] = CHAR_NULL;
|
||||
|
||||
Status = gRT->QueryVariableInfo(EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS|EFI_VARIABLE_NON_VOLATILE, &MaxStorSize, &RemStorSize, &MaxVarSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
DataSize = (UINTN)MaxVarSize;
|
||||
DataBuffer = AllocatePool(DataSize);
|
||||
DataBuffer = AllocateZeroPool(DataSize);
|
||||
if (DataBuffer == NULL) {
|
||||
FreePool(FoundVarName);
|
||||
return (SHELL_OUT_OF_RESOURCES);
|
||||
|
@ -98,6 +116,7 @@ ProcessVariables (
|
|||
//
|
||||
// do the print or delete
|
||||
//
|
||||
Found = TRUE;
|
||||
if (!Delete) {
|
||||
ShellPrintHiiEx(
|
||||
-1,
|
||||
|
@ -135,8 +154,19 @@ ProcessVariables (
|
|||
if (DataBuffer != NULL) {
|
||||
FreePool(DataBuffer);
|
||||
}
|
||||
|
||||
return (SHELL_UNSUPPORTED);
|
||||
if (!Found) {
|
||||
if (VariableName != NULL && Guid == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, VariableName);
|
||||
} else if (VariableName != NULL && Guid != NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, Guid, VariableName);
|
||||
} else if (VariableName == NULL && Guid == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND), gShellDebug1HiiHandle);
|
||||
} else if (VariableName == NULL && Guid != NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, Guid);
|
||||
}
|
||||
return (SHELL_NOT_FOUND);
|
||||
}
|
||||
return (SHELL_SUCCESS);
|
||||
}
|
||||
|
||||
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
||||
|
@ -148,6 +178,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
|||
{NULL, TypeMax}
|
||||
};
|
||||
|
||||
/**
|
||||
Function for 'dmpstore' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunDmpStore (
|
||||
|
@ -177,10 +213,7 @@ ShellCommandRunDmpStore (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
if (ShellCommandLineGetCount(Package) < 1) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (ShellCommandLineGetCount(Package) > 2) {
|
||||
if (ShellCommandLineGetCount(Package) > 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) {
|
||||
|
@ -195,14 +228,14 @@ ShellCommandRunDmpStore (
|
|||
if (Temp != NULL) {
|
||||
Status = ConvertStringToGuid(Temp, &GuidData);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"-guid");
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
Guid = &GuidData;
|
||||
} else {
|
||||
Guid = &gEfiGlobalVariableGuid;
|
||||
}
|
||||
VariableName = ShellCommandLineGetRawValue(Package, 2);
|
||||
VariableName = ShellCommandLineGetRawValue(Package, 1);
|
||||
} else {
|
||||
VariableName = NULL;
|
||||
Guid = NULL;
|
||||
|
@ -210,9 +243,8 @@ ShellCommandRunDmpStore (
|
|||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
if (ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) {
|
||||
///@todo fix this after Jordan makes lib...
|
||||
ShellPrintEx(-1, -1, L"Not implemeneted yet (ASSERT follows).\r\n");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
ASSERT(FALSE);
|
||||
ShellPrintEx(-1, -1, L"Not implemeneted yet.\r\n");
|
||||
ShellStatus = SHELL_UNSUPPORTED;
|
||||
} else {
|
||||
ShellStatus = ProcessVariables (VariableName, Guid, ShellCommandLineGetFlag(Package, L"-d"));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for EfiCompress shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -15,6 +15,12 @@
|
|||
#include "UefiShellDebug1CommandsLib.h"
|
||||
#include "Compress.h"
|
||||
|
||||
/**
|
||||
Function for 'compress' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunEfiCompress (
|
||||
|
@ -76,65 +82,68 @@ ShellCommandRunEfiCompress (
|
|||
} else {
|
||||
InFileName = ShellFindFilePath(ShellCommandLineGetRawValue(Package, 1));
|
||||
OutFileName = ShellCommandLineGetRawValue(Package, 2);
|
||||
Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
if (InFileName == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1));
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
if (FileHandleIsDirectory(InShellFileHandle) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (FileHandleIsDirectory(OutShellFileHandle) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
Status = gEfiShellProtocol->GetFileSize(InShellFileHandle, &InSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
InBuffer = AllocateZeroPool((UINTN)InSize);
|
||||
ASSERT(InBuffer != NULL);
|
||||
Status = gEfiShellProtocol->ReadFile(InShellFileHandle, &((UINTN)InSize), InBuffer);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
OutBuffer = AllocateZeroPool((UINTN)OutSize);
|
||||
ASSERT(OutBuffer != NULL);
|
||||
Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
|
||||
}
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_COMPRESS_FAIL), gShellDebug1HiiHandle, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
} else {
|
||||
Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &((UINTN)OutSize), OutBuffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
Status = gEfiShellProtocol->GetFileSize(InShellFileHandle, &InSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
InBuffer = AllocateZeroPool((UINTN)InSize);
|
||||
ASSERT(InBuffer != NULL);
|
||||
Status = gEfiShellProtocol->ReadFile(InShellFileHandle, &((UINTN)InSize), InBuffer);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
OutBuffer = AllocateZeroPool((UINTN)OutSize);
|
||||
ASSERT(OutBuffer != NULL);
|
||||
Status = Compress(InBuffer, InSize, OutBuffer, &OutSize);
|
||||
}
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_COMPRESS_FAIL), gShellDebug1HiiHandle, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
} else {
|
||||
Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &((UINTN)OutSize), OutBuffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShellCommandLineFreeVarList (Package);
|
||||
}
|
||||
if (InFileName != NULL) {
|
||||
FreePool(InFileName);
|
||||
}
|
||||
if (InShellFileHandle != NULL) {
|
||||
gEfiShellProtocol->CloseFile(InShellFileHandle);
|
||||
}
|
||||
if (OutShellFileHandle != NULL) {
|
||||
gEfiShellProtocol->CloseFile(OutShellFileHandle);
|
||||
}
|
||||
if (InBuffer != NULL) {
|
||||
FreePool(InBuffer);
|
||||
}
|
||||
if (OutBuffer != NULL) {
|
||||
FreePool(OutBuffer);
|
||||
}
|
||||
SHELL_FREE_NON_NULL(InFileName);
|
||||
SHELL_FREE_NON_NULL(InBuffer);
|
||||
SHELL_FREE_NON_NULL(OutBuffer);
|
||||
|
||||
return (ShellStatus);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
#include <Protocol/Decompress.h>
|
||||
|
||||
|
||||
/**
|
||||
Function for 'decompress' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunEfiDecompress (
|
||||
|
@ -27,8 +33,8 @@ ShellCommandRunEfiDecompress (
|
|||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
SHELL_STATUS ShellStatus;
|
||||
SHELL_FILE_HANDLE InFileHandle;
|
||||
SHELL_FILE_HANDLE OutFileHandle;
|
||||
SHELL_FILE_HANDLE InFileHandle;
|
||||
SHELL_FILE_HANDLE OutFileHandle;
|
||||
UINT32 OutSize;
|
||||
UINTN OutSizeTemp;
|
||||
VOID *OutBuffer;
|
||||
|
@ -36,7 +42,7 @@ ShellCommandRunEfiDecompress (
|
|||
VOID *InBuffer;
|
||||
CHAR16 *InFileName;
|
||||
CONST CHAR16 *OutFileName;
|
||||
UINT64 temp;
|
||||
UINT64 Temp64Bit;
|
||||
UINT32 ScratchSize;
|
||||
VOID *ScratchBuffer;
|
||||
EFI_DECOMPRESS_PROTOCOL *Decompress;
|
||||
|
@ -83,81 +89,84 @@ ShellCommandRunEfiDecompress (
|
|||
} else {
|
||||
InFileName = ShellFindFilePath(ShellCommandLineGetRawValue(Package, 1));
|
||||
OutFileName = ShellCommandLineGetRawValue(Package, 2);
|
||||
Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
if (InFileName == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1));
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
Status = ShellOpenFileByName(OutFileName, &OutFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
if (FileHandleIsDirectory(InFileHandle) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (FileHandleIsDirectory(OutFileHandle) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
Status = FileHandleGetSize(InFileHandle, &temp);
|
||||
ASSERT(temp <= (UINT32)(-1));
|
||||
InSize = (UINTN)temp;
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
InBuffer = AllocatePool(InSize);
|
||||
ASSERT(InBuffer != NULL);
|
||||
Status = gEfiShellProtocol->ReadFile(InFileHandle, &InSize, InBuffer);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
Status = gBS->LocateProtocol(&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
Status = Decompress->GetInfo(Decompress, InBuffer, (UINT32)InSize, &OutSize, &ScratchSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
OutBuffer = AllocatePool(OutSize);
|
||||
ScratchBuffer = AllocatePool(ScratchSize);
|
||||
ASSERT(OutBuffer != NULL);
|
||||
ASSERT(ScratchBuffer != NULL);
|
||||
|
||||
Status = Decompress->Decompress(Decompress, InBuffer, (UINT32)InSize, OutBuffer, OutSize, ScratchBuffer, ScratchSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_DECOMPRESS_FAIL), gShellDebug1HiiHandle, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
} else {
|
||||
OutSizeTemp = OutSize;
|
||||
Status = gEfiShellProtocol->WriteFile(OutFileHandle, &OutSizeTemp, OutBuffer);
|
||||
OutSize = (UINT32)OutSizeTemp;
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, InFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, OutFileName);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
Status = ShellOpenFileByName(OutFileName, &OutFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 2), Status);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
if (ShellStatus == SHELL_SUCCESS) {
|
||||
Status = FileHandleGetSize(InFileHandle, &Temp64Bit);
|
||||
ASSERT(Temp64Bit <= (UINT32)(-1));
|
||||
InSize = (UINTN)Temp64Bit;
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
InBuffer = AllocateZeroPool(InSize);
|
||||
ASSERT(InBuffer != NULL);
|
||||
Status = gEfiShellProtocol->ReadFile(InFileHandle, &InSize, InBuffer);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
Status = gBS->LocateProtocol(&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
Status = Decompress->GetInfo(Decompress, InBuffer, (UINT32)InSize, &OutSize, &ScratchSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
OutBuffer = AllocateZeroPool(OutSize);
|
||||
ScratchBuffer = AllocateZeroPool(ScratchSize);
|
||||
ASSERT(OutBuffer != NULL);
|
||||
ASSERT(ScratchBuffer != NULL);
|
||||
|
||||
Status = Decompress->Decompress(Decompress, InBuffer, (UINT32)InSize, OutBuffer, OutSize, ScratchBuffer, ScratchSize);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_EFI_DECOMPRESS_FAIL), gShellDebug1HiiHandle, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
} else {
|
||||
OutSizeTemp = OutSize;
|
||||
Status = gEfiShellProtocol->WriteFile(OutFileHandle, &OutSizeTemp, OutBuffer);
|
||||
OutSize = (UINT32)OutSizeTemp;
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, OutFileName, Status);
|
||||
ShellStatus = SHELL_DEVICE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShellCommandLineFreeVarList (Package);
|
||||
}
|
||||
if (InFileName != NULL) {
|
||||
FreePool(InFileName);
|
||||
}
|
||||
if (InFileHandle != NULL) {
|
||||
gEfiShellProtocol->CloseFile(InFileHandle);
|
||||
}
|
||||
if (OutFileHandle != NULL) {
|
||||
gEfiShellProtocol->CloseFile(OutFileHandle);
|
||||
}
|
||||
if (InBuffer != NULL) {
|
||||
FreePool(InBuffer);
|
||||
}
|
||||
if (OutBuffer != NULL) {
|
||||
FreePool(OutBuffer);
|
||||
}
|
||||
if (ScratchBuffer != NULL) {
|
||||
FreePool(ScratchBuffer);
|
||||
}
|
||||
|
||||
SHELL_FREE_NON_NULL(InFileName);
|
||||
SHELL_FREE_NON_NULL(InBuffer);
|
||||
SHELL_FREE_NON_NULL(OutBuffer);
|
||||
SHELL_FREE_NON_NULL(ScratchBuffer);
|
||||
|
||||
return (ShellStatus);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for LoadPciRom shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -18,19 +18,31 @@
|
|||
#include <IndustryStandard/PeImage.h>
|
||||
#include <Protocol/Decompress.h>
|
||||
|
||||
/**
|
||||
Connects all available drives and controllers.
|
||||
|
||||
@retval EFI_SUCCESS The operation was successful.
|
||||
@retval EFI_ABORTED The abort mechanism was received.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LoadPciRomConnectAllDriversToAllControllers (
|
||||
VOID
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeLoadPciRom (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
/**
|
||||
Command entry point.
|
||||
|
||||
@param[in] RomBar The Rom Base address.
|
||||
@param[in] RomSize The Rom size.
|
||||
@param[in] FileName The file name.
|
||||
|
||||
@retval EFI_SUCCESS The command completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Command usage error.
|
||||
@retval EFI_UNSUPPORTED Protocols unsupported.
|
||||
@retval EFI_OUT_OF_RESOURCES Out of memory.
|
||||
@retval Other value Unknown error.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LoadEfiDriversFromRomImage (
|
||||
|
@ -44,6 +56,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
|||
{NULL, TypeMax}
|
||||
};
|
||||
|
||||
/**
|
||||
Function for 'loadpcirom' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunLoadPciRom (
|
||||
|
@ -83,11 +101,11 @@ ShellCommandRunLoadPciRom (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
if (ShellCommandLineGetCount(Package) < 1) {
|
||||
if (ShellCommandLineGetCount(Package) < 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
if (!ShellCommandLineGetFlag(Package, L"-nc")) {
|
||||
if (ShellCommandLineGetFlag(Package, L"-nc")) {
|
||||
Connect = FALSE;
|
||||
} else {
|
||||
Connect = TRUE;
|
||||
|
@ -103,15 +121,12 @@ ShellCommandRunLoadPciRom (
|
|||
){
|
||||
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, Param, Status);
|
||||
ShellStatus = SHELL_ACCESS_DENIED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (FileList == NULL || IsListEmpty(&FileList->Link)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle);
|
||||
} else if (ShellStatus == SHELL_SUCCESS) {
|
||||
|
||||
|
||||
if (ShellStatus == SHELL_SUCCESS && FileList != NULL) {
|
||||
//
|
||||
// loop through the list and make sure we are not aborting...
|
||||
//
|
||||
|
@ -130,7 +145,7 @@ ShellCommandRunLoadPciRom (
|
|||
continue;
|
||||
}
|
||||
SourceSize = (UINTN) Node->Info->FileSize;
|
||||
File1Buffer = AllocatePool (SourceSize);
|
||||
File1Buffer = AllocateZeroPool (SourceSize);
|
||||
ASSERT(File1Buffer != NULL);
|
||||
Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
|
@ -147,6 +162,9 @@ ShellCommandRunLoadPciRom (
|
|||
}
|
||||
FreePool(File1Buffer);
|
||||
}
|
||||
} else if (ShellStatus == SHELL_SUCCESS) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
|
||||
Status = ShellCloseFileMetaArg(&FileList);
|
||||
|
@ -162,31 +180,27 @@ ShellCommandRunLoadPciRom (
|
|||
return (ShellStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
Command entry point.
|
||||
|
||||
@param[in] RomBar The Rom Base address.
|
||||
@param[in] RomSize The Rom size.
|
||||
@param[in] FileName The file name.
|
||||
|
||||
@retval EFI_SUCCESS The command completed successfully.
|
||||
@retval EFI_INVALID_PARAMETER Command usage error.
|
||||
@retval EFI_UNSUPPORTED Protocols unsupported.
|
||||
@retval EFI_OUT_OF_RESOURCES Out of memory.
|
||||
@retval Other value Unknown error.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LoadEfiDriversFromRomImage (
|
||||
VOID *RomBar,
|
||||
UINTN RomSize,
|
||||
CONST CHAR16 *FileName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Command entry point.
|
||||
|
||||
Arguments:
|
||||
|
||||
RomBar - Rom
|
||||
RomSize - Rom size
|
||||
FileName - The file name
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The command completed successfully
|
||||
EFI_INVALID_PARAMETER - Command usage error
|
||||
EFI_UNSUPPORTED - Protocols unsupported
|
||||
EFI_OUT_OF_RESOURCES - Out of memory
|
||||
Other value - Unknown error
|
||||
|
||||
**/
|
||||
{
|
||||
EFI_PCI_EXPANSION_ROM_HEADER *EfiRomHeader;
|
||||
PCI_DATA_STRUCTURE *Pcir;
|
||||
|
@ -196,7 +210,7 @@ Returns:
|
|||
UINT16 ImageOffset;
|
||||
EFI_HANDLE ImageHandle;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS retStatus;
|
||||
EFI_STATUS ReturnStatus;
|
||||
CHAR16 RomFileName[280];
|
||||
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||
BOOLEAN SkipImage;
|
||||
|
@ -209,7 +223,7 @@ Returns:
|
|||
EFI_DECOMPRESS_PROTOCOL *Decompress;
|
||||
|
||||
ImageIndex = 0;
|
||||
retStatus = EFI_NOT_FOUND;
|
||||
ReturnStatus = EFI_NOT_FOUND;
|
||||
RomBarOffset = (UINTN) RomBar;
|
||||
|
||||
do {
|
||||
|
@ -219,7 +233,7 @@ Returns:
|
|||
if (EfiRomHeader->Signature != 0xaa55) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, FileName, ImageIndex);
|
||||
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
|
||||
return retStatus;
|
||||
return ReturnStatus;
|
||||
}
|
||||
|
||||
Pcir = (PCI_DATA_STRUCTURE *) (UINTN) (RomBarOffset + EfiRomHeader->PcirOffset);
|
||||
|
@ -262,9 +276,9 @@ Returns:
|
|||
&ScratchSize
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
DecompressedImageBuffer = AllocatePool (DestinationSize);
|
||||
DecompressedImageBuffer = AllocateZeroPool (DestinationSize);
|
||||
if (ImageBuffer != NULL) {
|
||||
Scratch = AllocatePool (ScratchSize);
|
||||
Scratch = AllocateZeroPool (ScratchSize);
|
||||
if (Scratch != NULL) {
|
||||
Status = Decompress->Decompress (
|
||||
Decompress,
|
||||
|
@ -312,7 +326,7 @@ Returns:
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, FileName, ImageIndex, Status);
|
||||
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
|
||||
} else {
|
||||
retStatus = Status;
|
||||
ReturnStatus = Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -328,10 +342,17 @@ Returns:
|
|||
ImageIndex++;
|
||||
} while (((Pcir->Indicator & 0x80) == 0x00) && ((RomBarOffset - (UINTN) RomBar) < RomSize));
|
||||
|
||||
return retStatus;
|
||||
return ReturnStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
Connects all available drives and controllers.
|
||||
|
||||
@retval EFI_SUCCESS The operation was successful.
|
||||
@retval EFI_ABORTED The abort mechanism was received.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LoadPciRomConnectAllDriversToAllControllers (
|
||||
VOID
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Mode shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the acModeanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which acModeanies this distribution. The full text of the license may be found at
|
||||
|
@ -12,23 +12,29 @@
|
|||
|
||||
**/
|
||||
|
||||
STATIC CONST CHAR16 strNameEfiReservedMemoryType[] = L"Reserved";
|
||||
STATIC CONST CHAR16 strNameEfiLoaderCode[] = L"LoadCode";
|
||||
STATIC CONST CHAR16 strNameEfiLoaderData[] = L"LoadData";
|
||||
STATIC CONST CHAR16 strNameEfiBootServicesCode[] = L"BSCode";
|
||||
STATIC CONST CHAR16 strNameEfiBootServicesData[] = L"BSData";
|
||||
STATIC CONST CHAR16 strNameEfiRuntimeServicesCode[] = L"RTCode";
|
||||
STATIC CONST CHAR16 strNameEfiRuntimeServicesData[] = L"RTData";
|
||||
STATIC CONST CHAR16 strNameEfiConventionalMemory[] = L"Conv";
|
||||
STATIC CONST CHAR16 strNameEfiUnusableMemory[] = L"Unusable";
|
||||
STATIC CONST CHAR16 strNameEfiACPIReclaimMemory[] = L"ACPIRec";
|
||||
STATIC CONST CHAR16 strNameEfiACPIMemoryNVS[] = L"ACPI_NVS";
|
||||
STATIC CONST CHAR16 strNameEfiMemoryMappedIO[] = L"MMIO";
|
||||
STATIC CONST CHAR16 strNameEfiMemoryMappedIOPortSpace[] = L"MMIOPort";
|
||||
STATIC CONST CHAR16 strNameEfiPalCode[] = L"PalCode";
|
||||
STATIC CONST CHAR16 NameEfiReservedMemoryType[] = L"Reserved";
|
||||
STATIC CONST CHAR16 NameEfiLoaderCode[] = L"LoaderCode";
|
||||
STATIC CONST CHAR16 NameEfiLoaderData[] = L"LoaderData";
|
||||
STATIC CONST CHAR16 NameEfiBootServicesCode[] = L"BS_Code";
|
||||
STATIC CONST CHAR16 NameEfiBootServicesData[] = L"BS_Data";
|
||||
STATIC CONST CHAR16 NameEfiRuntimeServicesCode[] = L"RT_Code";
|
||||
STATIC CONST CHAR16 NameEfiRuntimeServicesData[] = L"RT_Data";
|
||||
STATIC CONST CHAR16 NameEfiConventionalMemory[] = L"Available";
|
||||
STATIC CONST CHAR16 NameEfiUnusableMemory[] = L"Unusable";
|
||||
STATIC CONST CHAR16 NameEfiACPIReclaimMemory[] = L"ACPIRec";
|
||||
STATIC CONST CHAR16 NameEfiACPIMemoryNVS[] = L"ACPI_NVS";
|
||||
STATIC CONST CHAR16 NameEfiMemoryMappedIO[] = L"MMIO";
|
||||
STATIC CONST CHAR16 NameEfiMemoryMappedIOPortSpace[] = L"MMIOPort";
|
||||
STATIC CONST CHAR16 NameEfiPalCode[] = L"PalCode";
|
||||
|
||||
#include "UefiShellDebug1CommandsLib.h"
|
||||
|
||||
/**
|
||||
Function for 'memmap' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunMemMap (
|
||||
|
@ -64,8 +70,17 @@ ShellCommandRunMemMap (
|
|||
UINT64 RTCodePagesSize;
|
||||
UINT64 AvailPagesSize;
|
||||
UINT64 TotalPagesSize;
|
||||
UINT64 AcpiReclaimPages;
|
||||
UINT64 AcpiNvsPages;
|
||||
UINT64 MmioSpacePages;
|
||||
UINT64 AcpiReclaimPagesSize;
|
||||
UINT64 AcpiNvsPagesSize;
|
||||
UINT64 MmioSpacePagesSize;
|
||||
BOOLEAN Sfo;
|
||||
|
||||
AcpiReclaimPages = 0;
|
||||
AcpiNvsPages = 0;
|
||||
MmioSpacePages = 0;
|
||||
TotalPages = 0;
|
||||
ReservedPages = 0;
|
||||
LoadCodePages = 0;
|
||||
|
@ -109,7 +124,7 @@ ShellCommandRunMemMap (
|
|||
Status = gBS->GetMemoryMap(&Size, Buffer, &MapKey, &ItemSize, &Version);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL){
|
||||
Size += SIZE_1KB;
|
||||
Buffer = AllocatePool(Size);
|
||||
Buffer = AllocateZeroPool(Size);
|
||||
Status = gBS->GetMemoryMap(&Size, Buffer, &MapKey, &ItemSize, &Version);
|
||||
}
|
||||
if (EFI_ERROR(Status)) {
|
||||
|
@ -123,67 +138,70 @@ ShellCommandRunMemMap (
|
|||
switch (((EFI_MEMORY_DESCRIPTOR*)Walker)->Type) {
|
||||
// replaced ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages) with 0000
|
||||
case EfiReservedMemoryType:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiReservedMemoryType, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiReservedMemoryType, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ReservedPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiLoaderCode:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiLoaderCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
LoadCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiLoaderData:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiLoaderData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiLoaderData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
LoadDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiBootServicesCode:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiBootServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiBootServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
BSCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiBootServicesData:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiBootServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiBootServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
BSDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiRuntimeServicesCode:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiRuntimeServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiRuntimeServicesCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
RTCodePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiRuntimeServicesData:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiRuntimeServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiRuntimeServicesData, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
RTDataPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiConventionalMemory:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiConventionalMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiConventionalMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
AvailPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiUnusableMemory:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiUnusableMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiUnusableMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiACPIReclaimMemory:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiACPIReclaimMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiACPIReclaimMemory, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
AcpiReclaimPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiACPIMemoryNVS:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiACPIMemoryNVS, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiACPIMemoryNVS, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
AcpiNvsPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiMemoryMappedIO:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiMemoryMappedIO, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiMemoryMappedIO, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
MmioSpacePages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiMemoryMappedIOPortSpace:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiMemoryMappedIOPortSpace, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiMemoryMappedIOPortSpace, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
case EfiPalCode:
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, strNameEfiPalCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages), ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
ShellPrintHiiEx(-1, -1, NULL, (EFI_STRING_ID)(!Sfo?STRING_TOKEN (STR_MEMMAP_LIST_ITEM):STRING_TOKEN (STR_MEMMAP_LIST_ITEM_SFO)), gShellDebug1HiiHandle, NameEfiPalCode, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart, ((EFI_MEMORY_DESCRIPTOR*)Walker)->PhysicalStart+MultU64x64(SIZE_4KB,((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages)-1, ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages, ((EFI_MEMORY_DESCRIPTOR*)Walker)->Attribute);
|
||||
TotalPages += ((EFI_MEMORY_DESCRIPTOR*)Walker)->NumberOfPages;
|
||||
break;
|
||||
default:
|
||||
|
@ -202,6 +220,9 @@ ShellCommandRunMemMap (
|
|||
RTCodePagesSize = MultU64x64(SIZE_4KB,RTCodePages);
|
||||
AvailPagesSize = MultU64x64(SIZE_4KB,AvailPages);
|
||||
TotalPagesSize = MultU64x64(SIZE_4KB,TotalPages);
|
||||
AcpiReclaimPagesSize = MultU64x64(SIZE_4KB,AcpiReclaimPages);
|
||||
AcpiNvsPagesSize = MultU64x64(SIZE_4KB,AcpiNvsPages);
|
||||
MmioSpacePagesSize = MultU64x64(SIZE_4KB,MmioSpacePages);
|
||||
if (!Sfo) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_LIST_SUMM), gShellDebug1HiiHandle,
|
||||
ReservedPages, ReservedPagesSize,
|
||||
|
@ -209,7 +230,11 @@ ShellCommandRunMemMap (
|
|||
LoadDataPages, LoadDataPagesSize,
|
||||
BSCodePages, BSCodePagesSize,
|
||||
BSDataPages, BSDataPagesSize,
|
||||
RTCodePages, RTCodePagesSize,
|
||||
RTDataPages, RTDataPagesSize,
|
||||
AcpiReclaimPages, AcpiReclaimPagesSize,
|
||||
AcpiNvsPages, AcpiNvsPagesSize,
|
||||
MmioSpacePages, MmioSpacePagesSize,
|
||||
AvailPages, AvailPagesSize,
|
||||
DivU64x32(MultU64x64(SIZE_4KB,TotalPages), SIZE_1MB), TotalPagesSize
|
||||
);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Mm shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -25,38 +25,6 @@ typedef enum {
|
|||
EfiPciEConfig
|
||||
} EFI_ACCESS_TYPE;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DumpIoModify (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ReadMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
);
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
WriteMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
GetHex (
|
||||
IN UINT16 *str,
|
||||
OUT UINT64 *data
|
||||
);
|
||||
|
||||
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
||||
{L"-mmio", TypeFlag},
|
||||
{L"-mem", TypeFlag},
|
||||
|
@ -70,6 +38,142 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
|||
|
||||
STATIC CONST UINT64 MaxNum[9] = { 0xff, 0xffff, 0xffffffff, 0xffffffffffffffff };
|
||||
|
||||
/**
|
||||
Read some data into a buffer from memory.
|
||||
|
||||
@param[in] Width The width of each read.
|
||||
@param[in] Addresss The memory location to start reading at.
|
||||
@param[in] Size The size of Buffer in Width sized units.
|
||||
@param[out] Buffer The buffer to read into.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ReadMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
OUT VOID *Buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
// This function is defective. This ASSERT prevents the defect from affecting anything.
|
||||
//
|
||||
ASSERT(Size == 1);
|
||||
do {
|
||||
if (Width == EfiPciWidthUint8) {
|
||||
*(UINT8 *) Buffer = *(UINT8 *) (UINTN) Address;
|
||||
Address -= 1;
|
||||
} else if (Width == EfiPciWidthUint16) {
|
||||
*(UINT16 *) Buffer = *(UINT16 *) (UINTN) Address;
|
||||
Address -= 2;
|
||||
} else if (Width == EfiPciWidthUint32) {
|
||||
*(UINT32 *) Buffer = *(UINT32 *) (UINTN) Address;
|
||||
Address -= 4;
|
||||
} else if (Width == EfiPciWidthUint64) {
|
||||
*(UINT64 *) Buffer = *(UINT64 *) (UINTN) Address;
|
||||
Address -= 8;
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_READ_ERROR), gShellDebug1HiiHandle);
|
||||
break;
|
||||
}
|
||||
Size--;
|
||||
} while (Size > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
Write some data to memory.
|
||||
|
||||
@param[in] Width The width of each write.
|
||||
@param[in] Addresss The memory location to start writing at.
|
||||
@param[in] Size The size of Buffer in Width sized units.
|
||||
@param[in] Buffer The buffer to write from.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
WriteMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
// This function is defective. This ASSERT prevents the defect from affecting anything.
|
||||
//
|
||||
ASSERT(Size == 1);
|
||||
do {
|
||||
if (Width == EfiPciWidthUint8) {
|
||||
*(UINT8 *) (UINTN) Address = *(UINT8 *) Buffer;
|
||||
Address += 1;
|
||||
} else if (Width == EfiPciWidthUint16) {
|
||||
*(UINT16 *) (UINTN) Address = *(UINT16 *) Buffer;
|
||||
Address += 2;
|
||||
} else if (Width == EfiPciWidthUint32) {
|
||||
*(UINT32 *) (UINTN) Address = *(UINT32 *) Buffer;
|
||||
Address += 4;
|
||||
} else if (Width == EfiPciWidthUint64) {
|
||||
*(UINT64 *) (UINTN) Address = *(UINT64 *) Buffer;
|
||||
Address += 8;
|
||||
} else {
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
Size--;
|
||||
} while (Size > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
Convert a string to it's hex data.
|
||||
|
||||
@param[in] str The pointer to the string of hex data.
|
||||
@param[out] data The pointer to the buffer to fill. Valid upon a TRUE return.
|
||||
|
||||
@retval TRUE The conversion was successful.
|
||||
@retval FALSE The conversion failed.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
GetHex (
|
||||
IN UINT16 *str,
|
||||
OUT UINT64 *data
|
||||
)
|
||||
{
|
||||
UINTN TempUint;
|
||||
CHAR16 TempChar;
|
||||
BOOLEAN Find;
|
||||
|
||||
Find = FALSE;
|
||||
//
|
||||
// convert hex digits
|
||||
//
|
||||
TempUint = 0;
|
||||
TempChar = *(str++);
|
||||
while (TempChar != CHAR_NULL) {
|
||||
if (TempChar >= 'a' && TempChar <= 'f') {
|
||||
TempChar -= 'a' - 'A';
|
||||
}
|
||||
|
||||
if (TempChar == ' ') {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((TempChar >= '0' && TempChar <= '9') || (TempChar >= 'A' && TempChar <= 'F')) {
|
||||
TempUint = TempUint << 4 | TempChar - (TempChar >= 'A' ? 'A' - 10 : '0');
|
||||
|
||||
Find = TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TempChar = *(str++);
|
||||
}
|
||||
|
||||
*data = TempUint;
|
||||
return Find;
|
||||
}
|
||||
|
||||
/**
|
||||
Get the PCI-E Address from a PCI address format 0x0000ssbbddffrrr
|
||||
where ss is SEGMENT, bb is BUS, dd is DEVICE, ff is FUNCTION
|
||||
|
@ -157,7 +261,7 @@ ShellCommandRunMm (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
if (ShellCommandLineGetCount(Package) < 1) {
|
||||
if (ShellCommandLineGetCount(Package) < 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
|
@ -165,15 +269,49 @@ ShellCommandRunMm (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-w") && ShellCommandLineGetValue(Package, L"-w") == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-w");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
} else {
|
||||
if (ShellCommandLineGetFlag(Package, L"-mmio")) {
|
||||
AccessType = EFIMemoryMappedIo;
|
||||
if (ShellCommandLineGetFlag(Package, L"-mem")
|
||||
||ShellCommandLineGetFlag(Package, L"-io")
|
||||
||ShellCommandLineGetFlag(Package, L"-pci")
|
||||
||ShellCommandLineGetFlag(Package, L"-pcie")
|
||||
){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-mem")) {
|
||||
AccessType = EfiMemory;
|
||||
if (ShellCommandLineGetFlag(Package, L"-io")
|
||||
||ShellCommandLineGetFlag(Package, L"-pci")
|
||||
||ShellCommandLineGetFlag(Package, L"-pcie")
|
||||
){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-io")) {
|
||||
AccessType = EfiIo;
|
||||
if (ShellCommandLineGetFlag(Package, L"-pci")
|
||||
||ShellCommandLineGetFlag(Package, L"-pcie")
|
||||
){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-pci")) {
|
||||
AccessType = EfiPciConfig;
|
||||
if (ShellCommandLineGetFlag(Package, L"-pcie")
|
||||
){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
} else if (ShellCommandLineGetFlag(Package, L"-pcie")) {
|
||||
AccessType = EfiPciEConfig;
|
||||
}
|
||||
|
@ -185,7 +323,7 @@ ShellCommandRunMm (
|
|||
|
||||
Temp = ShellCommandLineGetValue(Package, L"-w");
|
||||
if (Temp != NULL) {
|
||||
ItemValue = StrDecimalToUintn (Temp);
|
||||
ItemValue = ShellStrToUintn (Temp);
|
||||
|
||||
switch (ItemValue) {
|
||||
case 1:
|
||||
|
@ -209,20 +347,26 @@ ShellCommandRunMm (
|
|||
break;
|
||||
|
||||
default:
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"-w");
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, L"-w");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
|
||||
Temp = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp != NULL) {
|
||||
Address = StrHexToUint64(Temp);
|
||||
if (!ShellIsHexOrDecimalNumber(Temp, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp, (UINT64*)&Address, TRUE, FALSE))) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
Temp = ShellCommandLineGetRawValue(Package, 2);
|
||||
if (Temp != NULL) {
|
||||
Value = StrHexToUint64(Temp);
|
||||
if (!ShellIsHexOrDecimalNumber(Temp, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp, &Value, TRUE, FALSE))) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
switch (Size) {
|
||||
case 1:
|
||||
if (Value > 0xFF) {
|
||||
|
@ -304,7 +448,6 @@ ShellCommandRunMm (
|
|||
}
|
||||
}
|
||||
if (IoDev == NULL) {
|
||||
// TODO add token
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_SEGMENT_NOT_FOUND), gShellDebug1HiiHandle, SegmentNumber);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
|
@ -357,10 +500,10 @@ ShellCommandRunMm (
|
|||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCI), gShellDebug1HiiHandle);
|
||||
IoDev->Pci.Read (IoDev, Width, Address, 1, &Buffer);
|
||||
} else if (AccessType == EfiPciEConfig) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE), gShellDebug1HiiHandle);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE), gShellDebug1HiiHandle);
|
||||
IoDev->Pci.Read (IoDev, Width, PciEAddress, 1, &Buffer);
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MEM), gShellDebug1HiiHandle);
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MEM), gShellDebug1HiiHandle);
|
||||
ReadMem (Width, Address, 1, &Buffer);
|
||||
}
|
||||
|
||||
|
@ -387,68 +530,59 @@ ShellCommandRunMm (
|
|||
do {
|
||||
if (AccessType == EfiIo && Address + Size > 0x10000) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS_RANGE2), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_IO_ADDRESS_2), HiiHandle, L"mm");
|
||||
break;
|
||||
}
|
||||
|
||||
Buffer = 0;
|
||||
if (AccessType == EFIMemoryMappedIo) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MMIO), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_HMMIO), HiiHandle);
|
||||
IoDev->Mem.Read (IoDev, Width, Address, 1, &Buffer);
|
||||
} else if (AccessType == EfiIo) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_IO), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_HIO), HiiHandle);
|
||||
IoDev->Io.Read (IoDev, Width, Address, 1, &Buffer);
|
||||
} else if (AccessType == EfiPciConfig) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCI), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_HPCI), HiiHandle);
|
||||
IoDev->Pci.Read (IoDev, Width, Address, 1, &Buffer);
|
||||
} else if (AccessType == EfiPciEConfig) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_PCIE), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_HPCIE), HiiHandle);
|
||||
IoDev->Pci.Read (IoDev, Width, PciEAddress, 1, &Buffer);
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_MEM), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_HMEM), HiiHandle);
|
||||
ReadMem (Width, Address, 1, &Buffer);
|
||||
}
|
||||
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ADDRESS), gShellDebug1HiiHandle, Address);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_ADDRESS), HiiHandle, Address);
|
||||
|
||||
if (Size == 1) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF2), gShellDebug1HiiHandle, Buffer);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_BUFFER_2), HiiHandle, Buffer);
|
||||
} else if (Size == 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF4), gShellDebug1HiiHandle, Buffer);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_BUFFER_4), HiiHandle, Buffer);
|
||||
} else if (Size == 4) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF8), gShellDebug1HiiHandle, Buffer);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_BUFFER_8), HiiHandle, Buffer);
|
||||
} else if (Size == 8) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_BUF16), gShellDebug1HiiHandle, Buffer);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_BUFFER_16), HiiHandle, Buffer);
|
||||
}
|
||||
ShellPrintEx(-1, -1, L" > ");
|
||||
//
|
||||
// wait user input to modify
|
||||
//
|
||||
if (InputStr != NULL) {
|
||||
FreePool(InputStr);
|
||||
InputStr = NULL;
|
||||
}
|
||||
ShellPromptForResponse(ShellPromptResponseTypeFreeform, NULL, (VOID**)&InputStr);
|
||||
|
||||
//
|
||||
// skip space characters
|
||||
//
|
||||
for (Index = 0; InputStr[Index] == ' '; Index++);
|
||||
for (Index = 0; InputStr != NULL && InputStr[Index] == ' '; Index++);
|
||||
|
||||
//
|
||||
// parse input string
|
||||
//
|
||||
if (InputStr[Index] == '.' || InputStr[Index] == 'q' || InputStr[Index] == 'Q') {
|
||||
if (InputStr != NULL && (InputStr[Index] == '.' || InputStr[Index] == 'q' || InputStr[Index] == 'Q')) {
|
||||
Complete = TRUE;
|
||||
} else if (InputStr[Index] == CHAR_NULL) {
|
||||
} else if (InputStr == NULL || InputStr[Index] == CHAR_NULL) {
|
||||
//
|
||||
// Continue to next address
|
||||
//
|
||||
|
@ -466,8 +600,8 @@ ShellCommandRunMm (
|
|||
}
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_ERROR), HiiHandle);
|
||||
continue;
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_ERROR), HiiHandle);
|
||||
}
|
||||
|
||||
Address += Size;
|
||||
|
@ -492,111 +626,3 @@ Done:
|
|||
}
|
||||
return ShellStatus;
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
ReadMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
do {
|
||||
if (Width == EfiPciWidthUint8) {
|
||||
*(UINT8 *) Buffer = *(UINT8 *) (UINTN) Address;
|
||||
Address -= 1;
|
||||
} else if (Width == EfiPciWidthUint16) {
|
||||
*(UINT16 *) Buffer = *(UINT16 *) (UINTN) Address;
|
||||
Address -= 2;
|
||||
} else if (Width == EfiPciWidthUint32) {
|
||||
*(UINT32 *) Buffer = *(UINT32 *) (UINTN) Address;
|
||||
Address -= 4;
|
||||
} else if (Width == EfiPciWidthUint64) {
|
||||
*(UINT64 *) Buffer = *(UINT64 *) (UINTN) Address;
|
||||
Address -= 8;
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MM_READ_ERROR), gShellDebug1HiiHandle);
|
||||
// PrintToken (STRING_TOKEN (STR_IOMOD_READ_MEM_ERROR), HiiHandle);
|
||||
break;
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
Size--;
|
||||
} while (Size > 0);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
WriteMem (
|
||||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
|
||||
IN UINT64 Address,
|
||||
IN UINTN Size,
|
||||
IN VOID *Buffer
|
||||
)
|
||||
{
|
||||
do {
|
||||
if (Width == EfiPciWidthUint8) {
|
||||
*(UINT8 *) (UINTN) Address = *(UINT8 *) Buffer;
|
||||
Address += 1;
|
||||
} else if (Width == EfiPciWidthUint16) {
|
||||
*(UINT16 *) (UINTN) Address = *(UINT16 *) Buffer;
|
||||
Address += 2;
|
||||
} else if (Width == EfiPciWidthUint32) {
|
||||
*(UINT32 *) (UINTN) Address = *(UINT32 *) Buffer;
|
||||
Address += 4;
|
||||
} else if (Width == EfiPciWidthUint64) {
|
||||
*(UINT64 *) (UINTN) Address = *(UINT64 *) Buffer;
|
||||
Address += 8;
|
||||
} else {
|
||||
ASSERT (FALSE);
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
Size--;
|
||||
} while (Size > 0);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
GetHex (
|
||||
IN UINT16 *str,
|
||||
OUT UINT64 *data
|
||||
)
|
||||
{
|
||||
UINTN u;
|
||||
CHAR16 c;
|
||||
BOOLEAN Find;
|
||||
|
||||
Find = FALSE;
|
||||
//
|
||||
// convert hex digits
|
||||
//
|
||||
u = 0;
|
||||
c = *(str++);
|
||||
while (c != CHAR_NULL) {
|
||||
if (c >= 'a' && c <= 'f') {
|
||||
c -= 'a' - 'A';
|
||||
}
|
||||
|
||||
if (c == ' ') {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
|
||||
u = u << 4 | c - (c >= 'A' ? 'A' - 10 : '0');
|
||||
|
||||
Find = TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
c = *(str++);
|
||||
}
|
||||
|
||||
*data = u;
|
||||
return Find;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Mode shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the acModeanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which acModeanies this distribution. The full text of the license may be found at
|
||||
|
@ -14,6 +14,12 @@
|
|||
|
||||
#include "UefiShellDebug1CommandsLib.h"
|
||||
|
||||
/**
|
||||
Function for 'mode' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunMode (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for Pci shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -1938,14 +1938,29 @@ ShellCommandRunPci (
|
|||
}
|
||||
} else {
|
||||
|
||||
if (ShellCommandLineGetCount(Package) == 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
if (ShellCommandLineGetCount(Package) > 4) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-s");
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
//
|
||||
// Get all instances of PciRootBridgeIo. Allocate space for 1 EFI_HANDLE and
|
||||
// call LibLocateHandle(), if EFI_BUFFER_TOO_SMALL is returned, allocate enough
|
||||
// space for handles and call it again.
|
||||
//
|
||||
HandleBufSize = sizeof (EFI_HANDLE);
|
||||
HandleBuf = (EFI_HANDLE *) AllocatePool (HandleBufSize);
|
||||
HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize);
|
||||
if (HandleBuf == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_OUT_OF_RESOURCES;
|
||||
|
@ -1987,7 +2002,7 @@ ShellCommandRunPci (
|
|||
//
|
||||
// Argument Count == 1(no other argument): enumerate all pci functions
|
||||
//
|
||||
if (ShellCommandLineGetCount(Package) == 0) {
|
||||
if (ShellCommandLineGetCount(Package) == 1) {
|
||||
gST->ConOut->QueryMode (
|
||||
gST->ConOut,
|
||||
gST->ConOut->Mode->Mode,
|
||||
|
@ -2134,20 +2149,6 @@ ShellCommandRunPci (
|
|||
goto Done;
|
||||
}
|
||||
|
||||
if (ShellCommandLineGetCount(Package) == 1) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
//
|
||||
// Arg count >= 3, dump binary of specified function, interpret if necessary
|
||||
//
|
||||
if (ShellCommandLineGetCount(Package) > 3) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ExplainData = FALSE;
|
||||
Segment = 0;
|
||||
Bus = 0;
|
||||
|
@ -2159,7 +2160,7 @@ ShellCommandRunPci (
|
|||
|
||||
Temp = ShellCommandLineGetValue(Package, L"-s");
|
||||
if (Temp != NULL) {
|
||||
Segment = (UINT16) StrHexToUintn (Temp);
|
||||
Segment = (UINT16) ShellStrToUintn (Temp);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2168,7 +2169,7 @@ ShellCommandRunPci (
|
|||
//
|
||||
Temp = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp != NULL) {
|
||||
Bus = (UINT16)StrHexToUintn(Temp);
|
||||
Bus = (UINT16)ShellStrToUintn(Temp);
|
||||
if (Bus > MAX_BUS_NUMBER) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -2177,7 +2178,7 @@ ShellCommandRunPci (
|
|||
}
|
||||
Temp = ShellCommandLineGetRawValue(Package, 2);
|
||||
if (Temp != NULL) {
|
||||
Device = (UINT16) StrHexToUintn(Temp);
|
||||
Device = (UINT16) ShellStrToUintn(Temp);
|
||||
if (Device > MAX_DEVICE_NUMBER){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -2187,7 +2188,7 @@ ShellCommandRunPci (
|
|||
|
||||
Temp = ShellCommandLineGetRawValue(Package, 3);
|
||||
if (Temp != NULL) {
|
||||
Func = (UINT16) StrHexToUintn(Temp);
|
||||
Func = (UINT16) ShellStrToUintn(Temp);
|
||||
if (Func > MAX_FUNCTION_NUMBER){
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
|
@ -2469,21 +2470,22 @@ Returns:
|
|||
// if a bus typed one is found and its bus range covers bus, this handle
|
||||
// is the handle we are looking for.
|
||||
//
|
||||
if ((*Descriptors)->Desc == ACPI_END_TAG_DESCRIPTOR) {
|
||||
*IsEnd = TRUE;
|
||||
}
|
||||
|
||||
while ((*Descriptors)->Desc != ACPI_END_TAG_DESCRIPTOR) {
|
||||
if ((*Descriptors)->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) {
|
||||
*MinBus = (UINT16) (*Descriptors)->AddrRangeMin;
|
||||
*MaxBus = (UINT16) (*Descriptors)->AddrRangeMax;
|
||||
(*Descriptors)++;
|
||||
break;
|
||||
return (EFI_SUCCESS);
|
||||
}
|
||||
|
||||
(*Descriptors)++;
|
||||
}
|
||||
|
||||
if ((*Descriptors)->Desc == ACPI_END_TAG_DESCRIPTOR) {
|
||||
*IsEnd = TRUE;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -4496,7 +4498,7 @@ PciExplainPciExpress (
|
|||
|
||||
ExtendRegSize = 0x1000 - 0x100;
|
||||
|
||||
ExRegBuffer = (UINT8 *) AllocatePool (ExtendRegSize);
|
||||
ExRegBuffer = (UINT8 *) AllocateZeroPool (ExtendRegSize);
|
||||
|
||||
//
|
||||
// PciRootBridgeIo protocol should support pci express extend space IO
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for SerMode shell Debug1 function.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -16,9 +16,20 @@
|
|||
#include <Library/ShellLib.h>
|
||||
#include <Protocol/SerialIo.h>
|
||||
|
||||
/**
|
||||
Display information about a serial device by it's handle.
|
||||
|
||||
If HandleValid is FALSE, do all devices.
|
||||
|
||||
@param[in] HandleIdx The handle index for the device.
|
||||
@param[in] HandleValid TRUE if HandleIdx is valid.
|
||||
|
||||
@retval SHELL_INVALID_PARAMETER A parameter was invalid.
|
||||
@retval SHELL_SUCCESS The operation was successful.
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
iDisplaySettings (
|
||||
DisplaySettings (
|
||||
IN UINTN HandleIdx,
|
||||
IN BOOLEAN HandleValid
|
||||
)
|
||||
|
@ -147,6 +158,12 @@ iDisplaySettings (
|
|||
return ShellStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
Function for 'sermode' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunSerMode (
|
||||
|
@ -169,6 +186,7 @@ ShellCommandRunSerMode (
|
|||
LIST_ENTRY *Package;
|
||||
CHAR16 *ProblemParam;
|
||||
CONST CHAR16 *Temp;
|
||||
UINT64 Intermediate;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
HandleIdx = 0;
|
||||
|
@ -188,28 +206,29 @@ ShellCommandRunSerMode (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
if (ShellCommandLineGetCount(Package) < 5 && ShellCommandLineGetCount(Package) > 1) {
|
||||
if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (ShellCommandLineGetCount(Package) > 5) {
|
||||
} else if (ShellCommandLineGetCount(Package) > 6) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
Temp = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp != NULL) {
|
||||
HandleIdx = StrHexToUintn(Temp);
|
||||
Status = ShellConvertStringToUint64(Temp, &Intermediate, TRUE, FALSE);
|
||||
HandleIdx = (UINTN)Intermediate;
|
||||
Temp = ShellCommandLineGetRawValue(Package, 2);
|
||||
if (Temp == NULL) {
|
||||
ShellStatus = iDisplaySettings (HandleIdx, TRUE);
|
||||
ShellStatus = DisplaySettings (HandleIdx, TRUE);
|
||||
goto Done;
|
||||
}
|
||||
} else {
|
||||
ShellStatus = iDisplaySettings (0, FALSE);
|
||||
ShellStatus = DisplaySettings (0, FALSE);
|
||||
goto Done;
|
||||
}
|
||||
Temp = ShellCommandLineGetRawValue(Package, 2);
|
||||
if (Temp != NULL) {
|
||||
BaudRate = StrHexToUintn(Temp);
|
||||
BaudRate = ShellStrToUintn(Temp);
|
||||
} else {
|
||||
ASSERT(FALSE);
|
||||
BaudRate = 0;
|
||||
|
@ -252,7 +271,7 @@ ShellCommandRunSerMode (
|
|||
}
|
||||
Temp = ShellCommandLineGetRawValue(Package, 4);
|
||||
if (Temp != NULL) {
|
||||
DataBits = StrHexToUintn(Temp);
|
||||
DataBits = ShellStrToUintn(Temp);
|
||||
} else {
|
||||
//
|
||||
// make sure this is some number not in the list below.
|
||||
|
@ -270,7 +289,7 @@ ShellCommandRunSerMode (
|
|||
goto Done;
|
||||
}
|
||||
Temp = ShellCommandLineGetRawValue(Package, 5);
|
||||
Value = StrHexToUintn(Temp);
|
||||
Value = ShellStrToUintn(Temp);
|
||||
switch (Value) {
|
||||
case 0:
|
||||
StopBits = DefaultStopBits;
|
||||
|
@ -328,7 +347,7 @@ ShellCommandRunSerMode (
|
|||
}
|
||||
}
|
||||
|
||||
if (Index == NoHandles) {
|
||||
if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, HandleIdx);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for SetSize shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -14,6 +14,12 @@
|
|||
|
||||
#include "UefiShellDebug1CommandsLib.h"
|
||||
|
||||
/**
|
||||
Function for 'setsize' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunSetSize (
|
||||
|
@ -55,20 +61,31 @@ ShellCommandRunSetSize (
|
|||
ASSERT(FALSE);
|
||||
}
|
||||
} else {
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (Temp1 == NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle);
|
||||
if (ShellCommandLineGetCount(Package) < 3) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
NewSize = 0;
|
||||
} else {
|
||||
NewSize = ShellStrToUintn(Temp1);
|
||||
Temp1 = ShellCommandLineGetRawValue(Package, 1);
|
||||
if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
NewSize = 0;
|
||||
} else {
|
||||
NewSize = ShellStrToUintn(Temp1);
|
||||
}
|
||||
}
|
||||
for (LoopVar = 2 ; LoopVar < ShellCommandLineGetCount(Package) && ShellStatus == SHELL_SUCCESS ; LoopVar++) {
|
||||
Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
Status = ShellOpenFileByName(ShellCommandLineGetRawValue(Package, LoopVar), &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
}
|
||||
if (EFI_ERROR(Status) && LoopVar == 2) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_OPEN_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar), Status);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
break;
|
||||
} else {
|
||||
Status = FileHandleSetSize(FileHandle, NewSize);
|
||||
|
@ -78,6 +95,8 @@ ShellCommandRunSetSize (
|
|||
} else if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar), Status);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar));
|
||||
}
|
||||
ShellCloseFile(&FileHandle);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for SetVar shell Debug1 function.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -22,6 +22,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
|
|||
{NULL, TypeMax}
|
||||
};
|
||||
|
||||
/**
|
||||
Function for 'setvar' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunSetVar (
|
||||
|
@ -38,6 +44,7 @@ ShellCommandRunSetVar (
|
|||
EFI_GUID Guid;
|
||||
CONST CHAR16 *StringGuid;
|
||||
UINT32 Attributes;
|
||||
UINT32 Attributes2;
|
||||
VOID *Buffer;
|
||||
UINTN Size;
|
||||
UINTN LoopVar;
|
||||
|
@ -88,7 +95,8 @@ ShellCommandRunSetVar (
|
|||
StringGuid = ShellCommandLineGetValue(Package, L"-guid");
|
||||
Status = ConvertStringToGuid(StringGuid, &Guid);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, StringGuid);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
if (Data == NULL) {
|
||||
|
@ -97,7 +105,7 @@ ShellCommandRunSetVar (
|
|||
//
|
||||
Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
Buffer = AllocatePool(Size);
|
||||
Buffer = AllocateZeroPool(Size);
|
||||
Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes, &Size, Buffer);
|
||||
}
|
||||
if (!EFI_ERROR(Status)&& Buffer != NULL) {
|
||||
|
@ -138,22 +146,36 @@ ShellCommandRunSetVar (
|
|||
Attributes |= EFI_VARIABLE_NON_VOLATILE;
|
||||
}
|
||||
if (ShellIsHexOrDecimalNumber(Data, TRUE, FALSE)) {
|
||||
//
|
||||
// arbitrary buffer
|
||||
//
|
||||
Buffer = AllocateZeroPool((StrLen(Data) / 2));
|
||||
for (LoopVar = 0 ; LoopVar < (StrLen(Data) / 2) ; LoopVar++) {
|
||||
((UINT8*)Buffer)[LoopVar] = (UINT8)(HexCharToUintn(Data[LoopVar*2]) * 16);
|
||||
((UINT8*)Buffer)[LoopVar] = (UINT8)(((UINT8*)Buffer)[LoopVar] + HexCharToUintn(Data[LoopVar*2+1]));
|
||||
}
|
||||
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, StrLen(Data) / 2, Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
|
||||
ShellStatus = SHELL_ACCESS_DENIED;
|
||||
if (StrLen(Data) % 2 != 0) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDebug1HiiHandle, Data);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
ASSERT(ShellStatus == SHELL_SUCCESS);
|
||||
//
|
||||
// arbitrary buffer
|
||||
//
|
||||
Buffer = AllocateZeroPool((StrLen(Data) / 2));
|
||||
for (LoopVar = 0 ; LoopVar < (StrLen(Data) / 2) ; LoopVar++) {
|
||||
((UINT8*)Buffer)[LoopVar] = (UINT8)(HexCharToUintn(Data[LoopVar*2]) * 16);
|
||||
((UINT8*)Buffer)[LoopVar] = (UINT8)(((UINT8*)Buffer)[LoopVar] + HexCharToUintn(Data[LoopVar*2+1]));
|
||||
}
|
||||
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, StrLen(Data) / 2, Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
|
||||
ShellStatus = SHELL_ACCESS_DENIED;
|
||||
} else {
|
||||
ASSERT(ShellStatus == SHELL_SUCCESS);
|
||||
}
|
||||
}
|
||||
} else if (StrnCmp(Data, L"\"", 1) == 0) {
|
||||
Size = 0;
|
||||
Attributes2 = 0;
|
||||
Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes2, &Size, Buffer);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
Buffer = AllocateZeroPool(Size);
|
||||
Status = gRT->GetVariable((CHAR16*)VariableName, &Guid, &Attributes2, &Size, Buffer);
|
||||
FreePool(Buffer);
|
||||
Attributes = Attributes2;
|
||||
}
|
||||
//
|
||||
// ascii text
|
||||
//
|
||||
|
@ -162,6 +184,7 @@ ShellCommandRunSetVar (
|
|||
AsciiSPrint(Buffer, StrSize(Data) / 2, "%s", Data);
|
||||
((CHAR8*)Buffer)[AsciiStrLen(Buffer)-1] = CHAR_NULL;
|
||||
|
||||
|
||||
Status = gRT->SetVariable((CHAR16*)VariableName, &Guid, Attributes, AsciiStrSize(Buffer)-sizeof(CHAR8), Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_SET), gShellDebug1HiiHandle, &Guid, VariableName, Status);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Tools of clarify the content of the smbios table.
|
||||
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -52,7 +52,7 @@ ShellCommandRunSmbiosView (
|
|||
Package = NULL;
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
|
||||
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
|
||||
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, ProblemParam);
|
||||
|
@ -65,11 +65,21 @@ ShellCommandRunSmbiosView (
|
|||
if (ShellCommandLineGetCount(Package) > 1) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else if (
|
||||
(ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||
|
||||
(ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-s")) ||
|
||||
(ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-a")) ||
|
||||
(ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-s")) ||
|
||||
(ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) ||
|
||||
(ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a"))
|
||||
) {
|
||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);
|
||||
ShellStatus = SHELL_INVALID_PARAMETER;
|
||||
} else {
|
||||
|
||||
//
|
||||
// Init Lib
|
||||
//
|
||||
|
||||
Status = LibSmbiosInit ();
|
||||
if (EFI_ERROR (Status)) {
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
|
@ -370,7 +380,7 @@ InitSmbiosTableStatistics (
|
|||
mStatisticsTable = NULL;
|
||||
}
|
||||
|
||||
mStatisticsTable = (STRUCTURE_STATISTICS *) AllocatePool (SMBiosTable->NumberOfSmbiosStructures * sizeof (STRUCTURE_STATISTICS));
|
||||
mStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (SMBiosTable->NumberOfSmbiosStructures * sizeof (STRUCTURE_STATISTICS));
|
||||
|
||||
if (mStatisticsTable == NULL) {
|
||||
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OUT_OF_MEM), gShellDebug1HiiHandle);
|
||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for NULL named library for debug1 profile shell command functions.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -21,6 +21,12 @@ CONST EFI_GUID gShellDebug1HiiGuid = \
|
|||
0x25f200aa, 0xd3cb, 0x470a, { 0xbf, 0x51, 0xe7, 0xd1, 0x62, 0xd2, 0x2e, 0x6f } \
|
||||
};
|
||||
|
||||
/**
|
||||
Gets the debug file name. This will be used if HII is not working.
|
||||
|
||||
@retval NULL No file is available.
|
||||
@return The NULL-terminated filename to get help from.
|
||||
**/
|
||||
CONST CHAR16*
|
||||
EFIAPI
|
||||
ShellCommandGetManFileNameDebug1 (
|
||||
|
@ -64,21 +70,23 @@ UefiShellDebug1CommandsLibConstructor (
|
|||
//
|
||||
// install our shell command handlers that are always installed
|
||||
//
|
||||
ShellCommandRegisterCommandName(L"SetSize", ShellCommandRunSetSize , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETSIZE) );
|
||||
ShellCommandRegisterCommandName(L"setsize", ShellCommandRunSetSize , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETSIZE) );
|
||||
ShellCommandRegisterCommandName(L"comp", ShellCommandRunComp , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_COMP) );
|
||||
ShellCommandRegisterCommandName(L"mode", ShellCommandRunMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MODE) );
|
||||
ShellCommandRegisterCommandName(L"memmap", ShellCommandRunMemMap , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MEMMAP) );
|
||||
ShellCommandRegisterCommandName(L"eficompress", ShellCommandRunEfiCompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFICOMPRESS) );
|
||||
ShellCommandRegisterCommandName(L"efidecompress", ShellCommandRunEfiDecompress , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EFIDCOMPRESS) );
|
||||
ShellCommandRegisterCommandName(L"dmem", ShellCommandRunDmem , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMEM) );
|
||||
ShellCommandRegisterCommandName(L"LoadPciRom", ShellCommandRunLoadPciRom , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_LOAD_PCI_ROM) );
|
||||
ShellCommandRegisterCommandName(L"loadpcirom", ShellCommandRunLoadPciRom , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_LOAD_PCI_ROM) );
|
||||
ShellCommandRegisterCommandName(L"mm", ShellCommandRunMm , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_MM) );
|
||||
ShellCommandRegisterCommandName(L"SetVar", ShellCommandRunSetVar , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETVAR) );
|
||||
ShellCommandRegisterCommandName(L"SerMode", ShellCommandRunSerMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SERMODE) );
|
||||
ShellCommandRegisterCommandName(L"Pci", ShellCommandRunPci , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_PCI) );
|
||||
ShellCommandRegisterCommandName(L"setvar", ShellCommandRunSetVar , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SETVAR) );
|
||||
ShellCommandRegisterCommandName(L"sermode", ShellCommandRunSerMode , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SERMODE) );
|
||||
ShellCommandRegisterCommandName(L"pci", ShellCommandRunPci , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_PCI) );
|
||||
ShellCommandRegisterCommandName(L"smbiosview", ShellCommandRunSmbiosView , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_SMBIOSVIEW) );
|
||||
ShellCommandRegisterCommandName(L"dmpstore", ShellCommandRunDmpStore , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DMPSTORE) );
|
||||
ShellCommandRegisterCommandName(L"dblk", ShellCommandRunDblk , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_DBLK) );
|
||||
ShellCommandRegisterCommandName(L"edit", ShellCommandRunEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EDIT) );
|
||||
ShellCommandRegisterCommandName(L"hexedit", ShellCommandRunHexEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_HEXEDIT) );
|
||||
|
||||
//
|
||||
// check install profile bit of the profiles mask is set
|
||||
|
@ -87,10 +95,8 @@ UefiShellDebug1CommandsLibConstructor (
|
|||
ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfg , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG) );
|
||||
}
|
||||
|
||||
/*
|
||||
ShellCommandRegisterCommandName(L"hexedit", ShellCommandRunHexEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_HEXEDIT );
|
||||
ShellCommandRegisterCommandName(L"edit", ShellCommandRunEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EDIT) );
|
||||
*/
|
||||
|
||||
|
||||
|
||||
ShellCommandRegisterAlias(L"dmem", L"mem");
|
||||
|
||||
|
@ -99,6 +105,9 @@ UefiShellDebug1CommandsLibConstructor (
|
|||
|
||||
/**
|
||||
Destructor for the library. free any resources.
|
||||
|
||||
@param ImageHandle The image handle of the process.
|
||||
@param SystemTable The EFI System Table pointer.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
|
@ -132,6 +141,14 @@ STATIC CONST CHAR8 Hex[] = {
|
|||
'F'
|
||||
};
|
||||
|
||||
/**
|
||||
Dump some hexadecimal data to the screen.
|
||||
|
||||
@param[in] Indent How many spaces to indent the output.
|
||||
@param[in] Offset The offset of the printing.
|
||||
@param[in] DataSize The size in bytes of UserData.
|
||||
@param[in] UserData The data to print out.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DumpHex (
|
||||
|
@ -147,12 +164,10 @@ DumpHex (
|
|||
|
||||
CHAR8 Str[20];
|
||||
|
||||
UINT8 c;
|
||||
UINT8 TempByte;
|
||||
UINTN Size;
|
||||
UINTN Index;
|
||||
|
||||
ASSERT (UserData != NULL);
|
||||
|
||||
Data = UserData;
|
||||
while (DataSize != 0) {
|
||||
Size = 16;
|
||||
|
@ -161,11 +176,11 @@ DumpHex (
|
|||
}
|
||||
|
||||
for (Index = 0; Index < Size; Index += 1) {
|
||||
c = Data[Index];
|
||||
Val[Index * 3 + 0] = Hex[c >> 4];
|
||||
Val[Index * 3 + 1] = Hex[c & 0xF];
|
||||
TempByte = Data[Index];
|
||||
Val[Index * 3 + 0] = Hex[TempByte >> 4];
|
||||
Val[Index * 3 + 1] = Hex[TempByte & 0xF];
|
||||
Val[Index * 3 + 2] = (CHAR8) ((Index == 7) ? '-' : ' ');
|
||||
Str[Index] = (CHAR8) ((c < ' ' || c > 'z') ? '.' : c);
|
||||
Str[Index] = (CHAR8) ((TempByte < ' ' || TempByte > 'z') ? '.' : TempByte);
|
||||
}
|
||||
|
||||
Val[Index * 3] = 0;
|
||||
|
@ -213,7 +228,7 @@ CharToUpper (
|
|||
EFI System Table based on the provided GUID.
|
||||
|
||||
@param[in] TableGuid A pointer to the table's GUID type.
|
||||
@param[out] Table On exit, a pointer to a system configuration table.
|
||||
@param[in,out] Table On exit, a pointer to a system configuration table.
|
||||
|
||||
@retval EFI_SUCCESS A configuration table matching TableGuid was found.
|
||||
@retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
|
||||
|
@ -229,7 +244,7 @@ GetSystemConfigurationTable (
|
|||
ASSERT (Table != NULL);
|
||||
|
||||
for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
|
||||
if (CompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid)) == 0) {
|
||||
if (CompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
|
||||
*Table = gST->ConfigurationTable[Index].VendorTable;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -264,6 +279,15 @@ HexCharToUintn (
|
|||
return (UINTN) (10 + CharToUpper (Char) - L'A');
|
||||
}
|
||||
|
||||
/**
|
||||
Convert a string representation of a guid to a Guid value.
|
||||
|
||||
@param[in] StringGuid The pointer to the string of a guid.
|
||||
@param[in,out] Guid The pointer to the GUID structure to populate.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||
@retval EFI_SUCCESS The conversion was successful.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ConvertStringToGuid (
|
||||
|
@ -271,39 +295,399 @@ ConvertStringToGuid (
|
|||
IN OUT EFI_GUID *Guid
|
||||
)
|
||||
{
|
||||
if (StrLen(StringGuid) != 35) {
|
||||
CHAR16 *TempCopy;
|
||||
CHAR16 *TempSpot;
|
||||
CHAR16 *Walker;
|
||||
UINT64 TempVal;
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (StringGuid == NULL) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
} else {
|
||||
Guid->Data1 = (UINT32)StrHexToUintn(StringGuid);
|
||||
StringGuid += 9;
|
||||
Guid->Data2 = (UINT16)StrHexToUintn(StringGuid);
|
||||
StringGuid += 5;
|
||||
Guid->Data3 = (UINT16)StrHexToUintn(StringGuid);
|
||||
StringGuid += 5;
|
||||
Guid->Data4[0] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[0] = (UINT8)(Guid->Data4[0]+ (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[1] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[1] = (UINT8)(Guid->Data4[1] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[2] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[2] = (UINT8)(Guid->Data4[2] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[3] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[3] = (UINT8)(Guid->Data4[3] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[4] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[4] = (UINT8)(Guid->Data4[4] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[5] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[5] = (UINT8)(Guid->Data4[5] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[6] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[6] = (UINT8)(Guid->Data4[6] + (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
StringGuid += 2;
|
||||
Guid->Data4[7] = (UINT8)(HexCharToUintn(StringGuid[0]) * 16);
|
||||
Guid->Data4[7] = (UINT8)(Guid->Data4[7] = (UINT8)HexCharToUintn(StringGuid[1]));
|
||||
return (EFI_SUCCESS);
|
||||
} else if (StrLen(StringGuid) != 36) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
TempCopy = NULL;
|
||||
TempCopy = StrnCatGrow(&TempCopy, NULL, StringGuid, 0);
|
||||
Walker = TempCopy;
|
||||
TempSpot = StrStr(Walker, L"-");
|
||||
*TempSpot = CHAR_NULL;
|
||||
Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
FreePool(TempCopy);
|
||||
return (Status);
|
||||
}
|
||||
Guid->Data1 = (UINT32)TempVal;
|
||||
Walker += 9;
|
||||
TempSpot = StrStr(Walker, L"-");
|
||||
*TempSpot = CHAR_NULL;
|
||||
Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
FreePool(TempCopy);
|
||||
return (Status);
|
||||
}
|
||||
Guid->Data2 = (UINT16)TempVal;
|
||||
Walker += 5;
|
||||
TempSpot = StrStr(Walker, L"-");
|
||||
*TempSpot = CHAR_NULL;
|
||||
Status = ShellConvertStringToUint64(Walker, &TempVal, TRUE, FALSE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
FreePool(TempCopy);
|
||||
return (Status);
|
||||
}
|
||||
Guid->Data3 = (UINT16)TempVal;
|
||||
Walker += 5;
|
||||
Guid->Data4[0] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[0] = (UINT8)(Guid->Data4[0]+ (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[1] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[1] = (UINT8)(Guid->Data4[1] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 3;
|
||||
Guid->Data4[2] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[2] = (UINT8)(Guid->Data4[2] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[3] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[3] = (UINT8)(Guid->Data4[3] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[4] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[4] = (UINT8)(Guid->Data4[4] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[5] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[5] = (UINT8)(Guid->Data4[5] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[6] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[6] = (UINT8)(Guid->Data4[6] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
Walker += 2;
|
||||
Guid->Data4[7] = (UINT8)(HexCharToUintn(Walker[0]) * 16);
|
||||
Guid->Data4[7] = (UINT8)(Guid->Data4[7] + (UINT8)HexCharToUintn(Walker[1]));
|
||||
FreePool(TempCopy);
|
||||
return (EFI_SUCCESS);
|
||||
}
|
||||
|
||||
CHAR16 TempBufferCatSPrint[1000];
|
||||
/**
|
||||
Appends a formatted Unicode string to a Null-terminated Unicode string
|
||||
|
||||
This function appends a formatted Unicode string to the Null-terminated
|
||||
Unicode string specified by String. String is optional and may be NULL.
|
||||
Storage for the formatted Unicode string returned is allocated using
|
||||
AllocateZeroPool(). The pointer to the appended string is returned. The caller
|
||||
is responsible for freeing the returned string.
|
||||
|
||||
If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Format is NULL, then ASSERT().
|
||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
@param String A null-terminated Unicode string.
|
||||
@param FormatString A null-terminated Unicode format string.
|
||||
@param ... The variable argument list whose contents are accessed based
|
||||
on the format string specified by Format.
|
||||
|
||||
@retval NULL There was not enough available memory.
|
||||
@return Null terminated Unicode string is that is the formatted
|
||||
string appended to String.
|
||||
@sa CatVSPrint
|
||||
**/
|
||||
CHAR16*
|
||||
EFIAPI
|
||||
CatSPrint (
|
||||
IN CONST CHAR16 *String OPTIONAL,
|
||||
IN CONST CHAR16 *FormatString,
|
||||
...
|
||||
)
|
||||
{
|
||||
VA_LIST Marker;
|
||||
UINTN StringLength;
|
||||
if (String != NULL) {
|
||||
StrCpy(TempBufferCatSPrint, String);
|
||||
} else {
|
||||
*TempBufferCatSPrint = CHAR_NULL;
|
||||
}
|
||||
VA_START (Marker, FormatString);
|
||||
StringLength = StrLen(TempBufferCatSPrint);
|
||||
|
||||
UnicodeVSPrint(TempBufferCatSPrint+StrLen(TempBufferCatSPrint), 1000-StringLength, FormatString, Marker);
|
||||
return (AllocateCopyPool(StrSize(TempBufferCatSPrint), TempBufferCatSPrint));
|
||||
}
|
||||
|
||||
/**
|
||||
Clear the line at the specified Row.
|
||||
|
||||
@param[in] Row The row number to be cleared ( start from 1 )
|
||||
@param[in] LastCol The last printable column.
|
||||
@param[in] LastRow The last printable row.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
EditorClearLine (
|
||||
IN UINTN Row,
|
||||
IN UINTN LastCol,
|
||||
IN UINTN LastRow
|
||||
)
|
||||
{
|
||||
CHAR16 Line[200];
|
||||
|
||||
if (Row == 0) {
|
||||
Row = 1;
|
||||
}
|
||||
|
||||
//
|
||||
// prepare a blank line
|
||||
//
|
||||
SetMem16(Line, LastCol*sizeof(CHAR16), L' ');
|
||||
|
||||
if (Row == LastRow) {
|
||||
//
|
||||
// if CHAR_NULL is still at position 80, it will cause first line error
|
||||
//
|
||||
Line[LastCol - 1] = CHAR_NULL;
|
||||
} else {
|
||||
Line[LastCol] = CHAR_NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// print out the blank line
|
||||
//
|
||||
ShellPrintEx (0, ((INT32)Row) - 1, Line);
|
||||
}
|
||||
|
||||
/**
|
||||
Determine if the character is valid for a filename.
|
||||
|
||||
@param[in] Ch The character to test.
|
||||
|
||||
@retval TRUE The character is valid.
|
||||
@retval FALSE The character is not valid.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsValidFileNameChar (
|
||||
IN CONST CHAR16 Ch
|
||||
)
|
||||
{
|
||||
//
|
||||
// See if there are any illegal characters within the name
|
||||
//
|
||||
if (Ch < 0x20 || Ch == L'\"' || Ch == L'*' || Ch == L'/' || Ch == L'<' || Ch == L'>' || Ch == L'?' || Ch == L'|' || Ch == L' ') {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Check if file name has illegal characters.
|
||||
|
||||
@param Name The filename to check.
|
||||
|
||||
@retval TRUE The filename is ok.
|
||||
@retval FALSE The filename is not ok.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsValidFileName (
|
||||
IN CONST CHAR16 *Name
|
||||
)
|
||||
{
|
||||
|
||||
UINTN Index;
|
||||
UINTN Len;
|
||||
|
||||
//
|
||||
// check the length of Name
|
||||
//
|
||||
for (Len = 0, Index = StrLen (Name) - 1; Index + 1 != 0; Index--, Len++) {
|
||||
if (Name[Index] == '\\' || Name[Index] == ':') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Len == 0 || Len > 255) {
|
||||
return FALSE;
|
||||
}
|
||||
//
|
||||
// check whether any char in Name not appears in valid file name char
|
||||
//
|
||||
for (Index = 0; Index < StrLen (Name); Index++) {
|
||||
if (!IsValidFileNameChar (Name[Index])) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Find a filename that is valid (not taken) with the given extension.
|
||||
|
||||
@param[in] Extension The file extension.
|
||||
|
||||
@retval NULL Something went wrong.
|
||||
@return the valid filename.
|
||||
**/
|
||||
CHAR16 *
|
||||
EFIAPI
|
||||
EditGetDefaultFileName (
|
||||
IN CONST CHAR16 *Extension
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN Suffix;
|
||||
BOOLEAN FoundNewFile;
|
||||
CHAR16 *FileNameTmp;
|
||||
|
||||
Suffix = 0;
|
||||
FoundNewFile = FALSE;
|
||||
|
||||
do {
|
||||
FileNameTmp = CatSPrint (NULL, L"NewFile%d.%s", Suffix, Extension);
|
||||
|
||||
//
|
||||
// after that filename changed to path
|
||||
//
|
||||
Status = ShellFileExists (FileNameTmp);
|
||||
|
||||
if (Status == EFI_NOT_FOUND) {
|
||||
return FileNameTmp;
|
||||
}
|
||||
|
||||
FreePool (FileNameTmp);
|
||||
FileNameTmp = NULL;
|
||||
Suffix++;
|
||||
} while (Suffix != 0);
|
||||
|
||||
FreePool (FileNameTmp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
Read a file into an allocated buffer. The buffer is the responsibility
|
||||
of the caller to free.
|
||||
|
||||
@param[in] FileName The filename of the file to open.
|
||||
@param[out] Buffer Upon successful return, the pointer to the
|
||||
address of the allocated buffer.
|
||||
@param[out] BufferSize If not NULL, then the pointer to the size
|
||||
of the allocated buffer.
|
||||
@param[out] ReadOnly Upon successful return TRUE if the file is
|
||||
read only. FALSE otherwise.
|
||||
|
||||
@retval EFI_NOT_FOUND The filename did not represent a file in the
|
||||
file system.
|
||||
@retval EFI_SUCCESS The file was read into the buffer.
|
||||
@retval EFI_OUT_OF_RESOURCES A memory allocation failed.
|
||||
@retval EFI_LOAD_ERROR The file read operation failed.
|
||||
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||
@retval EFI_INVALID_PARAMETER FileName was NULL.
|
||||
@retval EFI_INVALID_PARAMETER FileName was a directory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ReadFileIntoBuffer (
|
||||
IN CONST CHAR16 *FileName,
|
||||
OUT VOID **Buffer,
|
||||
OUT UINTN *BufferSize OPTIONAL,
|
||||
OUT BOOLEAN *ReadOnly
|
||||
)
|
||||
{
|
||||
VOID *InternalBuffer;
|
||||
UINTN FileSize;
|
||||
SHELL_FILE_HANDLE FileHandle;
|
||||
BOOLEAN CreateFile;
|
||||
EFI_STATUS Status;
|
||||
EFI_FILE_INFO *Info;
|
||||
|
||||
InternalBuffer = NULL;
|
||||
FileSize = 0;
|
||||
FileHandle = NULL;
|
||||
CreateFile = FALSE;
|
||||
Status = EFI_SUCCESS;
|
||||
Info = NULL;
|
||||
|
||||
if (FileName == NULL || Buffer == NULL || ReadOnly == NULL) {
|
||||
return (EFI_INVALID_PARAMETER);
|
||||
}
|
||||
|
||||
//
|
||||
// try to open the file
|
||||
//
|
||||
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ, 0);
|
||||
|
||||
if (!EFI_ERROR(Status)) {
|
||||
ASSERT(CreateFile == FALSE);
|
||||
if (FileHandle == NULL) {
|
||||
return EFI_LOAD_ERROR;
|
||||
}
|
||||
|
||||
Info = ShellGetFileInfo(FileHandle);
|
||||
|
||||
if (Info->Attribute & EFI_FILE_DIRECTORY) {
|
||||
FreePool (Info);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (Info->Attribute & EFI_FILE_READ_ONLY) {
|
||||
*ReadOnly = TRUE;
|
||||
} else {
|
||||
*ReadOnly = FALSE;
|
||||
}
|
||||
//
|
||||
// get file size
|
||||
//
|
||||
FileSize = (UINTN) Info->FileSize;
|
||||
|
||||
FreePool (Info);
|
||||
} else if (Status == EFI_NOT_FOUND) {
|
||||
//
|
||||
// file not exists. add create and try again
|
||||
//
|
||||
Status = ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
} else {
|
||||
//
|
||||
// it worked. now delete it and move on with the name (now validated)
|
||||
//
|
||||
Status = ShellDeleteFile (&FileHandle);
|
||||
if (Status == EFI_WARN_DELETE_FAILURE) {
|
||||
Status = EFI_ACCESS_DENIED;
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
//
|
||||
// file doesn't exist, so set CreateFile to TRUE and can't be read-only
|
||||
//
|
||||
CreateFile = TRUE;
|
||||
*ReadOnly = FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// the file exists
|
||||
//
|
||||
if (!CreateFile) {
|
||||
//
|
||||
// allocate buffer to read file
|
||||
//
|
||||
InternalBuffer = AllocateZeroPool (FileSize);
|
||||
if (InternalBuffer == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// read file into InternalBuffer
|
||||
//
|
||||
Status = ShellReadFile (FileHandle, &FileSize, InternalBuffer);
|
||||
ShellCloseFile(&FileHandle);
|
||||
FileHandle = NULL;
|
||||
if (EFI_ERROR (Status)) {
|
||||
SHELL_FREE_NON_NULL (InternalBuffer);
|
||||
return EFI_LOAD_ERROR;
|
||||
}
|
||||
}
|
||||
*Buffer = InternalBuffer;
|
||||
if (BufferSize != NULL) {
|
||||
*BufferSize = FileSize;
|
||||
}
|
||||
return (EFI_SUCCESS);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Main file for NULL named library for Profile1 shell command functions.
|
||||
|
||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
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
|
||||
|
@ -12,12 +12,16 @@
|
|||
|
||||
**/
|
||||
|
||||
#if !defined (_UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_)
|
||||
#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <ShellBase.h>
|
||||
|
||||
#include <Guid/GlobalVariable.h>
|
||||
#include <Guid/ConsoleInDevice.h>
|
||||
#include <Guid/ConsoleOutDevice.h>
|
||||
#include <Guid/FileSystemInfo.h>
|
||||
|
||||
#include <Protocol/EfiShell.h>
|
||||
#include <Protocol/EfiShellParameters.h>
|
||||
|
@ -34,6 +38,8 @@
|
|||
#include <Protocol/DriverFamilyOverride.h>
|
||||
#include <Protocol/DriverHealth.h>
|
||||
#include <Protocol/DevicePathFromText.h>
|
||||
#include <Protocol/SimplePointer.h>
|
||||
#include <Protocol/PciRootBridgeIo.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
|
@ -77,7 +83,7 @@ DumpHex (
|
|||
EFI System Table based on the provided GUID.
|
||||
|
||||
@param[in] TableGuid A pointer to the table's GUID type.
|
||||
@param[out] Table On exit, a pointer to a system configuration table.
|
||||
@param[in,out] Table On exit, a pointer to a system configuration table.
|
||||
|
||||
@retval EFI_SUCCESS A configuration table matching TableGuid was found.
|
||||
@retval EFI_NOT_FOUND A configuration table matching TableGuid was not found.
|
||||
|
@ -329,4 +335,135 @@ ShellCommandRunDblk (
|
|||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
/**
|
||||
Function for 'edit' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunEdit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
/**
|
||||
Function for 'hexedit' command.
|
||||
|
||||
@param[in] ImageHandle Handle to the Image (NULL if Internal).
|
||||
@param[in] SystemTable Pointer to the System Table (NULL if Internal).
|
||||
**/
|
||||
SHELL_STATUS
|
||||
EFIAPI
|
||||
ShellCommandRunHexEdit (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
);
|
||||
|
||||
/**
|
||||
Appends a formatted Unicode string to a Null-terminated Unicode string
|
||||
|
||||
This function appends a formatted Unicode string to the Null-terminated
|
||||
Unicode string specified by String. String is optional and may be NULL.
|
||||
Storage for the formatted Unicode string returned is allocated using
|
||||
AllocateZeroPool(). The pointer to the appended string is returned. The caller
|
||||
is responsible for freeing the returned string.
|
||||
|
||||
If String is not NULL and not aligned on a 16-bit boundary, then ASSERT().
|
||||
If Format is NULL, then ASSERT().
|
||||
If Format is not aligned on a 16-bit boundary, then ASSERT().
|
||||
|
||||
@param String A null-terminated Unicode string.
|
||||
@param FormatString A null-terminated Unicode format string.
|
||||
@param ... The variable argument list whose contents are accessed based
|
||||
on the format string specified by Format.
|
||||
|
||||
@retval NULL There was not enough available memory.
|
||||
@return Null terminated Unicode string is that is the formatted
|
||||
string appended to String.
|
||||
@sa CatVSPrint
|
||||
**/
|
||||
CHAR16*
|
||||
EFIAPI
|
||||
CatSPrint (
|
||||
IN CONST CHAR16 *String OPTIONAL,
|
||||
IN CONST CHAR16 *FormatString,
|
||||
...
|
||||
);
|
||||
|
||||
/**
|
||||
Clear the line at the specified Row.
|
||||
|
||||
@param[in] Row The row number to be cleared ( start from 1 )
|
||||
@param[in] LastCol The last printable column.
|
||||
@param[in] LastRow The last printable row.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
EditorClearLine (
|
||||
IN UINTN Row,
|
||||
IN UINTN LastCol,
|
||||
IN UINTN LastRow
|
||||
);
|
||||
|
||||
/**
|
||||
Check if file name has illegal characters.
|
||||
|
||||
@param Name The filename to check.
|
||||
|
||||
@retval TRUE The filename is ok.
|
||||
@retval FALSE The filename is not ok.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
IsValidFileName (
|
||||
IN CONST CHAR16 *Name
|
||||
);
|
||||
|
||||
/**
|
||||
Find a filename that is valid (not taken) with the given extension.
|
||||
|
||||
@param[in] Extension The file extension.
|
||||
|
||||
@retval NULL Something went wrong.
|
||||
@return the valid filename.
|
||||
**/
|
||||
CHAR16 *
|
||||
EFIAPI
|
||||
EditGetDefaultFileName (
|
||||
IN CONST CHAR16 *Extension
|
||||
);
|
||||
|
||||
/**
|
||||
Read a file into an allocated buffer. The buffer is the responsibility
|
||||
of the caller to free.
|
||||
|
||||
@param[in] FileName The filename of the file to open.
|
||||
@param[out] Buffer Upon successful return, the pointer to the
|
||||
address of the allocated buffer.
|
||||
@param[out] BufferSize If not NULL, then the pointer to the size
|
||||
of the allocated buffer.
|
||||
@param[out] ReadOnly Upon successful return TRUE if the file is
|
||||
read only. FALSE otherwise.
|
||||
|
||||
@retval EFI_NOT_FOUND The filename did not represent a file in the
|
||||
file system. Directories cannot be read with
|
||||
this method.
|
||||
@retval EFI_SUCCESS The file was read into the buffer.
|
||||
@retval EFI_OUT_OF_RESOURCES A memory allocation failed.
|
||||
@retval EFI_LOAD_ERROR The file read operation failed.
|
||||
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
||||
@retval EFI_INVALID_PARAMETER FileName was NULL.
|
||||
@retval EFI_INVALID_PARAMETER FileName was a directory.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
ReadFileIntoBuffer (
|
||||
IN CONST CHAR16 *FileName,
|
||||
OUT VOID **Buffer,
|
||||
OUT UINTN *BufferSize OPTIONAL,
|
||||
OUT BOOLEAN *ReadOnly
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -52,6 +52,48 @@
|
|||
UefiShellDebug1CommandsLib.h
|
||||
UefiShellDebug1CommandsLib.uni
|
||||
|
||||
## Files shared by both editors
|
||||
EditTitleBar.h
|
||||
EditTitleBar.c
|
||||
EditInputBar.h
|
||||
EditInputBar.c
|
||||
EditStatusBar.h
|
||||
EditStatusBar.c
|
||||
EditMenuBar.h
|
||||
EditMenuBar.c
|
||||
|
||||
## Files specific to the text editor
|
||||
./Edit/Edit.c
|
||||
./Edit/TextEditor.h
|
||||
./Edit/TextEditorTypes.h
|
||||
./Edit/FileBuffer.h
|
||||
./Edit/FileBuffer.c
|
||||
./Edit/MainTextEditor.h
|
||||
./Edit/MainTextEditor.c
|
||||
./Edit/Misc.h
|
||||
./Edit/Misc.c
|
||||
./Edit/TextEditStrings.uni
|
||||
|
||||
## Files specific to the HEX editor
|
||||
./HexEdit/BufferImage.h
|
||||
./HexEdit/BufferImage.c
|
||||
./HexEdit/Clipboard.h
|
||||
./HexEdit/Clipboard.c
|
||||
./HexEdit/DiskImage.h
|
||||
./HexEdit/DiskImage.c
|
||||
./HexEdit/FileImage.h
|
||||
./HexEdit/FileImage.c
|
||||
./HexEdit/HexEdit.c
|
||||
./HexEdit/HexEditor.h
|
||||
./HexEdit/HexEditorTypes.h
|
||||
./HexEdit/HexeditStrings.uni
|
||||
./HexEdit/MainHexEditor.h
|
||||
./HexEdit/MainHexEditor.c
|
||||
./HexEdit/MemImage.h
|
||||
./HexEdit/MemImage.c
|
||||
./HexEdit/Misc.h
|
||||
./HexEdit/Misc.c
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
ShellPkg/ShellPkg.dec
|
||||
|
@ -71,14 +113,20 @@
|
|||
PrintLib
|
||||
|
||||
[Pcd]
|
||||
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
|
||||
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize # ALWAYS_CONSUMED
|
||||
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED
|
||||
gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize # ALWAYS_CONSUMED
|
||||
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength # ALWAYS_CONSUMED
|
||||
|
||||
[Protocols]
|
||||
gEfiPciRootBridgeIoProtocolGuid
|
||||
gEfiBlockIoProtocolGuid
|
||||
gEfiSimplePointerProtocolGuid
|
||||
|
||||
[Guids]
|
||||
gEfiGlobalVariableGuid
|
||||
gEfiSmbiosTableGuid
|
||||
gEfiMpsTableGuid
|
||||
gEfiSalSystemTableGuid
|
||||
gEfiAcpi10TableGuid
|
||||
gEfiAcpi20TableGuid
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue