ShellPkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:13:38 +08:00
parent 24bfed691d
commit ba0014b9f8
133 changed files with 1886 additions and 1886 deletions

View File

@ -990,7 +990,7 @@ ConsoleLoggerSetMode (
ConsoleInfo->CurrentStartRow = 0; ConsoleInfo->CurrentStartRow = 0;
ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut); ConsoleInfo->OurConOut.ClearScreen (&ConsoleInfo->OurConOut);
} }
return Status; return Status;
} }

View File

@ -2,7 +2,7 @@
Function definitions for shell simple text in and out on top of file handles. Function definitions for shell simple text in and out on top of file handles.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -105,7 +105,7 @@ FileBasedSimpleTextInReadKeyStroke(
CharSize = sizeof(CHAR16); CharSize = sizeof(CHAR16);
} else { } else {
CharSize = sizeof(CHAR8); CharSize = sizeof(CHAR8);
} }
// //
// Decrement the amount of free space by Size or set to zero (for odd length files) // Decrement the amount of free space by Size or set to zero (for odd length files)
// //
@ -123,7 +123,7 @@ FileBasedSimpleTextInReadKeyStroke(
} }
/** /**
Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting input from a file. SHELL_FILE_HANDLE to support redirecting input from a file.
@param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
@ -162,7 +162,7 @@ CreateSimpleTextInOnFile(
ProtocolToReturn->FileHandle = FileHandleToUse; ProtocolToReturn->FileHandle = FileHandleToUse;
ProtocolToReturn->SimpleTextIn.Reset = FileBasedSimpleTextInReset; ProtocolToReturn->SimpleTextIn.Reset = FileBasedSimpleTextInReset;
ProtocolToReturn->SimpleTextIn.ReadKeyStroke = FileBasedSimpleTextInReadKeyStroke; ProtocolToReturn->SimpleTextIn.ReadKeyStroke = FileBasedSimpleTextInReadKeyStroke;
Status = gBS->CreateEvent ( Status = gBS->CreateEvent (
EVT_NOTIFY_WAIT, EVT_NOTIFY_WAIT,
TPL_NOTIFY, TPL_NOTIFY,
@ -177,9 +177,9 @@ CreateSimpleTextInOnFile(
} }
///@todo possibly also install SimpleTextInputEx on the handle at this point. ///@todo possibly also install SimpleTextInputEx on the handle at this point.
Status = gBS->InstallProtocolInterface( Status = gBS->InstallProtocolInterface(
&(ProtocolToReturn->TheHandle), &(ProtocolToReturn->TheHandle),
&gEfiSimpleTextInProtocolGuid, &gEfiSimpleTextInProtocolGuid,
EFI_NATIVE_INTERFACE, EFI_NATIVE_INTERFACE,
&(ProtocolToReturn->SimpleTextIn)); &(ProtocolToReturn->SimpleTextIn));
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
*HandleLocation = ProtocolToReturn->TheHandle; *HandleLocation = ProtocolToReturn->TheHandle;
@ -191,7 +191,7 @@ CreateSimpleTextInOnFile(
} }
/** /**
Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting input from a file. SHELL_FILE_HANDLE to support redirecting input from a file.
@param[in] SimpleTextIn The pointer to the SimpleTextIn to close. @param[in] SimpleTextIn The pointer to the SimpleTextIn to close.
@ -213,8 +213,8 @@ CloseSimpleTextInOnFile(
Status = gBS->CloseEvent(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn.WaitForKey); Status = gBS->CloseEvent(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL *)SimpleTextIn)->SimpleTextIn.WaitForKey);
Status1 = gBS->UninstallProtocolInterface( Status1 = gBS->UninstallProtocolInterface(
((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle, ((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->TheHandle,
&gEfiSimpleTextInProtocolGuid, &gEfiSimpleTextInProtocolGuid,
&(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->SimpleTextIn)); &(((SHELL_EFI_SIMPLE_TEXT_INPUT_PROTOCOL*)SimpleTextIn)->SimpleTextIn));
FreePool(SimpleTextIn); FreePool(SimpleTextIn);
@ -283,9 +283,9 @@ FileBasedSimpleTextOutQueryMode (
) )
{ {
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol; EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol;
PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut; PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut;
// Pass the QueryMode call thru to the original SimpleTextOutProtocol // Pass the QueryMode call thru to the original SimpleTextOutProtocol
return (PassThruProtocol->QueryMode( return (PassThruProtocol->QueryMode(
PassThruProtocol, PassThruProtocol,
@ -421,7 +421,7 @@ FileBasedSimpleTextOutOutputString (
} }
/** /**
Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting output from a file. SHELL_FILE_HANDLE to support redirecting output from a file.
@param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
@ -473,9 +473,9 @@ CreateSimpleTextOutOnFile(
ProtocolToReturn->SimpleTextOut.Mode->CursorVisible = OriginalProtocol->Mode->CursorVisible; ProtocolToReturn->SimpleTextOut.Mode->CursorVisible = OriginalProtocol->Mode->CursorVisible;
Status = gBS->InstallProtocolInterface( Status = gBS->InstallProtocolInterface(
&(ProtocolToReturn->TheHandle), &(ProtocolToReturn->TheHandle),
&gEfiSimpleTextOutProtocolGuid, &gEfiSimpleTextOutProtocolGuid,
EFI_NATIVE_INTERFACE, EFI_NATIVE_INTERFACE,
&(ProtocolToReturn->SimpleTextOut)); &(ProtocolToReturn->SimpleTextOut));
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
*HandleLocation = ProtocolToReturn->TheHandle; *HandleLocation = ProtocolToReturn->TheHandle;
@ -488,7 +488,7 @@ CreateSimpleTextOutOnFile(
} }
/** /**
Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting output from a file. SHELL_FILE_HANDLE to support redirecting output from a file.
@param[in] SimpleTextOut The pointer to the SimpleTextOUT to close. @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close.
@ -505,8 +505,8 @@ CloseSimpleTextOutOnFile(
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
Status = gBS->UninstallProtocolInterface( Status = gBS->UninstallProtocolInterface(
((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle, ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->TheHandle,
&gEfiSimpleTextOutProtocolGuid, &gEfiSimpleTextOutProtocolGuid,
&(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut)); &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)->SimpleTextOut));
FreePool(SimpleTextOut->Mode); FreePool(SimpleTextOut->Mode);
FreePool(SimpleTextOut); FreePool(SimpleTextOut);

View File

@ -2,7 +2,7 @@
Function definitions for shell simple text in and out on top of file handles. Function definitions for shell simple text in and out on top of file handles.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -17,7 +17,7 @@
#define _SHELL_CONSOLE_WRAPPERS_HEADER_ #define _SHELL_CONSOLE_WRAPPERS_HEADER_
/** /**
Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a Function to create a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting input from a file. SHELL_FILE_HANDLE to support redirecting input from a file.
@param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
@ -33,7 +33,7 @@ CreateSimpleTextInOnFile(
); );
/** /**
Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a Function to close a EFI_SIMPLE_TEXT_INPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting input from a file. SHELL_FILE_HANDLE to support redirecting input from a file.
@param[in] SimpleTextIn The pointer to the SimpleTextIn to close. @param[in] SimpleTextIn The pointer to the SimpleTextIn to close.
@ -46,7 +46,7 @@ CloseSimpleTextInOnFile(
); );
/** /**
Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a Function to create a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting output from a file. SHELL_FILE_HANDLE to support redirecting output from a file.
@param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use. @param[in] FileHandleToUse The pointer to the SHELL_FILE_HANDLE to use.
@ -64,7 +64,7 @@ CreateSimpleTextOutOnFile(
); );
/** /**
Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a Function to close a EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL on top of a
SHELL_FILE_HANDLE to support redirecting output from a file. SHELL_FILE_HANDLE to support redirecting output from a file.
@param[in] SimpleTextOut The pointer to the SimpleTextOUT to close. @param[in] SimpleTextOut The pointer to the SimpleTextOUT to close.

View File

@ -21,14 +21,14 @@
#define MEM_WRITE_REALLOC_OVERHEAD 1024 #define MEM_WRITE_REALLOC_OVERHEAD 1024
/** /**
File style interface for console (Open). File style interface for console (Open).
@param[in] This Ignored. @param[in] This Ignored.
@param[out] NewHandle Ignored. @param[out] NewHandle Ignored.
@param[in] FileName Ignored. @param[in] FileName Ignored.
@param[in] OpenMode Ignored. @param[in] OpenMode Ignored.
@param[in] Attributes Ignored. @param[in] Attributes Ignored.
@retval EFI_NOT_FOUND @retval EFI_NOT_FOUND
**/ **/
EFI_STATUS EFI_STATUS
@ -46,9 +46,9 @@ FileInterfaceOpenNotFound(
/** /**
File style interface for console (Close, Delete, & Flush) File style interface for console (Close, Delete, & Flush)
@param[in] This Ignored. @param[in] This Ignored.
@retval EFI_SUCCESS @retval EFI_SUCCESS
**/ **/
EFI_STATUS EFI_STATUS
@ -65,7 +65,7 @@ FileInterfaceNopGeneric(
@param[in] This Ignored. @param[in] This Ignored.
@param[out] Position Ignored. @param[out] Position Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -80,10 +80,10 @@ FileInterfaceNopGetPosition(
/** /**
File style interface for console (SetPosition). File style interface for console (SetPosition).
@param[in] This Ignored. @param[in] This Ignored.
@param[in] Position Ignored. @param[in] Position Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -98,12 +98,12 @@ FileInterfaceNopSetPosition(
/** /**
File style interface for console (GetInfo). File style interface for console (GetInfo).
@param[in] This Ignored. @param[in] This Ignored.
@param[in] InformationType Ignored. @param[in] InformationType Ignored.
@param[in, out] BufferSize Ignored. @param[in, out] BufferSize Ignored.
@param[out] Buffer Ignored. @param[out] Buffer Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -120,12 +120,12 @@ FileInterfaceNopGetInfo(
/** /**
File style interface for console (SetInfo). File style interface for console (SetInfo).
@param[in] This Ignored. @param[in] This Ignored.
@param[in] InformationType Ignored. @param[in] InformationType Ignored.
@param[in] BufferSize Ignored. @param[in] BufferSize Ignored.
@param[in] Buffer Ignored. @param[in] Buffer Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -144,11 +144,11 @@ FileInterfaceNopSetInfo(
File style interface for StdOut (Write). File style interface for StdOut (Write).
Writes data to the screen. Writes data to the screen.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@retval EFI_UNSUPPORTED No output console is supported. @retval EFI_UNSUPPORTED No output console is supported.
@return A return value from gST->ConOut->OutputString. @return A return value from gST->ConOut->OutputString.
**/ **/
@ -171,11 +171,11 @@ FileInterfaceStdOutWrite(
/** /**
File style interface for StdIn (Write). File style interface for StdIn (Write).
@param[in] This Ignored. @param[in] This Ignored.
@param[in, out] BufferSize Ignored. @param[in, out] BufferSize Ignored.
@param[in] Buffer Ignored. @param[in] Buffer Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -193,11 +193,11 @@ FileInterfaceStdInWrite(
File style interface for console StdErr (Write). File style interface for console StdErr (Write).
Writes error to the error output. Writes error to the error output.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@return A return value from gST->StdErr->OutputString. @return A return value from gST->StdErr->OutputString.
**/ **/
EFI_STATUS EFI_STATUS
@ -213,11 +213,11 @@ FileInterfaceStdErrWrite(
/** /**
File style interface for console StdOut (Read). File style interface for console StdOut (Read).
@param[in] This Ignored. @param[in] This Ignored.
@param[in, out] BufferSize Ignored. @param[in, out] BufferSize Ignored.
@param[out] Buffer Ignored. @param[out] Buffer Ignored.
@retval EFI_UNSUPPORTED @retval EFI_UNSUPPORTED
**/ **/
EFI_STATUS EFI_STATUS
@ -233,11 +233,11 @@ FileInterfaceStdOutRead(
/** /**
File style interface for console StdErr (Read). File style interface for console StdErr (Read).
@param[in] This Ignored. @param[in] This Ignored.
@param[in, out] BufferSize Ignored. @param[in, out] BufferSize Ignored.
@param[out] Buffer Ignored. @param[out] Buffer Ignored.
@retval EFI_UNSUPPORTED Always. @retval EFI_UNSUPPORTED Always.
**/ **/
EFI_STATUS EFI_STATUS
@ -253,11 +253,11 @@ FileInterfaceStdErrRead(
/** /**
File style interface for NUL file (Read). File style interface for NUL file (Read).
@param[in] This Ignored. @param[in] This Ignored.
@param[in, out] BufferSize Poiner to 0 upon return. @param[in, out] BufferSize Poiner to 0 upon return.
@param[out] Buffer Ignored. @param[out] Buffer Ignored.
@retval EFI_SUCCESS Always. @retval EFI_SUCCESS Always.
**/ **/
EFI_STATUS EFI_STATUS
@ -274,11 +274,11 @@ FileInterfaceNulRead(
/** /**
File style interface for NUL file (Write). File style interface for NUL file (Write).
@param[in] This Ignored. @param[in] This Ignored.
@param[in, out] BufferSize Ignored. @param[in, out] BufferSize Ignored.
@param[in] Buffer Ignored. @param[in] Buffer Ignored.
@retval EFI_SUCCESS @retval EFI_SUCCESS
**/ **/
EFI_STATUS EFI_STATUS
@ -304,7 +304,7 @@ FileInterfaceNulWrite(
EFI_STATUS EFI_STATUS
CreateTabCompletionList ( CreateTabCompletionList (
IN CONST CHAR16 *InputString, IN CONST CHAR16 *InputString,
IN CONST UINTN StringLen, IN CONST UINTN StringLen,
IN CONST UINTN BufferSize, IN CONST UINTN BufferSize,
IN OUT EFI_SHELL_FILE_INFO **TabCompletionList, IN OUT EFI_SHELL_FILE_INFO **TabCompletionList,
IN OUT UINTN *TabUpdatePos IN OUT UINTN *TabUpdatePos
@ -1025,9 +1025,9 @@ typedef struct {
File style interface for Environment Variable (Close). File style interface for Environment Variable (Close).
Frees the memory for this object. Frees the memory for this object.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@retval EFI_SUCCESS @retval EFI_SUCCESS
**/ **/
EFI_STATUS EFI_STATUS
@ -1043,8 +1043,8 @@ FileInterfaceEnvClose(
UINTN TotalSize; UINTN TotalSize;
// //
// Most if not all UEFI commands will have an '\r\n' at the end of any output. // Most if not all UEFI commands will have an '\r\n' at the end of any output.
// Since the output was redirected to a variable, it does not make sense to // Since the output was redirected to a variable, it does not make sense to
// keep this. So, before closing, strip the trailing '\r\n' from the variable // keep this. So, before closing, strip the trailing '\r\n' from the variable
// if it exists. // if it exists.
// //
@ -1063,12 +1063,12 @@ FileInterfaceEnvClose(
NewBuffer = AllocateZeroPool (TotalSize); NewBuffer = AllocateZeroPool (TotalSize);
if (NewBuffer == NULL) { if (NewBuffer == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer); Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
} }
if (!EFI_ERROR(Status) && NewBuffer != NULL) { if (!EFI_ERROR(Status) && NewBuffer != NULL) {
if (TotalSize / sizeof (CHAR16) >= 3) { if (TotalSize / sizeof (CHAR16) >= 3) {
if ( (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 2] == CHAR_LINEFEED) && if ( (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 2] == CHAR_LINEFEED) &&
(((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] == CHAR_CARRIAGE_RETURN) (((CHAR16*)NewBuffer)[TotalSize / sizeof (CHAR16) - 3] == CHAR_CARRIAGE_RETURN)
@ -1112,8 +1112,8 @@ FileInterfaceEnvClose(
} }
} }
} }
} }
SHELL_FREE_NON_NULL(NewBuffer); SHELL_FREE_NON_NULL(NewBuffer);
FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This); FreePool((EFI_FILE_PROTOCOL_ENVIRONMENT*)This);
return (Status); return (Status);
@ -1121,9 +1121,9 @@ FileInterfaceEnvClose(
/** /**
File style interface for Environment Variable (Delete). File style interface for Environment Variable (Delete).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@retval The return value from FileInterfaceEnvClose(). @retval The return value from FileInterfaceEnvClose().
**/ **/
EFI_STATUS EFI_STATUS
@ -1138,11 +1138,11 @@ FileInterfaceEnvDelete(
/** /**
File style interface for Environment Variable (Read). File style interface for Environment Variable (Read).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[out] Buffer The pointer to the buffer to fill. @param[out] Buffer The pointer to the buffer to fill.
@retval EFI_SUCCESS The data was read. @retval EFI_SUCCESS The data was read.
**/ **/
EFI_STATUS EFI_STATUS
@ -1162,11 +1162,11 @@ FileInterfaceEnvRead(
/** /**
File style interface for Volatile Environment Variable (Write). File style interface for Volatile Environment Variable (Write).
This function also caches the environment variable into gShellEnvVarList. This function also caches the environment variable into gShellEnvVarList.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@retval EFI_SUCCESS The data was successfully write to variable. @retval EFI_SUCCESS The data was successfully write to variable.
@retval SHELL_OUT_OF_RESOURCES A memory allocation failed. @retval SHELL_OUT_OF_RESOURCES A memory allocation failed.
**/ **/
@ -1239,11 +1239,11 @@ FileInterfaceEnvVolWrite(
/** /**
File style interface for Non Volatile Environment Variable (Write). File style interface for Non Volatile Environment Variable (Write).
This function also caches the environment variable into gShellEnvVarList. This function also caches the environment variable into gShellEnvVarList.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@retval EFI_SUCCESS The data was successfully write to variable. @retval EFI_SUCCESS The data was successfully write to variable.
@retval SHELL_OUT_OF_RESOURCES A memory allocation failed. @retval SHELL_OUT_OF_RESOURCES A memory allocation failed.
**/ **/
@ -1362,7 +1362,7 @@ CreateFileInterfaceEnv(
EnvFileInterface->Flush = FileInterfaceNopGeneric; EnvFileInterface->Flush = FileInterfaceNopGeneric;
EnvFileInterface->Delete = FileInterfaceEnvDelete; EnvFileInterface->Delete = FileInterfaceEnvDelete;
EnvFileInterface->Read = FileInterfaceEnvRead; EnvFileInterface->Read = FileInterfaceEnvRead;
CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize); CopyMem(EnvFileInterface->Name, EnvName, EnvNameSize);
// //
@ -1513,10 +1513,10 @@ typedef struct {
/** /**
File style interface for Mem (SetPosition). File style interface for Mem (SetPosition).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[out] Position The position to set. @param[out] Position The position to set.
@retval EFI_SUCCESS The position was successfully changed. @retval EFI_SUCCESS The position was successfully changed.
@retval EFI_INVALID_PARAMETER The Position was invalid. @retval EFI_INVALID_PARAMETER The Position was invalid.
**/ **/
@ -1537,12 +1537,12 @@ FileInterfaceMemSetPosition(
/** /**
File style interface for Mem (GetPosition). File style interface for Mem (GetPosition).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[out] Position The pointer to the position. @param[out] Position The pointer to the position.
@retval EFI_SUCCESS The position was retrieved. @retval EFI_SUCCESS The position was retrieved.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
FileInterfaceMemGetPosition( FileInterfaceMemGetPosition(
@ -1604,11 +1604,11 @@ FileInterfaceMemGetInfo(
/** /**
File style interface for Mem (Write). File style interface for Mem (Write).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources. @retval EFI_OUT_OF_RESOURCES The operation failed due to lack of resources.
@retval EFI_SUCCESS The data was written. @retval EFI_SUCCESS The data was written.
**/ **/
@ -1659,11 +1659,11 @@ FileInterfaceMemWrite(
/** /**
File style interface for Mem (Read). File style interface for Mem (Read).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to fill. @param[in] Buffer The pointer to the buffer to fill.
@retval EFI_SUCCESS The data was read. @retval EFI_SUCCESS The data was read.
**/ **/
EFI_STATUS EFI_STATUS
@ -1689,11 +1689,11 @@ FileInterfaceMemRead(
File style interface for Mem (Close). File style interface for Mem (Close).
Frees all memory associated with this object. Frees all memory associated with this object.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@retval EFI_SUCCESS The 'file' was closed. @retval EFI_SUCCESS The 'file' was closed.
**/ **/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
FileInterfaceMemClose( FileInterfaceMemClose(
@ -1784,7 +1784,7 @@ typedef struct {
@param This Protocol instance pointer. @param This Protocol instance pointer.
@param Position Byte position from the start of the file. @param Position Byte position from the start of the file.
@retval EFI_SUCCESS Data was written. @retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open. @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
@ -1804,7 +1804,7 @@ FileInterfaceFileSetPosition(
@param This Protocol instance pointer. @param This Protocol instance pointer.
@param Position Byte position from the start of the file. @param Position Byte position from the start of the file.
@retval EFI_SUCCESS Data was written. @retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.. @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open..
@ -1999,7 +1999,7 @@ FileInterfaceFileOpen (
Close and delete the file handle. Close and delete the file handle.
@param This Protocol instance pointer. @param This Protocol instance pointer.
@retval EFI_SUCCESS The device was opened. @retval EFI_SUCCESS The device was opened.
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted. @retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted.
@ -2018,9 +2018,9 @@ FileInterfaceFileDelete(
/** /**
File style interface for File (Close). File style interface for File (Close).
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@retval EFI_SUCCESS The file was closed. @retval EFI_SUCCESS The file was closed.
**/ **/
EFI_STATUS EFI_STATUS
@ -2038,13 +2038,13 @@ FileInterfaceFileClose(
/** /**
File style interface for File (Write). File style interface for File (Write).
If the file was opened with ASCII mode the data will be processed through If the file was opened with ASCII mode the data will be processed through
AsciiSPrint before writing. AsciiSPrint before writing.
@param[in] This The pointer to the EFI_FILE_PROTOCOL object. @param[in] This The pointer to the EFI_FILE_PROTOCOL object.
@param[in, out] BufferSize Size in bytes of Buffer. @param[in, out] BufferSize Size in bytes of Buffer.
@param[in] Buffer The pointer to the buffer to write. @param[in] Buffer The pointer to the buffer to write.
@retval EFI_SUCCESS The data was written. @retval EFI_SUCCESS The data was written.
**/ **/
EFI_STATUS EFI_STATUS
@ -2081,10 +2081,10 @@ FileInterfaceFileWrite(
This will create a new EFI_FILE_PROTOCOL identical to the Templace This will create a new EFI_FILE_PROTOCOL identical to the Templace
except that the new one has Unicode and Ascii knowledge. except that the new one has Unicode and Ascii knowledge.
@param[in] Template A pointer to the EFI_FILE_PROTOCOL object. @param[in] Template A pointer to the EFI_FILE_PROTOCOL object.
@param[in] Unicode TRUE for UCS-2, FALSE for ASCII. @param[in] Unicode TRUE for UCS-2, FALSE for ASCII.
@return a new EFI_FILE_PROTOCOL object to be used instead of the template. @return a new EFI_FILE_PROTOCOL object to be used instead of the template.
**/ **/
EFI_FILE_PROTOCOL* EFI_FILE_PROTOCOL*

View File

@ -1,7 +1,7 @@
/** @file /** @file
This is THE shell (application) This is THE shell (application)
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -104,7 +104,7 @@ TrimSpaces(
} }
/** /**
Parse for the next instance of one string within another string. Can optionally make sure that Parse for the next instance of one string within another string. Can optionally make sure that
the string was not escaped (^ character) per the shell specification. the string was not escaped (^ character) per the shell specification.
@param[in] SourceString The string to search within @param[in] SourceString The string to search within
@ -160,13 +160,13 @@ IsValidEnvironmentVariableName(
) )
{ {
CONST CHAR16 *Walker; CONST CHAR16 *Walker;
Walker = NULL; Walker = NULL;
ASSERT (BeginPercent != NULL); ASSERT (BeginPercent != NULL);
ASSERT (EndPercent != NULL); ASSERT (EndPercent != NULL);
ASSERT (BeginPercent < EndPercent); ASSERT (BeginPercent < EndPercent);
if ((BeginPercent + 1) == EndPercent) { if ((BeginPercent + 1) == EndPercent) {
return FALSE; return FALSE;
} }
@ -212,9 +212,9 @@ ContainsSplit(
SecondQuote = NULL; SecondQuote = NULL;
TempSpot = FindFirstCharacter(CmdLine, L"|", L'^'); TempSpot = FindFirstCharacter(CmdLine, L"|", L'^');
if (FirstQuote == NULL || if (FirstQuote == NULL ||
TempSpot == NULL || TempSpot == NULL ||
TempSpot == CHAR_NULL || TempSpot == CHAR_NULL ||
FirstQuote > TempSpot FirstQuote > TempSpot
) { ) {
return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)); return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL));
@ -223,7 +223,7 @@ ContainsSplit(
while ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)) { while ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)) {
if (FirstQuote == NULL || FirstQuote > TempSpot) { if (FirstQuote == NULL || FirstQuote > TempSpot) {
break; break;
} }
SecondQuote = FindNextInstance (FirstQuote + 1, L"\"", TRUE); SecondQuote = FindNextInstance (FirstQuote + 1, L"\"", TRUE);
if (SecondQuote == NULL) { if (SecondQuote == NULL) {
break; break;
@ -235,14 +235,14 @@ ContainsSplit(
FirstQuote = FindNextInstance (SecondQuote + 1, L"\"", TRUE); FirstQuote = FindNextInstance (SecondQuote + 1, L"\"", TRUE);
TempSpot = FindFirstCharacter(TempSpot + 1, L"|", L'^'); TempSpot = FindFirstCharacter(TempSpot + 1, L"|", L'^');
continue; continue;
} }
} }
return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL)); return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL));
} }
/** /**
Function to start monitoring for CTRL-S using SimpleTextInputEx. This Function to start monitoring for CTRL-S using SimpleTextInputEx. This
feature's enabled state was not known when the shell initially launched. feature's enabled state was not known when the shell initially launched.
@retval EFI_SUCCESS The feature is enabled. @retval EFI_SUCCESS The feature is enabled.
@ -266,8 +266,8 @@ InternalEfiShellStartCtrlSMonitor(
EFI_OPEN_PROTOCOL_GET_PROTOCOL); EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SHELL_NO_IN_EX), STRING_TOKEN (STR_SHELL_NO_IN_EX),
ShellInfoObject.HiiHandle); ShellInfoObject.HiiHandle);
@ -284,7 +284,7 @@ InternalEfiShellStartCtrlSMonitor(
&KeyData, &KeyData,
NotificationFunction, NotificationFunction,
&ShellInfoObject.CtrlSNotifyHandle1); &ShellInfoObject.CtrlSNotifyHandle1);
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
Status = SimpleEx->RegisterKeyNotify( Status = SimpleEx->RegisterKeyNotify(
@ -302,7 +302,7 @@ InternalEfiShellStartCtrlSMonitor(
&KeyData, &KeyData,
NotificationFunction, NotificationFunction,
&ShellInfoObject.CtrlSNotifyHandle3); &ShellInfoObject.CtrlSNotifyHandle3);
} }
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
Status = SimpleEx->RegisterKeyNotify( Status = SimpleEx->RegisterKeyNotify(
@ -1129,7 +1129,7 @@ ProcessCommandLine(
/** /**
Function try to find location of the Startup.nsh file. Function try to find location of the Startup.nsh file.
The buffer is callee allocated and should be freed by the caller. The buffer is callee allocated and should be freed by the caller.
@param ImageDevicePath The path to the image for shell. first place to look for the startup script @param ImageDevicePath The path to the image for shell. first place to look for the startup script
@ -1156,7 +1156,7 @@ LocateStartupScript (
// Try to find 'Startup.nsh' in the directory where the shell itself was launched. // Try to find 'Startup.nsh' in the directory where the shell itself was launched.
// //
MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath); MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath);
if (MapName != NULL) { if (MapName != NULL) {
StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0); StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, MapName, 0);
if (StartupScriptPath == NULL) { if (StartupScriptPath == NULL) {
// //
@ -1387,7 +1387,7 @@ AddBufferToFreeList (
/** /**
Create a new buffer list and stores the old one to OldBufferList Create a new buffer list and stores the old one to OldBufferList
@param OldBufferList The temporary list head used to store the nodes in BufferToFreeList. @param OldBufferList The temporary list head used to store the nodes in BufferToFreeList.
**/ **/
@ -1432,7 +1432,7 @@ AddLineToCommandHistory(
Count = 0; Count = 0;
MaxHistoryCmdCount = PcdGet16(PcdShellMaxHistoryCommandCount); MaxHistoryCmdCount = PcdGet16(PcdShellMaxHistoryCommandCount);
if (MaxHistoryCmdCount == 0) { if (MaxHistoryCmdCount == 0) {
return ; return ;
} }
@ -1546,7 +1546,7 @@ StripUnreplacedEnvironmentVariables(
} }
continue; continue;
} }
if (FirstQuote == NULL || SecondPercent < FirstQuote) { if (FirstQuote == NULL || SecondPercent < FirstQuote) {
if (IsValidEnvironmentVariableName(FirstPercent, SecondPercent)) { if (IsValidEnvironmentVariableName(FirstPercent, SecondPercent)) {
// //
@ -1662,16 +1662,16 @@ ShellConvertVariables (
; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL ; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL
; MasterEnvList += StrLen(MasterEnvList) + 1 ; MasterEnvList += StrLen(MasterEnvList) + 1
){ ){
StrCpyS( ItemTemp, StrCpyS( ItemTemp,
((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)),
L"%" L"%"
); );
StrCatS( ItemTemp, StrCatS( ItemTemp,
((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)),
MasterEnvList MasterEnvList
); );
StrCatS( ItemTemp, StrCatS( ItemTemp,
((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)), ((ItemSize+(2*sizeof(CHAR16)))/sizeof(CHAR16)),
L"%" L"%"
); );
ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE); ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, ItemTemp, EfiShellGetEnv(MasterEnvList), TRUE, FALSE);
@ -1697,7 +1697,7 @@ ShellConvertVariables (
// //
ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, L"^%", L"%", TRUE, FALSE); ShellCopySearchAndReplace(NewCommandLine1, NewCommandLine2, NewSize, L"^%", L"%", TRUE, FALSE);
StrCpyS(NewCommandLine1, NewSize/sizeof(CHAR16), NewCommandLine2); StrCpyS(NewCommandLine1, NewSize/sizeof(CHAR16), NewCommandLine2);
FreePool(NewCommandLine2); FreePool(NewCommandLine2);
FreePool(ItemTemp); FreePool(ItemTemp);
@ -1823,7 +1823,7 @@ RunSplitCommand(
} }
/** /**
Take the original command line, substitute any variables, free Take the original command line, substitute any variables, free
the original string, return the modified copy. the original string, return the modified copy.
@param[in] CmdLine pointer to the command line to update. @param[in] CmdLine pointer to the command line to update.
@ -1847,7 +1847,7 @@ ShellSubstituteVariables(
} }
/** /**
Take the original command line, substitute any alias in the first group of space delimited characters, free Take the original command line, substitute any alias in the first group of space delimited characters, free
the original string, return the modified copy. the original string, return the modified copy.
@param[in] CmdLine pointer to the command line to update. @param[in] CmdLine pointer to the command line to update.
@ -1906,7 +1906,7 @@ ShellSubstituteAliases(
SHELL_FREE_NON_NULL(*CmdLine); SHELL_FREE_NON_NULL(*CmdLine);
SHELL_FREE_NON_NULL(CommandName); SHELL_FREE_NON_NULL(CommandName);
// //
// re-assign the passed in double pointer to point to our newly allocated buffer // re-assign the passed in double pointer to point to our newly allocated buffer
// //
@ -1919,7 +1919,7 @@ ShellSubstituteAliases(
Takes the Argv[0] part of the command line and determine the meaning of it. Takes the Argv[0] part of the command line and determine the meaning of it.
@param[in] CmdName pointer to the command line to update. @param[in] CmdName pointer to the command line to update.
@retval Internal_Command The name is an internal command. @retval Internal_Command The name is an internal command.
@retval File_Sys_Change the name is a file system change. @retval File_Sys_Change the name is a file system change.
@retval Script_File_Name the name is a NSH script file. @retval Script_File_Name the name is a NSH script file.
@ -1947,7 +1947,7 @@ GetOperationType(
// Test for file system change request. anything ending with first : and cant have spaces. // Test for file system change request. anything ending with first : and cant have spaces.
// //
if (CmdName[(StrLen(CmdName)-1)] == L':') { if (CmdName[(StrLen(CmdName)-1)] == L':') {
if ( StrStr(CmdName, L" ") != NULL if ( StrStr(CmdName, L" ") != NULL
|| StrLen(StrStr(CmdName, L":")) > 1 || StrLen(StrStr(CmdName, L":")) > 1
) { ) {
return (Unknown_Invalid); return (Unknown_Invalid);
@ -1977,7 +1977,7 @@ GetOperationType(
SHELL_FREE_NON_NULL(FileWithPath); SHELL_FREE_NON_NULL(FileWithPath);
return (Efi_Application); return (Efi_Application);
} }
SHELL_FREE_NON_NULL(FileWithPath); SHELL_FREE_NON_NULL(FileWithPath);
// //
// No clue what this is... return invalid flag... // No clue what this is... return invalid flag...
@ -1994,7 +1994,7 @@ GetOperationType(
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_NOT_FOUND The operation type is unknown or invalid. @retval EFI_NOT_FOUND The operation type is unknown or invalid.
**/ **/
EFI_STATUS EFI_STATUS
IsValidSplit( IsValidSplit(
IN CONST CHAR16 *CmdLine IN CONST CHAR16 *CmdLine
) )
@ -2079,13 +2079,13 @@ VerifySplit(
// recurse to verify the next item // recurse to verify the next item
// //
TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1; TempSpot = FindFirstCharacter(CmdLine, L"|", L'^') + 1;
if (*TempSpot == L'a' && if (*TempSpot == L'a' &&
(*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL) (*(TempSpot + 1) == L' ' || *(TempSpot + 1) == CHAR_NULL)
) { ) {
// If it's an ASCII pipe '|a' // If it's an ASCII pipe '|a'
TempSpot += 1; TempSpot += 1;
} }
return (VerifySplit(TempSpot)); return (VerifySplit(TempSpot));
} }
@ -2149,7 +2149,7 @@ ChangeMappedDrive(
// make sure we are the right operation // make sure we are the right operation
// //
ASSERT(CmdLine[(StrLen(CmdLine)-1)] == L':' && StrStr(CmdLine, L" ") == NULL); ASSERT(CmdLine[(StrLen(CmdLine)-1)] == L':' && StrStr(CmdLine, L" ") == NULL);
// //
// Call the protocol API to do the work // Call the protocol API to do the work
// //
@ -2294,7 +2294,7 @@ ProcessCommandLineToFinal(
Run an internal shell command. Run an internal shell command.
This API will update the shell's environment since these commands are libraries. This API will update the shell's environment since these commands are libraries.
@param[in] CmdLine the command line to run. @param[in] CmdLine the command line to run.
@param[in] FirstParameter the first parameter on the command line @param[in] FirstParameter the first parameter on the command line
@param[in] ParamProtocol the shell parameters protocol pointer @param[in] ParamProtocol the shell parameters protocol pointer
@ -2317,7 +2317,7 @@ RunInternalCommand(
SHELL_STATUS CommandReturnedStatus; SHELL_STATUS CommandReturnedStatus;
BOOLEAN LastError; BOOLEAN LastError;
CHAR16 *Walker; CHAR16 *Walker;
CHAR16 *NewCmdLine; CHAR16 *NewCmdLine;
NewCmdLine = AllocateCopyPool (StrSize (CmdLine), CmdLine); NewCmdLine = AllocateCopyPool (StrSize (CmdLine), CmdLine);
if (NewCmdLine == NULL) { if (NewCmdLine == NULL) {
@ -2597,7 +2597,7 @@ SetupAndRunCommandOrFile(
/** /**
Function will process and run a command line. Function will process and run a command line.
This will determine if the command line represents an internal shell This will determine if the command line represents an internal shell
command or dispatch an external application. command or dispatch an external application.
@param[in] CmdLine The command line to parse. @param[in] CmdLine The command line to parse.
@ -2673,7 +2673,7 @@ RunShellCommand(
Status = ProcessNewSplitCommandLine(CleanOriginal); Status = ProcessNewSplitCommandLine(CleanOriginal);
SHELL_FREE_NON_NULL(CleanOriginal); SHELL_FREE_NON_NULL(CleanOriginal);
return (Status); return (Status);
} }
// //
// We need the first parameter information so we can determine the operation type // We need the first parameter information so we can determine the operation type
@ -2734,7 +2734,7 @@ RunShellCommand(
/** /**
Function will process and run a command line. Function will process and run a command line.
This will determine if the command line represents an internal shell This will determine if the command line represents an internal shell
command or dispatch an external application. command or dispatch an external application.
@param[in] CmdLine The command line to parse. @param[in] CmdLine The command line to parse.
@ -2907,8 +2907,8 @@ RunScriptFileHandle (
; // conditional increment in the body of the loop ; // conditional increment in the body of the loop
){ ){
ASSERT(CommandLine2 != NULL); ASSERT(CommandLine2 != NULL);
StrnCpyS( CommandLine2, StrnCpyS( CommandLine2,
PrintBuffSize/sizeof(CHAR16), PrintBuffSize/sizeof(CHAR16),
NewScriptFile->CurrentCommand->Cl, NewScriptFile->CurrentCommand->Cl,
PrintBuffSize/sizeof(CHAR16) - 1 PrintBuffSize/sizeof(CHAR16) - 1
); );
@ -2934,8 +2934,8 @@ RunScriptFileHandle (
// //
// Due to variability in starting the find and replace action we need to have both buffers the same. // Due to variability in starting the find and replace action we need to have both buffers the same.
// //
StrnCpyS( CommandLine, StrnCpyS( CommandLine,
PrintBuffSize/sizeof(CHAR16), PrintBuffSize/sizeof(CHAR16),
CommandLine2, CommandLine2,
PrintBuffSize/sizeof(CHAR16) - 1 PrintBuffSize/sizeof(CHAR16) - 1
); );
@ -2990,8 +2990,8 @@ RunScriptFileHandle (
Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PrintBuffSize, L"%8", L"\"\"", FALSE, FALSE); Status = ShellCopySearchAndReplace(CommandLine, CommandLine2, PrintBuffSize, L"%8", L"\"\"", FALSE, FALSE);
Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PrintBuffSize, L"%9", L"\"\"", FALSE, FALSE); Status = ShellCopySearchAndReplace(CommandLine2, CommandLine, PrintBuffSize, L"%9", L"\"\"", FALSE, FALSE);
StrnCpyS( CommandLine2, StrnCpyS( CommandLine2,
PrintBuffSize/sizeof(CHAR16), PrintBuffSize/sizeof(CHAR16),
CommandLine, CommandLine,
PrintBuffSize/sizeof(CHAR16) - 1 PrintBuffSize/sizeof(CHAR16) - 1
); );

View File

@ -2,7 +2,7 @@
function definitions for internal to shell functions. function definitions for internal to shell functions.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -294,7 +294,7 @@ RunCommand(
/** /**
Function will process and run a command line. Function will process and run a command line.
This will determine if the command line represents an internal shell This will determine if the command line represents an internal shell
command or dispatch an external application. command or dispatch an external application.
@param[in] CmdLine The command line to parse. @param[in] CmdLine The command line to parse.
@ -383,8 +383,8 @@ TrimSpaces(
); );
/** /**
Create a new buffer list and stores the old one to OldBufferList Create a new buffer list and stores the old one to OldBufferList
@param OldBufferList The temporary list head used to store the nodes in BufferToFreeList. @param OldBufferList The temporary list head used to store the nodes in BufferToFreeList.
**/ **/

View File

@ -1,7 +1,7 @@
/** @file /** @file
function declarations for shell environment functions. function declarations for shell environment functions.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -143,9 +143,9 @@ GetEnvironmentVariableList(
if (ListHead == NULL) { if (ListHead == NULL) {
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
ValBufferSize = INIT_DATA_BUFFER_SIZE; ValBufferSize = INIT_DATA_BUFFER_SIZE;
NameBufferSize = INIT_NAME_BUFFER_SIZE; NameBufferSize = INIT_NAME_BUFFER_SIZE;
VariableName = AllocateZeroPool(NameBufferSize); VariableName = AllocateZeroPool(NameBufferSize);
@ -171,7 +171,7 @@ GetEnvironmentVariableList(
NameSize = NameBufferSize; NameSize = NameBufferSize;
Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid);
} }
if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){ if (!EFI_ERROR(Status) && CompareGuid(&Guid, &gShellVariableGuid)){
VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST)); VarList = AllocateZeroPool(sizeof(ENV_VAR_LIST));
if (VarList == NULL) { if (VarList == NULL) {
@ -200,7 +200,7 @@ GetEnvironmentVariableList(
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
break; break;
} }
ValSize = ValBufferSize; ValSize = ValBufferSize;
Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val); Status = SHELL_GET_ENVIRONMENT_VARIABLE_AND_ATTRIBUTES(VariableName, &VarList->Atts, &ValSize, VarList->Val);
} }
@ -348,8 +348,8 @@ SetEnvironmentVariables(
// //
// Copy the string into the Key, leaving the last character allocated as NULL to terminate // Copy the string into the Key, leaving the last character allocated as NULL to terminate
// //
StrnCpyS( Node->Key, StrnCpyS( Node->Key,
StrStr(CurrentString, L"=") - CurrentString + 1, StrStr(CurrentString, L"=") - CurrentString + 1,
CurrentString, CurrentString,
StrStr(CurrentString, L"=") - CurrentString StrStr(CurrentString, L"=") - CurrentString
); );
@ -413,7 +413,7 @@ ShellFindEnvVarInList (
) )
{ {
ENV_VAR_LIST *Node; ENV_VAR_LIST *Node;
if (Key == NULL || Value == NULL || ValueSize == NULL) { if (Key == NULL || Value == NULL || ValueSize == NULL) {
return SHELL_INVALID_PARAMETER; return SHELL_INVALID_PARAMETER;
} }
@ -459,7 +459,7 @@ ShellAddEnvVarToList (
ENV_VAR_LIST *Node; ENV_VAR_LIST *Node;
CHAR16 *LocalKey; CHAR16 *LocalKey;
CHAR16 *LocalValue; CHAR16 *LocalValue;
if (Key == NULL || Value == NULL || ValueSize == 0) { if (Key == NULL || Value == NULL || ValueSize == 0) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
@ -511,7 +511,7 @@ ShellAddEnvVarToList (
Remove a specified environment variable in gShellEnvVarList. Remove a specified environment variable in gShellEnvVarList.
@param Key The name of the environment variable. @param Key The name of the environment variable.
@retval EFI_SUCCESS The command executed successfully. @retval EFI_SUCCESS The command executed successfully.
@retval EFI_NOT_FOUND The environment variable is not found in @retval EFI_NOT_FOUND The environment variable is not found in
gShellEnvVarList. gShellEnvVarList.
@ -546,7 +546,7 @@ ShellRemvoeEnvVarFromList (
/** /**
Initialize the gShellEnvVarList and cache all Shell-Guid-based environment Initialize the gShellEnvVarList and cache all Shell-Guid-based environment
variables. variables.
**/ **/
EFI_STATUS EFI_STATUS
ShellInitEnvVarList ( ShellInitEnvVarList (

View File

@ -6,7 +6,7 @@
//#include <Library/UefiRuntimeServicesTableLib.h> //#include <Library/UefiRuntimeServicesTableLib.h>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -266,9 +266,9 @@ ShellRemvoeEnvVarFromList (
); );
/** /**
Initialize the gShellEnvVarList and cache all Shell-Guid-based environment Initialize the gShellEnvVarList and cache all Shell-Guid-based environment
variables. variables.
**/ **/
EFI_STATUS EFI_STATUS
ShellInitEnvVarList ( ShellInitEnvVarList (

View File

@ -146,14 +146,14 @@ GetManFileName(
} else { } else {
Buffer = AllocateZeroPool(StrSize(ManFileName) + 4*sizeof(CHAR16)); Buffer = AllocateZeroPool(StrSize(ManFileName) + 4*sizeof(CHAR16));
if (Buffer != NULL) { if (Buffer != NULL) {
StrnCpyS( Buffer, StrnCpyS( Buffer,
(StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16), (StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16),
ManFileName, ManFileName,
StrLen(ManFileName) StrLen(ManFileName)
); );
StrnCatS( Buffer, StrnCatS( Buffer,
(StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16), (StrSize(ManFileName) + 4*sizeof(CHAR16))/sizeof(CHAR16),
L".man", L".man",
4 4
); );
} }

View File

@ -5,7 +5,7 @@
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2014, Red Hat, Inc. Copyright (C) 2014, Red Hat, Inc.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -147,8 +147,8 @@ DEBUG_CODE_END();
// Remove any non-escaped quotes in the string // Remove any non-escaped quotes in the string
// Remove any remaining escape characters in the string // Remove any remaining escape characters in the string
// //
for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL) for (NextDelim = FindFirstCharacter(*TempParameter, L"\"^", CHAR_NULL)
; *NextDelim != CHAR_NULL ; *NextDelim != CHAR_NULL
; NextDelim = FindFirstCharacter(NextDelim, L"\"^", CHAR_NULL) ; NextDelim = FindFirstCharacter(NextDelim, L"\"^", CHAR_NULL)
) { ) {
if (*NextDelim == L'^') { if (*NextDelim == L'^') {
@ -165,9 +165,9 @@ DEBUG_CODE_END();
// //
if (StripQuotation) { if (StripQuotation) {
CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1)); CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1));
} else{ } else{
NextDelim++; NextDelim++;
} }
} }
} }
@ -181,7 +181,7 @@ DEBUG_CODE_END();
parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL. this supports space parameters for inclusion in EFI_SHELL_PARAMETERS_PROTOCOL. this supports space
delimited and quote surrounded parameter definition. delimited and quote surrounded parameter definition.
All special character processing (alias, environment variable, redirection, All special character processing (alias, environment variable, redirection,
etc... must be complete before calling this API. etc... must be complete before calling this API.
@param[in] CommandLine String of command line to parse @param[in] CommandLine String of command line to parse
@ -269,7 +269,7 @@ ParseCommandLineToArgs(
} }
ASSERT(Count >= (*Argc)); ASSERT(Count >= (*Argc));
Status = EFI_SUCCESS; Status = EFI_SUCCESS;
Done: Done:
SHELL_FREE_NON_NULL(TempParameter); SHELL_FREE_NON_NULL(TempParameter);
SHELL_FREE_NON_NULL(NewCommandLine); SHELL_FREE_NON_NULL(NewCommandLine);
@ -503,7 +503,7 @@ IsUnicodeFile(
} }
gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition); gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition);
gEfiShellProtocol->CloseFile(Handle); gEfiShellProtocol->CloseFile(Handle);
return (Status); return (Status);
} }
/** /**
@ -580,7 +580,7 @@ FixFileName (
Copy = FileName+1; Copy = FileName+1;
if ((TempLocation = StrStr(Copy , L"\"")) != NULL) { if ((TempLocation = StrStr(Copy , L"\"")) != NULL) {
TempLocation[0] = CHAR_NULL; TempLocation[0] = CHAR_NULL;
} }
} else { } else {
Copy = FileName; Copy = FileName;
while(Copy[0] == L' ') { while(Copy[0] == L' ') {
@ -588,7 +588,7 @@ FixFileName (
} }
if ((TempLocation = StrStr(Copy , L" ")) != NULL) { if ((TempLocation = StrStr(Copy , L" ")) != NULL) {
TempLocation[0] = CHAR_NULL; TempLocation[0] = CHAR_NULL;
} }
} }
if (Copy[0] == CHAR_NULL) { if (Copy[0] == CHAR_NULL) {
@ -620,7 +620,7 @@ FixVarName (
Copy = FileName+1; Copy = FileName+1;
if ((TempLocation = StrStr(Copy , L"%")) != NULL) { if ((TempLocation = StrStr(Copy , L"%")) != NULL) {
TempLocation[0] = CHAR_NULL; TempLocation[0] = CHAR_NULL;
} }
} }
return (FixFileName(Copy)); return (FixFileName(Copy));
@ -629,9 +629,9 @@ FixVarName (
/** /**
Remove the unicode file tag from the begining of the file buffer since that will not be Remove the unicode file tag from the begining of the file buffer since that will not be
used by StdIn. used by StdIn.
@param[in] Handle Pointer to the handle of the file to be processed. @param[in] Handle Pointer to the handle of the file to be processed.
@retval EFI_SUCCESS The unicode file tag has been moved successfully. @retval EFI_SUCCESS The unicode file tag has been moved successfully.
**/ **/
EFI_STATUS EFI_STATUS
@ -837,7 +837,7 @@ UpdateStdInStdOutStdErr(
if (StrStr(CommandLineWalker, L" 1>> ") != NULL) { if (StrStr(CommandLineWalker, L" 1>> ") != NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
} }
if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >> ")) != NULL) { if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >> ")) != NULL) {
FirstLocation = MIN(CommandLineWalker, FirstLocation); FirstLocation = MIN(CommandLineWalker, FirstLocation);
SetMem16(CommandLineWalker, 8, L' '); SetMem16(CommandLineWalker, 8, L' ');
@ -864,7 +864,7 @@ UpdateStdInStdOutStdErr(
if (StrStr(CommandLineWalker, L" >>a ") != NULL) { if (StrStr(CommandLineWalker, L" >>a ") != NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
} }
if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>a ")) != NULL) { if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" 1>a ")) != NULL) {
FirstLocation = MIN(CommandLineWalker, FirstLocation); FirstLocation = MIN(CommandLineWalker, FirstLocation);
SetMem16(CommandLineWalker, 10, L' '); SetMem16(CommandLineWalker, 10, L' ');
@ -878,7 +878,7 @@ UpdateStdInStdOutStdErr(
if (StrStr(CommandLineWalker, L" 1>a ") != NULL) { if (StrStr(CommandLineWalker, L" 1>a ") != NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
} }
} }
if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >a ")) != NULL) { if (!EFI_ERROR(Status) && (CommandLineWalker = StrStr(CommandLineCopy, L" >a ")) != NULL) {
FirstLocation = MIN(CommandLineWalker, FirstLocation); FirstLocation = MIN(CommandLineWalker, FirstLocation);
SetMem16(CommandLineWalker, 8, L' '); SetMem16(CommandLineWalker, 8, L' ');
@ -1107,7 +1107,7 @@ UpdateStdInStdOutStdErr(
// //
// Cant redirect during a reconnect operation. // Cant redirect during a reconnect operation.
// //
||(StrStr(NewCommandLine, L"connect -r") != NULL ||(StrStr(NewCommandLine, L"connect -r") != NULL
&& (StdOutVarName != NULL || StdOutFileName != NULL || StdErrFileName != NULL || StdErrVarName != NULL)) && (StdOutVarName != NULL || StdOutFileName != NULL || StdErrFileName != NULL || StdErrVarName != NULL))
// //
// Check that filetypes (Unicode/Ascii) do not change during an append // Check that filetypes (Unicode/Ascii) do not change during an append
@ -1307,7 +1307,7 @@ RestoreStdInStdOutStdErr (
{ {
SPLIT_LIST *Split; SPLIT_LIST *Split;
if (ShellParameters == NULL if (ShellParameters == NULL
||OldStdIn == NULL ||OldStdIn == NULL
||OldStdOut == NULL ||OldStdOut == NULL
||OldStdErr == NULL ||OldStdErr == NULL
@ -1382,7 +1382,7 @@ UpdateArgcArgv(
) )
{ {
BOOLEAN StripParamQuotation; BOOLEAN StripParamQuotation;
ASSERT(ShellParameters != NULL); ASSERT(ShellParameters != NULL);
StripParamQuotation = TRUE; StripParamQuotation = TRUE;
@ -1396,10 +1396,10 @@ UpdateArgcArgv(
if (Type == Script_File_Name) { if (Type == Script_File_Name) {
StripParamQuotation = FALSE; StripParamQuotation = FALSE;
} }
return ParseCommandLineToArgs( NewCommandLine, return ParseCommandLineToArgs( NewCommandLine,
StripParamQuotation, StripParamQuotation,
&(ShellParameters->Argv), &(ShellParameters->Argv),
&(ShellParameters->Argc) &(ShellParameters->Argc)
); );
} }

View File

@ -4,7 +4,7 @@
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -1422,7 +1422,7 @@ EfiShellEnablePageBreak (
variables with the format 'x=y', where x is the variables with the format 'x=y', where x is the
environment variable name and y is the value. If this environment variable name and y is the value. If this
is NULL, then the current shell environment is used. is NULL, then the current shell environment is used.
@param[out] StartImageStatus Returned status from gBS->StartImage. @param[out] StartImageStatus Returned status from gBS->StartImage.
@retval EFI_SUCCESS The command executed successfully. The status code @retval EFI_SUCCESS The command executed successfully. The status code
@ -1460,7 +1460,7 @@ InternalShellExecuteDevicePath(
ZeroMem(&ShellParamsProtocol, sizeof(EFI_SHELL_PARAMETERS_PROTOCOL)); ZeroMem(&ShellParamsProtocol, sizeof(EFI_SHELL_PARAMETERS_PROTOCOL));
NewHandle = NULL; NewHandle = NULL;
NewCmdLine = AllocateCopyPool (StrSize (CommandLine), CommandLine); NewCmdLine = AllocateCopyPool (StrSize (CommandLine), CommandLine);
if (NewCmdLine == NULL) { if (NewCmdLine == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -1505,8 +1505,8 @@ InternalShellExecuteDevicePath(
// //
if (LoadedImage->ImageCodeType != EfiLoaderCode){ if (LoadedImage->ImageCodeType != EfiLoaderCode){
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SHELL_IMAGE_NOT_APP), STRING_TOKEN (STR_SHELL_IMAGE_NOT_APP),
ShellInfoObject.HiiHandle ShellInfoObject.HiiHandle
@ -1630,7 +1630,7 @@ FreeAlloc:
variables with the format 'x=y', where x is the variables with the format 'x=y', where x is the
environment variable name and y is the value. If this environment variable name and y is the value. If this
is NULL, then the current shell environment is used. is NULL, then the current shell environment is used.
@param[out] StartImageStatus Returned status from the command line. @param[out] StartImageStatus Returned status from the command line.
@retval EFI_SUCCESS The command executed successfully. The status code @retval EFI_SUCCESS The command executed successfully. The status code
@ -2210,7 +2210,7 @@ EfiShellGetGuidFromName(
if (Guid == NULL || GuidName == NULL) { if (Guid == NULL || GuidName == NULL) {
return (EFI_INVALID_PARAMETER); return (EFI_INVALID_PARAMETER);
} }
Status = GetGuidFromStringName(GuidName, NULL, &NewGuid); Status = GetGuidFromStringName(GuidName, NULL, &NewGuid);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
@ -2762,8 +2762,8 @@ EfiShellGetEnvEx(
; Node = (ENV_VAR_LIST*)GetNextNode(&gShellEnvVarList.Link, &Node->Link) ; Node = (ENV_VAR_LIST*)GetNextNode(&gShellEnvVarList.Link, &Node->Link)
){ ){
ASSERT(Node->Key != NULL); ASSERT(Node->Key != NULL);
StrCpyS( CurrentWriteLocation, StrCpyS( CurrentWriteLocation,
(Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)), (Size)/sizeof(CHAR16) - (CurrentWriteLocation - ((CHAR16*)Buffer)),
Node->Key Node->Key
); );
CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1; CurrentWriteLocation += StrLen(CurrentWriteLocation) + 1;
@ -3233,9 +3233,9 @@ EfiShellGetHelpText(
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
StrnCpyS( FixCommand, StrnCpyS( FixCommand,
(StrSize(Command) - 4 * sizeof (CHAR16))/sizeof(CHAR16), (StrSize(Command) - 4 * sizeof (CHAR16))/sizeof(CHAR16),
Command, Command,
StrLen(Command)-4 StrLen(Command)-4
); );
Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText); Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText);
@ -3295,7 +3295,7 @@ InternalEfiShellGetListAlias(
VOID VOID
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_GUID Guid; EFI_GUID Guid;
CHAR16 *VariableName; CHAR16 *VariableName;
@ -3330,17 +3330,17 @@ InternalEfiShellGetListAlias(
RetVal = NULL; RetVal = NULL;
break; break;
} }
NameSize = NameBufferSize; NameSize = NameBufferSize;
Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid); Status = gRT->GetNextVariableName(&NameSize, VariableName, &Guid);
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
SHELL_FREE_NON_NULL(RetVal); SHELL_FREE_NON_NULL(RetVal);
RetVal = NULL; RetVal = NULL;
break; break;
} }
if (CompareGuid(&Guid, &gShellAliasGuid)){ if (CompareGuid(&Guid, &gShellAliasGuid)){
ASSERT((RetVal == NULL && RetSize == 0) || (RetVal != NULL)); ASSERT((RetVal == NULL && RetSize == 0) || (RetVal != NULL));
RetVal = StrnCatGrow(&RetVal, &RetSize, VariableName, 0); RetVal = StrnCatGrow(&RetVal, &RetSize, VariableName, 0);
@ -3355,10 +3355,10 @@ InternalEfiShellGetListAlias(
/** /**
Convert a null-terminated unicode string, in-place, to all lowercase. Convert a null-terminated unicode string, in-place, to all lowercase.
Then return it. Then return it.
@param Str The null-terminated string to be converted to all lowercase. @param Str The null-terminated string to be converted to all lowercase.
@return The null-terminated string converted into all lowercase. @return The null-terminated string converted into all lowercase.
**/ **/
CHAR16 * CHAR16 *
ToLower ( ToLower (
@ -3385,7 +3385,7 @@ ToLower (
@param[out] Volatile upon return of a single command if TRUE indicates @param[out] Volatile upon return of a single command if TRUE indicates
this is stored in a volatile fashion. FALSE otherwise. this is stored in a volatile fashion. FALSE otherwise.
@return If Alias is not NULL, it will return a pointer to @return If Alias is not NULL, it will return a pointer to
the NULL-terminated command for that alias. the NULL-terminated command for that alias.
If Alias is NULL, ReturnedData points to a ';' If Alias is NULL, ReturnedData points to a ';'
delimited list of alias (e.g. delimited list of alias (e.g.
@ -3801,7 +3801,7 @@ CleanUpShellEnvironment (
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx; EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *SimpleEx;
CleanUpShellProtocol (NewShell); CleanUpShellProtocol (NewShell);
Status = gBS->CloseEvent(NewShell->ExecutionBreak); Status = gBS->CloseEvent(NewShell->ExecutionBreak);
@ -3844,21 +3844,21 @@ NotificationFunction(
if ( ((KeyData->Key.UnicodeChar == L'c') && if ( ((KeyData->Key.UnicodeChar == L'c') &&
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))) || (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))) ||
(KeyData->Key.UnicodeChar == 3) (KeyData->Key.UnicodeChar == 3)
){ ){
if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) { if (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak == NULL) {
return (EFI_UNSUPPORTED); return (EFI_UNSUPPORTED);
} }
return (gBS->SignalEvent(ShellInfoObject.NewEfiShellProtocol->ExecutionBreak)); return (gBS->SignalEvent(ShellInfoObject.NewEfiShellProtocol->ExecutionBreak));
} else if ((KeyData->Key.UnicodeChar == L's') && } else if ((KeyData->Key.UnicodeChar == L's') &&
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED)) (KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
){ ){
ShellInfoObject.HaltOutput = TRUE; ShellInfoObject.HaltOutput = TRUE;
} }
return (EFI_SUCCESS); return (EFI_SUCCESS);
} }
/** /**
Function to start monitoring for CTRL-C using SimpleTextInputEx. This Function to start monitoring for CTRL-C using SimpleTextInputEx. This
feature's enabled state was not known when the shell initially launched. feature's enabled state was not known when the shell initially launched.
@retval EFI_SUCCESS The feature is enabled. @retval EFI_SUCCESS The feature is enabled.
@ -3882,8 +3882,8 @@ InernalEfiShellStartMonitor(
EFI_OPEN_PROTOCOL_GET_PROTOCOL); EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SHELL_NO_IN_EX), STRING_TOKEN (STR_SHELL_NO_IN_EX),
ShellInfoObject.HiiHandle); ShellInfoObject.HiiHandle);
@ -3904,7 +3904,7 @@ InernalEfiShellStartMonitor(
&KeyData, &KeyData,
NotificationFunction, NotificationFunction,
&ShellInfoObject.CtrlCNotifyHandle1); &ShellInfoObject.CtrlCNotifyHandle1);
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED; KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
Status = SimpleEx->RegisterKeyNotify( Status = SimpleEx->RegisterKeyNotify(

View File

@ -3,7 +3,7 @@
manipulation, and initialization of EFI_SHELL_PROTOCOL. manipulation, and initialization of EFI_SHELL_PROTOCOL.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -36,7 +36,7 @@ typedef struct {
This must be removed via calling CleanUpShellProtocol(). This must be removed via calling CleanUpShellProtocol().
@param[in, out] NewShell The pointer to the pointer to the structure @param[in, out] NewShell The pointer to the pointer to the structure
to install. to install.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -819,7 +819,7 @@ EfiShellIsRootShell(
aliases will be returned in ReturnedData. aliases will be returned in ReturnedData.
@param[out] Volatile upon return of a single command if TRUE indicates @param[out] Volatile upon return of a single command if TRUE indicates
this is stored in a volatile fashion. FALSE otherwise. this is stored in a volatile fashion. FALSE otherwise.
@return If Alias is not NULL, it will return a pointer to @return If Alias is not NULL, it will return a pointer to
the NULL-terminated command for that alias. the NULL-terminated command for that alias.
If Alias is NULL, ReturnedData points to a ';' If Alias is NULL, ReturnedData points to a ';'
delimited list of alias (e.g. delimited list of alias (e.g.
@ -917,7 +917,7 @@ InternalEfiShellSetEnv(
); );
/** /**
Function to start monitoring for CTRL-C using SimpleTextInputEx. This Function to start monitoring for CTRL-C using SimpleTextInputEx. This
feature's enabled state was not known when the shell initially launched. feature's enabled state was not known when the shell initially launched.
@retval EFI_SUCCESS The feature is enabled. @retval EFI_SUCCESS The feature is enabled.

View File

@ -2,4 +2,4 @@ TestArgv.nsh is a very simple shell script to test how the interpreter parses
the parameters. It uses ShellCTestApp.efi to dump the parameters passed from the the parameters. It uses ShellCTestApp.efi to dump the parameters passed from the
intepreter. intepreter.
TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log". TestArgv.log is the desired output created using "TestArgv.nsh > TestArgv.log".

View File

@ -1,7 +1,7 @@
## @file ## @file
# This is the shell application # This is the shell application
# #
# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -36,4 +36,4 @@
[LibraryClasses] [LibraryClasses]
ShellCEntryLib ShellCEntryLib
UefiLib UefiLib

View File

@ -12,14 +12,14 @@
and start and end time values. and start and end time values.
Dp uses this information to group records in different ways. It also uses Dp uses this information to group records in different ways. It also uses
timer information to calculate elapsed time for each measurement. timer information to calculate elapsed time for each measurement.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
@ -741,10 +741,10 @@ InitSummaryData (
/** /**
Dump performance data. Dump performance data.
@param[in] ImageHandle The image handle. @param[in] ImageHandle The image handle.
@param[in] SystemTable The system table. @param[in] SystemTable The system table.
@retval SHELL_SUCCESS Command completed successfully. @retval SHELL_SUCCESS Command completed successfully.
@retval SHELL_INVALID_PARAMETER Command usage error. @retval SHELL_INVALID_PARAMETER Command usage error.
@retval SHELL_ABORTED The user aborts the operation. @retval SHELL_ABORTED The user aborts the operation.
@ -952,7 +952,7 @@ RunDp (
**** Cooked (Default) **** Cooked (Default)
****************************************************************************/ ****************************************************************************/
GatherStatistics (CustomCumulativeData); GatherStatistics (CustomCumulativeData);
if (CumulativeMode) { if (CumulativeMode) {
ProcessCumulative (CustomCumulativeData); ProcessCumulative (CustomCumulativeData);
} else if (AllMode) { } else if (AllMode) {
Status = DumpAllTrace( Number2Display, ExcludeMode); Status = DumpAllTrace( Number2Display, ExcludeMode);

View File

@ -7,7 +7,7 @@
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php // http://opensource.org/licenses/bsd-license.php
// //
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// //
@ -108,7 +108,7 @@
" -t VALUE - Sets display threshold to VALUE microseconds\r\n" " -t VALUE - Sets display threshold to VALUE microseconds\r\n"
" -n COUNT - Limits display to COUNT lines in All and Raw modes\r\n" " -n COUNT - Limits display to COUNT lines in All and Raw modes\r\n"
" -i - Displays identifier\r\n" " -i - Displays identifier\r\n"
" -c TOKEN - Display pre-defined and custom cumulative data\r\n" " -c TOKEN - Display pre-defined and custom cumulative data\r\n"
" Pre-defined cumulative token are:\r\n" " Pre-defined cumulative token are:\r\n"
" 1. LoadImage:\r\n" " 1. LoadImage:\r\n"
" 2. StartImage:\r\n" " 2. StartImage:\r\n"

View File

@ -44,24 +44,24 @@ extern UINT32 const NumCum;
///@} ///@}
/** /**
Calculate an event's duration in timer ticks. Calculate an event's duration in timer ticks.
Given the count direction and the event's start and end timer values, Given the count direction and the event's start and end timer values,
calculate the duration of the event in timer ticks. Information for calculate the duration of the event in timer ticks. Information for
the current measurement is pointed to by the parameter. the current measurement is pointed to by the parameter.
If the measurement's start time is 1, it indicates that the developer If the measurement's start time is 1, it indicates that the developer
is indicating that the measurement began at the release of reset. is indicating that the measurement began at the release of reset.
The start time is adjusted to the timer's starting count before performing The start time is adjusted to the timer's starting count before performing
the elapsed time calculation. the elapsed time calculation.
The calculated duration, in ticks, is the absolute difference between The calculated duration, in ticks, is the absolute difference between
the measurement's ending and starting counts. the measurement's ending and starting counts.
@param Measurement Pointer to a MEASUREMENT_RECORD structure containing @param Measurement Pointer to a MEASUREMENT_RECORD structure containing
data for the current measurement. data for the current measurement.
@return The 64-bit duration of the event. @return The 64-bit duration of the event.
**/ **/
UINT64 UINT64
@ -69,14 +69,14 @@ GetDuration (
IN OUT MEASUREMENT_RECORD *Measurement IN OUT MEASUREMENT_RECORD *Measurement
); );
/** /**
Determine whether the Measurement record is for an EFI Phase. Determine whether the Measurement record is for an EFI Phase.
The Token and Module members of the measurement record are checked. The Token and Module members of the measurement record are checked.
Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL. Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL.
@param[in] Measurement A pointer to the Measurement record to test. @param[in] Measurement A pointer to the Measurement record to test.
@retval TRUE The measurement record is for an EFI Phase. @retval TRUE The measurement record is for an EFI Phase.
@retval FALSE The measurement record is NOT for an EFI Phase. @retval FALSE The measurement record is NOT for an EFI Phase.
**/ **/
@ -99,17 +99,17 @@ IsCorePerf(
IN MEASUREMENT_RECORD *Measurement IN MEASUREMENT_RECORD *Measurement
); );
/** /**
Get the file name portion of the Pdb File Name. Get the file name portion of the Pdb File Name.
The portion of the Pdb File Name between the last backslash and The portion of the Pdb File Name between the last backslash and
either a following period or the end of the string is converted either a following period or the end of the string is converted
to Unicode and copied into UnicodeBuffer. The name is truncated, to Unicode and copied into UnicodeBuffer. The name is truncated,
if necessary, to ensure that UnicodeBuffer is not overrun. if necessary, to ensure that UnicodeBuffer is not overrun.
@param[in] PdbFileName Pdb file name. @param[in] PdbFileName Pdb file name.
@param[out] UnicodeBuffer The resultant Unicode File Name. @param[out] UnicodeBuffer The resultant Unicode File Name.
**/ **/
VOID VOID
DpGetShortPdbFileName ( DpGetShortPdbFileName (
@ -117,7 +117,7 @@ DpGetShortPdbFileName (
OUT CHAR16 *UnicodeBuffer OUT CHAR16 *UnicodeBuffer
); );
/** /**
Get a human readable name for an image handle. Get a human readable name for an image handle.
The following methods will be tried orderly: The following methods will be tried orderly:
1. Image PDB 1. Image PDB
@ -126,29 +126,29 @@ DpGetShortPdbFileName (
4. Image GUID 4. Image GUID
5. Image DevicePath 5. Image DevicePath
6. Unknown Driver Name 6. Unknown Driver Name
@param[in] Handle @param[in] Handle
@post The resulting Unicode name string is stored in the @post The resulting Unicode name string is stored in the
mGaugeString global array. mGaugeString global array.
**/ **/
VOID VOID
DpGetNameFromHandle ( DpGetNameFromHandle (
IN EFI_HANDLE Handle IN EFI_HANDLE Handle
); );
/** /**
Calculate the Duration in microseconds. Calculate the Duration in microseconds.
Duration is multiplied by 1000, instead of Frequency being divided by 1000 or Duration is multiplied by 1000, instead of Frequency being divided by 1000 or
multiplying the result by 1000, in order to maintain precision. Since Duration is multiplying the result by 1000, in order to maintain precision. Since Duration is
a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow. a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow.
The time is calculated as (Duration * 1000) / Timer_Frequency. The time is calculated as (Duration * 1000) / Timer_Frequency.
@param[in] Duration The event duration in timer ticks. @param[in] Duration The event duration in timer ticks.
@return A 64-bit value which is the Elapsed time in microseconds. @return A 64-bit value which is the Elapsed time in microseconds.
**/ **/
UINT64 UINT64
@ -156,16 +156,16 @@ DurationInMicroSeconds (
IN UINT64 Duration IN UINT64 Duration
); );
/** /**
Get index of Measurement Record's match in the CumData array. Get index of Measurement Record's match in the CumData array.
If the Measurement's Token value matches a Token in one of the CumData If the Measurement's Token value matches a Token in one of the CumData
records, the index of the matching record is returned. The returned records, the index of the matching record is returned. The returned
index is a signed value so that negative values can indicate that index is a signed value so that negative values can indicate that
the Measurement didn't match any entry in the CumData array. the Measurement didn't match any entry in the CumData array.
@param[in] Measurement A pointer to a Measurement Record to match against the CumData array. @param[in] Measurement A pointer to a Measurement Record to match against the CumData array.
@retval <0 Token is not in the CumData array. @retval <0 Token is not in the CumData array.
@retval >=0 Return value is the index into CumData where Token is found. @retval >=0 Return value is the index into CumData where Token is found.
**/ **/
@ -174,17 +174,17 @@ GetCumulativeItem(
IN MEASUREMENT_RECORD *Measurement IN MEASUREMENT_RECORD *Measurement
); );
/** /**
Collect verbose statistics about the logged performance measurements. Collect verbose statistics about the logged performance measurements.
General Summary information for all Trace measurements is gathered and General Summary information for all Trace measurements is gathered and
stored within the SummaryData structure. This information is both stored within the SummaryData structure. This information is both
used internally by subsequent reporting functions, and displayed used internally by subsequent reporting functions, and displayed
at the end of verbose reports. at the end of verbose reports.
@pre The SummaryData and CumData structures must be initialized @pre The SummaryData and CumData structures must be initialized
prior to calling this function. prior to calling this function.
@post The SummaryData and CumData structures contain statistics for the @post The SummaryData and CumData structures contain statistics for the
current performance logs. current performance logs.
@ -196,23 +196,23 @@ GatherStatistics(
IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL IN OUT PERF_CUM_DATA *CustomCumulativeData OPTIONAL
); );
/** /**
Gather and print ALL Trace Records. Gather and print ALL Trace Records.
Displays all "interesting" Trace measurements in order.<BR> Displays all "interesting" Trace measurements in order.<BR>
The number of records displayed is controlled by: The number of records displayed is controlled by:
- records with a duration less than mInterestThreshold microseconds are not displayed. - records with a duration less than mInterestThreshold microseconds are not displayed.
- No more than Limit records are displayed. A Limit of zero will not limit the output. - No more than Limit records are displayed. A Limit of zero will not limit the output.
- If the ExcludeFlag is TRUE, records matching entries in the CumData array are not - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
displayed. displayed.
@pre The mInterestThreshold global variable is set to the shortest duration to be printed. @pre The mInterestThreshold global variable is set to the shortest duration to be printed.
The mGaugeString and mUnicodeToken global arrays are used for temporary string storage. The mGaugeString and mUnicodeToken global arrays are used for temporary string storage.
They must not be in use by a calling function. They must not be in use by a calling function.
@param[in] Limit The number of records to print. Zero is ALL. @param[in] Limit The number of records to print. Zero is ALL.
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation. @retval EFI_ABORTED The user aborts the operation.
@return Others from a call to gBS->LocateHandleBuffer(). @return Others from a call to gBS->LocateHandleBuffer().
@ -223,20 +223,20 @@ DumpAllTrace(
IN BOOLEAN ExcludeFlag IN BOOLEAN ExcludeFlag
); );
/** /**
Gather and print Raw Trace Records. Gather and print Raw Trace Records.
All Trace measurements with a duration greater than or equal to All Trace measurements with a duration greater than or equal to
mInterestThreshold are printed without interpretation. mInterestThreshold are printed without interpretation.
The number of records displayed is controlled by: The number of records displayed is controlled by:
- records with a duration less than mInterestThreshold microseconds are not displayed. - records with a duration less than mInterestThreshold microseconds are not displayed.
- No more than Limit records are displayed. A Limit of zero will not limit the output. - No more than Limit records are displayed. A Limit of zero will not limit the output.
- If the ExcludeFlag is TRUE, records matching entries in the CumData array are not - If the ExcludeFlag is TRUE, records matching entries in the CumData array are not
displayed. displayed.
@pre The mInterestThreshold global variable is set to the shortest duration to be printed. @pre The mInterestThreshold global variable is set to the shortest duration to be printed.
@param[in] Limit The number of records to print. Zero is ALL. @param[in] Limit The number of records to print. Zero is ALL.
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -248,9 +248,9 @@ DumpRawTrace(
IN BOOLEAN ExcludeFlag IN BOOLEAN ExcludeFlag
); );
/** /**
Gather and print Major Phase metrics. Gather and print Major Phase metrics.
**/ **/
VOID VOID
ProcessPhases( ProcessPhases(
@ -258,11 +258,11 @@ ProcessPhases(
); );
/** /**
Gather and print Handle data. Gather and print Handle data.
@param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display. @param[in] ExcludeFlag TRUE to exclude individual Cumulative items from display.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation. @retval EFI_ABORTED The user aborts the operation.
@return Others from a call to gBS->LocateHandleBuffer(). @return Others from a call to gBS->LocateHandleBuffer().
@ -273,11 +273,11 @@ ProcessHandles(
); );
/** /**
Gather and print PEIM data. Gather and print PEIM data.
Only prints complete PEIM records Only prints complete PEIM records
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation. @retval EFI_ABORTED The user aborts the operation.
**/ **/
@ -286,14 +286,14 @@ ProcessPeims(
VOID VOID
); );
/** /**
Gather and print global data. Gather and print global data.
Strips out incomplete or "Execution Phase" records Strips out incomplete or "Execution Phase" records
Only prints records where Handle is NULL Only prints records where Handle is NULL
Increment TIndex for every record, even skipped ones, so that we have an Increment TIndex for every record, even skipped ones, so that we have an
indication of every measurement record taken. indication of every measurement record taken.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_ABORTED The user aborts the operation. @retval EFI_ABORTED The user aborts the operation.
**/ **/
@ -302,16 +302,16 @@ ProcessGlobal(
VOID VOID
); );
/** /**
Gather and print cumulative data. Gather and print cumulative data.
Traverse the measurement records and:<BR> Traverse the measurement records and:<BR>
For each record with a Token listed in the CumData array:<BR> For each record with a Token listed in the CumData array:<BR>
- Update the instance count and the total, minimum, and maximum durations. - Update the instance count and the total, minimum, and maximum durations.
Finally, print the gathered cumulative statistics. Finally, print the gathered cumulative statistics.
@param[in] CustomCumulativeData The pointer to the custom cumulative data. @param[in] CustomCumulativeData The pointer to the custom cumulative data.
**/ **/
VOID VOID
ProcessCumulative( ProcessCumulative(

View File

@ -39,24 +39,24 @@
#include "Literals.h" #include "Literals.h"
#include "DpInternal.h" #include "DpInternal.h"
/** /**
Calculate an event's duration in timer ticks. Calculate an event's duration in timer ticks.
Given the count direction and the event's start and end timer values, Given the count direction and the event's start and end timer values,
calculate the duration of the event in timer ticks. Information for calculate the duration of the event in timer ticks. Information for
the current measurement is pointed to by the parameter. the current measurement is pointed to by the parameter.
If the measurement's start time is 1, it indicates that the developer If the measurement's start time is 1, it indicates that the developer
is indicating that the measurement began at the release of reset. is indicating that the measurement began at the release of reset.
The start time is adjusted to the timer's starting count before performing The start time is adjusted to the timer's starting count before performing
the elapsed time calculation. the elapsed time calculation.
The calculated duration, in ticks, is the absolute difference between The calculated duration, in ticks, is the absolute difference between
the measurement's ending and starting counts. the measurement's ending and starting counts.
@param Measurement Pointer to a MEASUREMENT_RECORD structure containing @param Measurement Pointer to a MEASUREMENT_RECORD structure containing
data for the current measurement. data for the current measurement.
@return The 64-bit duration of the event. @return The 64-bit duration of the event.
**/ **/
UINT64 UINT64
@ -81,14 +81,14 @@ GetDuration (
return Duration; return Duration;
} }
/** /**
Determine whether the Measurement record is for an EFI Phase. Determine whether the Measurement record is for an EFI Phase.
The Token and Module members of the measurement record are checked. The Token and Module members of the measurement record are checked.
Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL. Module must be empty and Token must be one of SEC, PEI, DXE, BDS, or SHELL.
@param[in] Measurement A pointer to the Measurement record to test. @param[in] Measurement A pointer to the Measurement record to test.
@retval TRUE The measurement record is for an EFI Phase. @retval TRUE The measurement record is for an EFI Phase.
@retval FALSE The measurement record is NOT for an EFI Phase. @retval FALSE The measurement record is NOT for an EFI Phase.
**/ **/
@ -139,17 +139,17 @@ IsCorePerf(
return RetVal; return RetVal;
} }
/** /**
Get the file name portion of the Pdb File Name. Get the file name portion of the Pdb File Name.
The portion of the Pdb File Name between the last backslash and The portion of the Pdb File Name between the last backslash and
either a following period or the end of the string is converted either a following period or the end of the string is converted
to Unicode and copied into UnicodeBuffer. The name is truncated, to Unicode and copied into UnicodeBuffer. The name is truncated,
if necessary, to ensure that UnicodeBuffer is not overrun. if necessary, to ensure that UnicodeBuffer is not overrun.
@param[in] PdbFileName Pdb file name. @param[in] PdbFileName Pdb file name.
@param[out] UnicodeBuffer The resultant Unicode File Name. @param[out] UnicodeBuffer The resultant Unicode File Name.
**/ **/
VOID VOID
DpGetShortPdbFileName ( DpGetShortPdbFileName (
@ -192,7 +192,7 @@ DpGetShortPdbFileName (
} }
} }
/** /**
Get a human readable name for an image handle. Get a human readable name for an image handle.
The following methods will be tried orderly: The following methods will be tried orderly:
1. Image PDB 1. Image PDB
@ -377,17 +377,17 @@ DpGetNameFromHandle (
FreePool (StringPtr); FreePool (StringPtr);
} }
/** /**
Calculate the Duration in microseconds. Calculate the Duration in microseconds.
Duration is multiplied by 1000, instead of Frequency being divided by 1000 or Duration is multiplied by 1000, instead of Frequency being divided by 1000 or
multiplying the result by 1000, in order to maintain precision. Since Duration is multiplying the result by 1000, in order to maintain precision. Since Duration is
a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow. a 64-bit value, multiplying it by 1000 is unlikely to produce an overflow.
The time is calculated as (Duration * 1000) / Timer_Frequency. The time is calculated as (Duration * 1000) / Timer_Frequency.
@param[in] Duration The event duration in timer ticks. @param[in] Duration The event duration in timer ticks.
@return A 64-bit value which is the Elapsed time in microseconds. @return A 64-bit value which is the Elapsed time in microseconds.
**/ **/
UINT64 UINT64
@ -398,16 +398,16 @@ DurationInMicroSeconds (
return DivU64x32 (Duration, 1000); return DivU64x32 (Duration, 1000);
} }
/** /**
Get index of Measurement Record's match in the CumData array. Get index of Measurement Record's match in the CumData array.
If the Measurement's Token value matches a Token in one of the CumData If the Measurement's Token value matches a Token in one of the CumData
records, the index of the matching record is returned. The returned records, the index of the matching record is returned. The returned
index is a signed value so that negative values can indicate that index is a signed value so that negative values can indicate that
the Measurement didn't match any entry in the CumData array. the Measurement didn't match any entry in the CumData array.
@param[in] Measurement A pointer to a Measurement Record to match against the CumData array. @param[in] Measurement A pointer to a Measurement Record to match against the CumData array.
@retval <0 Token is not in the CumData array. @retval <0 Token is not in the CumData array.
@retval >=0 Return value is the index into CumData where Token is found. @retval >=0 Return value is the index into CumData where Token is found.
**/ **/

View File

@ -2,7 +2,7 @@
The implementation for the 'tftp' Shell command. The implementation for the 'tftp' Shell command.
Copyright (c) 2015, ARM Ltd. All rights reserved.<BR> Copyright (c) 2015, ARM Ltd. All rights reserved.<BR>
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved. <BR> Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved. <BR>
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
@ -50,8 +50,8 @@ STATIC CONST CHAR16 mTftpProgressDelete[] = L"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b
@return TRUE The value was returned. @return TRUE The value was returned.
@return FALSE A parsing error occured. @return FALSE A parsing error occured.
**/ **/
STATIC STATIC
BOOLEAN BOOLEAN
StringToUint16 ( StringToUint16 (
IN CONST CHAR16 *ValueStr, IN CONST CHAR16 *ValueStr,
OUT UINT16 *Value OUT UINT16 *Value
@ -64,7 +64,7 @@ StringToUint16 (
@param[in] NicNumber The network physical device number. @param[in] NicNumber The network physical device number.
@param[out] NicName Address where to store the NIC name. @param[out] NicName Address where to store the NIC name.
The memory area has to be at least The memory area has to be at least
IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH
double byte wide. double byte wide.
@return EFI_SUCCESS The name of the NIC was returned. @return EFI_SUCCESS The name of the NIC was returned.
@ -75,8 +75,8 @@ StringToUint16 (
Managed Network Protocol could not be Managed Network Protocol could not be
read. read.
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
GetNicName ( GetNicName (
IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ControllerHandle,
IN UINTN NicNumber, IN UINTN NicNumber,
@ -102,8 +102,8 @@ GetNicName (
@return Others Either the creation of the child or the opening @return Others Either the creation of the child or the opening
of the protocol failed. of the protocol failed.
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
CreateServiceChildAndOpenProtocol ( CreateServiceChildAndOpenProtocol (
IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ControllerHandle,
IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ServiceBindingProtocolGuid,
@ -124,8 +124,8 @@ CreateServiceChildAndOpenProtocol (
@param[in] ChildHandle Handle of the child to be destroyed. @param[in] ChildHandle Handle of the child to be destroyed.
**/ **/
STATIC STATIC
VOID VOID
CloseProtocolAndDestroyServiceChild ( CloseProtocolAndDestroyServiceChild (
IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ControllerHandle,
IN EFI_GUID *ServiceBindingProtocolGuid, IN EFI_GUID *ServiceBindingProtocolGuid,
@ -148,8 +148,8 @@ CloseProtocolAndDestroyServiceChild (
(see EFI_MTFTP4_PROTOCOL.GetInfo() status codes) (see EFI_MTFTP4_PROTOCOL.GetInfo() status codes)
or error when parsing the response of the server. or error when parsing the response of the server.
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
GetFileSize ( GetFileSize (
IN EFI_MTFTP4_PROTOCOL *Mtftp4, IN EFI_MTFTP4_PROTOCOL *Mtftp4,
IN CONST CHAR8 *FilePath, IN CONST CHAR8 *FilePath,
@ -175,8 +175,8 @@ GetFileSize (
(see EFI_MTFTP4_PROTOCOL.ReadFile() status codes). (see EFI_MTFTP4_PROTOCOL.ReadFile() status codes).
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
DownloadFile ( DownloadFile (
IN EFI_MTFTP4_PROTOCOL *Mtftp4, IN EFI_MTFTP4_PROTOCOL *Mtftp4,
IN CONST CHAR16 *FilePath, IN CONST CHAR16 *FilePath,
@ -198,8 +198,8 @@ DownloadFile (
@retval EFI_SUCCESS All packets are accepted. @retval EFI_SUCCESS All packets are accepted.
**/ **/
STATIC STATIC
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
CheckPacket ( CheckPacket (
IN EFI_MTFTP4_PROTOCOL *This, IN EFI_MTFTP4_PROTOCOL *This,
@ -623,7 +623,7 @@ StringToUint16 (
@param[in] NicNumber The network physical device number. @param[in] NicNumber The network physical device number.
@param[out] NicName Address where to store the NIC name. @param[out] NicName Address where to store the NIC name.
The memory area has to be at least The memory area has to be at least
IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH IP4_CONFIG2_INTERFACE_INFO_NAME_LENGTH
double byte wide. double byte wide.
@return EFI_SUCCESS The name of the NIC was returned. @return EFI_SUCCESS The name of the NIC was returned.

View File

@ -1,7 +1,7 @@
/** @file /** @file
GUID for Shell Map for Get/Set via runtime services. GUID for Shell Map for Get/Set via runtime services.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -22,4 +22,4 @@
extern EFI_GUID gShellMapGuid; extern EFI_GUID gShellMapGuid;
#endif #endif

View File

@ -1,7 +1,7 @@
/** @file /** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database. Provides interface to advanced shell functionality for parsing both handle and protocol database.
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -120,9 +120,9 @@ GetStringNameFromHandle(
/** /**
Get best support language for this driver. Get best support language for this driver.
First base on the user input language to search, second base on the current First base on the user input language to search, second base on the current
platform used language to search, third get the first language from the platform used language to search, third get the first language from the
support language list. The caller need to free the buffer of the best language. support language list. The caller need to free the buffer of the best language.
@param[in] SupportedLanguages The support languages for this driver. @param[in] SupportedLanguages The support languages for this driver.

View File

@ -4,7 +4,7 @@
This library is for use ONLY by shell commands linked into the shell application. This library is for use ONLY by shell commands linked into the shell application.
This library will not function if it is used for UEFI Shell 2.0 Applications. This library will not function if it is used for UEFI Shell 2.0 Applications.
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -507,10 +507,10 @@ ShellCommandConsistMappingUnInitialize (
); );
/** /**
Create a consistent mapped name for the device specified by DevicePath Create a consistent mapped name for the device specified by DevicePath
based on the Table. based on the Table.
This must be called after ShellCommandConsistMappingInitialize() and This must be called after ShellCommandConsistMappingInitialize() and
before ShellCommandConsistMappingUnInitialize() is called. before ShellCommandConsistMappingUnInitialize() is called.
@param[in] DevicePath The pointer to the dev path for the device. @param[in] DevicePath The pointer to the dev path for the device.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Provides interface to shell functionality for shell commands and applications. Provides interface to shell functionality for shell commands and applications.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -1356,9 +1356,9 @@ ShellFileHandleReadLine(
/** /**
Function to delete a file by name Function to delete a file by name
@param[in] FileName Pointer to file name to delete. @param[in] FileName Pointer to file name to delete.
@retval EFI_SUCCESS the file was deleted sucessfully @retval EFI_SUCCESS the file was deleted sucessfully
@retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not @retval EFI_WARN_DELETE_FAILURE the handle was closed, but the file was not
deleted deleted
@ -1388,7 +1388,7 @@ ShellDeleteFileByName(
@param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed. @param[in] CommandToGetHelpOn Pointer to a string containing the command name of help file to be printed.
@param[in] SectionToGetHelpOn Pointer to the section specifier(s). @param[in] SectionToGetHelpOn Pointer to the section specifier(s).
@param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints @param[in] PrintCommandText If TRUE, prints the command followed by the help content, otherwise prints
the help content only. the help content only.
@retval EFI_DEVICE_ERROR The help data format was incorrect. @retval EFI_DEVICE_ERROR The help data format was incorrect.
@retval EFI_NOT_FOUND The help data could not be found. @retval EFI_NOT_FOUND The help data could not be found.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Provides interface to advanced shell functionality for parsing both handle and protocol database. Provides interface to advanced shell functionality for parsing both handle and protocol database.
Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials This program and the accompanying materials
@ -163,53 +163,53 @@
/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a
/// ///
typedef struct { typedef struct {
/// ///
/// A unique number identifying the firmware image within the device. The number is /// A unique number identifying the firmware image within the device. The number is
/// between 1 and DescriptorCount. /// between 1 and DescriptorCount.
/// ///
UINT8 ImageIndex; UINT8 ImageIndex;
/// ///
/// A unique number identifying the firmware image type. /// A unique number identifying the firmware image type.
/// ///
EFI_GUID ImageTypeId; EFI_GUID ImageTypeId;
/// ///
/// A unique number identifying the firmware image. /// A unique number identifying the firmware image.
/// ///
UINT64 ImageId; UINT64 ImageId;
/// ///
/// A pointer to a null-terminated string representing the firmware image name. /// A pointer to a null-terminated string representing the firmware image name.
/// ///
CHAR16 *ImageIdName; CHAR16 *ImageIdName;
/// ///
/// Identifies the version of the device firmware. The format is vendor specific and new /// Identifies the version of the device firmware. The format is vendor specific and new
/// version must have a greater value than an old version. /// version must have a greater value than an old version.
/// ///
UINT32 Version; UINT32 Version;
/// ///
/// A pointer to a null-terminated string representing the firmware image version name. /// A pointer to a null-terminated string representing the firmware image version name.
/// ///
CHAR16 *VersionName; CHAR16 *VersionName;
/// ///
/// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
/// ///
UINTN Size; UINTN Size;
/// ///
/// Image attributes that are supported by this device. See 'Image Attribute Definitions' /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
/// for possible returned values of this parameter. A value of 1 indicates the attribute is /// for possible returned values of this parameter. A value of 1 indicates the attribute is
/// supported and the current setting value is indicated in AttributesSetting. A /// supported and the current setting value is indicated in AttributesSetting. A
/// value of 0 indicates the attribute is not supported and the current setting value in /// value of 0 indicates the attribute is not supported and the current setting value in
/// AttributesSetting is meaningless. /// AttributesSetting is meaningless.
/// ///
UINT64 AttributesSupported; UINT64 AttributesSupported;
/// ///
/// Image attributes. See 'Image Attribute Definitions' for possible returned values of /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
/// this parameter. /// this parameter.
/// ///
UINT64 AttributesSetting; UINT64 AttributesSetting;
/// ///
/// Image compatibilities. See 'Image Compatibility Definitions' for possible returned /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
/// values of this parameter. /// values of this parameter.
/// ///
UINT64 Compatibilities; UINT64 Compatibilities;
} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1; } EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1;
@ -218,53 +218,53 @@ typedef struct {
/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5 /// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5
/// ///
typedef struct { typedef struct {
/// ///
/// A unique number identifying the firmware image within the device. The number is /// A unique number identifying the firmware image within the device. The number is
/// between 1 and DescriptorCount. /// between 1 and DescriptorCount.
/// ///
UINT8 ImageIndex; UINT8 ImageIndex;
/// ///
/// A unique number identifying the firmware image type. /// A unique number identifying the firmware image type.
/// ///
EFI_GUID ImageTypeId; EFI_GUID ImageTypeId;
/// ///
/// A unique number identifying the firmware image. /// A unique number identifying the firmware image.
/// ///
UINT64 ImageId; UINT64 ImageId;
/// ///
/// A pointer to a null-terminated string representing the firmware image name. /// A pointer to a null-terminated string representing the firmware image name.
/// ///
CHAR16 *ImageIdName; CHAR16 *ImageIdName;
/// ///
/// Identifies the version of the device firmware. The format is vendor specific and new /// Identifies the version of the device firmware. The format is vendor specific and new
/// version must have a greater value than an old version. /// version must have a greater value than an old version.
/// ///
UINT32 Version; UINT32 Version;
/// ///
/// A pointer to a null-terminated string representing the firmware image version name. /// A pointer to a null-terminated string representing the firmware image version name.
/// ///
CHAR16 *VersionName; CHAR16 *VersionName;
/// ///
/// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid. /// Size of the image in bytes. If size=0, then only ImageIndex and ImageTypeId are valid.
/// ///
UINTN Size; UINTN Size;
/// ///
/// Image attributes that are supported by this device. See 'Image Attribute Definitions' /// Image attributes that are supported by this device. See 'Image Attribute Definitions'
/// for possible returned values of this parameter. A value of 1 indicates the attribute is /// for possible returned values of this parameter. A value of 1 indicates the attribute is
/// supported and the current setting value is indicated in AttributesSetting. A /// supported and the current setting value is indicated in AttributesSetting. A
/// value of 0 indicates the attribute is not supported and the current setting value in /// value of 0 indicates the attribute is not supported and the current setting value in
/// AttributesSetting is meaningless. /// AttributesSetting is meaningless.
/// ///
UINT64 AttributesSupported; UINT64 AttributesSupported;
/// ///
/// Image attributes. See 'Image Attribute Definitions' for possible returned values of /// Image attributes. See 'Image Attribute Definitions' for possible returned values of
/// this parameter. /// this parameter.
/// ///
UINT64 AttributesSetting; UINT64 AttributesSetting;
/// ///
/// Image compatibilities. See 'Image Compatibility Definitions' for possible returned /// Image compatibilities. See 'Image Compatibility Definitions' for possible returned
/// values of this parameter. /// values of this parameter.
/// ///
UINT64 Compatibilities; UINT64 Compatibilities;
/// ///
/// Describes the lowest ImageDescriptor version that the device will accept. Only /// Describes the lowest ImageDescriptor version that the device will accept. Only

View File

@ -1,6 +1,6 @@
## @file ## @file
# Provides interface to advanced shell functionality for parsing both handle and protocol database. # Provides interface to advanced shell functionality for parsing both handle and protocol database.
# Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. <BR> # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
# (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> # (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR> # (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
# #
@ -354,4 +354,4 @@
[Pcd.common] [Pcd.common]
gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellIncludeNtGuids ## CONSUMES

View File

@ -2,7 +2,7 @@
Main file for BCFG command. Main file for BCFG command.
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -94,8 +94,8 @@ typedef struct {
**/ **/
EFI_STATUS EFI_STATUS
UpdateOptionalData( UpdateOptionalData(
UINT16 Index, UINT16 Index,
UINTN DataSize, UINTN DataSize,
UINT8 *Data, UINT8 *Data,
IN CONST BCFG_OPERATION_TARGET Target IN CONST BCFG_OPERATION_TARGET Target
) )
@ -109,7 +109,7 @@ UpdateOptionalData(
UINTN OriginalOptionDataSize; UINTN OriginalOptionDataSize;
UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Index); UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Target == BcfgTargetBootOrder?L"Boot":L"Driver", Index);
OriginalSize = 0; OriginalSize = 0;
OriginalData = NULL; OriginalData = NULL;
NewData = NULL; NewData = NULL;
@ -157,7 +157,7 @@ UpdateOptionalData(
// put the data back under the variable // put the data back under the variable
// //
Status = gRT->SetVariable( Status = gRT->SetVariable(
VariableName, VariableName,
(EFI_GUID*)&gEfiGlobalVariableGuid, (EFI_GUID*)&gEfiGlobalVariableGuid,
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
NewSize, NewSize,
@ -180,7 +180,7 @@ UpdateOptionalData(
**/ **/
EFI_STATUS EFI_STATUS
GetBootOptionCrc( GetBootOptionCrc(
UINT32 *Crc, UINT32 *Crc,
UINT16 BootIndex UINT16 BootIndex
) )
{ {
@ -629,7 +629,7 @@ BcfgAdd(
(VOID**)&FilePath); (VOID**)&FilePath);
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellBcfgHiiHandle, L"bcfg", HandleNumber); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_HANDLE), gShellBcfgHiiHandle, L"bcfg", HandleNumber);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} else { } else {
@ -660,7 +660,7 @@ BcfgAdd(
|| ParentControllerHandleCount > 0 || ParentControllerHandleCount > 0
|| ChildControllerHandleCount > 0 || ChildControllerHandleCount > 0
|| !EFI_ERROR(Status) ) { || !EFI_ERROR(Status) ) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Handle Number"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Handle Number");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -680,18 +680,18 @@ BcfgAdd(
// //
// If filename matched nothing fail // If filename matched nothing fail
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellBcfgHiiHandle, L"bcfg", File); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellBcfgHiiHandle, L"bcfg", File);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (FileList->Link.ForwardLink != FileList->Link.BackLink) { } else if (FileList->Link.ForwardLink != FileList->Link.BackLink) {
// //
// If filename expanded to multiple names, fail // If filename expanded to multiple names, fail
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellBcfgHiiHandle, L"bcfg", File); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE), gShellBcfgHiiHandle, L"bcfg", File);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Arg = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link); Arg = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link);
if (EFI_ERROR(Arg->Status)) { if (EFI_ERROR(Arg->Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellBcfgHiiHandle, L"bcfg", File); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_OPEN), gShellBcfgHiiHandle, L"bcfg", File);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -703,7 +703,7 @@ BcfgAdd(
// //
DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName); DevicePath = gEfiShellProtocol->GetDevicePathFromFilePath(Arg->FullName);
if (DevicePath == NULL) { if (DevicePath == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName);
ShellStatus = SHELL_UNSUPPORTED; ShellStatus = SHELL_UNSUPPORTED;
} else { } else {
if (UsePath) { if (UsePath) {
@ -752,7 +752,7 @@ BcfgAdd(
} }
if (TargetLocation == 0xFFFF) { if (TargetLocation == 0xFFFF) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET_NF), gShellBcfgHiiHandle, L"bcfg");
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET), gShellBcfgHiiHandle, TargetLocation); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_TARGET), gShellBcfgHiiHandle, TargetLocation);
} }
@ -794,7 +794,7 @@ BcfgAdd(
} }
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", OptionStr); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", OptionStr);
} else { } else {
NewOrder = AllocateZeroPool ((OrderCount + 1) * sizeof (NewOrder[0])); NewOrder = AllocateZeroPool ((OrderCount + 1) * sizeof (NewOrder[0]));
if (NewOrder != NULL) { if (NewOrder != NULL) {
@ -882,7 +882,7 @@ BcfgRemove(
0, 0,
NULL); NULL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0])); NewOrder = AllocateZeroPool(OrderCount*sizeof(CurrentOrder[0]));
@ -903,7 +903,7 @@ BcfgRemove(
Status = EFI_OUT_OF_RESOURCES; Status = EFI_OUT_OF_RESOURCES;
} }
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder");
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
return (SHELL_SUCCESS); return (SHELL_SUCCESS);
@ -965,7 +965,7 @@ BcfgMove(
FreePool(NewOrder); FreePool(NewOrder);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_WRITE_FAIL), gShellBcfgHiiHandle, L"bcfg", Target == BcfgTargetBootOrder?(CHAR16*)L"BootOrder":(CHAR16*)L"DriverOrder");
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
return (SHELL_SUCCESS); return (SHELL_SUCCESS);
@ -1027,7 +1027,7 @@ BcfgAddOpt(
// //
Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > ((UINT16)OrderCount)) { if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL || ((UINT16)Intermediate) > ((UINT16)OrderCount)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
return (ShellStatus); return (ShellStatus);
} }
@ -1042,7 +1042,7 @@ BcfgAddOpt(
} }
// //
// determine whether we have file with data, quote delimited information, or a hot-key // determine whether we have file with data, quote delimited information, or a hot-key
// //
if (Walker[0] == L'\"') { if (Walker[0] == L'\"') {
// //
@ -1050,12 +1050,12 @@ BcfgAddOpt(
// //
Temp = StrStr(Walker+1, L"\""); Temp = StrStr(Walker+1, L"\"");
if (Temp == NULL || StrLen(Temp) != 1) { if (Temp == NULL || StrLen(Temp) != 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
FileName = StrnCatGrow(&FileName, NULL, Walker+1, 0); FileName = StrnCatGrow(&FileName, NULL, Walker+1, 0);
if (FileName == NULL) { if (FileName == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_OUT_OF_RESOURCES; ShellStatus = SHELL_OUT_OF_RESOURCES;
return (ShellStatus); return (ShellStatus);
} }
@ -1064,7 +1064,7 @@ BcfgAddOpt(
Temp2[0] = CHAR_NULL; Temp2[0] = CHAR_NULL;
Temp2++; Temp2++;
if (StrLen(Temp2)>0) { if (StrLen(Temp2)>0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
if (EFI_ERROR(ShellFileExists(Walker))) { if (EFI_ERROR(ShellFileExists(Walker))) {
@ -1086,14 +1086,14 @@ BcfgAddOpt(
// filename // filename
// //
if (EFI_ERROR(ShellFileExists(Walker))) { if (EFI_ERROR(ShellFileExists(Walker))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
FileName = StrnCatGrow(&FileName, NULL, Walker, 0); FileName = StrnCatGrow(&FileName, NULL, Walker, 0);
} }
} else { } else {
if (Target != BcfgTargetBootOrder) { if (Target != BcfgTargetBootOrder) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_BOOT_ONLY), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
@ -1103,7 +1103,7 @@ BcfgAddOpt(
// //
Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
if (EFI_ERROR(Status) || (((UINT32)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) { if (EFI_ERROR(Status) || (((UINT32)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate; NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate;
@ -1118,12 +1118,12 @@ BcfgAddOpt(
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
// //
// Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct. // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.
// Re-allocate with the added information. // Re-allocate with the added information.
// //
KeyOptionBuffer = AllocatePool (sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount)); KeyOptionBuffer = AllocatePool (sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount));
if (KeyOptionBuffer == NULL) { if (KeyOptionBuffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_OUT_OF_RESOURCES; ShellStatus = SHELL_OUT_OF_RESOURCES;
return ShellStatus; return ShellStatus;
} }
@ -1135,7 +1135,7 @@ BcfgAddOpt(
// //
Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) { if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate) || StrStr(Walker, L" ") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].ScanCode = (UINT16)Intermediate; ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].ScanCode = (UINT16)Intermediate;
@ -1152,7 +1152,7 @@ BcfgAddOpt(
// //
Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE); Status = ShellConvertStringToUint64(Walker, &Intermediate, FALSE, TRUE);
if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate)) { if (EFI_ERROR(Status) || (((UINT16)Intermediate) != Intermediate)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", Walker);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].UnicodeChar = (UINT16)Intermediate; ((EFI_INPUT_KEY*)(((UINT8*)KeyOptionBuffer) + sizeof(EFI_KEY_OPTION)))[LoopCounter].UnicodeChar = (UINT16)Intermediate;
@ -1173,9 +1173,9 @@ BcfgAddOpt(
KeyOptionBuffer->BootOption = CurrentOrder[OptionIndex]; KeyOptionBuffer->BootOption = CurrentOrder[OptionIndex];
Status = GetBootOptionCrc(&(KeyOptionBuffer->BootOptionCrc), KeyOptionBuffer->BootOption); Status = GetBootOptionCrc(&(KeyOptionBuffer->BootOptionCrc), KeyOptionBuffer->BootOption);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"Option Index");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
@ -1197,11 +1197,11 @@ BcfgAddOpt(
sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount), sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount),
KeyOptionBuffer); KeyOptionBuffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_VAR_NO_NUM), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_VAR_NO_NUM), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
ASSERT(FileName == NULL && Data == NULL); ASSERT(FileName == NULL && Data == NULL);
@ -1229,7 +1229,7 @@ BcfgAddOpt(
} }
Data = AllocateZeroPool((UINTN)Intermediate); Data = AllocateZeroPool((UINTN)Intermediate);
if (Data == NULL) { if (Data == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_OUT_OF_RESOURCES; ShellStatus = SHELL_OUT_OF_RESOURCES;
} }
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
@ -1242,14 +1242,14 @@ BcfgAddOpt(
if (!EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS && Data != NULL) { if (!EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS && Data != NULL) {
Status = UpdateOptionalData(CurrentOrder[OptionIndex], (UINTN)Intermediate, (UINT8*)Data, Target); Status = UpdateOptionalData(CurrentOrder[OptionIndex], (UINTN)Intermediate, (UINT8*)Data, Target);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) { if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
SHELL_FREE_NON_NULL(Data); SHELL_FREE_NON_NULL(Data);
@ -1291,7 +1291,7 @@ BcfgDisplayDump(
UINTN OptionalDataOffset; UINTN OptionalDataOffset;
if (OrderCount == 0) { if (OrderCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg");
return (SHELL_SUCCESS); return (SHELL_SUCCESS);
} }
@ -1321,7 +1321,7 @@ BcfgDisplayDump(
} }
if (EFI_ERROR(Status) || Buffer == NULL) { if (EFI_ERROR(Status) || Buffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
++Errors; ++Errors;
goto Cleanup; goto Cleanup;
} }
@ -1463,7 +1463,7 @@ ShellCommandRunBcfg (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellBcfgHiiHandle, L"bcfg", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellBcfgHiiHandle, L"bcfg", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -1476,7 +1476,7 @@ ShellCommandRunBcfg (
if (ShellCommandLineGetFlag(Package, L"-opt")) { if (ShellCommandLineGetFlag(Package, L"-opt")) {
CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt"); CurrentOperation.OptData = ShellCommandLineGetValue(Package, L"-opt");
if (CurrentOperation.OptData == NULL) { if (CurrentOperation.OptData == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellBcfgHiiHandle, L"bcfg", L"-opt"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellBcfgHiiHandle, L"bcfg", L"-opt");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeOpt; CurrentOperation.Type = BcfgTypeOpt;
@ -1488,14 +1488,14 @@ ShellCommandRunBcfg (
if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) || if ((ShellCommandLineGetCount(Package) < 3 && CurrentOperation.Type != BcfgTypeOpt) ||
(ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt) (ShellCommandLineGetCount(Package) < 2 && CurrentOperation.Type == BcfgTypeOpt)
){ ){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"driver") == 0) {
CurrentOperation.Target = BcfgTargetDriverOrder; CurrentOperation.Target = BcfgTargetDriverOrder;
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)ShellCommandLineGetRawValue(Package, 1), L"boot") == 0) {
CurrentOperation.Target = BcfgTargetBootOrder; CurrentOperation.Target = BcfgTargetBootOrder;
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_DRIVER_BOOT), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
@ -1541,17 +1541,17 @@ ShellCommandRunBcfg (
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} else if (ShellCommandLineGetFlag(Package, L"-v")) { } else if (ShellCommandLineGetFlag(Package, L"-v")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"-v (without dump)"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", L"-v (without dump)");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"add") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"add") == 0) {
if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeAdd; CurrentOperation.Type = BcfgTypeAdd;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
@ -1563,13 +1563,13 @@ ShellCommandRunBcfg (
} }
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addp") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addp") == 0) {
if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeAddp; CurrentOperation.Type = BcfgTypeAddp;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
@ -1581,20 +1581,20 @@ ShellCommandRunBcfg (
} }
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addh") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"addh") == 0) {
if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) { if ((ParamNumber + 3) >= ShellCommandLineGetCount(Package)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeAddh; CurrentOperation.Type = BcfgTypeAddh;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
CurrentOperation.Number1 = (UINT16)Intermediate; CurrentOperation.Number1 = (UINT16)Intermediate;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
@ -1605,42 +1605,42 @@ ShellCommandRunBcfg (
} }
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"rm") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"rm") == 0) {
if ((ParamNumber + 1) >= ShellCommandLineGetCount(Package)) { if ((ParamNumber + 1) >= ShellCommandLineGetCount(Package)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeRm; CurrentOperation.Type = BcfgTypeRm;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
CurrentOperation.Number1 = (UINT16)Intermediate; CurrentOperation.Number1 = (UINT16)Intermediate;
if (CurrentOperation.Number1 >= Count){ if (CurrentOperation.Number1 >= Count){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
} else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"mv") == 0) { } else if (gUnicodeCollation->StriColl(gUnicodeCollation, (CHAR16*)CurrentParam, L"mv") == 0) {
if ((ParamNumber + 2) >= ShellCommandLineGetCount(Package)) { if ((ParamNumber + 2) >= ShellCommandLineGetCount(Package)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellBcfgHiiHandle, L"bcfg");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
CurrentOperation.Type = BcfgTypeMv; CurrentOperation.Type = BcfgTypeMv;
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
CurrentOperation.Number1 = (UINT16)Intermediate; CurrentOperation.Number1 = (UINT16)Intermediate;
if (CurrentOperation.Number1 >= Count){ if (CurrentOperation.Number1 >= Count){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber); CurrentParam = ShellCommandLineGetRawValue(Package, ++ParamNumber);
if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) { if (CurrentParam == NULL || !ShellIsHexOrDecimalNumber(CurrentParam, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(CurrentParam, &Intermediate, TRUE, FALSE);
@ -1649,7 +1649,7 @@ ShellCommandRunBcfg (
if (CurrentOperation.Number2 == CurrentOperation.Number1 if (CurrentOperation.Number2 == CurrentOperation.Number1
||CurrentOperation.Number2 >= Count ||CurrentOperation.Number2 >= Count
){ ){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
@ -1751,7 +1751,7 @@ ShellCommandRunBcfg (
} }
} }
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellBcfgHiiHandle, L"bcfg", CurrentParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }

View File

@ -1,7 +1,7 @@
## @file ## @file
# Provides interface to shell functionality for shell commands and applications. # Provides interface to shell functionality for shell commands and applications.
# #
# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved. <BR> # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. <BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -40,5 +40,5 @@
[Protocols] [Protocols]
gEfiShellParametersProtocolGuid ## CONSUMES gEfiShellParametersProtocolGuid ## CONSUMES
gEfiShellInterfaceGuid ## SOMETIMES_CONSUMES gEfiShellInterfaceGuid ## SOMETIMES_CONSUMES

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main file for support of shell consist mapping. Main file for support of shell consist mapping.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -56,10 +56,10 @@ typedef struct {
@retval EFI_OUT_OF_RESOURCES Out of resources. @retval EFI_OUT_OF_RESOURCES Out of resources.
@retval EFI_SUCCESS The appending was successful. @retval EFI_SUCCESS The appending was successful.
**/ **/
typedef typedef
EFI_STATUS EFI_STATUS
(*SERIAL_DECODE_FUNCTION) ( (*SERIAL_DECODE_FUNCTION) (
EFI_DEVICE_PATH_PROTOCOL *DevPath, EFI_DEVICE_PATH_PROTOCOL *DevPath,
DEVICE_CONSIST_MAPPING_INFO *MapInfo, DEVICE_CONSIST_MAPPING_INFO *MapInfo,
EFI_DEVICE_PATH_PROTOCOL *OrigDevPath EFI_DEVICE_PATH_PROTOCOL *OrigDevPath
); );
@ -640,7 +640,7 @@ DevPathSerialUsb (
UsbIo = NULL; UsbIo = NULL;
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
Status = gBS->OpenProtocol(TempHandle, &gEfiUsbIoProtocolGuid, (VOID**)&UsbIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); Status = gBS->OpenProtocol(TempHandle, &gEfiUsbIoProtocolGuid, (VOID**)&UsbIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
} }
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
ASSERT(UsbIo != NULL); ASSERT(UsbIo != NULL);
@ -661,7 +661,7 @@ DevPathSerialUsb (
} }
} }
} }
} }
} }
return Status; return Status;
} }
@ -1520,13 +1520,13 @@ ShellCommandConsistMappingInitialize (
continue; continue;
} }
Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
&gEfiBlockIoProtocolGuid, &gEfiBlockIoProtocolGuid,
(VOID **)&BlockIo (VOID **)&BlockIo
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
Status = gBS->HandleProtocol( HandleBuffer[HandleLoop], Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
&gEfiSimpleFileSystemProtocolGuid, &gEfiSimpleFileSystemProtocolGuid,
(VOID **)&SimpleFileSystem (VOID **)&SimpleFileSystem
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {

View File

@ -79,7 +79,7 @@ CommandInit(
UINTN Index; UINTN Index;
EFI_STATUS Status; EFI_STATUS Status;
CHAR8 *PlatformLang; CHAR8 *PlatformLang;
GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL); GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL);
if (PlatformLang == NULL) { if (PlatformLang == NULL) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
@ -115,7 +115,7 @@ CommandInit(
// //
// Find the best matching matching language from the supported languages // Find the best matching matching language from the supported languages
// of Unicode Collation2 protocol. // of Unicode Collation2 protocol.
// //
BestLanguage = GetBestLanguage ( BestLanguage = GetBestLanguage (
Uc->SupportedLanguages, Uc->SupportedLanguages,
@ -311,7 +311,7 @@ ShellCommandFindDynamicCommand (
// //
// not found or out of resources // not found or out of resources
// //
return NULL; return NULL;
} }
for (NextCommand = CommandHandleList; *NextCommand != NULL; NextCommand++) { for (NextCommand = CommandHandleList; *NextCommand != NULL; NextCommand++) {
@ -328,7 +328,7 @@ ShellCommandFindDynamicCommand (
if (gUnicodeCollation->StriColl( if (gUnicodeCollation->StriColl(
gUnicodeCollation, gUnicodeCollation,
(CHAR16*)CommandString, (CHAR16*)CommandString,
(CHAR16*)DynamicCommand->CommandName) == 0 (CHAR16*)DynamicCommand->CommandName) == 0
){ ){
FreePool(CommandHandleList); FreePool(CommandHandleList);
return (DynamicCommand); return (DynamicCommand);
@ -429,7 +429,7 @@ ShellCommandGetDynamicCommandHelp(
// //
// TODO: how to get proper language? // TODO: how to get proper language?
// //
return DynamicCommand->GetHelp(DynamicCommand, "en"); return DynamicCommand->GetHelp(DynamicCommand, "en");
} }
/** /**
@ -847,7 +847,7 @@ ShellCommandRegisterAlias (
{ {
ALIAS_LIST *Node; ALIAS_LIST *Node;
ALIAS_LIST *CommandAlias; ALIAS_LIST *CommandAlias;
ALIAS_LIST *PrevCommandAlias; ALIAS_LIST *PrevCommandAlias;
INTN LexicalMatchValue; INTN LexicalMatchValue;
// //
@ -896,7 +896,7 @@ ShellCommandRegisterAlias (
// //
// Swap PrevCommandAlias and CommandAlias list entry if PrevCommandAlias list entry // Swap PrevCommandAlias and CommandAlias list entry if PrevCommandAlias list entry
// is alphabetically greater than CommandAlias list entry // is alphabetically greater than CommandAlias list entry
// //
if (LexicalMatchValue > 0) { if (LexicalMatchValue > 0) {
CommandAlias = (ALIAS_LIST *) SwapListEntries (&PrevCommandAlias->Link, &CommandAlias->Link); CommandAlias = (ALIAS_LIST *) SwapListEntries (&PrevCommandAlias->Link, &CommandAlias->Link);
} else if (LexicalMatchValue < 0) { } else if (LexicalMatchValue < 0) {

View File

@ -154,7 +154,7 @@ ShellCommandRunComp (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"comp", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -162,22 +162,22 @@ ShellCommandRunComp (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 3) { if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"comp");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 3) { } else if (ShellCommandLineGetCount(Package) < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"comp");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
TempParam = ShellCommandLineGetRawValue(Package, 1); TempParam = ShellCommandLineGetRawValue(Package, 1);
ASSERT(TempParam != NULL); ASSERT(TempParam != NULL);
FileName1 = ShellFindFilePath(TempParam); FileName1 = ShellFindFilePath(TempParam);
if (FileName1 == NULL) { if (FileName1 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName(FileName1, &FileHandle1, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }
@ -185,12 +185,12 @@ ShellCommandRunComp (
ASSERT(TempParam != NULL); ASSERT(TempParam != NULL);
FileName2 = ShellFindFilePath(TempParam); FileName2 = ShellFindFilePath(TempParam);
if (FileName2 == NULL) { if (FileName2 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName(FileName2, &FileHandle2, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"comp", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }

View File

@ -7,7 +7,7 @@
This sequence is further divided into Blocks and Huffman codings This sequence is further divided into Blocks and Huffman codings
are applied to each Block. are applied to each Block.
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -181,7 +181,7 @@ PutDword (
/** /**
Allocate memory spaces for data structures used in compression process. Allocate memory spaces for data structures used in compression process.
@retval EFI_SUCCESS Memory was allocated successfully. @retval EFI_SUCCESS Memory was allocated successfully.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
**/ **/
@ -740,7 +740,7 @@ MakeLen (
/** /**
Assign code to each symbol based on the code length array. Assign code to each symbol based on the code length array.
@param[in] LoopVar8 The number of symbols. @param[in] LoopVar8 The number of symbols.
@param[in] Len The code length array. @param[in] Len The code length array.
@param[out] Code The stores codes for each symbol. @param[out] Code The stores codes for each symbol.
@ -764,7 +764,7 @@ MakeCode (
Code[LoopVar1] = Start[Len[LoopVar1]]++; Code[LoopVar1] = Start[Len[LoopVar1]]++;
} }
} }
/** /**
Generates Huffman codes given a frequency distribution of symbols. Generates Huffman codes given a frequency distribution of symbols.
@ -1175,7 +1175,7 @@ HufEncodeStart (
/** /**
Outputs an Original Character or a Pointer. Outputs an Original Character or a Pointer.
@param[in] LoopVar5 The original character or the 'String Length' element of @param[in] LoopVar5 The original character or the 'String Length' element of
a Pointer. a Pointer.
@param[in] LoopVar7 The 'Position' field of a Pointer. @param[in] LoopVar7 The 'Position' field of a Pointer.
**/ **/

View File

@ -2,7 +2,7 @@
Main file for Dblk shell Debug1 function. Main file for Dblk shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -69,11 +69,11 @@ DisplayTheBlocks(
Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer); Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, Lba, BufferSize, Buffer);
if (!EFI_ERROR(Status) && Buffer != NULL) { if (!EFI_ERROR(Status) && Buffer != NULL) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DBLK_HEADER), STRING_TOKEN (STR_DBLK_HEADER),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Lba, Lba,
BufferSize, BufferSize,
BlockIo BlockIo
@ -81,7 +81,7 @@ DisplayTheBlocks(
DumpHex(2,0,BufferSize,Buffer); DumpHex(2,0,BufferSize,Buffer);
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"dblk", L"BlockIo");
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -135,7 +135,7 @@ ShellCommandRunDblk (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dblk", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -143,10 +143,10 @@ ShellCommandRunDblk (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 4) { if (ShellCommandLineGetCount(Package) > 4) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dblk");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 2) { } else if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"dblk");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -160,7 +160,7 @@ ShellCommandRunDblk (
Lba = 0; Lba = 0;
} else { } else {
if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) { if (!ShellIsHexOrDecimalNumber(LbaString, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", LbaString);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE); ShellConvertStringToUint64(LbaString, &Lba, TRUE, FALSE);
@ -170,29 +170,29 @@ ShellCommandRunDblk (
BlockCount = 1; BlockCount = 1;
} else { } else {
if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) { if (!ShellIsHexOrDecimalNumber(BlockCountString, TRUE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE); ShellConvertStringToUint64(BlockCountString, &BlockCount, TRUE, FALSE);
if (BlockCount > 0x10) { if (BlockCount > 0x10) {
BlockCount = 0x10; BlockCount = 0x10;
} else if (BlockCount == 0) { } else if (BlockCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockCountString);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
// //
// do the work if we have a valid block identifier // do the work if we have a valid block identifier
// //
if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) { if (gEfiShellProtocol->GetDevicePathFromMap(BlockName) == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dblk", BlockName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName); DevPath = (EFI_DEVICE_PATH_PROTOCOL*)gEfiShellProtocol->GetDevicePathFromMap(BlockName);
if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) { if (gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &DevPath, NULL) == EFI_NOT_FOUND) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MAP_PROTOCOL), gShellDebug1HiiHandle, L"dblk", BlockName, L"BlockIo");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount); ShellStatus = DisplayTheBlocks(gEfiShellProtocol->GetDevicePathFromMap(BlockName), Lba, (UINT8)BlockCount);

View File

@ -1,9 +1,9 @@
/** @file /** @file
Main file for Dmem shell Debug1 function. Main file for Dmem shell Debug1 function.
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -62,7 +62,7 @@ DisplayMmioMemory(
Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo); Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem");
return (SHELL_NOT_FOUND); return (SHELL_NOT_FOUND);
} }
Buffer = AllocateZeroPool(Size); Buffer = AllocateZeroPool(Size);
@ -72,7 +72,7 @@ DisplayMmioMemory(
Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer); Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
@ -135,7 +135,7 @@ ShellCommandRunDmem (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -143,7 +143,7 @@ ShellCommandRunDmem (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 3) { if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Temp1 = ShellCommandLineGetRawValue(Package, 1); Temp1 = ShellCommandLineGetRawValue(Package, 1);
@ -152,15 +152,15 @@ ShellCommandRunDmem (
Size = 512; Size = 512;
} else { } else {
if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) { if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
Temp1 = ShellCommandLineGetRawValue(Package, 2); Temp1 = ShellCommandLineGetRawValue(Package, 2);
if (Temp1 == NULL) { if (Temp1 == NULL) {
Size = 512; Size = 512;
} else { } else {
if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) { if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
@ -204,7 +204,7 @@ ShellCommandRunDmem (
} }
} }
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,
(UINT64)(UINTN)Address, (UINT64)(UINTN)Address,
gST->Hdr.HeaderSize, gST->Hdr.HeaderSize,
gST->Hdr.Revision, gST->Hdr.Revision,

View File

@ -1,8 +1,8 @@
/** @file /** @file
Main file for DmpStore shell Debug1 function. Main file for DmpStore shell Debug1 function.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -51,7 +51,7 @@ GetAttrType (
BufLen = 0; BufLen = 0;
RetString = NULL; RetString = NULL;
if ((Atts & EFI_VARIABLE_NON_VOLATILE) != 0) { if ((Atts & EFI_VARIABLE_NON_VOLATILE) != 0) {
StrnCatGrow (&RetString, &BufLen, L"+NV", 0); StrnCatGrow (&RetString, &BufLen, L"+NV", 0);
} }
@ -157,11 +157,11 @@ LoadVariablesFromFile (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return SHELL_DEVICE_ERROR; return SHELL_DEVICE_ERROR;
} }
ShellStatus = SHELL_SUCCESS; ShellStatus = SHELL_SUCCESS;
InitializeListHead (&List); InitializeListHead (&List);
Position = 0; Position = 0;
while (Position < FileSize) { while (Position < FileSize) {
// //
@ -220,7 +220,7 @@ LoadVariablesFromFile (
} }
Position += BufferSize + sizeof (Crc32); Position += BufferSize + sizeof (Crc32);
Variable = AllocateZeroPool (sizeof (*Variable) + NameSize + DataSize); Variable = AllocateZeroPool (sizeof (*Variable) + NameSize + DataSize);
if (Variable == NULL) { if (Variable == NULL) {
FreePool (Buffer); FreePool (Buffer);
@ -239,20 +239,20 @@ LoadVariablesFromFile (
InsertTailList (&List, &Variable->Link); InsertTailList (&List, &Variable->Link);
FreePool (Buffer); FreePool (Buffer);
} }
if ((Position != FileSize) || (ShellStatus != SHELL_SUCCESS)) { if ((Position != FileSize) || (ShellStatus != SHELL_SUCCESS)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle, L"dmpstore");
if (Position != FileSize) { if (Position != FileSize) {
ShellStatus = SHELL_VOLUME_CORRUPTED; ShellStatus = SHELL_VOLUME_CORRUPTED;
} }
} }
for ( Link = GetFirstNode (&List) for ( Link = GetFirstNode (&List)
; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS) ; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS)
; Link = GetNextNode (&List, Link) ; Link = GetNextNode (&List, Link)
) { ) {
Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE); Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE);
if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *) Name)) && if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *) Name)) &&
((Guid == NULL) || CompareGuid (&Variable->Guid, Guid)) ((Guid == NULL) || CompareGuid (&Variable->Guid, Guid))
) { ) {
@ -272,7 +272,7 @@ LoadVariablesFromFile (
Variable->Data Variable->Data
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", Variable->Name, Status);
} }
} }
} }
@ -369,19 +369,19 @@ AppendSingleVariableToFile (
Status = ShellWriteFile (FileHandle, &BufferSize, Buffer); Status = ShellWriteFile (FileHandle, &BufferSize, Buffer);
FreePool (Buffer); FreePool (Buffer);
if (!EFI_ERROR (Status) && if (!EFI_ERROR (Status) &&
(BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize + sizeof (UINT32)) (BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize + sizeof (UINT32))
) { ) {
Status = EFI_DEVICE_ERROR; Status = EFI_DEVICE_ERROR;
} }
return Status; return Status;
} }
/** /**
Recursive function to display or delete variables. Recursive function to display or delete variables.
This function will call itself to create a stack-based list of allt he variables to process, This function will call itself to create a stack-based list of allt he variables to process,
then fromt he last to the first, they will do either printing or deleting. then fromt he last to the first, they will do either printing or deleting.
This is necessary since once a delete happens GetNextVariableName() will work. This is necessary since once a delete happens GetNextVariableName() will work.
@ -480,9 +480,9 @@ CascadeProcessVariables (
// No matter what happened we process our own variable // No matter what happened we process our own variable
// Only continue if Guid and VariableName are each either NULL or a match // Only continue if Guid and VariableName are each either NULL or a match
// //
if ( ( Name == NULL if ( ( Name == NULL
|| gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*) Name) ) || gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*) Name) )
&& ( Guid == NULL && ( Guid == NULL
|| CompareGuid(&FoundVarGuid, Guid) ) || CompareGuid(&FoundVarGuid, Guid) )
) { ) {
DataSize = 0; DataSize = 0;
@ -634,16 +634,16 @@ ProcessVariables (
if (!Found) { if (!Found) {
if (ShellStatus == SHELL_OUT_OF_RESOURCES) { if (ShellStatus == SHELL_OUT_OF_RESOURCES) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"dmpstore");
return (ShellStatus); return (ShellStatus);
} else if (Name != NULL && Guid == NULL) { } else if (Name != NULL && Guid == NULL) {
if (StandardFormatOutput) { if (StandardFormatOutput) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N_SFO), gShellDebug1HiiHandle, Name); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N_SFO), gShellDebug1HiiHandle, Name);
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, L"dmpstore", Name); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, L"dmpstore", Name);
} }
} else if (Name != NULL && Guid != NULL) { } else if (Name != NULL && Guid != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, L"dmpstore", Guid, Name);
} else if (Name == NULL && Guid == NULL) { } else if (Name == NULL && Guid == NULL) {
if (StandardFormatOutput) { if (StandardFormatOutput) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_SFO), gShellDebug1HiiHandle); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_SFO), gShellDebug1HiiHandle);
@ -656,7 +656,7 @@ ProcessVariables (
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, L"dmpstore", Guid); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, L"dmpstore", Guid);
} }
} }
return (SHELL_NOT_FOUND); return (SHELL_NOT_FOUND);
} }
return (ShellStatus); return (ShellStatus);
@ -710,7 +710,7 @@ ShellCommandRunDmpStore (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmpstore", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -718,19 +718,19 @@ ShellCommandRunDmpStore (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmpstore");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) { } else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-all", L"-guid");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-l")) { } else if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-l")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) { } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-d");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-sfo")) { } else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-sfo")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"dmpstore", L"-l or -s", L"-sfo");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -741,7 +741,7 @@ ShellCommandRunDmpStore (
if (GuidStr != NULL) { if (GuidStr != NULL) {
RStatus = StrToGuid (GuidStr, &GuidData); RStatus = StrToGuid (GuidStr, &GuidData);
if (RETURN_ERROR (RStatus) || (GuidStr[GUID_STRING_LENGTH] != L'\0')) { if (RETURN_ERROR (RStatus) || (GuidStr[GUID_STRING_LENGTH] != L'\0')) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmpstore", GuidStr);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
Guid = &GuidData; Guid = &GuidData;
@ -762,7 +762,7 @@ ShellCommandRunDmpStore (
Type = DmpStoreSave; Type = DmpStoreSave;
File = ShellCommandLineGetValue(Package, L"-s"); File = ShellCommandLineGetValue(Package, L"-s");
if (File == NULL) { if (File == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
@ -772,16 +772,16 @@ ShellCommandRunDmpStore (
// //
FileInfo = ShellGetFileInfo (FileHandle); FileInfo = ShellGetFileInfo (FileHandle);
if (FileInfo == NULL) { if (FileInfo == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
Status = EFI_DEVICE_ERROR; Status = EFI_DEVICE_ERROR;
} else { } else {
if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File);
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
} else { } else {
Status = ShellDeleteFile (&FileHandle); Status = ShellDeleteFile (&FileHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
} }
} }
FreePool (FileInfo); FreePool (FileInfo);
@ -795,13 +795,13 @@ ShellCommandRunDmpStore (
// //
// Otherwise it's bad. // Otherwise it's bad.
// //
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
} }
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
} }
} }
@ -813,21 +813,21 @@ ShellCommandRunDmpStore (
Type = DmpStoreLoad; Type = DmpStoreLoad;
File = ShellCommandLineGetValue(Package, L"-l"); File = ShellCommandLineGetValue(Package, L"-l");
if (File == NULL) { if (File == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"dmpstore", L"-l");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
FileInfo = ShellGetFileInfo (FileHandle); FileInfo = ShellGetFileInfo (FileHandle);
if (FileInfo == NULL) { if (FileInfo == NULL) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"dmpstore", File);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} else { } else {
if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, L"dmpstore", File);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
FreePool (FileInfo); FreePool (FileInfo);

View File

@ -2,7 +2,7 @@
Main file for Edit shell Debug1 function. Main file for Edit shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -59,7 +59,7 @@ ShellCommandRunEdit (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"edit", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -67,7 +67,7 @@ ShellCommandRunEdit (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"edit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Cwd = gEfiShellProtocol->GetCurDir(NULL); Cwd = gEfiShellProtocol->GetCurDir(NULL);
@ -86,7 +86,7 @@ ShellCommandRunEdit (
} }
gEfiShellProtocol->SetCurDir(NULL, Nfs); gEfiShellProtocol->SetCurDir(NULL, Nfs);
FreePool(Nfs); FreePool(Nfs);
} }
} }
} }
@ -135,7 +135,7 @@ ShellCommandRunEdit (
// //
if (Status == EFI_SUCCESS) { if (Status == EFI_SUCCESS) {
} else if (Status == EFI_OUT_OF_RESOURCES) { } else if (Status == EFI_OUT_OF_RESOURCES) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"edit");
} else { } else {
if (Buffer != NULL) { if (Buffer != NULL) {
if (StrCmp (Buffer, L"") != 0) { if (StrCmp (Buffer, L"") != 0) {

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implements filebuffer interface functions. Implements filebuffer interface functions.
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -53,7 +53,7 @@ EFI_EDITOR_FILE_BUFFER FileBufferConst = {
// //
// the whole edit area needs to be refreshed // the whole edit area needs to be refreshed
// //
BOOLEAN FileBufferNeedRefresh; BOOLEAN FileBufferNeedRefresh;
// //
// only the current line in edit area needs to be refresh // only the current line in edit area needs to be refresh
@ -144,7 +144,7 @@ FileBufferBackup (
/** /**
Advance to the next Count lines Advance to the next Count lines
@param[in] Count The line number to advance by. @param[in] Count The line number to advance by.
@param[in] CurrentLine The pointer to the current line structure. @param[in] CurrentLine The pointer to the current line structure.
@param[in] LineList The pointer to the linked list of lines. @param[in] LineList The pointer to the linked list of lines.
@ -183,7 +183,7 @@ InternalEditorMiscLineAdvance (
/** /**
Retreat to the previous Count lines. Retreat to the previous Count lines.
@param[in] Count The line number to retreat by. @param[in] Count The line number to retreat by.
@param[in] CurrentLine The pointer to the current line structure. @param[in] CurrentLine The pointer to the current line structure.
@param[in] LineList The pointer to the linked list of lines. @param[in] LineList The pointer to the linked list of lines.
@ -222,7 +222,7 @@ InternalEditorMiscLineRetreat (
/** /**
Advance/Retreat lines Advance/Retreat lines
@param[in] Count line number to advance/retreat @param[in] Count line number to advance/retreat
>0 : advance >0 : advance
<0 : retreat <0 : retreat
@ -484,7 +484,7 @@ FileBufferPrintLine (
UINTN Limit; UINTN Limit;
CHAR16 *PrintLine; CHAR16 *PrintLine;
CHAR16 *PrintLine2; CHAR16 *PrintLine2;
UINTN BufLen; UINTN BufLen;
// //
// print start from correct character // print start from correct character
@ -710,7 +710,7 @@ FileBufferCreateLine (
Set FileName field in FileBuffer. Set FileName field in FileBuffer.
@param Str The file name to set. @param Str The file name to set.
@retval EFI_SUCCESS The filename was successfully set. @retval EFI_SUCCESS The filename was successfully set.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_INVALID_PARAMETER Str is not a valid filename. @retval EFI_INVALID_PARAMETER Str is not a valid filename.
@ -763,10 +763,10 @@ FileBufferFree (
/** /**
Read a file from disk into the FileBuffer. Read a file from disk into the FileBuffer.
@param[in] FileName The filename to read. @param[in] FileName The filename to read.
@param[in] Recover TRUE if is for recover mode, no information printouts. @param[in] Recover TRUE if is for recover mode, no information printouts.
@retval EFI_SUCCESS The load was successful. @retval EFI_SUCCESS The load was successful.
@retval EFI_LOAD_ERROR The load failed. @retval EFI_LOAD_ERROR The load failed.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@ -823,7 +823,7 @@ FileBufferRead (
} }
Info = ShellGetFileInfo(FileHandle); Info = ShellGetFileInfo(FileHandle);
if (Info->Attribute & EFI_FILE_DIRECTORY) { if (Info->Attribute & EFI_FILE_DIRECTORY) {
StatusBarSetStatusString (L"Directory Can Not Be Edited"); StatusBarSetStatusString (L"Directory Can Not Be Edited");
FreePool (Info); FreePool (Info);
@ -1397,7 +1397,7 @@ UnicodeToAscii (
@param[in] FileName The file name for writing. @param[in] FileName The file name for writing.
@retval EFI_SUCCESS Data was written. @retval EFI_SUCCESS Data was written.
@retval EFI_LOAD_ERROR @retval EFI_LOAD_ERROR
@retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file. @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file.
**/ **/
EFI_STATUS EFI_STATUS
@ -1472,7 +1472,7 @@ FileBufferSave (
FreePool(Info); FreePool(Info);
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
} }
if (Info != NULL) { if (Info != NULL) {
Attribute = Info->Attribute & ~EFI_FILE_READ_ONLY; Attribute = Info->Attribute & ~EFI_FILE_READ_ONLY;
FreePool(Info); FreePool(Info);
@ -1550,7 +1550,7 @@ FileBufferSave (
Size = TotalSize - LeftSize; Size = TotalSize - LeftSize;
Status = ShellWriteFile (FileHandle, &Size, Cache); Status = ShellWriteFile (FileHandle, &Size, Cache);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellDeleteFile (&FileHandle); ShellDeleteFile (&FileHandle);
FreePool (Cache); FreePool (Cache);
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
} }
@ -1911,7 +1911,7 @@ FileBufferDoReturn (
} }
/** /**
Delete current character from current line. This is the effect caused Delete current character from current line. This is the effect caused
by the 'del' key. by the 'del' key.
@retval EFI_SUCCESS @retval EFI_SUCCESS
@ -2023,7 +2023,7 @@ FileBufferScrollRight (
/** /**
Insert a char into line Insert a char into line
@param[in] Line The line to insert into. @param[in] Line The line to insert into.
@param[in] Char The char to insert. @param[in] Char The char to insert.
@param[in] Pos The position to insert the char at ( start from 0 ). @param[in] Pos The position to insert the char at ( start from 0 ).
@ -2395,7 +2395,7 @@ FileBufferEnd (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/** /**
Dispatch input to different handler Dispatch input to different handler
@param[in] Key The input key. One of: @param[in] Key The input key. One of:
ASCII KEY ASCII KEY
@ -2610,7 +2610,7 @@ RightCurrentScreen (
/** /**
Advance/Retreat lines and set CurrentLine in FileBuffer to it Advance/Retreat lines and set CurrentLine in FileBuffer to it
@param[in] Count The line number to advance/retreat @param[in] Count The line number to advance/retreat
>0 : advance >0 : advance
<0: retreat <0: retreat
@ -2756,7 +2756,7 @@ FileBufferMovePosition (
/** /**
Cut current line out and return a pointer to it. Cut current line out and return a pointer to it.
@param[out] CutLine Upon a successful return pointer to the pointer to @param[out] CutLine Upon a successful return pointer to the pointer to
the allocated cut line. the allocated cut line.
@retval EFI_SUCCESS The cut was successful. @retval EFI_SUCCESS The cut was successful.
@ -2930,7 +2930,7 @@ FileBufferSearch (
Column = 0; Column = 0;
Position = 0; Position = 0;
// //
// search if in current line // search if in current line
// //
@ -2949,7 +2949,7 @@ FileBufferSearch (
if (CharPos != NULL) { if (CharPos != NULL) {
Position = CharPos - Current + 1; Position = CharPos - Current + 1;
Found = TRUE; Found = TRUE;
} }
// //
// found // found
@ -2971,8 +2971,8 @@ FileBufferSearch (
if (CharPos != NULL) { if (CharPos != NULL) {
Position = CharPos - Line->Buffer + 1; Position = CharPos - Line->Buffer + 1;
Found = TRUE; Found = TRUE;
} }
if (Found) { if (Found) {
// //
// found // found

View File

@ -1,7 +1,7 @@
/** @file /** @file
Declares filebuffer interface functions. Declares filebuffer interface functions.
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -50,7 +50,7 @@ FileBufferRefresh (
VOID VOID
); );
/** /**
Dispatch input to different handler Dispatch input to different handler
@param[in] Key The input key. One of: @param[in] Key The input key. One of:
ASCII KEY ASCII KEY
@ -98,7 +98,7 @@ FileBufferRestorePosition (
Set FileName field in FileBuffer. Set FileName field in FileBuffer.
@param Str The file name to set. @param Str The file name to set.
@retval EFI_SUCCESS The filename was successfully set. @retval EFI_SUCCESS The filename was successfully set.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_INVALID_PARAMETER Str is not a valid filename. @retval EFI_INVALID_PARAMETER Str is not a valid filename.
@ -110,10 +110,10 @@ FileBufferSetFileName (
/** /**
Read a file from disk into the FileBuffer. Read a file from disk into the FileBuffer.
@param[in] FileName The filename to read. @param[in] FileName The filename to read.
@param[in] Recover TRUE if is for recover mode, no information printouts. @param[in] Recover TRUE if is for recover mode, no information printouts.
@retval EFI_SUCCESS The load was successful. @retval EFI_SUCCESS The load was successful.
@retval EFI_LOAD_ERROR The load failed. @retval EFI_LOAD_ERROR The load failed.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@ -131,7 +131,7 @@ FileBufferRead (
@param[in] FileName The file name for writing. @param[in] FileName The file name for writing.
@retval EFI_SUCCESS Data was written. @retval EFI_SUCCESS Data was written.
@retval EFI_LOAD_ERROR @retval EFI_LOAD_ERROR
@retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file. @retval EFI_OUT_OF_RESOURCES There were not enough resources to write the file.
**/ **/
EFI_STATUS EFI_STATUS
@ -154,7 +154,7 @@ FileBufferMovePosition (
/** /**
Cut current line out and return a pointer to it. Cut current line out and return a pointer to it.
@param[out] CutLine Upon a successful return pointer to the pointer to @param[out] CutLine Upon a successful return pointer to the pointer to
the allocated cut line. the allocated cut line.
@retval EFI_SUCCESS The cut was successful. @retval EFI_SUCCESS The cut was successful.

View File

@ -77,7 +77,7 @@ MainCommandGotoLine (
/** /**
Save current file to disk, you can save to current file name or Save current file to disk, you can save to current file name or
save to another file name. save to another file name.
@retval EFI_SUCCESS The file was saved correctly. @retval EFI_SUCCESS The file was saved correctly.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A file access error occured. @retval EFI_LOAD_ERROR A file access error occured.
@ -1136,7 +1136,7 @@ MainCommandGotoLine (
/** /**
Save current file to disk, you can save to current file name or Save current file to disk, you can save to current file name or
save to another file name. save to another file name.
@retval EFI_SUCCESS The file was saved correctly. @retval EFI_SUCCESS The file was saved correctly.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A file access error occured. @retval EFI_LOAD_ERROR A file access error occured.
@ -1150,7 +1150,7 @@ MainCommandSaveFile (
CHAR16 *FileName; CHAR16 *FileName;
BOOLEAN OldFile; BOOLEAN OldFile;
CHAR16 *Str; CHAR16 *Str;
SHELL_FILE_HANDLE FileHandle; SHELL_FILE_HANDLE FileHandle;
EFI_FILE_INFO *Info; EFI_FILE_INFO *Info;
// //
@ -1280,15 +1280,15 @@ MainCommandSaveFile (
StatusBarSetStatusString (L"Open Failed"); StatusBarSetStatusString (L"Open Failed");
FreePool (FileName); FreePool (FileName);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
Info = ShellGetFileInfo(FileHandle); Info = ShellGetFileInfo(FileHandle);
if (Info == NULL) { if (Info == NULL) {
StatusBarSetStatusString (L"Access Denied"); StatusBarSetStatusString (L"Access Denied");
FreePool (FileName); FreePool (FileName);
return (EFI_SUCCESS); return (EFI_SUCCESS);
} }
if (Info->Attribute & EFI_FILE_READ_ONLY) { if (Info->Attribute & EFI_FILE_READ_ONLY) {
StatusBarSetStatusString (L"Access Denied - Read Only"); StatusBarSetStatusString (L"Access Denied - Read Only");
FreePool (Info); FreePool (Info);
@ -1365,13 +1365,13 @@ MainCommandDisplayHelp (
EFI_KEY_DATA KeyData; EFI_KEY_DATA KeyData;
EFI_STATUS Status; EFI_STATUS Status;
UINTN EventIndex; UINTN EventIndex;
// //
// print helpInfo // print helpInfo
// //
for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) { for (CurrentLine = 0; 0 != MainMenuHelpInfo[CurrentLine]; CurrentLine++) {
InfoString = HiiGetString(gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL); InfoString = HiiGetString(gShellDebug1HiiHandle, MainMenuHelpInfo[CurrentLine], NULL);
ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString); ShellPrintEx (0, CurrentLine+1, L"%E%s%N", InfoString);
} }
// //
@ -1414,7 +1414,7 @@ MainCommandDisplayHelp (
FileBufferRestorePosition (); FileBufferRestorePosition ();
FileBufferNeedRefresh = TRUE; FileBufferNeedRefresh = TRUE;
FileBufferOnlyLineNeedRefresh = FALSE; FileBufferOnlyLineNeedRefresh = FALSE;
FileBufferRefresh (); FileBufferRefresh ();
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -1649,10 +1649,10 @@ MainEditorRefresh (
// //
// call the components refresh function // call the components refresh function
// //
if (EditorFirst if (EditorFirst
|| StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0 || StrCmp (FileBufferBackupVar.FileName, FileBuffer.FileName) != 0
|| FileBufferBackupVar.FileType != FileBuffer.FileType || FileBufferBackupVar.FileType != FileBuffer.FileType
|| FileBufferBackupVar.FileModified != FileBuffer.FileModified || FileBufferBackupVar.FileModified != FileBuffer.FileModified
|| FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly) { || FileBufferBackupVar.ReadOnly != FileBuffer.ReadOnly) {
MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0); MainTitleBarRefresh (MainEditor.FileBuffer->FileName, MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly, MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column, MainEditor.ScreenSize.Row, 0, 0);
@ -1660,8 +1660,8 @@ MainEditorRefresh (
} }
if (EditorFirst if (EditorFirst
|| FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row
|| FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column || FileBufferBackupVar.FilePosition.Column != FileBuffer.FilePosition.Column
|| FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert || FileBufferBackupVar.ModeInsert != FileBuffer.ModeInsert
|| StatusBarGetRefresh()) { || StatusBarGetRefresh()) {
@ -1906,9 +1906,9 @@ MainEditorKeyInput (
Status = MenuBarDispatchFunctionKey (&KeyData.Key); Status = MenuBarDispatchFunctionKey (&KeyData.Key);
} else { } else {
StatusBarSetStatusString (L"Unknown Command"); StatusBarSetStatusString (L"Unknown Command");
FileBufferMouseNeedRefresh = FALSE; FileBufferMouseNeedRefresh = FALSE;
} }
if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) { if (Status != EFI_SUCCESS && Status != EFI_OUT_OF_RESOURCES) {
// //
// not already has some error status // not already has some error status
@ -1975,6 +1975,6 @@ MainEditorBackup (
) )
{ {
FileBufferBackup (); FileBufferBackup ();
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -1,6 +1,6 @@
// /** // /**
// //
// Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
@ -20,7 +20,7 @@
#langdef en-US "english" #langdef en-US "english"
#string STR_EDIT_LIBEDITOR_TITLEBAR #language en-US "%EMainEditor init failed on TitleBar init\r\n%N" #string STR_EDIT_LIBEDITOR_TITLEBAR #language en-US "%EMainEditor init failed on TitleBar init\r\n%N"
#string STR_EDIT_LIBEDITOR_MAINMENU #language en-US "%EMainEditor init was not successful on MainMenu init\r\n%N" #string STR_EDIT_LIBEDITOR_MAINMENU #language en-US "%EMainEditor init was not successful on MainMenu init\r\n%N"
#string STR_EDIT_LIBEDITOR_STATUSBAR #language en-US "%EMainEditor init was not successful on StatusBar init\r\n%N" #string STR_EDIT_LIBEDITOR_STATUSBAR #language en-US "%EMainEditor init was not successful on StatusBar init\r\n%N"
#string STR_EDIT_LIBEDITOR_INPUTBAR #language en-US "%EMainEditor init was not successful on InputBar init\r\n%N" #string STR_EDIT_LIBEDITOR_INPUTBAR #language en-US "%EMainEditor init was not successful on InputBar init\r\n%N"
@ -28,33 +28,33 @@
#string STR_EDIT_LIBEDITOR_TITLEBAR_CLEANUP #language en-US "TitleBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_TITLEBAR_CLEANUP #language en-US "TitleBar cleanup was not successful\r\n"
#string STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP #language en-US "MenuBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP #language en-US "MenuBar cleanup was not successful\r\n"
#string STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP #language en-US "StatusBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP #language en-US "StatusBar cleanup was not successful\r\n"
#string STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP #language en-US "InputBar cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP #language en-US "InputBar cleanup was not successful\r\n"
#string STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP #language en-US "FileBuffer cleanup was not successful\r\n" #string STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP #language en-US "FileBuffer cleanup was not successful\r\n"
#string STR_EDIT_LIBEDITOR_MAINEDITOR_INIT #language en-US "%EMainEditor init was not succesful on TitleBar init\r\n%N" #string STR_EDIT_LIBEDITOR_MAINEDITOR_INIT #language en-US "%EMainEditor init was not succesful on TitleBar init\r\n%N"
#string STR_EDIT_LIBINPUTBAR_MAININPUTBAR #language en-US "%s" #string STR_EDIT_LIBINPUTBAR_MAININPUTBAR #language en-US "%s"
#string STR_EDIT_LIBMENUBAR_OPEN_FILE #language en-US "Open File" #string STR_EDIT_LIBMENUBAR_OPEN_FILE #language en-US "Open File"
#string STR_EDIT_LIBMENUBAR_SAVE_FILE #language en-US "Save File" #string STR_EDIT_LIBMENUBAR_SAVE_FILE #language en-US "Save File"
#string STR_EDIT_LIBMENUBAR_EXIT #language en-US "Exit" #string STR_EDIT_LIBMENUBAR_EXIT #language en-US "Exit"
#string STR_EDIT_LIBMENUBAR_CUT_LINE #language en-US "Cut Line" #string STR_EDIT_LIBMENUBAR_CUT_LINE #language en-US "Cut Line"
#string STR_EDIT_LIBMENUBAR_PASTE_LINE #language en-US "Paste Line" #string STR_EDIT_LIBMENUBAR_PASTE_LINE #language en-US "Paste Line"
#string STR_EDIT_LIBMENUBAR_GO_TO_LINE #language en-US "Go To Line" #string STR_EDIT_LIBMENUBAR_GO_TO_LINE #language en-US "Go To Line"
#string STR_EDIT_LIBMENUBAR_SEARCH #language en-US "Search" #string STR_EDIT_LIBMENUBAR_SEARCH #language en-US "Search"
#string STR_EDIT_LIBMENUBAR_SEARCH_REPLACE #language en-US "Search/Replace" #string STR_EDIT_LIBMENUBAR_SEARCH_REPLACE #language en-US "Search/Replace"
#string STR_EDIT_LIBMENUBAR_FILE_TYPE #language en-US "File Type" #string STR_EDIT_LIBMENUBAR_FILE_TYPE #language en-US "File Type"
#string STR_EDIT_LIBMENUBAR_F1 #language en-US "F1" #string STR_EDIT_LIBMENUBAR_F1 #language en-US "F1"
#string STR_EDIT_LIBMENUBAR_F2 #language en-US "F2" #string STR_EDIT_LIBMENUBAR_F2 #language en-US "F2"
#string STR_EDIT_LIBMENUBAR_F3 #language en-US "F3" #string STR_EDIT_LIBMENUBAR_F3 #language en-US "F3"
#string STR_EDIT_LIBMENUBAR_F4 #language en-US "F4" #string STR_EDIT_LIBMENUBAR_F4 #language en-US "F4"
#string STR_EDIT_LIBMENUBAR_F5 #language en-US "F5" #string STR_EDIT_LIBMENUBAR_F5 #language en-US "F5"
#string STR_EDIT_LIBMENUBAR_F6 #language en-US "F6" #string STR_EDIT_LIBMENUBAR_F6 #language en-US "F6"
#string STR_EDIT_LIBMENUBAR_F7 #language en-US "F7" #string STR_EDIT_LIBMENUBAR_F7 #language en-US "F7"
#string STR_EDIT_LIBMENUBAR_F8 #language en-US "F8" #string STR_EDIT_LIBMENUBAR_F8 #language en-US "F8"
#string STR_EDIT_LIBMENUBAR_F9 #language en-US "F9" #string STR_EDIT_LIBMENUBAR_F9 #language en-US "F9"
#string STR_EDIT_LIBMENUBAR_F10 #language en-US "F10" #string STR_EDIT_LIBMENUBAR_F10 #language en-US "F10"
#string STR_EDIT_LIBMENUBAR_F11 #language en-US "F11" #string STR_EDIT_LIBMENUBAR_F11 #language en-US "F11"
#string STR_EDIT_LIBMENUBAR_F12 #language en-US "F12" #string STR_EDIT_LIBMENUBAR_F12 #language en-US "F12"
#string STR_EDIT_LIBMENUBAR_CTRL_E #language en-US "Ctrl+E" #string STR_EDIT_LIBMENUBAR_CTRL_E #language en-US "Ctrl+E"
#string STR_EDIT_LIBMENUBAR_CTRL_W #language en-US "Ctrl+W" #string STR_EDIT_LIBMENUBAR_CTRL_W #language en-US "Ctrl+W"
#string STR_EDIT_HELP_TITLE #language en-US "Help \n" #string STR_EDIT_HELP_TITLE #language en-US "Help \n"
#string STR_EDIT_HELP_BLANK #language en-US " \n" #string STR_EDIT_HELP_BLANK #language en-US " \n"
#string STR_EDIT_HELP_LIST_TITLE #language en-US "Control Key Function Key Command \n" #string STR_EDIT_HELP_LIST_TITLE #language en-US "Control Key Function Key Command \n"
@ -69,7 +69,7 @@
#string STR_EDIT_HELP_OPEN_FILE #language en-US "Ctrl-O F8 Open File \n" #string STR_EDIT_HELP_OPEN_FILE #language en-US "Ctrl-O F8 Open File \n"
#string STR_EDIT_HELP_FILE_TYPE #language en-US "Ctrl-T F9 File Type \n" #string STR_EDIT_HELP_FILE_TYPE #language en-US "Ctrl-T F9 File Type \n"
#string STR_EDIT_HELP_EXIT_HELP #language en-US "Use Ctrl-W to exit this help \n" #string STR_EDIT_HELP_EXIT_HELP #language en-US "Use Ctrl-W to exit this help \n"
#string STR_EDIT_MAIN_INVALID_FILE_NAME #language en-US "%Hedit%N: Invalid File Name\r\n" #string STR_EDIT_MAIN_INVALID_FILE_NAME #language en-US "%Hedit%N: Invalid File Name\r\n"
#string STR_EDIT_MAIN_INIT_FAILED #language en-US "%Hedit%N: Initialization was not successful\r\n" #string STR_EDIT_MAIN_INIT_FAILED #language en-US "%Hedit%N: Initialization was not successful\r\n"
#string STR_EDIT_MAIN_BUFFER #language en-US "%Hedit%N: %s\r\n" #string STR_EDIT_MAIN_BUFFER #language en-US "%Hedit%N: %s\r\n"
#string STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR #language en-US "%Hedit%N: Unknown Editor Error\r\n" #string STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR #language en-US "%Hedit%N: Unknown Editor Error\r\n"

View File

@ -251,7 +251,7 @@ InputBarRefresh (
} }
mReturnString[Size] = CHAR_NULL; mReturnString[Size] = CHAR_NULL;
// //
// restore screen attributes // restore screen attributes

View File

@ -47,7 +47,7 @@ MenuBarInit (
CONST EDITOR_MENU_ITEM *ItemsWalker; CONST EDITOR_MENU_ITEM *ItemsWalker;
for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++); for (NumItems = 0, ItemsWalker = Items ; ItemsWalker != NULL && ItemsWalker->Function != NULL ; ItemsWalker++,NumItems++);
MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM)); MenuItems = AllocateZeroPool((NumItems+1) * sizeof(EDITOR_MENU_ITEM));
if (MenuItems == NULL) { if (MenuItems == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
@ -69,7 +69,7 @@ ControlHotKeyInit (
) )
{ {
ControlBasedMenuFunctions = Items; ControlBasedMenuFunctions = Items;
return EFI_SUCCESS; return EFI_SUCCESS;
} }
/** /**
Refresh function for the menu bar. Refresh function for the menu bar.
@ -138,7 +138,7 @@ MenuBarRefresh (
@param[in] Key The pressed key. @param[in] Key The pressed key.
@retval EFI_NOT_FOUND The key was not a valid function key @retval EFI_NOT_FOUND The key was not a valid function key
(an error was sent to the status bar). (an error was sent to the status bar).
@return The return value from the called dispatch function. @return The return value from the called dispatch function.
**/ **/
@ -167,7 +167,7 @@ MenuBarDispatchFunctionKey (
@param[in] KeyData The pressed key. @param[in] KeyData The pressed key.
@retval EFI_NOT_FOUND The key was not a valid control-based key @retval EFI_NOT_FOUND The key was not a valid control-based key
(an error was sent to the status bar). (an error was sent to the status bar).
@return EFI_SUCCESS. @return EFI_SUCCESS.
**/ **/

View File

@ -93,7 +93,7 @@ MenuBarRefresh (
@param[in] Key The pressed key. @param[in] Key The pressed key.
@retval EFI_NOT_FOUND The key was not a valid function key @retval EFI_NOT_FOUND The key was not a valid function key
(an error was sent to the status bar). (an error was sent to the status bar).
@return The return value from the called dispatch function. @return The return value from the called dispatch function.
**/ **/
@ -107,7 +107,7 @@ MenuBarDispatchFunctionKey (
@param[in] KeyData The pressed key. @param[in] KeyData The pressed key.
@retval EFI_NOT_FOUND The key was not a valid control-based key @retval EFI_NOT_FOUND The key was not a valid control-based key
(an error was sent to the status bar). (an error was sent to the status bar).
@return EFI_SUCCESS. @return EFI_SUCCESS.
**/ **/

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implements statusbar interface functions. Implements statusbar interface functions.
Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -71,7 +71,7 @@ typedef union {
/** /**
Cause the status bar to refresh it's printing on the screen. Cause the status bar to refresh it's printing on the screen.
@param[in] EditorFirst TRUE to indicate the first launch of the editor. @param[in] EditorFirst TRUE to indicate the first launch of the editor.
FALSE otherwise. FALSE otherwise.
@param[in] LastRow LastPrintable row. @param[in] LastRow LastPrintable row.
@param[in] LastCol Last printable column. @param[in] LastCol Last printable column.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Declares statusbar interface functions. Declares statusbar interface functions.
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -38,7 +38,7 @@ StatusBarCleanup (
/** /**
Cause the status bar to refresh it's printing on the screen. Cause the status bar to refresh it's printing on the screen.
@param[in] EditorFirst TRUE to indicate the first launch of the editor. @param[in] EditorFirst TRUE to indicate the first launch of the editor.
FALSE otherwise. FALSE otherwise.
@param[in] LastRow LastPrintable row. @param[in] LastRow LastPrintable row.
@param[in] LastCol Last printable column. @param[in] LastCol Last printable column.

View File

@ -2,7 +2,7 @@
Main file for EfiCompress shell Debug1 function. Main file for EfiCompress shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -70,7 +70,7 @@ ShellCommandRunEfiCompress (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"eficompress", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -78,10 +78,10 @@ ShellCommandRunEfiCompress (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 3) { if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"eficompress");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 3) { } else if (ShellCommandLineGetCount(Package) < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"eficompress");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
TempParam = ShellCommandLineGetRawValue(Package, 1); TempParam = ShellCommandLineGetRawValue(Package, 1);
@ -89,26 +89,26 @@ ShellCommandRunEfiCompress (
InFileName = ShellFindFilePath(TempParam); InFileName = ShellFindFilePath(TempParam);
OutFileName = ShellCommandLineGetRawValue(Package, 2); OutFileName = ShellCommandLineGetRawValue(Package, 2);
if (InFileName == NULL) { if (InFileName == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"eficompress", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
if (ShellIsDirectory(InFileName) == EFI_SUCCESS){ if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", InFileName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){ if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"eficompress", OutFileName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName(InFileName, &InShellFileHandle, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 1)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 1));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0); Status = ShellOpenFileByName(OutFileName, &OutShellFileHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 2)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"eficompress", ShellCommandLineGetRawValue(Package, 2));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }
@ -140,7 +140,7 @@ ShellCommandRunEfiCompress (
OutSize2 = (UINTN)OutSize; OutSize2 = (UINTN)OutSize;
Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &OutSize2, OutBuffer); Status = gEfiShellProtocol->WriteFile(OutShellFileHandle, &OutSize2, OutBuffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_WRITE_FAIL), gShellDebug1HiiHandle, L"eficompress", OutFileName);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
} }

View File

@ -2,7 +2,7 @@
Main file for EfiDecompress shell Debug1 function. Main file for EfiDecompress shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -77,7 +77,7 @@ ShellCommandRunEfiDecompress (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"efidecompress", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -85,10 +85,10 @@ ShellCommandRunEfiDecompress (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 3) { if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"efidecompress");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 3) { } else if (ShellCommandLineGetCount(Package) < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"efidecompress");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
TempParam = ShellCommandLineGetRawValue(Package, 1); TempParam = ShellCommandLineGetRawValue(Package, 1);
@ -96,21 +96,21 @@ ShellCommandRunEfiDecompress (
InFileName = ShellFindFilePath(TempParam); InFileName = ShellFindFilePath(TempParam);
OutFileName = ShellCommandLineGetRawValue(Package, 2); OutFileName = ShellCommandLineGetRawValue(Package, 2);
if (InFileName == NULL) { if (InFileName == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, L"efidecompress", TempParam);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
if (ShellIsDirectory(InFileName) == EFI_SUCCESS){ if (ShellIsDirectory(InFileName) == EFI_SUCCESS){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", InFileName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){ if (ShellIsDirectory(OutFileName) == EFI_SUCCESS){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"efidecompress", OutFileName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0); Status = ShellOpenFileByName(InFileName, &InFileHandle, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue(Package, 1)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"efidecompress", ShellCommandLineGetRawValue(Package, 1));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines HBufferImage - the view of the file that is visible at any point, Defines HBufferImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -138,7 +138,7 @@ HBufferImageInit (
} }
/** /**
Backup function for HBufferImage. Only a few fields need to be backup. Backup function for HBufferImage. Only a few fields need to be backup.
This is for making the file buffer refresh as few as possible. This is for making the file buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -190,7 +190,7 @@ HBufferImageBackup (
Lines Lines
CurrentLine CurrentLine
NumLines NumLines
ListHead ListHead
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
**/ **/
@ -946,7 +946,7 @@ HBufferImageRead (
case FileTypeMemBuffer: case FileTypeMemBuffer:
Status = HMemImageRead (MemOffset, MemSize, Recover); Status = HMemImageRead (MemOffset, MemSize, Recover);
break; break;
default: default:
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
break; break;
@ -1013,7 +1013,7 @@ HBufferImageSave (
case FileTypeMemBuffer: case FileTypeMemBuffer:
Status = HMemImageSave (MemOffset, MemSize); Status = HMemImageSave (MemOffset, MemSize);
break; break;
default: default:
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
break; break;
@ -1030,7 +1030,7 @@ HBufferImageSave (
Create a new line and append it to the line list. Create a new line and append it to the line list.
Fields affected: Fields affected:
NumLines NumLines
Lines Lines
@retval NULL create line failed. @retval NULL create line failed.
@return the line created. @return the line created.
@ -1368,7 +1368,7 @@ HBufferImageDoCharInput (
Check user specified FileRow is above current screen. Check user specified FileRow is above current screen.
@param[in] FileRow Row of file position ( start from 1 ). @param[in] FileRow Row of file position ( start from 1 ).
@retval TRUE It is above the current screen. @retval TRUE It is above the current screen.
@retval FALSE It is not above the current screen. @retval FALSE It is not above the current screen.
@ -1880,12 +1880,12 @@ HBufferImageGetTotalSize (
/** /**
Delete character from buffer. Delete character from buffer.
@param[in] Pos Position, Pos starting from 0. @param[in] Pos Position, Pos starting from 0.
@param[in] Count The Count of characters to delete. @param[in] Count The Count of characters to delete.
@param[out] DeleteBuffer The DeleteBuffer. @param[out] DeleteBuffer The DeleteBuffer.
@retval EFI_SUCCESS Success @retval EFI_SUCCESS Success
**/ **/
EFI_STATUS EFI_STATUS
HBufferImageDeleteCharacterFromBuffer ( HBufferImageDeleteCharacterFromBuffer (
@ -2014,7 +2014,7 @@ HBufferImageDeleteCharacterFromBuffer (
@param[in] Count Count of characters to add. @param[in] Count Count of characters to add.
@param[in] AddBuffer Add buffer. @param[in] AddBuffer Add buffer.
@retval EFI_SUCCESS Success. @retval EFI_SUCCESS Success.
**/ **/
EFI_STATUS EFI_STATUS
HBufferImageAddCharacterToBuffer ( HBufferImageAddCharacterToBuffer (
@ -2166,7 +2166,7 @@ HBufferImageDoDelete (
/** /**
Change the raw buffer to a list of lines for the UI. Change the raw buffer to a list of lines for the UI.
@param[in] Buffer The pointer to the buffer to fill. @param[in] Buffer The pointer to the buffer to fill.
@param[in] Bytes The size of the buffer in bytes. @param[in] Bytes The size of the buffer in bytes.
@ -2231,7 +2231,7 @@ HBufferImageBufferToList (
/** /**
Change the list of lines from the UI to a raw buffer. Change the list of lines from the UI to a raw buffer.
@param[in] Buffer The pointer to the buffer to fill. @param[in] Buffer The pointer to the buffer to fill.
@param[in] Bytes The size of the buffer in bytes. @param[in] Bytes The size of the buffer in bytes.

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines BufferImage - the view of the file that is visible at any point, Defines BufferImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -72,7 +72,7 @@ HBufferImageHandleInput (
); );
/** /**
Backup function for HBufferImage. Only a few fields need to be backup. Backup function for HBufferImage. Only a few fields need to be backup.
This is for making the file buffer refresh as few as possible. This is for making the file buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -151,7 +151,7 @@ HBufferImageMovePosition (
Create a new line and append it to the line list. Create a new line and append it to the line list.
Fields affected: Fields affected:
NumLines NumLines
Lines Lines
@retval NULL create line failed. @retval NULL create line failed.
@return the line created. @return the line created.
@ -174,12 +174,12 @@ HBufferImageFree (
/** /**
Delete character from buffer. Delete character from buffer.
@param[in] Pos Position, Pos starting from 0. @param[in] Pos Position, Pos starting from 0.
@param[in] Count The Count of characters to delete. @param[in] Count The Count of characters to delete.
@param[out] DeleteBuffer The DeleteBuffer. @param[out] DeleteBuffer The DeleteBuffer.
@retval EFI_SUCCESS Success @retval EFI_SUCCESS Success
**/ **/
EFI_STATUS EFI_STATUS
HBufferImageDeleteCharacterFromBuffer ( HBufferImageDeleteCharacterFromBuffer (
@ -195,7 +195,7 @@ HBufferImageDeleteCharacterFromBuffer (
@param[in] Count Count of characters to add. @param[in] Count Count of characters to add.
@param[in] AddBuffer Add buffer. @param[in] AddBuffer Add buffer.
@retval EFI_SUCCESS Success. @retval EFI_SUCCESS Success.
**/ **/
EFI_STATUS EFI_STATUS
HBufferImageAddCharacterToBuffer ( HBufferImageAddCharacterToBuffer (
@ -206,7 +206,7 @@ HBufferImageAddCharacterToBuffer (
/** /**
Change the raw buffer to a list of lines for the UI. Change the raw buffer to a list of lines for the UI.
@param[in] Buffer The pointer to the buffer to fill. @param[in] Buffer The pointer to the buffer to fill.
@param[in] Bytes The size of the buffer in bytes. @param[in] Bytes The size of the buffer in bytes.
@ -221,7 +221,7 @@ HBufferImageBufferToList (
/** /**
Change the list of lines from the UI to a raw buffer. Change the list of lines from the UI to a raw buffer.
@param[in] Buffer The pointer to the buffer to fill. @param[in] Buffer The pointer to the buffer to fill.
@param[in] Bytes The size of the buffer in bytes. @param[in] Bytes The size of the buffer in bytes.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Functions to deal with Clip Board Functions to deal with Clip Board
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines DiskImage - the view of the file that is visible at any point, Defines DiskImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at

View File

@ -39,7 +39,7 @@ HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
/** /**
Initialization function for HDiskImage. Initialization function for HDiskImage.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
**/ **/
@ -59,7 +59,7 @@ HDiskImageInit (
} }
/** /**
Backup function for HDiskImage. Only a few fields need to be backup. Backup function for HDiskImage. Only a few fields need to be backup.
This is for making the Disk buffer refresh as few as possible. This is for making the Disk buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -154,7 +154,7 @@ HDiskImageSetDiskNameOffsetSize (
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
@retval EFI_INVALID_PARAMETER A parameter was invalid. @retval EFI_INVALID_PARAMETER A parameter was invalid.
**/ **/
EFI_STATUS EFI_STATUS
HDiskImageRead ( HDiskImageRead (
@ -326,7 +326,7 @@ HDiskImageRead (
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
@retval EFI_INVALID_PARAMETER A parameter was invalid. @retval EFI_INVALID_PARAMETER A parameter was invalid.
**/ **/
EFI_STATUS EFI_STATUS
HDiskImageSave ( HDiskImageSave (

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines DiskImage - the view of the file that is visible at any point, Defines DiskImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -20,7 +20,7 @@
/** /**
Initialization function for HDiskImage. Initialization function for HDiskImage.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
**/ **/
@ -40,7 +40,7 @@ HDiskImageCleanup (
); );
/** /**
Backup function for HDiskImage. Only a few fields need to be backup. Backup function for HDiskImage. Only a few fields need to be backup.
This is for making the Disk buffer refresh as few as possible. This is for making the Disk buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -62,7 +62,7 @@ HDiskImageBackup (
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
@retval EFI_INVALID_PARAMETER A parameter was invalid. @retval EFI_INVALID_PARAMETER A parameter was invalid.
**/ **/
EFI_STATUS EFI_STATUS
HDiskImageRead ( HDiskImageRead (
@ -83,7 +83,7 @@ HDiskImageRead (
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@retval EFI_LOAD_ERROR A load error occured. @retval EFI_LOAD_ERROR A load error occured.
@retval EFI_INVALID_PARAMETER A parameter was invalid. @retval EFI_INVALID_PARAMETER A parameter was invalid.
**/ **/
EFI_STATUS EFI_STATUS
HDiskImageSave ( HDiskImageSave (

View File

@ -37,7 +37,7 @@ HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = {
/** /**
Initialization function for HFileImage Initialization function for HFileImage
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
**/ **/
EFI_STATUS EFI_STATUS
@ -60,7 +60,7 @@ HFileImageInit (
} }
/** /**
Backup function for HFileImage. Only a few fields need to be backup. Backup function for HFileImage. Only a few fields need to be backup.
This is for making the file buffer refresh as few as possible. This is for making the file buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines FileImage - the view of the file that is visible at any point, Defines FileImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -20,7 +20,7 @@
/** /**
Initialization function for HFileImage Initialization function for HFileImage
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
**/ **/
EFI_STATUS EFI_STATUS
@ -39,7 +39,7 @@ HFileImageCleanup (
); );
/** /**
Backup function for HFileImage. Only a few fields need to be backup. Backup function for HFileImage. Only a few fields need to be backup.
This is for making the file buffer refresh as few as possible. This is for making the file buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.

View File

@ -1,8 +1,8 @@
/** @file /** @file
Main entry point of editor Main entry point of editor
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -74,7 +74,7 @@ ShellCommandRunHexEdit (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"hexedit", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -86,10 +86,10 @@ ShellCommandRunHexEdit (
// //
if (ShellCommandLineGetFlag(Package, L"-d")){ if (ShellCommandLineGetFlag(Package, L"-d")){
if (ShellCommandLineGetCount(Package) < 4) { if (ShellCommandLineGetCount(Package) < 4) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) > 4) { } else if (ShellCommandLineGetCount(Package) > 4) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
WhatToDo = FileTypeDiskBuffer; WhatToDo = FileTypeDiskBuffer;
@ -98,7 +98,7 @@ ShellCommandRunHexEdit (
Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 3)); Size = ShellStrToUintn(ShellCommandLineGetRawValue(Package, 3));
} }
if (Offset == (UINTN)-1 || Size == (UINTN)-1) { if (Offset == (UINTN)-1 || Size == (UINTN)-1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"hexedit", L"-d");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
@ -108,15 +108,15 @@ ShellCommandRunHexEdit (
// //
if (ShellCommandLineGetFlag(Package, L"-f") && (WhatToDo == FileTypeNone)){ if (ShellCommandLineGetFlag(Package, L"-f") && (WhatToDo == FileTypeNone)){
if (ShellCommandLineGetCount(Package) < 2) { if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) > 2) { } else if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Name = ShellCommandLineGetRawValue(Package, 1); Name = ShellCommandLineGetRawValue(Package, 1);
if (Name == NULL || !IsValidFileName(Name)) { if (Name == NULL || !IsValidFileName(Name)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
WhatToDo = FileTypeFileBuffer; WhatToDo = FileTypeFileBuffer;
@ -129,10 +129,10 @@ ShellCommandRunHexEdit (
// //
if (ShellCommandLineGetFlag(Package, L"-m") && (WhatToDo == FileTypeNone)){ if (ShellCommandLineGetFlag(Package, L"-m") && (WhatToDo == FileTypeNone)){
if (ShellCommandLineGetCount(Package) < 3) { if (ShellCommandLineGetCount(Package) < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) > 3) { } else if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
WhatToDo = FileTypeMemBuffer; WhatToDo = FileTypeMemBuffer;
@ -143,10 +143,10 @@ ShellCommandRunHexEdit (
Name = ShellCommandLineGetRawValue(Package, 1); Name = ShellCommandLineGetRawValue(Package, 1);
if (WhatToDo == FileTypeNone && Name != NULL) { if (WhatToDo == FileTypeNone && Name != NULL) {
if (ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (!IsValidFileName(Name)) { } else if (!IsValidFileName(Name)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"hexedit", Name);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
WhatToDo = FileTypeFileBuffer; WhatToDo = FileTypeFileBuffer;
@ -154,7 +154,7 @@ ShellCommandRunHexEdit (
} else if (WhatToDo == FileTypeNone) { } else if (WhatToDo == FileTypeNone) {
if (gEfiShellProtocol->GetCurDir(NULL) == NULL) { if (gEfiShellProtocol->GetCurDir(NULL) == NULL) {
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
} else { } else {
NewName = EditGetDefaultFileName(L"bin"); NewName = EditGetDefaultFileName(L"bin");
Name = NewName; Name = NewName;
@ -163,10 +163,10 @@ ShellCommandRunHexEdit (
} }
if (ShellStatus == SHELL_SUCCESS && WhatToDo == FileTypeNone) { if (ShellStatus == SHELL_SUCCESS && WhatToDo == FileTypeNone) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (WhatToDo == FileTypeFileBuffer && ShellGetCurrentDir(NULL) == NULL) { } else if (WhatToDo == FileTypeFileBuffer && ShellGetCurrentDir(NULL) == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellDebug1HiiHandle, L"hexedit");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
@ -252,7 +252,7 @@ ShellCommandRunHexEdit (
// print editor exit code on screen // print editor exit code on screen
// //
if (Status == EFI_OUT_OF_RESOURCES) { if (Status == EFI_OUT_OF_RESOURCES) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"hexedit");
} else if (EFI_ERROR(Status)){ } else if (EFI_ERROR(Status)){
if (Buffer != NULL) { if (Buffer != NULL) {
if (StrCmp (Buffer, L"") != 0) { if (StrCmp (Buffer, L"") != 0) {

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main include file for hex editor Main include file for hex editor
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at

View File

@ -1,6 +1,6 @@
/** @file /** @file
data types that are used by editor data types that are used by editor
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License

View File

@ -1,6 +1,6 @@
// /** // /**
// //
// Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
// (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> // (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
// This program and the accompanying materials // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // are licensed and made available under the terms and conditions of the BSD License
@ -27,7 +27,7 @@
#string STR_HEXEDIT_DISKNAME #language en-US " %H-d DiskName FirstBlockNo. BlockNumber%N Open Disk Block For Editing\n" #string STR_HEXEDIT_DISKNAME #language en-US " %H-d DiskName FirstBlockNo. BlockNumber%N Open Disk Block For Editing\n"
#string STR_HEXEDIT_OFFSET_SIZE #language en-US " %H-m Offset Size%N Open Memory Region For Editing\n" #string STR_HEXEDIT_OFFSET_SIZE #language en-US " %H-m Offset Size%N Open Memory Region For Editing\n"
#string STR_HEXEDIT_FILE_NAME #language en-US "%Hhexedit%N: Invalid File Name\n" #string STR_HEXEDIT_FILE_NAME #language en-US "%Hhexedit%N: Invalid File Name\n"
#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE #language en-US "%EMainEditor init failed on TitleBar init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_TITLE #language en-US "%EMainEditor init failed on TitleBar init\n%N"
#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU #language en-US "%EMainEditor init failed on MainMenu init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_MAINMENU #language en-US "%EMainEditor init failed on MainMenu init\n%N"
#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS #language en-US "%EMainEditor init failed on StatusBar init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_STATUS #language en-US "%EMainEditor init failed on StatusBar init\n%N"
#string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_INPUTBAR #language en-US "%EMainEditor init failed on InputBar init\n%N" #string STR_HEXEDIT_LIBEDITOR_MAINEDITOR_INPUTBAR #language en-US "%EMainEditor init failed on InputBar init\n%N"

View File

@ -1,9 +1,9 @@
/** @file /** @file
Defines the Main Editor data type - Defines the Main Editor data type -
- Global variables - Global variables
- Instances of the other objects of the editor - Instances of the other objects of the editor
- Main Interfaces - Main Interfaces
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -111,14 +111,14 @@ HMainCommandDisplayHelp (
EFI_KEY_DATA KeyData; EFI_KEY_DATA KeyData;
EFI_STATUS Status; EFI_STATUS Status;
UINTN EventIndex; UINTN EventIndex;
// //
// print helpInfo // print helpInfo
// //
for (CurrentLine = 0; 0 != HexMainMenuHelpInfo[CurrentLine]; CurrentLine++) { for (CurrentLine = 0; 0 != HexMainMenuHelpInfo[CurrentLine]; CurrentLine++) {
InfoString = HiiGetString(gShellDebug1HiiHandle, HexMainMenuHelpInfo[CurrentLine] InfoString = HiiGetString(gShellDebug1HiiHandle, HexMainMenuHelpInfo[CurrentLine]
, NULL); , NULL);
ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString); ShellPrintEx (0,CurrentLine+1,L"%E%s%N",InfoString);
} }
// //
@ -245,7 +245,7 @@ HMainCommandGoToOffset (
/** /**
Save current opened buffer. Save current opened buffer.
If is file buffer, you can save to current file name or If is file buffer, you can save to current file name or
save to another file name. save to another file name.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
@ -375,7 +375,7 @@ HMainCommandSaveBuffer (
// 7. Update File Name field in Title Bar to B // 7. Update File Name field in Title Bar to B
// and remove the Modified flag in Title Bar. // and remove the Modified flag in Title Bar.
// //
Str = CatSPrint(NULL, Str = CatSPrint(NULL,
L"File to Save: [%s]", L"File to Save: [%s]",
HMainEditor.BufferImage->FileImage->FileName HMainEditor.BufferImage->FileImage->FileName
); );
@ -422,7 +422,7 @@ HMainCommandSaveBuffer (
// if just enter pressed, so think save to current file name // if just enter pressed, so think save to current file name
// //
if (StrLen (InputBarGetString()) == 0) { if (StrLen (InputBarGetString()) == 0) {
FileName = CatSPrint(NULL, FileName = CatSPrint(NULL,
L"%s", L"%s",
HMainEditor.BufferImage->FileImage->FileName HMainEditor.BufferImage->FileImage->FileName
); );
@ -476,7 +476,7 @@ HMainCommandSaveBuffer (
StatusBarSetStatusString (L"Access Denied"); StatusBarSetStatusString (L"Access Denied");
SHELL_FREE_NON_NULL (FileName); SHELL_FREE_NON_NULL (FileName);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
SHELL_FREE_NON_NULL(Info); SHELL_FREE_NON_NULL(Info);
// //
@ -520,7 +520,7 @@ HMainCommandSaveBuffer (
} // while } // while
} // if opened existing file } // if opened existing file
} // if OldFile } // if OldFile
// //
// save file back to disk // save file back to disk
// //
@ -1803,9 +1803,9 @@ HMainEditorCleanup (
MenuBarCleanup (); MenuBarCleanup ();
StatusBarCleanup (); StatusBarCleanup ();
InputBarCleanup (); InputBarCleanup ();
Status = HBufferImageCleanup (); Status = HBufferImageCleanup ();
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HEXEDIT_LIBEDITOR_BUFFERIMAGE_CLEAN), gShellDebug1HiiHandle);
@ -1850,28 +1850,28 @@ HMainEditorRefresh (
if (HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer) { if (HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer) {
if (HMainEditor.BufferImage->DiskImage != NULL && if (HMainEditor.BufferImage->DiskImage != NULL &&
HBufferImageBackupVar.DiskImage != NULL && HBufferImageBackupVar.DiskImage != NULL &&
(HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset || (HMainEditor.BufferImage->DiskImage->Offset != HBufferImageBackupVar.DiskImage->Offset ||
HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size) ){ HMainEditor.BufferImage->DiskImage->Size != HBufferImageBackupVar.DiskImage->Size) ){
NameChange = TRUE; NameChange = TRUE;
} }
} else if (HMainEditor.BufferImage->BufferType == FileTypeMemBuffer) { } else if (HMainEditor.BufferImage->BufferType == FileTypeMemBuffer) {
if (HMainEditor.BufferImage->MemImage != NULL && if (HMainEditor.BufferImage->MemImage != NULL &&
HBufferImageBackupVar.MemImage != NULL && HBufferImageBackupVar.MemImage != NULL &&
(HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset || (HMainEditor.BufferImage->MemImage->Offset != HBufferImageBackupVar.MemImage->Offset ||
HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size) ){ HMainEditor.BufferImage->MemImage->Size != HBufferImageBackupVar.MemImage->Size) ){
NameChange = TRUE; NameChange = TRUE;
} }
} else if (HMainEditor.BufferImage->BufferType == FileTypeFileBuffer) { } else if (HMainEditor.BufferImage->BufferType == FileTypeFileBuffer) {
if ( HMainEditor.BufferImage->FileImage != NULL && if ( HMainEditor.BufferImage->FileImage != NULL &&
HMainEditor.BufferImage->FileImage->FileName != NULL && HMainEditor.BufferImage->FileImage->FileName != NULL &&
HBufferImageBackupVar.FileImage != NULL && HBufferImageBackupVar.FileImage != NULL &&
HBufferImageBackupVar.FileImage->FileName != NULL && HBufferImageBackupVar.FileImage->FileName != NULL &&
StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0 ) { StrCmp (HMainEditor.BufferImage->FileImage->FileName, HBufferImageBackupVar.FileImage->FileName) != 0 ) {
NameChange = TRUE; NameChange = TRUE;
} }
} }
if ( HMainEditor.BufferImage->FileImage != NULL && if ( HMainEditor.BufferImage->FileImage != NULL &&
HBufferImageBackupVar.FileImage != NULL && HBufferImageBackupVar.FileImage != NULL &&
HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly ) { HMainEditor.BufferImage->FileImage->ReadOnly != HBufferImageBackupVar.FileImage->ReadOnly ) {
ReadChange = TRUE; ReadChange = TRUE;
} }
@ -1885,10 +1885,10 @@ HMainEditorRefresh (
// //
// call the components refresh function // call the components refresh function
// //
if (HEditorFirst if (HEditorFirst
|| NameChange || NameChange
|| HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType || HMainEditor.BufferImage->BufferType != HBufferImageBackupVar.BufferType
|| HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified || HBufferImageBackupVar.Modified != HMainEditor.BufferImage->Modified
|| ReadChange ) { || ReadChange ) {
MainTitleBarRefresh ( MainTitleBarRefresh (
@ -1904,8 +1904,8 @@ HMainEditorRefresh (
HBufferImageRefresh (); HBufferImageRefresh ();
} }
if (HEditorFirst if (HEditorFirst
|| HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row || HBufferImageBackupVar.DisplayPosition.Row != HMainEditor.BufferImage->DisplayPosition.Row
|| HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column || HBufferImageBackupVar.DisplayPosition.Column != HMainEditor.BufferImage->DisplayPosition.Column
|| StatusBarGetRefresh()) { || StatusBarGetRefresh()) {
StatusBarRefresh ( StatusBarRefresh (
@ -2334,7 +2334,7 @@ HMainEditorKeyInput (
case FileTypeMemBuffer: case FileTypeMemBuffer:
OldSize = HBufferImage.MemImage->Size; OldSize = HBufferImage.MemImage->Size;
break; break;
default: default:
OldSize = 0; OldSize = 0;
break; break;

View File

@ -1,10 +1,10 @@
/** @file /** @file
Defines the Main Editor data type - Defines the Main Editor data type -
- Global variables - Global variables
- Instances of the other objects of the editor - Instances of the other objects of the editor
- Main Interfaces - Main Interfaces
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at

View File

@ -1,7 +1,7 @@
/** @file /** @file
Functions to deal with Mem buffer Functions to deal with Mem buffer
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -67,7 +67,7 @@ HMemImageInit (
} }
/** /**
Backup function for HDiskImage. Only a few fields need to be backup. Backup function for HDiskImage. Only a few fields need to be backup.
This is for making the Disk buffer refresh as few as possible. This is for making the Disk buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.

View File

@ -1,8 +1,8 @@
/** @file /** @file
Defines MemImage - the view of the file that is visible at any point, Defines MemImage - the view of the file that is visible at any point,
as well as the event handlers for editing the file as well as the event handlers for editing the file
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -30,7 +30,7 @@ HMemImageInit (
); );
/** /**
Backup function for HDiskImage. Only a few fields need to be backup. Backup function for HDiskImage. Only a few fields need to be backup.
This is for making the Disk buffer refresh as few as possible. This is for making the Disk buffer refresh as few as possible.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Implementation of various string and line routines Implementation of various string and line routines
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -18,7 +18,7 @@ extern BOOLEAN HEditorMouseAction;
/** /**
Free a line and it's internal buffer. Free a line and it's internal buffer.
@param[in] Src The line to be freed. @param[in] Src The line to be freed.
**/ **/
VOID VOID
@ -109,7 +109,7 @@ HLineRetreat (
@param[in] Count The line number to advance/retreat. @param[in] Count The line number to advance/retreat.
>0 : advance >0 : advance
<0: retreat <0: retreat
@retval NULL An error occured. @retval NULL An error occured.
@return A pointer to the line after move. @return A pointer to the line after move.
@ -182,7 +182,7 @@ HMoveCurrentLine (
Lines Lines
CurrentLine CurrentLine
NumLines NumLines
ListHead ListHead
@param[in] ListHead The list head. @param[in] ListHead The list head.
@param[in] Lines The lines. @param[in] Lines The lines.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Definitions for various line and string routines Definitions for various line and string routines
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -22,7 +22,7 @@
@param[in] Count The line number to advance/retreat. @param[in] Count The line number to advance/retreat.
>0 : advance >0 : advance
<0: retreat <0: retreat
@retval NULL An error occured. @retval NULL An error occured.
@return A pointer to the line after move. @return A pointer to the line after move.
@ -53,7 +53,7 @@ HMoveCurrentLine (
Lines Lines
CurrentLine CurrentLine
NumLines NumLines
ListHead ListHead
@param[in] ListHead The list head. @param[in] ListHead The list head.
@param[in] Lines The lines. @param[in] Lines The lines.

View File

@ -2,7 +2,7 @@
Main file for LoadPciRom shell Debug1 function. Main file for LoadPciRom shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -93,7 +93,7 @@ ShellCommandRunLoadPciRom (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"loadpcirom", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -101,7 +101,7 @@ ShellCommandRunLoadPciRom (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) < 2) { if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"loadpcirom");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
if (ShellCommandLineGetFlag(Package, L"-nc")) { if (ShellCommandLineGetFlag(Package, L"-nc")) {
@ -120,7 +120,7 @@ ShellCommandRunLoadPciRom (
){ ){
Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList); Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Param);
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
break; break;
} }
@ -134,12 +134,12 @@ ShellCommandRunLoadPciRom (
; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link) ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
){ ){
if (EFI_ERROR(Node->Status)){ if (EFI_ERROR(Node->Status)){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
continue; continue;
} }
if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) { if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_DIR), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
continue; continue;
} }
@ -152,7 +152,7 @@ ShellCommandRunLoadPciRom (
} }
Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer); Status = gEfiShellProtocol->ReadFile(Node->Handle, &SourceSize, File1Buffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_READ_FAIL), gShellDebug1HiiHandle, L"loadpcirom", Node->FullName);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = LoadEfiDriversFromRomImage ( Status = LoadEfiDriversFromRomImage (
@ -166,7 +166,7 @@ ShellCommandRunLoadPciRom (
FreePool(File1Buffer); FreePool(File1Buffer);
} }
} else if (ShellStatus == SHELL_SUCCESS) { } else if (ShellStatus == SHELL_SUCCESS) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, "loadpcirom");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
if (FileList != NULL && !IsListEmpty(&FileList->Link)) { if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
@ -234,14 +234,14 @@ LoadEfiDriversFromRomImage (
EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomBarOffset; EfiRomHeader = (EFI_PCI_EXPANSION_ROM_HEADER *) (UINTN) RomBarOffset;
if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) { if (EfiRomHeader->Signature != PCI_EXPANSION_ROM_HEADER_SIGNATURE) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_CORRUPT), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_IMAGE_CORRUPT), HiiHandle, ImageIndex);
return ReturnStatus; return ReturnStatus;
} }
// //
// If the pointer to the PCI Data Structure is invalid, no further images can be located. // If the pointer to the PCI Data Structure is invalid, no further images can be located.
// The PCI Data Structure must be DWORD aligned. // The PCI Data Structure must be DWORD aligned.
// //
if (EfiRomHeader->PcirOffset == 0 || if (EfiRomHeader->PcirOffset == 0 ||
(EfiRomHeader->PcirOffset & 3) != 0 || (EfiRomHeader->PcirOffset & 3) != 0 ||
@ -340,12 +340,12 @@ LoadEfiDriversFromRomImage (
&ImageHandle &ImageHandle
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_LOAD_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_LOAD_IMAGE_ERROR), HiiHandle, ImageIndex, Status);
} else { } else {
Status = gBS->StartImage (ImageHandle, NULL, NULL); Status = gBS->StartImage (ImageHandle, NULL, NULL);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_LOADPCIROM_START_FAIL), gShellDebug1HiiHandle, L"loadpcirom", FileName, ImageIndex);
// PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status); // PrintToken (STRING_TOKEN (STR_LOADPCIROM_START_IMAGE), HiiHandle, ImageIndex, Status);
} else { } else {
ReturnStatus = Status; ReturnStatus = Status;

View File

@ -3,7 +3,7 @@
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which acModeanies this distribution. The full text of the license may be found at
@ -200,7 +200,7 @@ ShellCommandRunMemMap (
Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (SfoParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"memmap", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -208,7 +208,7 @@ ShellCommandRunMemMap (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 1) { if (ShellCommandLineGetCount(Package) > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"memmap");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version); Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version);
@ -218,7 +218,7 @@ ShellCommandRunMemMap (
Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version); Status = gBS->GetMemoryMap(&Size, Descriptors, &MapKey, &ItemSize, &Version);
} }
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MEMMAP_GET_FAILED), gShellDebug1HiiHandle, L"memmap");
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
} else { } else {
ASSERT(Version == EFI_MEMORY_DESCRIPTOR_VERSION); ASSERT(Version == EFI_MEMORY_DESCRIPTOR_VERSION);

View File

@ -2,7 +2,7 @@
Main file for Mode shell Debug1 function. Main file for Mode shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which acModeanies this distribution. The full text of the license may be found at
@ -58,7 +58,7 @@ ShellCommandRunMode (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"mode", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -66,21 +66,21 @@ ShellCommandRunMode (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 3) { if (ShellCommandLineGetCount(Package) > 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) == 2) { } else if (ShellCommandLineGetCount(Package) == 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) == 3) { } else if (ShellCommandLineGetCount(Package) == 3) {
Temp = ShellCommandLineGetRawValue(Package, 1); Temp = ShellCommandLineGetRawValue(Package, 1);
if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) { if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
NewCol = ShellStrToUintn(Temp); NewCol = ShellStrToUintn(Temp);
Temp = ShellCommandLineGetRawValue(Package, 2); Temp = ShellCommandLineGetRawValue(Package, 2);
if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) { if (!ShellIsHexOrDecimalNumber(Temp, FALSE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"mode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
NewRow = ShellStrToUintn(Temp); NewRow = ShellStrToUintn(Temp);
@ -93,7 +93,7 @@ ShellCommandRunMode (
if (Col == NewCol && Row == NewRow) { if (Col == NewCol && Row == NewRow) {
Status = gST->ConOut->SetMode(gST->ConOut, LoopVar); Status = gST->ConOut->SetMode(gST->ConOut, LoopVar);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_SET_FAIL), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} else { } else {
// worked fine... // worked fine...
@ -104,7 +104,7 @@ ShellCommandRunMode (
} }
if (!Done) { if (!Done) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MODE_NO_MATCH), gShellDebug1HiiHandle, L"mode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }

View File

@ -1,9 +1,9 @@
/** @file /** @file
Main file for Pci shell Debug1 function. Main file for Pci shell Debug1 function.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -2487,7 +2487,7 @@ ShellCommandRunPci (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"pci", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -2496,23 +2496,23 @@ ShellCommandRunPci (
} else { } else {
if (ShellCommandLineGetCount(Package) == 2) { if (ShellCommandLineGetCount(Package) == 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (ShellCommandLineGetCount(Package) > 4) { if (ShellCommandLineGetCount(Package) > 4) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (ShellCommandLineGetFlag(Package, L"-ec") && ShellCommandLineGetValue(Package, L"-ec") == NULL) { if (ShellCommandLineGetFlag(Package, L"-ec") && ShellCommandLineGetValue(Package, L"-ec") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-ec");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) { if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetValue(Package, L"-s") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"pci", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2524,7 +2524,7 @@ ShellCommandRunPci (
HandleBufSize = sizeof (EFI_HANDLE); HandleBufSize = sizeof (EFI_HANDLE);
HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize); HandleBuf = (EFI_HANDLE *) AllocateZeroPool (HandleBufSize);
if (HandleBuf == NULL) { if (HandleBuf == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_OUT_OF_RESOURCES; ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Done; goto Done;
} }
@ -2540,7 +2540,7 @@ ShellCommandRunPci (
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
HandleBuf = ReallocatePool (sizeof (EFI_HANDLE), HandleBufSize, HandleBuf); HandleBuf = ReallocatePool (sizeof (EFI_HANDLE), HandleBufSize, HandleBuf);
if (HandleBuf == NULL) { if (HandleBuf == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_OUT_OF_RESOURCES; ShellStatus = SHELL_OUT_OF_RESOURCES;
goto Done; goto Done;
} }
@ -2555,7 +2555,7 @@ ShellCommandRunPci (
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
goto Done; goto Done;
} }
@ -2591,7 +2591,7 @@ ShellCommandRunPci (
&Descriptors &Descriptors
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_HANDLE_CFG_ERR), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
goto Done; goto Done;
} }
@ -2604,7 +2604,7 @@ ShellCommandRunPci (
Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd); Status = PciGetNextBusRange (&Descriptors, &MinBus, &MaxBus, &IsEnd);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_BUS_RANGE_ERR), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
goto Done; goto Done;
} }
@ -2729,7 +2729,7 @@ ShellCommandRunPci (
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
Segment = (UINT16) RetVal; Segment = (UINT16) RetVal;
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2747,13 +2747,13 @@ ShellCommandRunPci (
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
Bus = (UINT16) RetVal; Bus = (UINT16) RetVal;
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (Bus > PCI_MAX_BUS) { if (Bus > PCI_MAX_BUS) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2766,13 +2766,13 @@ ShellCommandRunPci (
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
Device = (UINT16) RetVal; Device = (UINT16) RetVal;
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (Device > PCI_MAX_DEVICE){ if (Device > PCI_MAX_DEVICE){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2786,13 +2786,13 @@ ShellCommandRunPci (
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
Func = (UINT16) RetVal; Func = (UINT16) RetVal;
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (Func > PCI_MAX_FUNC){ if (Func > PCI_MAX_FUNC){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2806,7 +2806,7 @@ ShellCommandRunPci (
if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) { if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
ExtendedCapability = (UINT16) RetVal; ExtendedCapability = (UINT16) RetVal;
} else { } else {
ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp); ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle, L"pci", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -2826,7 +2826,7 @@ ShellCommandRunPci (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle, L"pci", -1, -1, NULL, STRING_TOKEN (STR_PCI_NO_FIND), gShellDebug1HiiHandle, L"pci",
Segment, Segment,
Bus Bus
); );
@ -2844,7 +2844,7 @@ ShellCommandRunPci (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_NO_CFG), gShellDebug1HiiHandle, L"pci");
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
goto Done; goto Done;
} }
@ -4999,13 +4999,13 @@ PrintInterpretedExtendedCompatibilityLinkControl (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL), STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->RootComplexLinkCapabilities, Header->RootComplexLinkCapabilities,
Header->RootComplexLinkControl, Header->RootComplexLinkControl,
Header->RootComplexLinkStatus Header->RootComplexLinkStatus
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5031,13 +5031,13 @@ PrintInterpretedExtendedCompatibilityPowerBudgeting (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_POWER), STRING_TOKEN (STR_PCI_EXT_CAP_POWER),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->DataSelect, Header->DataSelect,
Header->Data, Header->Data,
Header->PowerBudgetCapability Header->PowerBudgetCapability
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5067,12 +5067,12 @@ PrintInterpretedExtendedCompatibilityAcs (
VectorSize = 0; VectorSize = 0;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ACS), STRING_TOKEN (STR_PCI_EXT_CAP_ACS),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->AcsCapability, Header->AcsCapability,
Header->AcsControl Header->AcsControl
); );
if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(Header)) { if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(Header)) {
VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(Header); VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(Header);
if (VectorSize == 0) { if (VectorSize == 0) {
@ -5080,12 +5080,12 @@ PrintInterpretedExtendedCompatibilityAcs (
} }
for (LoopCounter = 0 ; LoopCounter * 8 < VectorSize ; LoopCounter++) { for (LoopCounter = 0 ; LoopCounter * 8 < VectorSize ; LoopCounter++) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ACS2), STRING_TOKEN (STR_PCI_EXT_CAP_ACS2),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
LoopCounter + 1, LoopCounter + 1,
Header->EgressControlVectorArray[LoopCounter] Header->EgressControlVectorArray[LoopCounter]
); );
} }
} }
DumpHex ( DumpHex (
@ -5113,12 +5113,12 @@ PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LAT), STRING_TOKEN (STR_PCI_EXT_CAP_LAT),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->MaxSnoopLatency, Header->MaxSnoopLatency,
Header->MaxNoSnoopLatency Header->MaxNoSnoopLatency
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5144,11 +5144,11 @@ PrintInterpretedExtendedCompatibilitySerialNumber (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_SN), STRING_TOKEN (STR_PCI_EXT_CAP_SN),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->SerialNumber Header->SerialNumber
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5174,14 +5174,14 @@ PrintInterpretedExtendedCompatibilityRcrb (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_RCRB), STRING_TOKEN (STR_PCI_EXT_CAP_RCRB),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->VendorId, Header->VendorId,
Header->DeviceId, Header->DeviceId,
Header->RcrbCapabilities, Header->RcrbCapabilities,
Header->RcrbControl Header->RcrbControl
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5207,11 +5207,11 @@ PrintInterpretedExtendedCompatibilityVendorSpecific (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VEN), STRING_TOKEN (STR_PCI_EXT_CAP_VEN),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->VendorSpecificHeader Header->VendorSpecificHeader
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5237,11 +5237,11 @@ PrintInterpretedExtendedCompatibilityECEA (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ECEA), STRING_TOKEN (STR_PCI_EXT_CAP_ECEA),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->AssociationBitmap Header->AssociationBitmap
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5267,12 +5267,12 @@ PrintInterpretedExtendedCompatibilityAri (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_ARI), STRING_TOKEN (STR_PCI_EXT_CAP_ARI),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->AriCapability, Header->AriCapability,
Header->AriControl Header->AriControl
); );
DumpHex ( DumpHex (
4, 4,
EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress), EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
@ -5299,19 +5299,19 @@ PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_DPA), STRING_TOKEN (STR_PCI_EXT_CAP_DPA),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->DpaCapability, Header->DpaCapability,
Header->DpaLatencyIndicator, Header->DpaLatencyIndicator,
Header->DpaStatus, Header->DpaStatus,
Header->DpaControl Header->DpaControl
); );
for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header) + 1 ; LinkCount++) { for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header) + 1 ; LinkCount++) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_DPA2), STRING_TOKEN (STR_PCI_EXT_CAP_DPA2),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
LinkCount+1, LinkCount+1,
Header->DpaPowerAllocationArray[LinkCount] Header->DpaPowerAllocationArray[LinkCount]
); );
@ -5342,17 +5342,17 @@ PrintInterpretedExtendedCompatibilityLinkDeclaration (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR), STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->ElementSelfDescription Header->ElementSelfDescription
); );
for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header) ; LinkCount++) { for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header) ; LinkCount++) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2), STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
LinkCount+1, LinkCount+1,
Header->LinkEntry[LinkCount] Header->LinkEntry[LinkCount]
); );
@ -5382,9 +5382,9 @@ PrintInterpretedExtendedCompatibilityAer (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_AER), STRING_TOKEN (STR_PCI_EXT_CAP_AER),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->UncorrectableErrorStatus, Header->UncorrectableErrorStatus,
Header->UncorrectableErrorMask, Header->UncorrectableErrorMask,
Header->UncorrectableErrorSeverity, Header->UncorrectableErrorSeverity,
@ -5431,9 +5431,9 @@ PrintInterpretedExtendedCompatibilityMulticast (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST), STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->MultiCastCapability, Header->MultiCastCapability,
Header->MulticastControl, Header->MulticastControl,
Header->McBaseAddress, Header->McBaseAddress,
@ -5471,9 +5471,9 @@ PrintInterpretedExtendedCompatibilityVirtualChannel (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE), STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->ExtendedVcCount, Header->ExtendedVcCount,
Header->PortVcCapability1, Header->PortVcCapability1,
Header->PortVcCapability2, Header->PortVcCapability2,
@ -5484,9 +5484,9 @@ PrintInterpretedExtendedCompatibilityVirtualChannel (
for (ItemCount = 0 ; ItemCount < Header->ExtendedVcCount ; ItemCount++) { for (ItemCount = 0 ; ItemCount < Header->ExtendedVcCount ; ItemCount++) {
CapabilityItem = &Header->Capability[ItemCount]; CapabilityItem = &Header->Capability[ItemCount];
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM), STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
ItemCount+1, ItemCount+1,
CapabilityItem->VcResourceCapability, CapabilityItem->VcResourceCapability,
CapabilityItem->PortArbTableOffset, CapabilityItem->PortArbTableOffset,
@ -5524,9 +5524,9 @@ PrintInterpretedExtendedCompatibilityResizeableBar (
for (ItemCount = 0 ; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) ; ItemCount++) { for (ItemCount = 0 ; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) ; ItemCount++) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR), STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
ItemCount+1, ItemCount+1,
Header->Capability[ItemCount].ResizableBarCapability, Header->Capability[ItemCount].ResizableBarCapability,
Header->Capability[ItemCount].ResizableBarControl Header->Capability[ItemCount].ResizableBarControl
@ -5559,9 +5559,9 @@ PrintInterpretedExtendedCompatibilityTph (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_TPH), STRING_TOKEN (STR_PCI_EXT_CAP_TPH),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->TphRequesterCapability, Header->TphRequesterCapability,
Header->TphRequesterControl Header->TphRequesterControl
); );
@ -5600,9 +5600,9 @@ PrintInterpretedExtendedCompatibilitySecondary (
Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE*)HeaderAddress; Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE*)HeaderAddress;
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1, NULL, -1, -1, NULL,
STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY), STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY),
gShellDebug1HiiHandle, gShellDebug1HiiHandle,
Header->LinkControl3.Uint32, Header->LinkControl3.Uint32,
Header->LaneErrorStatus Header->LaneErrorStatus
); );
@ -5633,7 +5633,7 @@ PrintInterpretedExtendedCompatibilitySecondary (
**/ **/
EFI_STATUS EFI_STATUS
PrintPciExtendedCapabilityDetails( PrintPciExtendedCapabilityDetails(
IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress, IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
IN CONST PCI_EXP_EXT_HDR *HeaderAddress, IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr IN CONST PCI_CAPABILITY_PCIEXP *PciExpressCapPtr
) )
@ -5666,7 +5666,7 @@ PrintPciExtendedCapabilityDetails(
case PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID: case PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID:
case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID: case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID:
return PrintInterpretedExtendedCompatibilityVirtualChannel(HeaderAddress, HeadersBaseAddress); return PrintInterpretedExtendedCompatibilityVirtualChannel(HeaderAddress, HeadersBaseAddress);
case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID: case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID:
// //
// should only be present if PCIE_CAP_DEVICEPORT_TYPE(PciExpressCapPtr->PcieCapReg) == 0100b, 0101b, or 0110b // should only be present if PCIE_CAP_DEVICEPORT_TYPE(PciExpressCapPtr->PcieCapReg) == 0100b, 0101b, or 0110b
// //

View File

@ -2,7 +2,7 @@
Main file for SerMode shell Debug1 function. Main file for SerMode shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -50,7 +50,7 @@ DisplaySettings (
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles); Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
return SHELL_INVALID_PARAMETER; return SHELL_INVALID_PARAMETER;
} }
@ -138,7 +138,7 @@ DisplaySettings (
StopBits StopBits
); );
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
break; break;
} }
@ -150,7 +150,7 @@ DisplaySettings (
if (Index == NoHandles) { if (Index == NoHandles) {
if ((NoHandles != 0 && HandleValid) || 0 == NoHandles) { if ((NoHandles != 0 && HandleValid) || 0 == NoHandles) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NOT_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }
@ -199,7 +199,7 @@ ShellCommandRunSerMode (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"sermode", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -207,10 +207,10 @@ ShellCommandRunSerMode (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) < 6 && ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) > 6) { } else if (ShellCommandLineGetCount(Package) > 6) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Temp = ShellCommandLineGetRawValue(Package, 1); Temp = ShellCommandLineGetRawValue(Package, 1);
@ -235,7 +235,7 @@ ShellCommandRunSerMode (
} }
Temp = ShellCommandLineGetRawValue(Package, 3); Temp = ShellCommandLineGetRawValue(Package, 3);
if (Temp == NULL || StrLen(Temp)>1) { if (Temp == NULL || StrLen(Temp)>1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
switch(Temp[0]){ switch(Temp[0]){
@ -264,7 +264,7 @@ ShellCommandRunSerMode (
Parity = SpaceParity; Parity = SpaceParity;
break; break;
default: default:
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -284,7 +284,7 @@ ShellCommandRunSerMode (
case 8: case 8:
break; break;
default: default:
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -308,13 +308,13 @@ ShellCommandRunSerMode (
break; break;
default: default:
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode", Temp);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles); Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiSerialIoProtocolGuid, NULL, &NoHandles, &Handles);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_NO_FOUND), gShellDebug1HiiHandle, L"sermode");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -337,13 +337,13 @@ ShellCommandRunSerMode (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (Status == EFI_INVALID_PARAMETER) { if (Status == EFI_INVALID_PARAMETER) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_UNSUPPORTED), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
ShellStatus = SHELL_UNSUPPORTED; ShellStatus = SHELL_UNSUPPORTED;
} else if (Status == EFI_DEVICE_ERROR) { } else if (Status == EFI_DEVICE_ERROR) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_DEV_ERROR), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index])); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_SET_FAIL), gShellDebug1HiiHandle, L"sermode", ConvertHandleToHandleIndex(Handles[Index]));
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
} }
} else { } else {
@ -356,7 +356,7 @@ ShellCommandRunSerMode (
} }
if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) { if (ShellStatus == SHELL_SUCCESS && Index == NoHandles) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SERMODE_BAD_HANDLE), gShellDebug1HiiHandle, L"sermode", HandleIdx);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }

View File

@ -2,7 +2,7 @@
Main file for SetSize shell Debug1 function. Main file for SetSize shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -55,7 +55,7 @@ ShellCommandRunSetSize (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setsize", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -63,13 +63,13 @@ ShellCommandRunSetSize (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) < 3) { if (ShellCommandLineGetCount(Package) < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
NewSize = 0; NewSize = 0;
} else { } else {
Temp1 = ShellCommandLineGetRawValue(Package, 1); Temp1 = ShellCommandLineGetRawValue(Package, 1);
if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) { if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SIZE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
NewSize = 0; NewSize = 0;
} else { } else {
@ -82,19 +82,19 @@ ShellCommandRunSetSize (
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|EFI_FILE_MODE_CREATE, 0);
} }
if (EFI_ERROR(Status) && LoopVar == 2) { if (EFI_ERROR(Status) && LoopVar == 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_NOT_SPEC), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (EFI_ERROR(Status)) { } else if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar));
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
break; break;
} else { } else {
Status = FileHandleSetSize(FileHandle, NewSize); Status = FileHandleSetSize(FileHandle, NewSize);
if (Status == EFI_VOLUME_FULL) { if (Status == EFI_VOLUME_FULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_VOLUME_FULL), gShellDebug1HiiHandle, L"setsize");
ShellStatus = SHELL_VOLUME_FULL; ShellStatus = SHELL_VOLUME_FULL;
} else if (EFI_ERROR(Status)) { } else if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_FAIL), gShellDebug1HiiHandle, L"setsize", ShellCommandLineGetRawValue(Package, LoopVar));
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SET_SIZE_DONE), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, LoopVar));

View File

@ -2,7 +2,7 @@
Main file for SetVar shell Debug1 function. Main file for SetVar shell Debug1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -378,19 +378,19 @@ ShellCommandRunSetVar (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"setvar", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ASSERT(FALSE); ASSERT(FALSE);
} }
} else if (ShellCommandLineCheckDuplicate (Package,&ProblemParam) != EFI_SUCCESS) { } else if (ShellCommandLineCheckDuplicate (Package,&ProblemParam) != EFI_SUCCESS) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DUPLICATE), gShellDebug1HiiHandle, L"setvar", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
if (ShellCommandLineGetCount(Package) < 2) { if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle, L"setvar");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
VariableName = ShellCommandLineGetRawValue(Package, 1); VariableName = ShellCommandLineGetRawValue(Package, 1);
@ -400,7 +400,7 @@ ShellCommandRunSetVar (
StringGuid = ShellCommandLineGetValue(Package, L"-guid"); StringGuid = ShellCommandLineGetValue(Package, L"-guid");
RStatus = StrToGuid (StringGuid, &Guid); RStatus = StrToGuid (StringGuid, &Guid);
if (RETURN_ERROR (RStatus) || (StringGuid[GUID_STRING_LENGTH] != L'\0')) { if (RETURN_ERROR (RStatus) || (StringGuid[GUID_STRING_LENGTH] != L'\0')) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"setvar", StringGuid);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }

View File

@ -1,7 +1,7 @@
/** @file /** @file
API for SMBIOS table. API for SMBIOS table.
Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#include "UefiShellDebug1CommandsLib.h" #include "UefiShellDebug1CommandsLib.h"
#include <Guid/SmBios.h> #include <Guid/SmBios.h>

View File

@ -1,8 +1,8 @@
/** @file /** @file
Module for clarifying the content of the smbios structure element information. Module for clarifying the content of the smbios structure element information.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -2892,7 +2892,7 @@ DisplaySBDSManufactureDate (
/** /**
Display System Reset (Type 23) information. Display System Reset (Type 23) information.
Identifies the system-reset capabilities for the system. Identifies the system-reset capabilities for the system.
Bits 7:6 Reserved for future assignment via this specification, set to 00b. Bits 7:6 Reserved for future assignment via this specification, set to 00b.
Bit 5 System contains a watchdog timer, either True (1) or False (0). Bit 5 System contains a watchdog timer, either True (1) or False (0).
@ -2996,7 +2996,7 @@ DisplaySystemResetCapabilities (
/** /**
Display Hardware Security (Type 24) information. Display Hardware Security (Type 24) information.
Identifies the password and reset status for the system: Identifies the password and reset status for the system:
Bits 7:6 Power-on Password Status, one of: Bits 7:6 Power-on Password Status, one of:

View File

@ -2,7 +2,7 @@
Build a table, each item is (Key, Info) pair. Build a table, each item is (Key, Info) pair.
And give a interface of query a string out of a table. And give a interface of query a string out of a table.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -3412,7 +3412,7 @@ QueryTable (
// Check if Key is in the range // Check if Key is in the range
// or if Key == Value in the table // or if Key == Value in the table
// //
if ((High > Low && Key >= Low && Key <= High) if ((High > Low && Key >= Low && Key <= High)
|| (Table[Index].Key == Key)) { || (Table[Index].Key == Key)) {
StrnCpyS (Info, InfoLen, Table[Index].Info, InfoLen - 1); StrnCpyS (Info, InfoLen, Table[Index].Info, InfoLen - 1);
StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen(Info)); StrnCatS (Info, InfoLen, L"\n", InfoLen - 1 - StrLen(Info));

View File

@ -2,7 +2,7 @@
Tools of clarify the content of the smbios table. Tools of clarify the content of the smbios table.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -69,7 +69,7 @@ ShellCommandRunSmbiosView (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"smbiosview", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -77,13 +77,13 @@ ShellCommandRunSmbiosView (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 1) { if (ShellCommandLineGetCount(Package) > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) { } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-t");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) { } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"smbiosview", L"-h");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if ( } else if (
(ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) || (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||
@ -93,7 +93,7 @@ ShellCommandRunSmbiosView (
(ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) || (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetFlag(Package, L"-a")) ||
(ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a")) (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-a"))
) { ) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"smbiosview");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -103,30 +103,30 @@ ShellCommandRunSmbiosView (
Status1 = LibSmbiosInit (); Status1 = LibSmbiosInit ();
Status2 = LibSmbios64BitInit (); Status2 = LibSmbios64BitInit ();
if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) { if (EFI_ERROR (Status1) && EFI_ERROR (Status2)) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), gShellDebug1HiiHandle);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
goto Done; goto Done;
} }
StructType = STRUCTURE_TYPE_RANDOM; StructType = STRUCTURE_TYPE_RANDOM;
RandomView = TRUE; RandomView = TRUE;
Temp = ShellCommandLineGetValue(Package, L"-t"); Temp = ShellCommandLineGetValue(Package, L"-t");
if (Temp != NULL) { if (Temp != NULL) {
StructType = (UINT8) ShellStrToUintn (Temp); StructType = (UINT8) ShellStrToUintn (Temp);
} }
if (ShellCommandLineGetFlag(Package, L"-a")) { if (ShellCommandLineGetFlag(Package, L"-a")) {
gShowType = SHOW_ALL; gShowType = SHOW_ALL;
} }
if (!EFI_ERROR (Status1)) { if (!EFI_ERROR (Status1)) {
// //
// Initialize the StructHandle to be the first handle // Initialize the StructHandle to be the first handle
// //
StructHandle = INVALID_HANDLE; StructHandle = INVALID_HANDLE;
LibGetSmbiosStructure (&StructHandle, NULL, NULL); LibGetSmbiosStructure (&StructHandle, NULL, NULL);
Temp = ShellCommandLineGetValue(Package, L"-h"); Temp = ShellCommandLineGetValue(Package, L"-h");
if (Temp != NULL) { if (Temp != NULL) {
RandomView = FALSE; RandomView = FALSE;
@ -140,7 +140,7 @@ ShellCommandRunSmbiosView (
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
goto Done; goto Done;
} }
if (ShellCommandLineGetFlag(Package, L"-s")) { if (ShellCommandLineGetFlag(Package, L"-s")) {
Status = DisplayStatisticsTable (SHOW_DETAIL); Status = DisplayStatisticsTable (SHOW_DETAIL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
@ -148,7 +148,7 @@ ShellCommandRunSmbiosView (
} }
goto Show64Bit; goto Show64Bit;
} }
// //
// Show SMBIOS structure information // Show SMBIOS structure information
// //
@ -174,13 +174,13 @@ Show64Bit:
// //
StructHandle = INVALID_HANDLE; StructHandle = INVALID_HANDLE;
LibGetSmbios64BitStructure (&StructHandle, NULL, NULL); LibGetSmbios64BitStructure (&StructHandle, NULL, NULL);
Temp = ShellCommandLineGetValue(Package, L"-h"); Temp = ShellCommandLineGetValue(Package, L"-h");
if (Temp != NULL) { if (Temp != NULL) {
RandomView = FALSE; RandomView = FALSE;
StructHandle = (UINT16) ShellStrToUintn(Temp); StructHandle = (UINT16) ShellStrToUintn(Temp);
} }
if (ShellCommandLineGetFlag(Package, L"-s")) { if (ShellCommandLineGetFlag(Package, L"-s")) {
Status = DisplaySmbios64BitStatisticsTable (SHOW_DETAIL); Status = DisplaySmbios64BitStatisticsTable (SHOW_DETAIL);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
@ -188,7 +188,7 @@ Show64Bit:
} }
goto Done; goto Done;
} }
// //
// Show SMBIOS structure information // Show SMBIOS structure information
// //
@ -666,7 +666,7 @@ InitSmbiosTableStatistics (
@param[out] NumberOfSmbios64Structures The number of structures in 64-bit SMBIOS table. @param[out] NumberOfSmbios64Structures The number of structures in 64-bit SMBIOS table.
@param[out] Smbios64TableLength The total length of 64-bit SMBIOS table. @param[out] Smbios64TableLength The total length of 64-bit SMBIOS table.
@retval EFI_SUCCESS Calculation was successful. @retval EFI_SUCCESS Calculation was successful.
**/ **/
EFI_STATUS EFI_STATUS
CalculateSmbios64BitStructureCountAndLength ( CalculateSmbios64BitStructureCountAndLength (
@ -677,10 +677,10 @@ CalculateSmbios64BitStructureCountAndLength (
{ {
SMBIOS_STRUCTURE_POINTER Smbios; SMBIOS_STRUCTURE_POINTER Smbios;
UINT8 *Raw; UINT8 *Raw;
*Smbios64TableLength = 0; *Smbios64TableLength = 0;
*NumberOfSmbios64Structures = 0; *NumberOfSmbios64Structures = 0;
Smbios.Raw = (UINT8 *)(UINTN)(Smbios64EntryPoint->TableAddress); Smbios.Raw = (UINT8 *)(UINTN)(Smbios64EntryPoint->TableAddress);
while (TRUE) { while (TRUE) {
if (Smbios.Hdr->Type == 127) { if (Smbios.Hdr->Type == 127) {
@ -702,11 +702,11 @@ CalculateSmbios64BitStructureCountAndLength (
// //
(*Smbios64TableLength) += ((UINTN) Smbios.Raw - (UINTN) Raw); (*Smbios64TableLength) += ((UINTN) Smbios.Raw - (UINTN) Raw);
if ((*Smbios64TableLength) > Smbios64EntryPoint->TableMaximumSize) { if ((*Smbios64TableLength) > Smbios64EntryPoint->TableMaximumSize) {
// //
// The actual table length exceeds maximum table size, // The actual table length exceeds maximum table size,
// There should be something wrong with SMBIOS table. // There should be something wrong with SMBIOS table.
// //
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
(*NumberOfSmbios64Structures)++; (*NumberOfSmbios64Structures)++;
} }
@ -727,7 +727,7 @@ InitSmbios64BitTableStatistics (
UINT16 Length; UINT16 Length;
UINT16 Offset; UINT16 Offset;
UINT16 Index; UINT16 Index;
EFI_STATUS Status; EFI_STATUS Status;
SMBIOS_STRUCTURE_POINTER SmbiosStruct; SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable; SMBIOS_TABLE_3_0_ENTRY_POINT *SMBiosTable;
STRUCTURE_STATISTICS *StatisticsPointer; STRUCTURE_STATISTICS *StatisticsPointer;
@ -755,9 +755,9 @@ InitSmbios64BitTableStatistics (
// //
Status = CalculateSmbios64BitStructureCountAndLength (SMBiosTable, &mNumberOfSmbios64BitStructures, &mSmbios64BitTableLength); Status = CalculateSmbios64BitStructureCountAndLength (SMBiosTable, &mNumberOfSmbios64BitStructures, &mSmbios64BitTableLength);
if ((EFI_ERROR (Status)) || (mSmbios64BitTableLength > SMBiosTable->TableMaximumSize)) { if ((EFI_ERROR (Status)) || (mSmbios64BitTableLength > SMBiosTable->TableMaximumSize)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS)); mSmbios64BitStatisticsTable = (STRUCTURE_STATISTICS *) AllocateZeroPool (mNumberOfSmbios64BitStructures * sizeof (STRUCTURE_STATISTICS));
if (mSmbios64BitStatisticsTable == NULL) { if (mSmbios64BitStatisticsTable == NULL) {

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main file for NULL named library for debug1 profile shell command functions. Main file for NULL named library for debug1 profile shell command functions.
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -173,7 +173,7 @@ GetSystemConfigurationTable (
/** /**
Clear the line at the specified Row. Clear the line at the specified Row.
@param[in] Row The row number to be cleared ( start from 1 ) @param[in] Row The row number to be cleared ( start from 1 )
@param[in] LastCol The last printable column. @param[in] LastCol The last printable column.
@param[in] LastRow The last printable row. @param[in] LastRow The last printable row.
@ -210,7 +210,7 @@ EditorClearLine (
Line[LastCol % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL; Line[LastCol % (ARRAY_SIZE (Line) - 1)] = CHAR_NULL;
} }
} }
// //
// print out the blank line // print out the blank line
// //
@ -243,7 +243,7 @@ IsValidFileNameChar (
/** /**
Check if file name has illegal characters. Check if file name has illegal characters.
@param Name The filename to check. @param Name The filename to check.
@retval TRUE The filename is ok. @retval TRUE The filename is ok.
@ -323,18 +323,18 @@ EditGetDefaultFileName (
} }
/** /**
Read a file into an allocated buffer. The buffer is the responsibility Read a file into an allocated buffer. The buffer is the responsibility
of the caller to free. of the caller to free.
@param[in] FileName The filename of the file to open. @param[in] FileName The filename of the file to open.
@param[out] Buffer Upon successful return, the pointer to the @param[out] Buffer Upon successful return, the pointer to the
address of the allocated buffer. address of the allocated buffer.
@param[out] BufferSize If not NULL, then the pointer to the size @param[out] BufferSize If not NULL, then the pointer to the size
of the allocated buffer. of the allocated buffer.
@param[out] ReadOnly Upon successful return TRUE if the file is @param[out] ReadOnly Upon successful return TRUE if the file is
read only. FALSE otherwise. read only. FALSE otherwise.
@retval EFI_NOT_FOUND The filename did not represent a file in the @retval EFI_NOT_FOUND The filename did not represent a file in the
file system. file system.
@retval EFI_SUCCESS The file was read into the buffer. @retval EFI_SUCCESS The file was read into the buffer.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
@ -381,7 +381,7 @@ ReadFileIntoBuffer (
} }
Info = ShellGetFileInfo(FileHandle); Info = ShellGetFileInfo(FileHandle);
if (Info->Attribute & EFI_FILE_DIRECTORY) { if (Info->Attribute & EFI_FILE_DIRECTORY) {
FreePool (Info); FreePool (Info);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main file for NULL named library for Profile1 shell command functions. Main file for NULL named library for Profile1 shell command functions.
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -312,7 +312,7 @@ ShellCommandRunHexEdit (
/** /**
Clear the line at the specified Row. Clear the line at the specified Row.
@param[in] Row The row number to be cleared ( start from 1 ) @param[in] Row The row number to be cleared ( start from 1 )
@param[in] LastCol The last printable column. @param[in] LastCol The last printable column.
@param[in] LastRow The last printable row. @param[in] LastRow The last printable row.
@ -326,7 +326,7 @@ EditorClearLine (
/** /**
Check if file name has illegal characters. Check if file name has illegal characters.
@param Name The filename to check. @param Name The filename to check.
@retval TRUE The filename is ok. @retval TRUE The filename is ok.
@ -351,18 +351,18 @@ EditGetDefaultFileName (
); );
/** /**
Read a file into an allocated buffer. The buffer is the responsibility Read a file into an allocated buffer. The buffer is the responsibility
of the caller to free. of the caller to free.
@param[in] FileName The filename of the file to open. @param[in] FileName The filename of the file to open.
@param[out] Buffer Upon successful return, the pointer to the @param[out] Buffer Upon successful return, the pointer to the
address of the allocated buffer. address of the allocated buffer.
@param[out] BufferSize If not NULL, then the pointer to the size @param[out] BufferSize If not NULL, then the pointer to the size
of the allocated buffer. of the allocated buffer.
@param[out] ReadOnly Upon successful return TRUE if the file is @param[out] ReadOnly Upon successful return TRUE if the file is
read only. FALSE otherwise. read only. FALSE otherwise.
@retval EFI_NOT_FOUND The filename did not represent a file in the @retval EFI_NOT_FOUND The filename did not represent a file in the
file system. Directories cannot be read with file system. Directories cannot be read with
this method. this method.
@retval EFI_SUCCESS The file was read into the buffer. @retval EFI_SUCCESS The file was read into the buffer.

View File

@ -1,7 +1,7 @@
## @file ## @file
# Provides shell Debug1 profile functions # Provides shell Debug1 profile functions
# #
# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -64,8 +64,8 @@
EditStatusBar.c EditStatusBar.c
EditMenuBar.h EditMenuBar.h
EditMenuBar.c EditMenuBar.c
## Files specific to the text editor ## Files specific to the text editor
Edit/Edit.c Edit/Edit.c
Edit/TextEditor.h Edit/TextEditor.h
Edit/TextEditorTypes.h Edit/TextEditorTypes.h
@ -76,7 +76,7 @@
Edit/Misc.h Edit/Misc.h
Edit/Misc.c Edit/Misc.c
Edit/TextEditStrings.uni Edit/TextEditStrings.uni
## Files specific to the HEX editor ## Files specific to the HEX editor
HexEdit/BufferImage.h HexEdit/BufferImage.h
HexEdit/BufferImage.c HexEdit/BufferImage.c

View File

@ -1,6 +1,6 @@
// /** // /**
// //
// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
// (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> // (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
// (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> // (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
// This program and the accompanying materials // This program and the accompanying materials
@ -1041,7 +1041,7 @@
" 2. The variable value is printed as a hexadecimal dump.\r\n" " 2. The variable value is printed as a hexadecimal dump.\r\n"
" 3. Option -d is used to delete variables. Option -s and -l are used to save\r\n" " 3. Option -d is used to delete variables. Option -s and -l are used to save\r\n"
" and load variables to and from a file. The variable name can be specified\r\n" " and load variables to and from a file. The variable name can be specified\r\n"
" when using these flags so that the operation only takes effect on\r\n" " when using these flags so that the operation only takes effect on\r\n"
" that variable.\r\n" " that variable.\r\n"
".SH EXAMPLES\r\n" ".SH EXAMPLES\r\n"
" \r\n" " \r\n"

View File

@ -2,7 +2,7 @@
Main file for connect shell Driver1 function. Main file for connect shell Driver1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -36,16 +36,16 @@ ShellConnectDevicePath (
EFI_STATUS Status; EFI_STATUS Status;
EFI_HANDLE Handle; EFI_HANDLE Handle;
EFI_HANDLE PreviousHandle; EFI_HANDLE PreviousHandle;
if (DevicePathToConnect == NULL) { if (DevicePathToConnect == NULL) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
PreviousHandle = NULL; PreviousHandle = NULL;
do{ do{
RemainingDevicePath = DevicePathToConnect; RemainingDevicePath = DevicePathToConnect;
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle); Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
if (!EFI_ERROR (Status) && (Handle != NULL)) { if (!EFI_ERROR (Status) && (Handle != NULL)) {
if (PreviousHandle == Handle) { if (PreviousHandle == Handle) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
@ -54,16 +54,16 @@ ShellConnectDevicePath (
Status = gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE); Status = gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE);
} }
} }
} while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath) ); } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath) );
return Status; return Status;
} }
/** /**
Connect drivers for PCI root bridge. Connect drivers for PCI root bridge.
@retval EFI_SUCCESS Connect drivers successfully. @retval EFI_SUCCESS Connect drivers successfully.
@retval EFI_NOT_FOUND Cannot find PCI root bridge device. @retval EFI_NOT_FOUND Cannot find PCI root bridge device.
@ -72,31 +72,31 @@ EFI_STATUS
ShellConnectPciRootBridge ( ShellConnectPciRootBridge (
VOID VOID
) )
{ {
UINTN RootBridgeHandleCount; UINTN RootBridgeHandleCount;
EFI_HANDLE *RootBridgeHandleBuffer; EFI_HANDLE *RootBridgeHandleBuffer;
UINTN RootBridgeIndex; UINTN RootBridgeIndex;
EFI_STATUS Status; EFI_STATUS Status;
RootBridgeHandleCount = 0; RootBridgeHandleCount = 0;
Status = gBS->LocateHandleBuffer ( Status = gBS->LocateHandleBuffer (
ByProtocol, ByProtocol,
&gEfiPciRootBridgeIoProtocolGuid, &gEfiPciRootBridgeIoProtocolGuid,
NULL, NULL,
&RootBridgeHandleCount, &RootBridgeHandleCount,
&RootBridgeHandleBuffer &RootBridgeHandleBuffer
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
for (RootBridgeIndex = 0; RootBridgeIndex < RootBridgeHandleCount; RootBridgeIndex++) { for (RootBridgeIndex = 0; RootBridgeIndex < RootBridgeHandleCount; RootBridgeIndex++) {
gBS->ConnectController (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE); gBS->ConnectController (RootBridgeHandleBuffer[RootBridgeIndex], NULL, NULL, FALSE);
} }
FreePool (RootBridgeHandleBuffer); FreePool (RootBridgeHandleBuffer);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -199,7 +199,7 @@ ShellConnectFromDevPaths (
{ {
EFI_DEVICE_PATH_PROTOCOL *DevPath; EFI_DEVICE_PATH_PROTOCOL *DevPath;
EFI_DEVICE_PATH_PROTOCOL *CopyOfDevPath; EFI_DEVICE_PATH_PROTOCOL *CopyOfDevPath;
EFI_DEVICE_PATH_PROTOCOL *Instance; EFI_DEVICE_PATH_PROTOCOL *Instance;
EFI_DEVICE_PATH_PROTOCOL *Next; EFI_DEVICE_PATH_PROTOCOL *Next;
UINTN Length; UINTN Length;
UINTN Index; UINTN Index;
@ -210,7 +210,7 @@ ShellConnectFromDevPaths (
BOOLEAN AtLeastOneConnected; BOOLEAN AtLeastOneConnected;
EFI_PCI_IO_PROTOCOL *PciIo; EFI_PCI_IO_PROTOCOL *PciIo;
UINT8 Class[3]; UINT8 Class[3];
DevPath = NULL; DevPath = NULL;
Length = 0; Length = 0;
AtLeastOneConnected = FALSE; AtLeastOneConnected = FALSE;
@ -266,14 +266,14 @@ ShellConnectFromDevPaths (
((DevicePathSubType (Instance) == MSG_USB_CLASS_DP) ((DevicePathSubType (Instance) == MSG_USB_CLASS_DP)
|| (DevicePathSubType (Instance) == MSG_USB_WWID_DP) || (DevicePathSubType (Instance) == MSG_USB_WWID_DP)
)) { )) {
Status = ShellConnectPciRootBridge (); Status = ShellConnectPciRootBridge ();
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
FreePool(Instance); FreePool(Instance);
FreePool(DevPath); FreePool(DevPath);
return Status; return Status;
} }
Status = gBS->LocateHandleBuffer ( Status = gBS->LocateHandleBuffer (
ByProtocol, ByProtocol,
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
@ -281,7 +281,7 @@ ShellConnectFromDevPaths (
&HandleArrayCount, &HandleArrayCount,
&HandleArray &HandleArray
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
for (Index = 0; Index < HandleArrayCount; Index++) { for (Index = 0; Index < HandleArrayCount; Index++) {
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
@ -289,7 +289,7 @@ ShellConnectFromDevPaths (
&gEfiPciIoProtocolGuid, &gEfiPciIoProtocolGuid,
(VOID **)&PciIo (VOID **)&PciIo
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class); Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x09, 3, &Class);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
@ -313,7 +313,7 @@ ShellConnectFromDevPaths (
if (HandleArray != NULL) { if (HandleArray != NULL) {
FreePool (HandleArray); FreePool (HandleArray);
} }
} else { } else {
// //
// connect the entire device path // connect the entire device path
// //
@ -323,9 +323,9 @@ ShellConnectFromDevPaths (
} }
} }
FreePool (Instance); FreePool (Instance);
} while (CopyOfDevPath != NULL); } while (CopyOfDevPath != NULL);
if (DevPath != NULL) { if (DevPath != NULL) {
FreePool(DevPath); FreePool(DevPath);
} }
@ -335,7 +335,7 @@ ShellConnectFromDevPaths (
} else { } else {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
} }
/** /**
@ -437,7 +437,7 @@ ShellCommandRunConnect (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"connect", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"connect", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -456,7 +456,7 @@ ShellCommandRunConnect (
// //
// error for too many parameters // error for too many parameters
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"connect"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"connect");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetFlag(Package, L"-c")) { } else if (ShellCommandLineGetFlag(Package, L"-c")) {
// //
@ -504,7 +504,7 @@ ShellCommandRunConnect (
Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate); Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} else { } else {
@ -515,22 +515,22 @@ ShellCommandRunConnect (
Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(Param2, &Intermediate, TRUE, FALSE);
Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate); Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} else { } else {
Handle2 = NULL; Handle2 = NULL;
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
if (Param1 != NULL && Handle1 == NULL){ if (Param1 != NULL && Handle1 == NULL){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (Param2 != NULL && Handle2 == NULL) { } else if (Param2 != NULL && Handle2 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (Handle2 != NULL && Handle1 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { } else if (Handle2 != NULL && Handle1 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"connect", Param2);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ConvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package, L"-r"), (BOOLEAN)(Count!=0)); Status = ConvertAndConnectControllers(Handle1, Handle2, ShellCommandLineGetFlag(Package, L"-r"), (BOOLEAN)(Count!=0));

View File

@ -2,7 +2,7 @@
Main file for DevTree shell Driver1 function. Main file for DevTree shell Driver1 function.
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -58,12 +58,12 @@ DoDevTreeForHandle(
ASSERT (TheHandle != NULL); ASSERT (TheHandle != NULL);
ASSERT (HiiString != NULL); ASSERT (HiiString != NULL);
if (ShellGetExecutionBreakFlag()) { if (ShellGetExecutionBreakFlag()) {
ShellStatus = SHELL_ABORTED; ShellStatus = SHELL_ABORTED;
return ShellStatus; return ShellStatus;
} }
// //
// We want controller handles. they will not have LoadedImage or DriverBinding (or others...) // We want controller handles. they will not have LoadedImage or DriverBinding (or others...)
// //
@ -184,7 +184,7 @@ ShellCommandRunDevTree (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devtree", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devtree", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -192,7 +192,7 @@ ShellCommandRunDevTree (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devtree"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devtree");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -206,7 +206,7 @@ ShellCommandRunDevTree (
// AsciiSPrint(Language, 10, "en-us"); // AsciiSPrint(Language, 10, "en-us");
} else { } else {
ASSERT(Language == NULL); ASSERT(Language == NULL);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devtree", L"-l"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devtree", L"-l");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -259,7 +259,7 @@ ShellCommandRunDevTree (
} else { } else {
Status = ShellConvertStringToUint64(Lang, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(Lang, &Intermediate, TRUE, FALSE);
if (EFI_ERROR(Status) || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL) { if (EFI_ERROR(Status) || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"devtree", Lang); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"devtree", Lang);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ShellStatus = DoDevTreeForHandle(ConvertHandleIndexToHandle((UINTN)Intermediate), Language, FlagD, 0, HiiString); ShellStatus = DoDevTreeForHandle(ConvertHandleIndexToHandle((UINTN)Intermediate), Language, FlagD, 0, HiiString);

View File

@ -2,7 +2,7 @@
Main file for devices shell Driver1 function. Main file for devices shell Driver1 function.
(C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -19,19 +19,19 @@
Get lots of info about a device from its handle. Get lots of info about a device from its handle.
@param[in] TheHandle The device handle to get info on. @param[in] TheHandle The device handle to get info on.
@param[in, out] Type On successful return R, B, or D (root, bus, or @param[in, out] Type On successful return R, B, or D (root, bus, or
device) will be placed in this buffer. device) will be placed in this buffer.
@param[in, out] Cfg On successful return this buffer will be @param[in, out] Cfg On successful return this buffer will be
TRUE if the handle has configuration, FALSE TRUE if the handle has configuration, FALSE
otherwise. otherwise.
@param[in, out] Diag On successful return this buffer will be @param[in, out] Diag On successful return this buffer will be
TRUE if the handle has disgnostics, FALSE TRUE if the handle has disgnostics, FALSE
otherwise. otherwise.
@param[in, out] Parents On successful return this buffer will be @param[in, out] Parents On successful return this buffer will be
contain the number of parent handles. contain the number of parent handles.
@param[in, out] Devices On successful return this buffer will be @param[in, out] Devices On successful return this buffer will be
contain the number of devices controlled. contain the number of devices controlled.
@param[in, out] Children On successful return this buffer will be @param[in, out] Children On successful return this buffer will be
contain the number of child handles. contain the number of child handles.
@param[out] Name The pointer to a buffer that will be allocated @param[out] Name The pointer to a buffer that will be allocated
and contain the string name of the handle. and contain the string name of the handle.
@ -58,7 +58,7 @@ GetDeviceHandleInfo (
EFI_HANDLE *HandleBuffer; EFI_HANDLE *HandleBuffer;
UINTN Count; UINTN Count;
if (TheHandle == NULL if (TheHandle == NULL
|| Type == NULL || Type == NULL
|| Cfg == NULL || Cfg == NULL
|| Diag == NULL || Diag == NULL
@ -168,7 +168,7 @@ ShellCommandRunDevices (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devices", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"devices", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -182,7 +182,7 @@ ShellCommandRunDevices (
// //
// error for too many parameters // error for too many parameters
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devices"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"devices");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -198,7 +198,7 @@ ShellCommandRunDevices (
// AsciiSPrint(Language, 10, "en-us"); // AsciiSPrint(Language, 10, "en-us");
} else { } else {
ASSERT(Language == NULL); ASSERT(Language == NULL);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devices", L"-l"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"devices", L"-l");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -253,13 +253,13 @@ ShellCommandRunDevices (
ShellStatus = SHELL_ABORTED; ShellStatus = SHELL_ABORTED;
break; break;
} }
} }
if (HandleList != NULL) { if (HandleList != NULL) {
FreePool(HandleList); FreePool(HandleList);
} }
} }
SHELL_FREE_NON_NULL(Language); SHELL_FREE_NON_NULL(Language);
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);

View File

@ -2,7 +2,7 @@
Main file for Dh shell Driver1 function. Main file for Dh shell Driver1 function.
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -342,7 +342,7 @@ GetProtocolInfoString(
} }
} }
} }
SHELL_FREE_NON_NULL(ProtocolGuidArray); SHELL_FREE_NON_NULL(ProtocolGuidArray);
if (RetVal == NULL) { if (RetVal == NULL) {
@ -395,7 +395,7 @@ GetDriverImageName (
/** /**
Display driver model information for a given handle. Display driver model information for a given handle.
@param[in] Handle The handle to display info on. @param[in] Handle The handle to display info on.
@param[in] BestName Use the best name? @param[in] BestName Use the best name?
@param[in] Language The language to output in. @param[in] Language The language to output in.
@ -483,14 +483,14 @@ DisplayDriverModelHandle (
Status = gEfiShellProtocol->GetDeviceName(Handle, EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); Status = gEfiShellProtocol->GetDeviceName(Handle, EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"<Unknown>"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"<Unknown>");
SHELL_FREE_NON_NULL(TempStringPointer); SHELL_FREE_NON_NULL(TempStringPointer);
TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE); TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER2), STRING_TOKEN (STR_DH_OUTPUT_DRIVER2),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
TempStringPointer!=NULL?TempStringPointer:L"<None>", TempStringPointer!=NULL?TempStringPointer:L"<None>",
ParentControllerHandleCount == 0?L"ROOT":(ChildControllerHandleCount > 0)?L"BUS":L"DEVICE", ParentControllerHandleCount == 0?L"ROOT":(ChildControllerHandleCount > 0)?L"BUS":L"DEVICE",
ConfigurationStatus?L"YES":L"NO", ConfigurationStatus?L"YES":L"NO",
@ -501,20 +501,20 @@ DisplayDriverModelHandle (
if (DriverBindingHandleCount == 0) { if (DriverBindingHandleCount == 0) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), STRING_TOKEN (STR_DH_OUTPUT_DRIVER3),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"<None>" L"<None>"
); );
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER3), STRING_TOKEN (STR_DH_OUTPUT_DRIVER3),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"" L""
); );
for (Index = 0; Index < DriverBindingHandleCount; Index++) { for (Index = 0; Index < DriverBindingHandleCount; Index++) {
@ -536,9 +536,9 @@ DisplayDriverModelHandle (
if (Image) { if (Image) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER4A), STRING_TOKEN (STR_DH_OUTPUT_DRIVER4A),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]), ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]),
@ -546,9 +546,9 @@ DisplayDriverModelHandle (
); );
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER4B), STRING_TOKEN (STR_DH_OUTPUT_DRIVER4B),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]), ConvertHandleToHandleIndex (DriverBindingHandleBuffer[Index]),
@ -561,28 +561,28 @@ DisplayDriverModelHandle (
if (ParentControllerHandleCount == 0) { if (ParentControllerHandleCount == 0) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), STRING_TOKEN (STR_DH_OUTPUT_DRIVER5),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"<None>" L"<None>"
); );
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER5), STRING_TOKEN (STR_DH_OUTPUT_DRIVER5),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"" L""
); );
for (Index = 0; Index < ParentControllerHandleCount; Index++) { for (Index = 0; Index < ParentControllerHandleCount; Index++) {
Status = gEfiShellProtocol->GetDeviceName(ParentControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); Status = gEfiShellProtocol->GetDeviceName(ParentControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER5B), STRING_TOKEN (STR_DH_OUTPUT_DRIVER5B),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex (ParentControllerHandleBuffer[Index]), ConvertHandleToHandleIndex (ParentControllerHandleBuffer[Index]),
@ -594,28 +594,28 @@ DisplayDriverModelHandle (
if (ChildControllerHandleCount == 0) { if (ChildControllerHandleCount == 0) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"<None>" L"<None>"
); );
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), STRING_TOKEN (STR_DH_OUTPUT_DRIVER6),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"" L""
); );
for (Index = 0; Index < ChildControllerHandleCount; Index++) { for (Index = 0; Index < ChildControllerHandleCount; Index++) {
Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[Index], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B), STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex (ChildControllerHandleBuffer[Index]), ConvertHandleToHandleIndex (ChildControllerHandleBuffer[Index]),
@ -675,9 +675,9 @@ DisplayDriverModelHandle (
} }
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER7), STRING_TOKEN (STR_DH_OUTPUT_DRIVER7),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(Handle), ConvertHandleToHandleIndex(Handle),
@ -692,9 +692,9 @@ DisplayDriverModelHandle (
DriverName = NULL; DriverName = NULL;
} }
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER7B), STRING_TOKEN (STR_DH_OUTPUT_DRIVER7B),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
DriverName!=NULL?DriverName:L"<Unknown>" DriverName!=NULL?DriverName:L"<Unknown>"
@ -702,11 +702,11 @@ DisplayDriverModelHandle (
SHELL_FREE_NON_NULL(DriverName); SHELL_FREE_NON_NULL(DriverName);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER8), STRING_TOKEN (STR_DH_OUTPUT_DRIVER8),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
DriverBinding->Version, DriverBinding->Version,
NumberOfChildren > 0?L"Bus":ControllerHandleCount > 0?L"Device":L"<Unknown>", NumberOfChildren > 0?L"Bus":ControllerHandleCount > 0?L"Device":L"<Unknown>",
ConfigurationStatus?L"YES":L"NO", ConfigurationStatus?L"YES":L"NO",
@ -715,29 +715,29 @@ DisplayDriverModelHandle (
if (ControllerHandleCount == 0) { if (ControllerHandleCount == 0) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER9), STRING_TOKEN (STR_DH_OUTPUT_DRIVER9),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"None" L"None"
); );
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER9), STRING_TOKEN (STR_DH_OUTPUT_DRIVER9),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"" L""
); );
for (HandleIndex = 0; HandleIndex < ControllerHandleCount; HandleIndex++) { for (HandleIndex = 0; HandleIndex < ControllerHandleCount; HandleIndex++) {
Status = gEfiShellProtocol->GetDeviceName(ControllerHandleBuffer[HandleIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); Status = gEfiShellProtocol->GetDeviceName(ControllerHandleBuffer[HandleIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER9B), STRING_TOKEN (STR_DH_OUTPUT_DRIVER9B),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(ControllerHandleBuffer[HandleIndex]), ConvertHandleToHandleIndex(ControllerHandleBuffer[HandleIndex]),
@ -756,9 +756,9 @@ DisplayDriverModelHandle (
Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[ChildIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer); Status = gEfiShellProtocol->GetDeviceName(ChildControllerHandleBuffer[ChildIndex], EFI_DEVICE_NAME_USE_COMPONENT_NAME|EFI_DEVICE_NAME_USE_DEVICE_PATH, (CHAR8*)Language, &TempStringPointer);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DH_OUTPUT_DRIVER6C), STRING_TOKEN (STR_DH_OUTPUT_DRIVER6C),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(ChildControllerHandleBuffer[ChildIndex]), ConvertHandleToHandleIndex(ChildControllerHandleBuffer[ChildIndex]),
@ -1109,7 +1109,7 @@ ShellCommandRunDh (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"dh", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"dh", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -1117,7 +1117,7 @@ ShellCommandRunDh (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 2) { if (ShellCommandLineGetCount(Package) > 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"dh"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"dh");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }

View File

@ -3,7 +3,7 @@
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -118,7 +118,7 @@ ShellCommandRunDisconnect (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"disconnect", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"disconnect", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -127,10 +127,10 @@ ShellCommandRunDisconnect (
} else { } else {
if (ShellCommandLineGetFlag(Package, L"-r")){ if (ShellCommandLineGetFlag(Package, L"-r")){
if (ShellCommandLineGetCount(Package) > 1){ if (ShellCommandLineGetCount(Package) > 1){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 1) { } else if (ShellCommandLineGetCount(Package) < 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = DisconnectAll (); Status = DisconnectAll ();
@ -151,10 +151,10 @@ ShellCommandRunDisconnect (
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
if (ShellCommandLineGetCount(Package) > 4){ if (ShellCommandLineGetCount(Package) > 4){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"disconnect");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 2) { } else if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"disconnect");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -171,17 +171,17 @@ ShellCommandRunDisconnect (
Handle3 = Param3!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate3):NULL; Handle3 = Param3!=NULL?ConvertHandleIndexToHandle((UINTN)Intermediate3):NULL;
if (Param1 != NULL && Handle1 == NULL) { if (Param1 != NULL && Handle1 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (Param2 != NULL && Handle2 == NULL) { } else if (Param2 != NULL && Handle2 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param2); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param2);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (Param3 != NULL && Handle3 == NULL) { } else if (Param3 != NULL && Handle3 == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param3); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"disconnect", Param3);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (Handle2 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { } else if (Handle2 != NULL && EFI_ERROR(gBS->OpenProtocol(Handle2, &gEfiDriverBindingProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
ASSERT(Param2 != NULL); ASSERT(Param2 != NULL);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"disconnect", ShellStrToUintn(Param2), L"driver handle"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_NOT), gShellDriver1HiiHandle, L"disconnect", ShellStrToUintn(Param2), L"driver handle");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ASSERT(Param1 != NULL); ASSERT(Param1 != NULL);

View File

@ -2,7 +2,7 @@
Main file for Drivers shell Driver1 function. Main file for Drivers shell Driver1 function.
(C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
@param[in] TheHandle The handle to get the device path for. @param[in] TheHandle The handle to get the device path for.
@retval NULL An error occured. @retval NULL An error occured.
@return A pointer to the driver path as a string. The callee must @return A pointer to the driver path as a string. The callee must
free this memory. free this memory.
**/ **/
CHAR16* CHAR16*
@ -302,7 +302,7 @@ ShellCommandRunDrivers (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drivers", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drivers", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -310,7 +310,7 @@ ShellCommandRunDrivers (
} }
} else { } else {
if (ShellCommandLineGetCount(Package) > 1) { if (ShellCommandLineGetCount(Package) > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drivers"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drivers");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
if (ShellCommandLineGetFlag(Package, L"-l")){ if (ShellCommandLineGetFlag(Package, L"-l")){
@ -320,7 +320,7 @@ ShellCommandRunDrivers (
AsciiSPrint(Language, StrSize(Lang), "%S", Lang); AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
} else { } else {
ASSERT(Language == NULL); ASSERT(Language == NULL);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drivers", L"-l"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drivers", L"-l");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }

View File

@ -2,7 +2,7 @@
Main file for DrvCfg shell Driver1 function. Main file for DrvCfg shell Driver1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -183,7 +183,7 @@ ConfigToFile(
STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL), STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
FileName, FileName,
Status); Status);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
@ -199,13 +199,13 @@ ConfigToFile(
if (EFI_ERROR(Status) || HiiDatabase == NULL) { if (EFI_ERROR(Status) || HiiDatabase == NULL) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_PROTOCOL_NF), STRING_TOKEN(STR_GEN_PROTOCOL_NF),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
L"EfiHiiDatabaseProtocol", L"EfiHiiDatabaseProtocol",
&gEfiHiiDatabaseProtocolGuid); &gEfiHiiDatabaseProtocolGuid);
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_NOT_FOUND); return (SHELL_NOT_FOUND);
@ -215,16 +215,16 @@ ConfigToFile(
Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase); Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_HANDLE_NOT), STRING_TOKEN(STR_GEN_HANDLE_NOT),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
ConvertHandleToHandleIndex(Handle), ConvertHandleToHandleIndex(Handle),
L"Device"); L"Device");
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
Status = HiiDatabase->ExportPackageLists(HiiDatabase, HiiHandle, &MainBufferSize, MainBuffer); Status = HiiDatabase->ExportPackageLists(HiiDatabase, HiiHandle, &MainBufferSize, MainBuffer);
@ -240,20 +240,20 @@ ConfigToFile(
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_FILE_WRITE_FAIL), STRING_TOKEN(STR_FILE_WRITE_FAIL),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
FileName); FileName);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_DRVCFG_COMP), STRING_TOKEN(STR_DRVCFG_COMP),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
return (SHELL_SUCCESS); return (SHELL_SUCCESS);
@ -296,9 +296,9 @@ ConfigFromFile(
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL), STRING_TOKEN(STR_GEN_FILE_OPEN_FAIL),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
FileName, FileName,
Status); Status);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
@ -314,13 +314,13 @@ ConfigFromFile(
if (EFI_ERROR(Status) || HiiDatabase == NULL) { if (EFI_ERROR(Status) || HiiDatabase == NULL) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_PROTOCOL_NF), STRING_TOKEN(STR_GEN_PROTOCOL_NF),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
L"EfiHiiDatabaseProtocol", L"EfiHiiDatabaseProtocol",
&gEfiHiiDatabaseProtocolGuid); &gEfiHiiDatabaseProtocolGuid);
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_NOT_FOUND); return (SHELL_NOT_FOUND);
@ -330,42 +330,42 @@ ConfigFromFile(
MainBufferSize = (UINTN)Temp; MainBufferSize = (UINTN)Temp;
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_FILE_READ_FAIL), STRING_TOKEN(STR_FILE_READ_FAIL),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
FileName); FileName);
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
MainBuffer = AllocateZeroPool((UINTN)MainBufferSize); MainBuffer = AllocateZeroPool((UINTN)MainBufferSize);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_OUT_MEM), STRING_TOKEN(STR_GEN_OUT_MEM),
gShellDriver1HiiHandle, L"drvcfg"); gShellDriver1HiiHandle, L"drvcfg");
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
Status = ShellReadFile(FileHandle, &MainBufferSize, MainBuffer); Status = ShellReadFile(FileHandle, &MainBufferSize, MainBuffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_FILE_READ_FAIL), STRING_TOKEN(STR_FILE_READ_FAIL),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
FileName); FileName);
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
SHELL_FREE_NON_NULL(MainBuffer); SHELL_FREE_NON_NULL(MainBuffer);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
@ -378,28 +378,28 @@ ConfigFromFile(
Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase); Status = ConvertHandleToHiiHandle(Handle, &HiiHandle, HiiDatabase);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_HANDLE_NOT), STRING_TOKEN(STR_GEN_HANDLE_NOT),
gShellDriver1HiiHandle, L"drvcfg", gShellDriver1HiiHandle, L"drvcfg",
ConvertHandleToHandleIndex(Handle), ConvertHandleToHandleIndex(Handle),
L"Device"); L"Device");
ShellCloseFile(&FileHandle); ShellCloseFile(&FileHandle);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, MainBuffer); Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, MainBuffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN), STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
L"HiiDatabase->UpdatePackageList", L"HiiDatabase->UpdatePackageList",
Status); Status);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
} else { } else {
// //
@ -421,24 +421,24 @@ ConfigFromFile(
// //
TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE); TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_DRVCFG_IN_FILE_NF), STRING_TOKEN(STR_DRVCFG_IN_FILE_NF),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
TempDevPathString); TempDevPathString);
SHELL_FREE_NON_NULL(TempDevPathString); SHELL_FREE_NON_NULL(TempDevPathString);
} else { } else {
Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, PackageListHeader); Status = HiiDatabase->UpdatePackageList(HiiDatabase, HiiHandle, PackageListHeader);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN), STRING_TOKEN(STR_GEN_UEFI_FUNC_WARN),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
L"drvcfg", L"drvcfg",
L"HiiDatabase->UpdatePackageList", L"HiiDatabase->UpdatePackageList",
Status); Status);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} else { } else {
@ -446,14 +446,14 @@ ConfigFromFile(
gBS->LocateDevicePath(&gEfiHiiConfigAccessProtocolGuid, &DevPath, &Handle); gBS->LocateDevicePath(&gEfiHiiConfigAccessProtocolGuid, &DevPath, &Handle);
HandleIndex = ConvertHandleToHandleIndex(Handle); HandleIndex = ConvertHandleToHandleIndex(Handle);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_DRVCFG_DONE_HII), STRING_TOKEN(STR_DRVCFG_DONE_HII),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
HandleIndex); HandleIndex);
} }
} }
} }
} }
} }
@ -463,10 +463,10 @@ ConfigFromFile(
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN(STR_DRVCFG_COMP), STRING_TOKEN(STR_DRVCFG_COMP),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
return (SHELL_SUCCESS); return (SHELL_SUCCESS);
} }
@ -593,22 +593,22 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_FORCE_D), STRING_TOKEN (STR_DRVCFG_FORCE_D),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
DefaultType); DefaultType);
} else if (ValidateOptions) { } else if (ValidateOptions) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_VALIDATE), STRING_TOKEN (STR_DRVCFG_VALIDATE),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
} else if (SetOptions) { } else if (SetOptions) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_SET), STRING_TOKEN (STR_DRVCFG_SET),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
} }
@ -619,8 +619,8 @@ PreHiiDrvCfg (
goto Done; goto Done;
} }
for ( for (
HandleBuffer = DriverImageHandleBuffer, DriverImageHandleCount = 0 HandleBuffer = DriverImageHandleBuffer, DriverImageHandleCount = 0
; HandleBuffer != NULL && *HandleBuffer != NULL ; HandleBuffer != NULL && *HandleBuffer != NULL
; HandleBuffer++,DriverImageHandleCount++); ; HandleBuffer++,DriverImageHandleCount++);
} else { } else {
DriverImageHandleCount = 1; DriverImageHandleCount = 1;
@ -666,7 +666,7 @@ PreHiiDrvCfg (
ShellStatus = SHELL_UNSUPPORTED; ShellStatus = SHELL_UNSUPPORTED;
continue; continue;
} }
BestLanguage = GetBestLanguage ( BestLanguage = GetBestLanguage (
DriverConfiguration->SupportedLanguages, DriverConfiguration->SupportedLanguages,
Iso639Language, Iso639Language,
@ -725,7 +725,7 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
for (LoopCounter = 0; LoopCounter < HandleCount; LoopCounter++) { for (LoopCounter = 0; LoopCounter < HandleCount; LoopCounter++) {
if ((HandleType[LoopCounter] & HR_CONTROLLER_HANDLE) == HR_CONTROLLER_HANDLE) { if ((HandleType[LoopCounter] & HR_CONTROLLER_HANDLE) == HR_CONTROLLER_HANDLE) {
@ -742,8 +742,8 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_NOT_SET), STRING_TOKEN (STR_DRVCFG_NOT_SET),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
} }
continue; continue;
@ -784,7 +784,7 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_DEF_FORCED), STRING_TOKEN (STR_DRVCFG_DEF_FORCED),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
ShellCmdDriverConfigurationProcessActionRequired ( ShellCmdDriverConfigurationProcessActionRequired (
DriverImageHandleBuffer[OuterLoopCounter], DriverImageHandleBuffer[OuterLoopCounter],
@ -797,8 +797,8 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), STRING_TOKEN (STR_DRVCFG_FORCE_FAILED),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -814,15 +814,15 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), STRING_TOKEN (STR_DRVCFG_OPTIONS_INV),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -853,7 +853,7 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
ShellCmdDriverConfigurationProcessActionRequired ( ShellCmdDriverConfigurationProcessActionRequired (
@ -868,8 +868,8 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_NOT_SET), STRING_TOKEN (STR_DRVCFG_NOT_SET),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -931,7 +931,7 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_DEF_FORCED), STRING_TOKEN (STR_DRVCFG_DEF_FORCED),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
ShellCmdDriverConfigurationProcessActionRequired ( ShellCmdDriverConfigurationProcessActionRequired (
@ -946,8 +946,8 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_FORCE_FAILED), STRING_TOKEN (STR_DRVCFG_FORCE_FAILED),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -963,15 +963,15 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID), STRING_TOKEN (STR_DRVCFG_OPTIONS_VALID),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_INV), STRING_TOKEN (STR_DRVCFG_OPTIONS_INV),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -1004,7 +1004,7 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_OPTIONS_SET), STRING_TOKEN (STR_DRVCFG_OPTIONS_SET),
gShellDriver1HiiHandle); gShellDriver1HiiHandle);
ShellCmdDriverConfigurationProcessActionRequired ( ShellCmdDriverConfigurationProcessActionRequired (
@ -1019,8 +1019,8 @@ PreHiiDrvCfg (
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_NOT_SET), STRING_TOKEN (STR_DRVCFG_NOT_SET),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Status); Status);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
@ -1081,11 +1081,11 @@ PrintConfigInfoOnAll(
Found = TRUE; Found = TRUE;
Index2 = *CurrentHandle == NULL ? 0 : ConvertHandleToHandleIndex(*CurrentHandle); Index2 = *CurrentHandle == NULL ? 0 : ConvertHandleToHandleIndex(*CurrentHandle);
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_LINE_HII), STRING_TOKEN (STR_DRVCFG_LINE_HII),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
Index2 Index2
); );
} }
@ -1203,7 +1203,7 @@ ShellCommandRunDrvCfg (
ASSERT(FALSE); ASSERT(FALSE);
} }
} }
} }
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
if (ShellCommandLineGetCount(Package) > 4) { if (ShellCommandLineGetCount(Package) > 4) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvcfg");
@ -1236,24 +1236,24 @@ ShellCommandRunDrvCfg (
} }
if (InFromFile && EFI_ERROR(ShellFileExists(FileName))) { if (InFromFile && EFI_ERROR(ShellFileExists(FileName))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FIND_FAIL), gShellDriver1HiiHandle, L"drvcfg", FileName);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
if (OutToFile && !EFI_ERROR(ShellFileExists(FileName))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_EXIST), gShellDriver1HiiHandle, L"drvcfg", FileName);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
if (Force && ForceTypeString == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", L"-f");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (OutToFile && !EFI_ERROR(ShellFileExists(FileName))) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_EXIST), gShellDriver1HiiHandle, L"drvcfg", FileName);
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
if (Force && ForceTypeString == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", L"-f");
ShellStatus = SHELL_INVALID_PARAMETER;
goto Done;
}
if (Force) { if (Force) {
Status = ShellConvertStringToUint64(ForceTypeString, &Intermediate, FALSE, FALSE); Status = ShellConvertStringToUint64(ForceTypeString, &Intermediate, FALSE, FALSE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDriver1HiiHandle, L"drvcfg", ForceTypeString, L"-f"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM_VAL), gShellDriver1HiiHandle, L"drvcfg", ForceTypeString, L"-f");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1266,7 +1266,7 @@ ShellCommandRunDrvCfg (
if (HandleIndex1 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex1, &Intermediate, TRUE, FALSE))) { if (HandleIndex1 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex1, &Intermediate, TRUE, FALSE))) {
Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate); Handle1 = ConvertHandleIndexToHandle((UINTN)Intermediate);
if (Handle1 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { if (Handle1 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1276,7 +1276,7 @@ ShellCommandRunDrvCfg (
if (HandleIndex2 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex2, &Intermediate, TRUE, FALSE))) { if (HandleIndex2 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex2, &Intermediate, TRUE, FALSE))) {
Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate); Handle2 = ConvertHandleIndexToHandle((UINTN)Intermediate);
if (Handle2 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { if (Handle2 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex2); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex2);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1286,7 +1286,7 @@ ShellCommandRunDrvCfg (
if (HandleIndex3 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex3, &Intermediate, TRUE, FALSE))) { if (HandleIndex3 != NULL && !EFI_ERROR(ShellConvertStringToUint64(HandleIndex3, &Intermediate, TRUE, FALSE))) {
Handle3 = ConvertHandleIndexToHandle((UINTN)Intermediate); Handle3 = ConvertHandleIndexToHandle((UINTN)Intermediate);
if (Handle3 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) { if (Handle3 == NULL || (UINT64)(UINTN)Intermediate != Intermediate) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex3); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"drvcfg", HandleIndex3);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1294,42 +1294,42 @@ ShellCommandRunDrvCfg (
if ((InFromFile || OutToFile) && (FileName == NULL)) { if ((InFromFile || OutToFile) && (FileName == NULL)) {
if (FileName == NULL) { if (FileName == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", InFromFile?L"-i":L"-o"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvcfg", InFromFile?L"-i":L"-o");
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_REQ), gShellDriver1HiiHandle, L"drvcfg"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_HANDLE_REQ), gShellDriver1HiiHandle, L"drvcfg");
} }
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (!UseHii && (InFromFile || OutToFile)) { if (!UseHii && (InFromFile || OutToFile)) {
if (InFromFile) { if (InFromFile) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-i"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-i");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (OutToFile) { if (OutToFile) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-o"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDriver1HiiHandle, L"drvcfg", L"-o");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
} }
if (Validate && Force) { if (Validate && Force) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-f"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-f");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (Validate && Set) { if (Validate && Set) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-s"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-v", L"-s");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (Set && Force) { if (Set && Force) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-s", L"-f"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-s", L"-f");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
if (OutToFile && InFromFile) { if (OutToFile && InFromFile) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-i", L"-o"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDriver1HiiHandle, L"drvcfg", L"-i", L"-o");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
goto Done; goto Done;
} }
@ -1365,11 +1365,11 @@ ShellCommandRunDrvCfg (
} else { } else {
if (!EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiHiiConfigAccessProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) { if (!EFI_ERROR(gBS->OpenProtocol(Handle1, &gEfiHiiConfigAccessProtocolGuid, NULL, gImageHandle, NULL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL))) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_LINE_HII), STRING_TOKEN (STR_DRVCFG_LINE_HII),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(Handle1) ConvertHandleToHandleIndex(Handle1)
); );
goto Done; goto Done;
@ -1399,7 +1399,7 @@ ShellCommandRunDrvCfg (
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_DRVCFG_NOT_SUPPORT), STRING_TOKEN (STR_DRVCFG_NOT_SUPPORT),
gShellDriver1HiiHandle, gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(Handle1) ConvertHandleToHandleIndex(Handle1)
); );
} }

View File

@ -2,7 +2,7 @@
Main file for DrvDiag shell Driver1 function. Main file for DrvDiag shell Driver1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -101,10 +101,10 @@ DoDiagnostics (
} else { } else {
DriverHandleList = GetHandleListByProtocolList(DiagGuidList); DriverHandleList = GetHandleListByProtocolList(DiagGuidList);
if (DriverHandleList == NULL) { if (DriverHandleList == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnosticsProtocolGuid", &gEfiDriverDiagnosticsProtocolGuid); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnosticsProtocolGuid", &gEfiDriverDiagnosticsProtocolGuid);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnostics2ProtocolGuid", &gEfiDriverDiagnostics2ProtocolGuid); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROTOCOL_NF), gShellDriver1HiiHandle, L"drvdiag", L"gEfiDriverDiagnostics2ProtocolGuid", &gEfiDriverDiagnostics2ProtocolGuid);
return (EFI_NOT_FOUND); return (EFI_NOT_FOUND);
} }
for (Walker = DriverHandleList ; Walker != NULL && *Walker != NULL ; DriverHandleListCount++, Walker++); for (Walker = DriverHandleList ; Walker != NULL && *Walker != NULL ; DriverHandleListCount++, Walker++);
} }
@ -150,7 +150,7 @@ DoDiagnostics (
} }
if (ControllerHandle == NULL) { if (ControllerHandle == NULL) {
PARSE_HANDLE_DATABASE_DEVICES(DriverHandleList[DriverHandleListLoop], &ControllerHandleListCount, &ControllerHandleList); PARSE_HANDLE_DATABASE_DEVICES(DriverHandleList[DriverHandleListLoop], &ControllerHandleListCount, &ControllerHandleList);
} }
if (ControllerHandleListCount == 0) { if (ControllerHandleListCount == 0) {
if (Mode == TestModeList) { if (Mode == TestModeList) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_DRIVER_NO_HANDLES), gShellDriver1HiiHandle); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DRVDIAG_DRIVER_NO_HANDLES), gShellDriver1HiiHandle);
@ -166,7 +166,7 @@ DoDiagnostics (
if (AllChilds) { if (AllChilds) {
ASSERT(ChildHandleList == NULL); ASSERT(ChildHandleList == NULL);
PARSE_HANDLE_DATABASE_MANAGED_CHILDREN( PARSE_HANDLE_DATABASE_MANAGED_CHILDREN(
DriverHandleList[DriverHandleListLoop], DriverHandleList[DriverHandleListLoop],
ControllerHandleList[ControllerHandleListLoop], ControllerHandleList[ControllerHandleListLoop],
&ChildHandleListCount, &ChildHandleListCount,
&ChildHandleList); &ChildHandleList);
@ -202,7 +202,7 @@ DoDiagnostics (
&OutBuffer); &OutBuffer);
FreePool(Language); FreePool(Language);
} }
} }
if (!Found && (Lang == NULL||(Lang!=NULL&&(Lang[2]!='-')))){ if (!Found && (Lang == NULL||(Lang!=NULL&&(Lang[2]!='-')))){
Status = gBS->OpenProtocol( Status = gBS->OpenProtocol(
DriverHandleList[DriverHandleListLoop], DriverHandleList[DriverHandleListLoop],
@ -357,7 +357,7 @@ ShellCommandRunDrvDiag (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drvdiag", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"drvdiag", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -375,7 +375,7 @@ ShellCommandRunDrvDiag (
// //
// error for too many parameters // error for too many parameters
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvdiag"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"drvdiag");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if ((ShellCommandLineGetFlag(Package, L"-s")) } else if ((ShellCommandLineGetFlag(Package, L"-s"))
|| (ShellCommandLineGetFlag(Package, L"-e")) || (ShellCommandLineGetFlag(Package, L"-e"))
@ -403,7 +403,7 @@ ShellCommandRunDrvDiag (
Lang = ShellCommandLineGetValue(Package, L"-l"); Lang = ShellCommandLineGetValue(Package, L"-l");
if (ShellCommandLineGetFlag(Package, L"-l") && Lang == NULL) { if (ShellCommandLineGetFlag(Package, L"-l") && Lang == NULL) {
ASSERT(Language == NULL); ASSERT(Language == NULL);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvdiag", L"-l"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDriver1HiiHandle, L"drvdiag", L"-l");
ShellCommandLineFreeVarList (Package); ShellCommandLineFreeVarList (Package);
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} else if (Lang != NULL) { } else if (Lang != NULL) {
@ -438,8 +438,8 @@ ShellCommandRunDrvDiag (
Mode, Mode,
Language, Language,
ShellCommandLineGetFlag(Package, L"-c"), ShellCommandLineGetFlag(Package, L"-c"),
Handle1, Handle1,
Handle2, Handle2,
Handle3 Handle3
); );

View File

@ -2,7 +2,7 @@
Main file for OpenInfo shell Driver1 function. Main file for OpenInfo shell Driver1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -126,7 +126,7 @@ TraverseHandleDatabase (
OpenInfo[OpenInfoIndex].OpenCount, OpenInfo[OpenInfoIndex].OpenCount,
OpenTypeString, OpenTypeString,
Name Name
); );
} }
} }
FreePool (OpenInfo); FreePool (OpenInfo);
@ -176,7 +176,7 @@ ShellCommandRunOpenInfo (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"openinfo", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle, L"openinfo", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -187,16 +187,16 @@ ShellCommandRunOpenInfo (
// //
// error for too many parameters // error for too many parameters
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"openinfo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"openinfo");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) == 0) { } else if (ShellCommandLineGetCount(Package) == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"openinfo"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"openinfo");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Param1 = ShellCommandLineGetRawValue(Package, 1); Param1 = ShellCommandLineGetRawValue(Package, 1);
Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE); Status = ShellConvertStringToUint64(Param1, &Intermediate, TRUE, FALSE);
if (EFI_ERROR(Status) || Param1 == NULL || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL){ if (EFI_ERROR(Status) || Param1 == NULL || ConvertHandleIndexToHandle((UINTN)Intermediate) == NULL){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
TheHandle = ConvertHandleIndexToHandle((UINTN)Intermediate); TheHandle = ConvertHandleIndexToHandle((UINTN)Intermediate);
@ -206,7 +206,7 @@ ShellCommandRunOpenInfo (
Status = TraverseHandleDatabase (TheHandle); Status = TraverseHandleDatabase (TheHandle);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"openinfo", Param1);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} }

View File

@ -1,9 +1,9 @@
/** @file /** @file
Main file for Reconnect shell Driver1 function. Main file for Reconnect shell Driver1 function.
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR> (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -29,11 +29,11 @@ VOID
ConnectAllConsoles ( ConnectAllConsoles (
VOID VOID
) )
{ {
ShellConnectFromDevPaths(L"ConInDev"); ShellConnectFromDevPaths(L"ConInDev");
ShellConnectFromDevPaths(L"ConOutDev"); ShellConnectFromDevPaths(L"ConOutDev");
ShellConnectFromDevPaths(L"ErrOutDev"); ShellConnectFromDevPaths(L"ErrOutDev");
ShellConnectFromDevPaths(L"ErrOut"); ShellConnectFromDevPaths(L"ErrOut");
ShellConnectFromDevPaths(L"ConIn"); ShellConnectFromDevPaths(L"ConIn");
ShellConnectFromDevPaths(L"ConOut"); ShellConnectFromDevPaths(L"ConOut");
@ -60,7 +60,7 @@ ShellCommandRunReconnect (
gInReconnect = TRUE; gInReconnect = TRUE;
ShellStatus = SHELL_SUCCESS; ShellStatus = SHELL_SUCCESS;
// //
// initialize the shell lib (we must be in non-auto-init...) // initialize the shell lib (we must be in non-auto-init...)
// //
@ -90,7 +90,7 @@ ShellCommandRunReconnect (
} }
ShellStatus = ShellCommandRunConnect(ImageHandle, SystemTable); ShellStatus = ShellCommandRunConnect(ImageHandle, SystemTable);
} }
} }
gInReconnect = FALSE; gInReconnect = FALSE;

View File

@ -2,7 +2,7 @@
// //
// (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP<BR> // (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP<BR>
// (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR> // (C) Copyright 2012-2015 Hewlett-Packard Development Company, L.P.<BR>
// Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR> // Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials // This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License // 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 // which accompanies this distribution. The full text of the license may be found at
@ -469,7 +469,7 @@
" CTRL - The handle number of the UEFI device\r\n" " CTRL - The handle number of the UEFI device\r\n"
" TYPE - The device type:\r\n" " TYPE - The device type:\r\n"
" [R] - Root Controller\r\n" " [R] - Root Controller\r\n"
" [B] - Bus Controller\r\n" " [B] - Bus Controller\r\n"
" [D] - Device Controller\r\n" " [D] - Device Controller\r\n"
" CFG - A managing driver supports the Driver Configuration\r\n" " CFG - A managing driver supports the Driver Configuration\r\n"
" Protocol. Yes if 'Y' or 'X'; No if 'N' or '-'.\r\n" " Protocol. Yes if 'Y' or 'X'; No if 'N' or '-'.\r\n"
@ -522,7 +522,7 @@
" 6. If only a single handle is specified and the handle has an\r\n" " 6. If only a single handle is specified and the handle has an\r\n"
" EFI_DRIVER_BINDING_PROTOCOL on it, then the handle is assumed to be a\r\n" " EFI_DRIVER_BINDING_PROTOCOL on it, then the handle is assumed to be a\r\n"
" driver handle. Otherwise, it is assumed to be a device handle.\r\n" " driver handle. Otherwise, it is assumed to be a device handle.\r\n"
" 7. If no parameters are specified, then the command will attempt to bind\r\n" " 7. If no parameters are specified, then the command will attempt to bind\r\n"
" all proper drivers to all devices without recursion. Each connection\r\n" " all proper drivers to all devices without recursion. Each connection\r\n"
" status will be displayed.\r\n" " status will be displayed.\r\n"
" 8. Output redirection is not supported for 'connect -r' usage.\r\n" " 8. Output redirection is not supported for 'connect -r' usage.\r\n"

View File

@ -2,7 +2,7 @@
Main file for Unload shell Driver1 function. Main file for Unload shell Driver1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -31,11 +31,11 @@ DumpLoadedImageProtocolInfo (
CHAR16 *TheString; CHAR16 *TheString;
TheString = GetProtocolInformationDump(TheHandle, &gEfiLoadedImageProtocolGuid, TRUE); TheString = GetProtocolInformationDump(TheHandle, &gEfiLoadedImageProtocolGuid, TRUE);
ShellPrintEx(-1, -1, L"%s", TheString); ShellPrintEx(-1, -1, L"%s", TheString);
SHELL_FREE_NON_NULL(TheString); SHELL_FREE_NON_NULL(TheString);
return (EFI_SUCCESS); return (EFI_SUCCESS);
} }
@ -86,7 +86,7 @@ ShellCommandRunUnload (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle,L"unload", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDriver1HiiHandle,L"unload", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -97,10 +97,10 @@ ShellCommandRunUnload (
// //
// error for too many parameters // error for too many parameters
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"unload"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDriver1HiiHandle, L"unload");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetCount(Package) < 2) { } else if (ShellCommandLineGetCount(Package) < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"unload"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDriver1HiiHandle, L"unload");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Param1 = ShellCommandLineGetRawValue(Package, 1); Param1 = ShellCommandLineGetRawValue(Package, 1);
@ -110,14 +110,14 @@ ShellCommandRunUnload (
} }
if (EFI_ERROR(Status) || Param1 == NULL || TheHandle == NULL){ if (EFI_ERROR(Status) || Param1 == NULL || TheHandle == NULL){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"unload", Param1); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_INV_HANDLE), gShellDriver1HiiHandle, L"unload", Param1);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
ASSERT(TheHandle != NULL); ASSERT(TheHandle != NULL);
if (ShellCommandLineGetFlag(Package, L"-v") || ShellCommandLineGetFlag(Package, L"-verbose")) { if (ShellCommandLineGetFlag(Package, L"-v") || ShellCommandLineGetFlag(Package, L"-verbose")) {
DumpLoadedImageProtocolInfo(TheHandle); DumpLoadedImageProtocolInfo(TheHandle);
} }
if (!ShellCommandLineGetFlag(Package, L"-n")) { if (!ShellCommandLineGetFlag(Package, L"-n")) {
Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_UNLOAD_CONF), gShellDriver1HiiHandle, (UINTN)TheHandle); Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_UNLOAD_CONF), gShellDriver1HiiHandle, (UINTN)TheHandle);
Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp); Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp);

View File

@ -1,7 +1,7 @@
## @file ## @file
# Provides shell install1 functions # Provides shell install1 functions
# #
# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. <BR> # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -48,4 +48,4 @@
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES
[Guids] [Guids]
gShellInstall1HiiGuid ## UNDEFINED gShellInstall1HiiGuid ## UNDEFINED

View File

@ -89,13 +89,13 @@ ShellCommandRunEndFor (
if (!Found) { if (!Found) {
CurrentScriptFile = ShellCommandGetCurrentScriptFile(); CurrentScriptFile = ShellCommandGetCurrentScriptFile();
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"For", L"For",
L"EndFor", L"EndFor",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
@ -339,13 +339,13 @@ ShellCommandRunFor (
// //
if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) { if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"EndFor", L"EndFor",
L"For", L"For",
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
@ -467,12 +467,12 @@ ShellCommandRunFor (
ArgSetWalker = ArgSet; ArgSetWalker = ArgSet;
if (ArgSetWalker[0] != L'(') { if (ArgSetWalker[0] != L'(') {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -490,11 +490,11 @@ ShellCommandRunFor (
} }
if (TempSpot == NULL) { if (TempSpot == NULL) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -505,12 +505,12 @@ ShellCommandRunFor (
} }
if (!ShellIsValidForNumber(ArgSetWalker)) { if (!ShellIsValidForNumber(ArgSetWalker)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -525,12 +525,12 @@ ShellCommandRunFor (
} }
if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){ if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -552,12 +552,12 @@ ShellCommandRunFor (
if (ArgSetWalker != NULL && *ArgSetWalker != CHAR_NULL) { if (ArgSetWalker != NULL && *ArgSetWalker != CHAR_NULL) {
if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){ if (ArgSetWalker == NULL || *ArgSetWalker == CHAR_NULL || !ShellIsValidForNumber(ArgSetWalker)){
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -572,18 +572,18 @@ ShellCommandRunFor (
if (StrStr(ArgSetWalker, L" ") != NULL) { if (StrStr(ArgSetWalker, L" ") != NULL) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile->CurrentCommand->Line); CurrentScriptFile->CurrentCommand->Line);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
} }
} }
} }
} }
@ -602,13 +602,13 @@ ShellCommandRunFor (
} }
} else { } else {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT), STRING_TOKEN (STR_GEN_PROBLEM_SCRIPT),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
ArgSet, ArgSet,
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
@ -659,14 +659,14 @@ ShellCommandRunFor (
// //
if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) { if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"EndFor", L"EndFor",
L"For", L"For",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
@ -721,14 +721,14 @@ ShellCommandRunFor (
// //
if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) { if (!MoveToTag(GetNextNode, L"endfor", L"for", NULL, CurrentScriptFile, TRUE, FALSE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"EndFor", L"EndFor",
L"For", L"For",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;

View File

@ -2,7 +2,7 @@
Main file for goto shell level 1 function. Main file for goto shell level 1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -83,14 +83,14 @@ ShellCommandRunGoto (
if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) { if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) {
CurrentScriptFile = ShellCommandGetCurrentScriptFile(); CurrentScriptFile = ShellCommandGetCurrentScriptFile();
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
CompareString, CompareString,
L"Goto", L"Goto",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;

View File

@ -2,7 +2,7 @@
Main file for If and else shell level 1 function. Main file for If and else shell level 1 function.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -335,7 +335,7 @@ TestOperation (
/** /**
Process an if statement and determine if its is valid or not. Process an if statement and determine if its is valid or not.
@param[in, out] PassingState Opon entry, the current state. Upon exit, @param[in, out] PassingState Opon entry, the current state. Upon exit,
the new state. the new state.
@param[in] StartParameterNumber The number of the first parameter of @param[in] StartParameterNumber The number of the first parameter of
this statement. this statement.
@ -346,7 +346,7 @@ TestOperation (
@param[in] ForceStringCompare TRUE for all string based, FALSE otherwise. @param[in] ForceStringCompare TRUE for all string based, FALSE otherwise.
@retval EFI_INVALID_PARAMETER A parameter was invalid. @retval EFI_INVALID_PARAMETER A parameter was invalid.
@retval EFI_SUCCESS The operation was successful. @retval EFI_SUCCESS The operation was successful.
**/ **/
EFI_STATUS EFI_STATUS
ProcessStatement ( ProcessStatement (
@ -649,9 +649,9 @@ ProcessStatement (
Break up the next part of the if statement (until the next 'and', 'or', or 'then'). Break up the next part of the if statement (until the next 'and', 'or', or 'then').
@param[in] ParameterNumber The current parameter number. @param[in] ParameterNumber The current parameter number.
@param[out] EndParameter Upon successful return, will point to the @param[out] EndParameter Upon successful return, will point to the
parameter to start the next iteration with. parameter to start the next iteration with.
@param[out] EndTag Upon successful return, will point to the @param[out] EndTag Upon successful return, will point to the
type that was found at the end of this statement. type that was found at the end of this statement.
@retval TRUE A valid statement was found. @retval TRUE A valid statement was found.
@ -837,12 +837,12 @@ ShellCommandRunIf (
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);
if (!gEfiShellProtocol->BatchIsActive()) { if (!gEfiShellProtocol->BatchIsActive()) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"if");
return (SHELL_UNSUPPORTED); return (SHELL_UNSUPPORTED);
} }
if (gEfiShellParametersProtocol->Argc < 3) { if (gEfiShellParametersProtocol->Argc < 3) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -852,14 +852,14 @@ ShellCommandRunIf (
CurrentScriptFile = ShellCommandGetCurrentScriptFile(); CurrentScriptFile = ShellCommandGetCurrentScriptFile();
if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) { if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, TRUE, TRUE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"EndIf", L"EndIf",
L"If", L"If",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
@ -920,12 +920,12 @@ ShellCommandRunIf (
// we are at the then // we are at the then
// //
if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) { if (CurrentParameter+1 != gEfiShellParametersProtocol->Argc) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TEXT_AFTER_THEN), gShellLevel1HiiHandle, L"if");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = PerformResultOperation(CurrentValue); Status = PerformResultOperation(CurrentValue);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
} }
@ -937,14 +937,14 @@ ShellCommandRunIf (
if (!BuildNextStatement(CurrentParameter, &EndParameter, &Ending)) { if (!BuildNextStatement(CurrentParameter, &EndParameter, &Ending)) {
CurrentScriptFile = ShellCommandGetCurrentScriptFile(); CurrentScriptFile = ShellCommandGetCurrentScriptFile();
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"Then", L"Then",
L"If", L"If",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
@ -963,7 +963,7 @@ ShellCommandRunIf (
if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) { if ((Ending == EndTagOr && CurrentValue) || (Ending == EndTagAnd && !CurrentValue)) {
Status = PerformResultOperation(CurrentValue); Status = PerformResultOperation(CurrentValue);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SYNTAX_AFTER_BAD), gShellLevel1HiiHandle, L"if", gEfiShellParametersProtocol->Argv[CurrentParameter]);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
break; break;
@ -1004,7 +1004,7 @@ ShellCommandRunElse (
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) { if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -1017,28 +1017,28 @@ ShellCommandRunElse (
if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"If", L"If",
L"Else", L"Else",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
} }
if (!MoveToTag(GetPreviousNode, L"if", L"else", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { if (!MoveToTag(GetPreviousNode, L"if", L"else", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"If", L"If",
L"Else", L"Else",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
@ -1046,14 +1046,14 @@ ShellCommandRunElse (
if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, FALSE, FALSE, FALSE)) { if (!MoveToTag(GetNextNode, L"endif", L"if", NULL, CurrentScriptFile, FALSE, FALSE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"EndIf", L"EndIf",
"Else", "Else",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);
@ -1082,7 +1082,7 @@ ShellCommandRunEndIf (
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
if (gEfiShellParametersProtocol->Argc > 1) { if (gEfiShellParametersProtocol->Argc > 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"if");
return (SHELL_INVALID_PARAMETER); return (SHELL_INVALID_PARAMETER);
} }
@ -1094,14 +1094,14 @@ ShellCommandRunEndIf (
CurrentScriptFile = ShellCommandGetCurrentScriptFile(); CurrentScriptFile = ShellCommandGetCurrentScriptFile();
if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) { if (!MoveToTag(GetPreviousNode, L"if", L"endif", NULL, CurrentScriptFile, FALSE, TRUE, FALSE)) {
ShellPrintHiiEx( ShellPrintHiiEx(
-1, -1,
-1, -1,
NULL, NULL,
STRING_TOKEN (STR_SYNTAX_NO_MATCHING), STRING_TOKEN (STR_SYNTAX_NO_MATCHING),
gShellLevel1HiiHandle, gShellLevel1HiiHandle,
L"If", L"If",
L"EndIf", L"EndIf",
CurrentScriptFile!=NULL CurrentScriptFile!=NULL
&& CurrentScriptFile->CurrentCommand!=NULL && CurrentScriptFile->CurrentCommand!=NULL
? CurrentScriptFile->CurrentCommand->Line:0); ? CurrentScriptFile->CurrentCommand->Line:0);
return (SHELL_DEVICE_ERROR); return (SHELL_DEVICE_ERROR);

View File

@ -2,7 +2,7 @@
Main file for Shift shell level 1 function. Main file for Shift shell level 1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -36,7 +36,7 @@ ShellCommandRunShift (
ASSERT_EFI_ERROR(Status); ASSERT_EFI_ERROR(Status);
if (!gEfiShellProtocol->BatchIsActive()) { if (!gEfiShellProtocol->BatchIsActive()) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_NO_SCRIPT), gShellLevel1HiiHandle, L"shift");
return (SHELL_UNSUPPORTED); return (SHELL_UNSUPPORTED);
} }
@ -44,7 +44,7 @@ ShellCommandRunShift (
ASSERT(CurrentScriptFile != NULL); ASSERT(CurrentScriptFile != NULL);
if (CurrentScriptFile->Argc < 2) { if (CurrentScriptFile->Argc < 2) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"shift");
return (SHELL_UNSUPPORTED); return (SHELL_UNSUPPORTED);
} }

View File

@ -2,7 +2,7 @@
Main file for stall shell level 1 function. Main file for stall shell level 1 function.
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -51,7 +51,7 @@ ShellCommandRunStall (
Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"stall", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel1HiiHandle, L"stall", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -59,20 +59,20 @@ ShellCommandRunStall (
} }
} else { } else {
if (ShellCommandLineGetRawValue(Package, 2) != NULL) { if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"stall"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel1HiiHandle, L"stall");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else if (ShellCommandLineGetRawValue(Package, 1) == NULL) { } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"stall"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel1HiiHandle, L"stall");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = ShellConvertStringToUint64(ShellCommandLineGetRawValue(Package, 1), &Intermediate, FALSE, FALSE); Status = ShellConvertStringToUint64(ShellCommandLineGetRawValue(Package, 1), &Intermediate, FALSE, FALSE);
if (EFI_ERROR(Status) || ((UINT64)(UINTN)(Intermediate)) != Intermediate) { if (EFI_ERROR(Status) || ((UINT64)(UINTN)(Intermediate)) != Intermediate) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"stall", ShellCommandLineGetRawValue(Package, 1)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel1HiiHandle, L"stall", ShellCommandLineGetRawValue(Package, 1));
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
Status = gBS->Stall((UINTN)Intermediate); Status = gBS->Stall((UINTN)Intermediate);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, L"stall"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_STALL_FAILED), gShellLevel1HiiHandle, L"stall");
ShellStatus = SHELL_DEVICE_ERROR; ShellStatus = SHELL_DEVICE_ERROR;
} }
} }

View File

@ -2,7 +2,7 @@
Main file for NULL named library for level 1 shell command functions. Main file for NULL named library for level 1 shell command functions.
(C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -103,18 +103,18 @@ ShellLevel1CommandsLibDestructor (
It functions so that count starts at 1 and it increases or decreases when it It functions so that count starts at 1 and it increases or decreases when it
hits the specified tags. when it hits zero the location has been found. hits the specified tags. when it hits zero the location has been found.
DecrementerTag and IncrementerTag are used to get around for/endfor and DecrementerTag and IncrementerTag are used to get around for/endfor and
similar paired types where the entire middle should be ignored. similar paired types where the entire middle should be ignored.
If label is used it will be used instead of the count. If label is used it will be used instead of the count.
@param[in] Function The function to use to enumerate through the @param[in] Function The function to use to enumerate through the
list. Normally GetNextNode or GetPreviousNode. list. Normally GetNextNode or GetPreviousNode.
@param[in] DecrementerTag The tag to decrement the count at. @param[in] DecrementerTag The tag to decrement the count at.
@param[in] IncrementerTag The tag to increment the count at. @param[in] IncrementerTag The tag to increment the count at.
@param[in] Label A label to look for. @param[in] Label A label to look for.
@param[in, out] ScriptFile The pointer to the current script file structure. @param[in, out] ScriptFile The pointer to the current script file structure.
@param[in] MovePast TRUE makes function return 1 past the found @param[in] MovePast TRUE makes function return 1 past the found
location. location.
@param[in] FindOnly TRUE to not change the ScriptFile. @param[in] FindOnly TRUE to not change the ScriptFile.
@param[in] CommandNode The pointer to the Node to test. @param[in] CommandNode The pointer to the Node to test.
@ -227,21 +227,21 @@ TestNodeForMove (
It functions so that count starts at 1 and it increases or decreases when it It functions so that count starts at 1 and it increases or decreases when it
hits the specified tags. when it hits zero the location has been found. hits the specified tags. when it hits zero the location has been found.
DecrementerTag and IncrementerTag are used to get around for/endfor and DecrementerTag and IncrementerTag are used to get around for/endfor and
similar paired types where the entire middle should be ignored. similar paired types where the entire middle should be ignored.
If label is used it will be used instead of the count. If label is used it will be used instead of the count.
@param[in] Function The function to use to enumerate through the @param[in] Function The function to use to enumerate through the
list. Normally GetNextNode or GetPreviousNode. list. Normally GetNextNode or GetPreviousNode.
@param[in] DecrementerTag The tag to decrement the count at. @param[in] DecrementerTag The tag to decrement the count at.
@param[in] IncrementerTag The tag to increment the count at. @param[in] IncrementerTag The tag to increment the count at.
@param[in] Label A label to look for. @param[in] Label A label to look for.
@param[in, out] ScriptFile The pointer to the current script file structure. @param[in, out] ScriptFile The pointer to the current script file structure.
@param[in] MovePast TRUE makes function return 1 past the found @param[in] MovePast TRUE makes function return 1 past the found
location. location.
@param[in] FindOnly TRUE to not change the ScriptFile. @param[in] FindOnly TRUE to not change the ScriptFile.
@param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
searching. searching.
**/ **/
BOOLEAN BOOLEAN

View File

@ -1,7 +1,7 @@
/** @file /** @file
Main file for NULL named library for level 1 shell command functions. Main file for NULL named library for level 1 shell command functions.
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -176,21 +176,21 @@ LIST_ENTRY *
It functions so that count starts at 1 and it increases or decreases when it It functions so that count starts at 1 and it increases or decreases when it
hits the specified tags. when it hits zero the location has been found. hits the specified tags. when it hits zero the location has been found.
DecrementerTag and IncrementerTag are used to get around for/endfor and DecrementerTag and IncrementerTag are used to get around for/endfor and
similar paired types where the entire middle should be ignored. similar paired types where the entire middle should be ignored.
If label is used it will be used instead of the count. If label is used it will be used instead of the count.
@param[in] Function The function to use to enumerate through the @param[in] Function The function to use to enumerate through the
list. Normally GetNextNode or GetPreviousNode. list. Normally GetNextNode or GetPreviousNode.
@param[in] DecrementerTag The tag to decrement the count at. @param[in] DecrementerTag The tag to decrement the count at.
@param[in] IncrementerTag The tag to increment the count at. @param[in] IncrementerTag The tag to increment the count at.
@param[in] Label A label to look for. @param[in] Label A label to look for.
@param[in, out] ScriptFile The pointer to the current script file structure. @param[in, out] ScriptFile The pointer to the current script file structure.
@param[in] MovePast TRUE makes function return 1 past the found @param[in] MovePast TRUE makes function return 1 past the found
location. location.
@param[in] FindOnly TRUE to not change the ScriptFile. @param[in] FindOnly TRUE to not change the ScriptFile.
@param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in @param[in] WrapAroundScript TRUE to wrap end-to-begining or vise versa in
searching. searching.
**/ **/
BOOLEAN BOOLEAN

View File

@ -2,7 +2,7 @@
Main file for attrib shell level 2 function. Main file for attrib shell level 2 function.
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR> (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -70,7 +70,7 @@ ShellCommandRunAttrib (
Status = ShellCommandLineParse (AttribParamList, &Package, &ProblemParam, TRUE); Status = ShellCommandLineParse (AttribParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"attrib", ProblemParam); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"attrib", ProblemParam);
FreePool(ProblemParam); FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
@ -133,7 +133,7 @@ ShellCommandRunAttrib (
ASSERT(ListOfFiles == NULL); ASSERT(ListOfFiles == NULL);
Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles); Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link) for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link)
@ -153,7 +153,7 @@ ShellCommandRunAttrib (
FileNode->Info->Attribute&EFI_FILE_READ_ONLY? L'R':L' ', FileNode->Info->Attribute&EFI_FILE_READ_ONLY? L'R':L' ',
FileNode->FileName FileNode->FileName
); );
if (ShellGetExecutionBreakFlag()) { if (ShellGetExecutionBreakFlag()) {
ShellStatus = SHELL_ABORTED; ShellStatus = SHELL_ABORTED;
break; break;
@ -162,7 +162,7 @@ ShellCommandRunAttrib (
Status = ShellCloseFileMetaArg(&ListOfFiles); Status = ShellCloseFileMetaArg(&ListOfFiles);
ListOfFiles = NULL; ListOfFiles = NULL;
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} // for loop for handling wildcard filenames } // for loop for handling wildcard filenames
@ -171,7 +171,7 @@ ShellCommandRunAttrib (
// //
// fail as we have conflcting params. // fail as we have conflcting params.
// //
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"attrib"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel2HiiHandle, L"attrib");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} else { } else {
// //
@ -188,7 +188,7 @@ ShellCommandRunAttrib (
// make sure we are not failing on the first one we do... if yes that's an error... // make sure we are not failing on the first one we do... if yes that's an error...
// //
if (ParamNumberCount == 1) { if (ParamNumberCount == 1) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"attrib"); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"attrib");
ShellStatus = SHELL_INVALID_PARAMETER; ShellStatus = SHELL_INVALID_PARAMETER;
} }
break; break;
@ -205,7 +205,7 @@ ShellCommandRunAttrib (
ASSERT(ListOfFiles == NULL); ASSERT(ListOfFiles == NULL);
Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles); Status = ShellOpenFileMetaArg((CHAR16*)FileName, EFI_FILE_MODE_READ, &ListOfFiles);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link) for (FileNode = (EFI_SHELL_FILE_INFO*)GetFirstNode(&ListOfFiles->Link)
@ -231,7 +231,7 @@ ShellCommandRunAttrib (
// //
Status = ShellSetFileInfo(FileNode->Handle, FileInfo); Status = ShellSetFileInfo(FileNode->Handle, FileInfo);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
} }
} }
@ -247,7 +247,7 @@ ShellCommandRunAttrib (
// //
Status = ShellSetFileInfo(FileNode->Handle, FileInfo); Status = ShellSetFileInfo(FileNode->Handle, FileInfo);
if (EFI_ERROR(Status)) {; if (EFI_ERROR(Status)) {;
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_AD), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_ACCESS_DENIED; ShellStatus = SHELL_ACCESS_DENIED;
} }
@ -256,7 +256,7 @@ ShellCommandRunAttrib (
Status = ShellCloseFileMetaArg(&ListOfFiles); Status = ShellCloseFileMetaArg(&ListOfFiles);
ListOfFiles = NULL; ListOfFiles = NULL;
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount)); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_CLOSE_FAIL), gShellLevel2HiiHandle, L"attrib", ShellCommandLineGetRawValue(Package, ParamNumberCount));
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} }
} // for loop for handling wildcard filenames } // for loop for handling wildcard filenames

Some files were not shown because too many files have changed in this diff Show More