diff options
author | Tian, Hot <hot.tian@intel.com> | 2014-02-26 08:47:21 +0000 |
---|---|---|
committer | hhtian <hhtian@6f19259b-4bc3-4df7-8a09-765794883524> | 2014-02-26 08:47:21 +0000 |
commit | 1ba4c8919e4bb160692a595ada040a66b709858d (patch) | |
tree | 57e3696e689d95fe4ceef8020864ca65b966085e /ShellPkg/Library/UefiShellLevel3CommandsLib | |
parent | 43f87104b17893fd6820897ddc48f8d8c963a48a (diff) | |
download | edk2-1ba4c8919e4bb160692a595ada040a66b709858d.tar.gz |
remove ShellPkg fro rebranch
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tian, Hot <hot.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2014@15266 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel3CommandsLib')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 165 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c | 132 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c | 120 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c | 96 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c | 209 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c | 105 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c | 293 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c | 328 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c | 98 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h | 162 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf | 71 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni | bin | 42738 -> 0 bytes | |||
-rw-r--r-- | ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c | 147 |
13 files changed, 0 insertions, 1926 deletions
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c deleted file mode 100644 index 1428d37a64..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c +++ /dev/null @@ -1,165 +0,0 @@ -/** @file
- Main file for Alias shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Print out each alias registered with the Shell.
-
- @retval STATUS_SUCCESS the printout was sucessful
- @return any return code from GetNextVariableName except EFI_NOT_FOUND
-**/
-SHELL_STATUS
-EFIAPI
-PrintAllShellAlias(
- VOID
- )
-{
- CONST CHAR16 *ConstAllAliasList;
- CHAR16 *Alias;
- CONST CHAR16 *Command;
- CHAR16 *Walker;
- BOOLEAN Volatile;
-
- Volatile = FALSE;
-
- ConstAllAliasList = gEfiShellProtocol->GetAlias(NULL, NULL);
- if (ConstAllAliasList == NULL) {
- return (SHELL_SUCCESS);
- }
- Alias = AllocateZeroPool(StrSize(ConstAllAliasList));
- if (Alias == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- Walker = (CHAR16*)ConstAllAliasList;
-
- do {
- CopyMem(Alias, Walker, StrSize(Walker));
- Walker = StrStr(Alias, L";");
- if (Walker != NULL) {
- Walker[0] = CHAR_NULL;
- Walker = Walker + 1;
- }
- Command = gEfiShellProtocol->GetAlias(Alias, &Volatile);
- if (ShellCommandIsOnAliasList(Alias)) {
- Volatile = FALSE;
- }
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ALIAS_OUTPUT), gShellLevel3HiiHandle, !Volatile?L' ':L'*', Alias, Command);
- } while (Walker != NULL && Walker[0] != CHAR_NULL);
-
- FreePool(Alias);
-
- return (SHELL_SUCCESS);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-v", TypeFlag},
- {L"-d", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'alias' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAlias (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
- CONST CHAR16 *Param2;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- Param2 = ShellCommandLineGetRawValue(Package, 2);
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetCount(Package) == 1) {
- //
- // print out alias'
- //
- Status = PrintAllShellAlias();
- } else if (ShellCommandLineGetFlag(Package, L"-d")) {
- //
- // delete an alias
- //
- Status = gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE);
- } else if (ShellCommandLineGetCount(Package) == 3) {
- //
- // must be adding an alias
- //
- Status = gEfiShellProtocol->SetAlias(Param2, Param1, FALSE, ShellCommandLineGetFlag(Package, L"-v"));
- if (EFI_ERROR(Status)) {
- if (Status == EFI_ACCESS_DENIED) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gShellLevel3HiiHandle);
- ShellStatus = SHELL_ACCESS_DENIED;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gShellLevel3HiiHandle, Status);
- ShellStatus = SHELL_DEVICE_ERROR;
- }
- }
- } else if (ShellCommandLineGetCount(Package) == 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c deleted file mode 100644 index 8cb1aedf43..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c +++ /dev/null @@ -1,132 +0,0 @@ -/** @file
- Main file for attrib shell level 2 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-/**
- Function for 'cls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCls (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- UINTN Background;
- UINTN ForeColor;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Param1;
-
- //
- // Initialize variables
- //
- ShellStatus = SHELL_SUCCESS;
- ProblemParam = NULL;
- Background = 0;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else {
- //
- // If there are 0 value parameters, clear sceen
- //
- Param1 = ShellCommandLineGetRawValue(Package, 1);
- if (Param1 == NULL) {
- //
- // clear screen
- //
- gST->ConOut->ClearScreen (gST->ConOut);
- } else if (ShellCommandLineGetCount(Package) > 2) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- switch (ShellStrToUintn(Param1)) {
- case 0:
- Background = EFI_BACKGROUND_BLACK;
- break;
- case 1:
- Background = EFI_BACKGROUND_BLUE;
- break;
- case 2:
- Background = EFI_BACKGROUND_GREEN;
- break;
- case 3:
- Background = EFI_BACKGROUND_CYAN;
- break;
- case 4:
- Background = EFI_BACKGROUND_RED;
- break;
- case 5:
- Background = EFI_BACKGROUND_MAGENTA;
- break;
- case 6:
- Background = EFI_BACKGROUND_BROWN;
- break;
- case 7:
- Background = EFI_BACKGROUND_LIGHTGRAY;
- break;
- }
- ForeColor = (~ShellStrToUintn(Param1)) & 0xF;
- Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background);
- ASSERT_EFI_ERROR(Status);
- Status = gST->ConOut->ClearScreen (gST->ConOut);
- ASSERT_EFI_ERROR(Status);
- }
- }
- }
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
-
- //
- // return the status
- //
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c deleted file mode 100644 index a34b2a9c84..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Echo.c +++ /dev/null @@ -1,120 +0,0 @@ -/** @file
- Main file for Echo shell level 3 function.
-
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-on", TypeFlag},
- {L"-off", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'echo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEcho (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- CHAR16 *ProblemParam;
- UINTN Size;
- CHAR16 *PrintString;
-
- Size = 0;
- ProblemParam = NULL;
- PrintString = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParseEx (ParamList, &Package, &ProblemParam, TRUE, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetFlag(Package, L"-on")) {
- //
- // Turn it on
- //
- ShellCommandSetEchoState(TRUE);
- } else if (ShellCommandLineGetFlag(Package, L"-off")) {
- //
- // turn it off
- //
- ShellCommandSetEchoState(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // output its current state
- //
- if (ShellCommandGetEchoState()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ECHO_ON), gShellLevel3HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ECHO_OFF), gShellLevel3HiiHandle);
- }
- } else {
- //
- // print the line
- //
- for ( ParamCount = 1
- ; ShellCommandLineGetRawValue(Package, ParamCount) != NULL
- ; ParamCount++
- ) {
- StrnCatGrow(&PrintString, &Size, ShellCommandLineGetRawValue(Package, ParamCount), 0);
- if (ShellCommandLineGetRawValue(Package, ParamCount+1) != NULL) {
- StrnCatGrow(&PrintString, &Size, L" ", 0);
- }
- }
- ShellPrintEx(-1, -1, L"%s\r\n", PrintString);
- SHELL_FREE_NON_NULL(PrintString);
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c deleted file mode 100644 index f1b20a13e3..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/GetMtc.c +++ /dev/null @@ -1,96 +0,0 @@ -/** @file
- Main file for GetMtc shell level 3 function.
-
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Function for 'getmtc' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGetMtc (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT64 Mtc;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the monotonic counter count
- //
- Status = gBS->GetNextMonotonicCount(&Mtc);
- if (Status == EFI_DEVICE_ERROR) {
- ShellStatus = SHELL_DEVICE_ERROR;
- } else if (Status == EFI_SECURITY_VIOLATION) {
- ShellStatus = SHELL_SECURITY_VIOLATION;
- } else if (EFI_ERROR(Status)) {
- ShellStatus = SHELL_DEVICE_ERROR;
- }
-
- //
- // print it...
- //
- if (ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GET_MTC_OUTPUT), gShellLevel3HiiHandle, Mtc);
- }
- }
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c deleted file mode 100644 index cd03ff7f07..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Help.c +++ /dev/null @@ -1,209 +0,0 @@ -/** @file
- Main file for Help shell level 3 function.
-
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-usage", TypeFlag},
- {L"-section", TypeMaxValue},
- {L"-verbose", TypeFlag},
- {L"-v", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'help' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHelp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST COMMAND_LIST *CommandList;
- CONST COMMAND_LIST *Node;
- CHAR16 *CommandToGetHelpOn;
- CHAR16 *SectionToGetHelpOn;
- CHAR16 *HiiString;
- BOOLEAN Found;
- BOOLEAN PrintCommandText;
-
- PrintCommandText = TRUE;
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- CommandToGetHelpOn = NULL;
- SectionToGetHelpOn = NULL;
- Found = FALSE;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // Check for conflicting parameters.
- //
- if (ShellCommandLineGetFlag(Package, L"-usage")
- &&ShellCommandLineGetFlag(Package, L"-section")
- &&(ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v"))
- ){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CON), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 2) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // Get the command name we are getting help on
- //
- ASSERT(CommandToGetHelpOn == NULL);
- StrnCatGrow(&CommandToGetHelpOn, NULL, ShellCommandLineGetRawValue(Package, 1), 0);
- if (CommandToGetHelpOn == NULL && ShellCommandLineGetFlag(Package, L"-?")) {
- //
- // If we dont have a command and we got a simple -?
- // we are looking for help on help command.
- //
- StrnCatGrow(&CommandToGetHelpOn, NULL, L"help", 0);
- }
-
- if (CommandToGetHelpOn == NULL) {
- StrnCatGrow(&CommandToGetHelpOn, NULL, L"*", 0);
- ASSERT(SectionToGetHelpOn == NULL);
- StrnCatGrow(&SectionToGetHelpOn, NULL, L"NAME", 0);
- } else {
- PrintCommandText = FALSE;
- ASSERT(SectionToGetHelpOn == NULL);
- //
- // Get the section name for the given command name
- //
- if (ShellCommandLineGetFlag(Package, L"-section")) {
- StrnCatGrow(&SectionToGetHelpOn, NULL, ShellCommandLineGetValue(Package, L"-section"), 0);
- } else if (ShellCommandLineGetFlag(Package, L"-usage")) {
- StrnCatGrow(&SectionToGetHelpOn, NULL, L"NAME,SYNOPSIS", 0);
- } else if (ShellCommandLineGetFlag(Package, L"-verbose") || ShellCommandLineGetFlag(Package, L"-v")) {
- } else {
- //
- // The output of help <command> will display NAME, SYNOPSIS, OPTIONS, DESCRIPTION, and EXAMPLES sections.
- //
- StrnCatGrow (&SectionToGetHelpOn, NULL, L"NAME,SYNOPSIS,OPTIONS,DESCRIPTION,EXAMPLES", 0);
- }
- }
-
- if (gUnicodeCollation->StriColl(gUnicodeCollation, CommandToGetHelpOn, L"special") == 0) {
- //
- // we need info on the special characters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_SC_HEADER), gShellLevel3HiiHandle);
- HiiString = HiiGetString(gShellLevel3HiiHandle, STRING_TOKEN(STR_HELP_SC_DATA), NULL);
- ShellPrintEx(-1, -1, L"%s", HiiString);
- FreePool(HiiString);
- Found = TRUE;
- } else {
- CommandList = ShellCommandGetCommandList(TRUE);
- ASSERT(CommandList != NULL);
- for ( Node = (COMMAND_LIST*)GetFirstNode(&CommandList->Link)
- ; CommandList != NULL && !IsListEmpty(&CommandList->Link) && !IsNull(&CommandList->Link, &Node->Link)
- ; Node = (COMMAND_LIST*)GetNextNode(&CommandList->Link, &Node->Link)
- ){
- //
- // Checking execution break flag when print multiple command help information.
- //
- if (ShellGetExecutionBreakFlag ()) {
- break;
- }
- if ((gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, CommandToGetHelpOn)) ||
- (gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL) != NULL && (gUnicodeCollation->MetaiMatch(gUnicodeCollation, Node->CommandString, (CHAR16*)(gEfiShellProtocol->GetAlias(CommandToGetHelpOn, NULL)))))) {
- //
- // We have a command to look for help on.
- //
- Status = ShellPrintHelp(Node->CommandString, SectionToGetHelpOn, PrintCommandText);
- if (Status == EFI_DEVICE_ERROR) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_INV), gShellLevel3HiiHandle, Node->CommandString);
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, Node->CommandString);
- } else {
- Found = TRUE;
- }
- }
- }
- //
- // Search the .man file for Shell applications (Shell external commands).
- //
- if (!Found) {
- Status = ShellPrintHelp(CommandToGetHelpOn, SectionToGetHelpOn, FALSE);
- if (Status == EFI_DEVICE_ERROR) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_INV), gShellLevel3HiiHandle, CommandToGetHelpOn);
- } else if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_NF), gShellLevel3HiiHandle, CommandToGetHelpOn);
- } else {
- Found = TRUE;
- }
- }
- }
-
- if (!Found) {
- ShellStatus = SHELL_NOT_FOUND;
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
- }
-
- if (CommandToGetHelpOn != NULL && StrCmp(CommandToGetHelpOn, L"*") == 0){
- //
- // If '*' then the command entered was 'Help' without qualifiers, This footer
- // provides additional info on help switches
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_HELP_FOOTER), gShellLevel3HiiHandle);
- }
- if (CommandToGetHelpOn != NULL) {
- FreePool(CommandToGetHelpOn);
- }
- if (SectionToGetHelpOn != NULL) {
- FreePool(SectionToGetHelpOn);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c deleted file mode 100644 index bedd591c0d..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Pause.c +++ /dev/null @@ -1,105 +0,0 @@ -/** @file
- Main file for Pause shell level 3 function.
-
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-q", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'pause' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPause (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- SHELL_PROMPT_RESPONSE *Resp;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- if (!gEfiShellProtocol->BatchIsActive()) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_SCRIPT_ONLY), gShellLevel3HiiHandle);
- return (SHELL_UNSUPPORTED);
- }
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- } else if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (!ShellCommandLineGetFlag(Package, L"-q")) {
- Status = ShellPromptForResponseHii(ShellPromptResponseTypeQuitContinue, STRING_TOKEN (STR_PAUSE_PROMPT), gShellLevel3HiiHandle, (VOID**)&Resp);
- } else {
- Status = ShellPromptForResponse(ShellPromptResponseTypeQuitContinue, NULL, (VOID**)&Resp);
- }
-
- if (EFI_ERROR(Status) || Resp == NULL || *Resp == ShellPromptResponseQuit) {
- ShellCommandRegisterExit(TRUE, 0);
- ShellStatus = SHELL_ABORTED;
- }
-
- if (Resp != NULL) {
- FreePool(Resp);
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c deleted file mode 100644 index f5e27ef1a9..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c +++ /dev/null @@ -1,293 +0,0 @@ -/** @file
- Main file for Touch shell level 3 function.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Do the touch operation on a single handle.
-
- @param[in] Handle The handle to update the date/time on.
-
- @retval EFI_ACCESS_DENIED The file referenced by Handle is read only.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-TouchFileByHandle (
- IN EFI_HANDLE Handle
- )
-{
- EFI_STATUS Status;
- EFI_FILE_INFO *FileInfo;
-
- FileInfo = gEfiShellProtocol->GetFileInfo(Handle);
- if ((FileInfo->Attribute & EFI_FILE_READ_ONLY) != 0){
- return (EFI_ACCESS_DENIED);
- }
- Status = gRT->GetTime(&FileInfo->ModificationTime, NULL);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"gRT->GetTime", Status);
- return (SHELL_DEVICE_ERROR);
- }
-
- CopyMem(&FileInfo->LastAccessTime, &FileInfo->ModificationTime, sizeof(EFI_TIME));
-
- Status = gEfiShellProtocol->SetFileInfo(Handle, FileInfo);
-
- FreePool(FileInfo);
-
- return (Status);
-}
-
-/**
- Touch a given file and potantially recurse down if it was a directory.
-
- @param[in] Name The name of this file.
- @param[in] FS The name of the file system this file is on.
- @param[in] Handle The handle of this file already opened.
- @param[in] Rec TRUE to recurse if possible.
-
- @retval EFI_INVALID_PARAMETER A parameter was invalid.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-DoTouchByHandle (
- IN CONST CHAR16 *Name,
- IN CHAR16 *FS,
- IN SHELL_FILE_HANDLE Handle,
- IN BOOLEAN Rec
- )
-{
- EFI_STATUS Status;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Walker;
- CHAR16 *TempSpot;
-
- Status = EFI_SUCCESS;
- FileList = NULL;
- Walker = NULL;
-
- if (FS == NULL) {
- FS = StrnCatGrow(&FS, NULL, Name, 0);
- if (FS != NULL) {
- TempSpot = StrStr(FS, L"\\");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
- }
- }
- }
- if (FS == NULL) {
- return (EFI_INVALID_PARAMETER);
- }
-
- //
- // do it
- //
- Status = TouchFileByHandle(Handle);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Name, Status);
- return (Status);
- }
-
- //
- // if it's a directory recurse...
- //
- if (FileHandleIsDirectory(Handle) == EFI_SUCCESS && Rec) {
- //
- // get each file under this directory
- //
- if (EFI_ERROR(gEfiShellProtocol->FindFilesInDir(Handle, &FileList))) {
- Status = EFI_INVALID_PARAMETER;
- }
-
- //
- // recurse on each
- //
- for (Walker = (EFI_SHELL_FILE_INFO *)GetFirstNode(&FileList->Link)
- ; FileList != NULL && !IsNull(&FileList->Link, &Walker->Link) && !EFI_ERROR(Status)
- ; Walker = (EFI_SHELL_FILE_INFO *)GetNextNode(&FileList->Link, &Walker->Link)
- ){
- if ( (StrCmp(Walker->FileName, L".") != 0)
- && (StrCmp(Walker->FileName, L"..") != 0)
- ){
- //
- // Open the file since we need that handle.
- //
- Status = gEfiShellProtocol->OpenFileByName (Walker->FullName, &Walker->Handle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Walker->FullName, Status);
- Status = EFI_ACCESS_DENIED;
- } else {
- Status = DoTouchByHandle(Walker->FullName, FS, Walker->Handle, TRUE);
- gEfiShellProtocol->CloseFile(Walker->Handle);
- Walker->Handle = NULL;
- }
- }
- }
-
- //
- // free stuff
- //
- if (FileList != NULL && EFI_ERROR(gEfiShellProtocol->FreeFileList(&FileList))) {
- Status = EFI_INVALID_PARAMETER;
- }
- }
-
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-r", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'touch' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTouch (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Param;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Node;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, (CHAR16*)Param);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
- //
- // make sure we completed the param parsing sucessfully...
- // Also make sure that any previous action was sucessful
- //
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // check that we have at least 1 file
- //
- if (FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
- continue;
- } else {
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
- //
- // make sure the file opened ok
- //
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- Status = DoTouchByHandle(Node->FullName, NULL, Node->Handle, ShellCommandLineGetFlag(Package, L"-r"));
- if (EFI_ERROR(Status) && Status != EFI_ACCESS_DENIED) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Status);
- ShellStatus = SHELL_NOT_FOUND;
- }
- }
- }
- }
- //
- // Free the fileList
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- ASSERT_EFI_ERROR(Status);
- }
- FileList = NULL;
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c deleted file mode 100644 index dffefd1234..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c +++ /dev/null @@ -1,328 +0,0 @@ -/** @file
- Main file for Type shell level 3 function.
-
- Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-/**
- Display a single file to StdOut.
-
- If both Ascii and UCS2 are FALSE attempt to discover the file type.
-
- @param[in] Handle The handle to the file to display.
- @param[in] Ascii TRUE to force ASCII, FALSE othewise.
- @param[in] UCS2 TRUE to force UCS2, FALSE othewise.
-
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
- @retval EFI_SUCCESS The operation was successful.
-**/
-EFI_STATUS
-EFIAPI
-TypeFileByHandle (
- IN SHELL_FILE_HANDLE Handle,
- IN BOOLEAN Ascii,
- IN BOOLEAN UCS2
- )
-{
- UINTN ReadSize;
- VOID *Buffer;
- VOID *AllocatedBuffer;
- EFI_STATUS Status;
- UINTN LoopVar;
- UINTN LoopSize;
- CHAR16 AsciiChar;
- CHAR16 Ucs2Char;
-
- ReadSize = PcdGet32(PcdShellFileOperationSize);
- AllocatedBuffer = AllocateZeroPool(ReadSize);
- if (AllocatedBuffer == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
-
- Status = ShellSetFilePosition(Handle, 0);
- ASSERT_EFI_ERROR(Status);
-
- while (ReadSize == ((UINTN)PcdGet32(PcdShellFileOperationSize))) {
- Buffer = AllocatedBuffer;
- ZeroMem(Buffer, ReadSize);
- Status = ShellReadFile(Handle, &ReadSize, Buffer);
- if (EFI_ERROR(Status)){
- break;
- }
-
- if (!(Ascii|UCS2)) {
- if (*(UINT16*)Buffer == gUnicodeFileTag) {
- UCS2 = TRUE;
- } else {
- Ascii = TRUE;
- }
- }
-
- if (Ascii) {
- LoopSize = ReadSize;
- for (LoopVar = 0 ; LoopVar < LoopSize ; LoopVar++) {
- //
- // The valid range of ASCII characters is 0x20-0x7E.
- // Display "." when there is an invalid character.
- //
- AsciiChar = CHAR_NULL;
- AsciiChar = ((CHAR8*)Buffer)[LoopVar];
- if (AsciiChar == '\r' || AsciiChar == '\n') {
- //
- // Allow Line Feed (LF) (0xA) & Carriage Return (CR) (0xD)
- // characters to be displayed as is.
- //
- if (AsciiChar == '\n' && ((CHAR8*)Buffer)[LoopVar-1] != '\r') {
- //
- // In case Line Feed (0xA) is encountered & Carriage Return (0xD)
- // was not the previous character, print CR and LF. This is because
- // Shell 2.0 requires carriage return with line feed for displaying
- // each new line from left.
- //
- ShellPrintEx (-1, -1, L"\r\n");
- continue;
- }
- } else {
- //
- // For all other characters which are not printable, display '.'
- //
- if (AsciiChar < 0x20 || AsciiChar >= 0x7F) {
- AsciiChar = '.';
- }
- }
- ShellPrintEx (-1, -1, L"%c", AsciiChar);
- }
- } else {
- if (*(UINT16*)Buffer == gUnicodeFileTag) {
- //
- // For unicode files, skip displaying the byte order marker.
- //
- Buffer = ((UINT16*)Buffer) + 1;
- LoopSize = (ReadSize / (sizeof (CHAR16))) - 1;
- } else {
- LoopSize = ReadSize / (sizeof (CHAR16));
- }
-
- for (LoopVar = 0 ; LoopVar < LoopSize ; LoopVar++) {
- //
- // An invalid range of characters is 0x0-0x1F.
- // Display "." when there is an invalid character.
- //
- Ucs2Char = CHAR_NULL;
- Ucs2Char = ((CHAR16*)Buffer)[LoopVar];
- if (Ucs2Char == '\r' || Ucs2Char == '\n') {
- //
- // Allow Line Feed (LF) (0xA) & Carriage Return (CR) (0xD)
- // characters to be displayed as is.
- //
- if (Ucs2Char == '\n' && ((CHAR16*)Buffer)[LoopVar-1] != '\r') {
- //
- // In case Line Feed (0xA) is encountered & Carriage Return (0xD)
- // was not the previous character, print CR and LF. This is because
- // Shell 2.0 requires carriage return with line feed for displaying
- // each new line from left.
- //
- ShellPrintEx (-1, -1, L"\r\n");
- continue;
- }
- }
- else if (Ucs2Char < 0x20) {
- //
- // For all other characters which are not printable, display '.'
- //
- Ucs2Char = L'.';
- }
- ShellPrintEx (-1, -1, L"%c", Ucs2Char);
- }
- }
-
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
- }
- FreePool (AllocatedBuffer);
- ShellPrintEx (-1, -1, L"\r\n");
- return (Status);
-}
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-a", TypeFlag},
- {L"-u", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'type' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunType (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- CONST CHAR16 *Param;
- SHELL_STATUS ShellStatus;
- UINTN ParamCount;
- EFI_SHELL_FILE_INFO *FileList;
- EFI_SHELL_FILE_INFO *Node;
- BOOLEAN AsciiMode;
- BOOLEAN UnicodeMode;
-
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
- ParamCount = 0;
- FileList = NULL;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- AsciiMode = ShellCommandLineGetFlag(Package, L"-a");
- UnicodeMode = ShellCommandLineGetFlag(Package, L"-u");
-
- if (AsciiMode && UnicodeMode) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"-a & -u");
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else if (ShellCommandLineGetRawValue(Package, 1) == NULL) {
- //
- // we insufficient parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- //
- // get a list with each file specified by parameters
- // if parameter is a directory then add all the files below it to the list
- //
- for ( ParamCount = 1, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ; Param != NULL
- ; ParamCount++, Param = ShellCommandLineGetRawValue(Package, ParamCount)
- ){
- Status = ShellOpenFileMetaArg((CHAR16*)Param, EFI_FILE_MODE_READ, &FileList);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellLevel3HiiHandle, (CHAR16*)Param);
- ShellStatus = SHELL_NOT_FOUND;
- break;
- }
- //
- // make sure we completed the param parsing sucessfully...
- // Also make sure that any previous action was sucessful
- //
- if (ShellStatus == SHELL_SUCCESS) {
- //
- // check that we have at least 1 file
- //
- if (FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel3HiiHandle, Param);
- continue;
- } else {
- //
- // loop through the list and make sure we are not aborting...
- //
- for ( Node = (EFI_SHELL_FILE_INFO*)GetFirstNode(&FileList->Link)
- ; !IsNull(&FileList->Link, &Node->Link) && !ShellGetExecutionBreakFlag()
- ; Node = (EFI_SHELL_FILE_INFO*)GetNextNode(&FileList->Link, &Node->Link)
- ){
-
- if (ShellGetExecutionBreakFlag()) {
- break;
- }
-
- //
- // make sure the file opened ok
- //
- if (EFI_ERROR(Node->Status)){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NO_OPEN), gShellLevel3HiiHandle, Node->FileName, Node->Status);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- //
- // make sure its not a directory
- //
- if (FileHandleIsDirectory(Node->Handle) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_IS_DIR), gShellLevel3HiiHandle, Node->FileName);
- ShellStatus = SHELL_NOT_FOUND;
- continue;
- }
-
- //
- // do it
- //
- Status = TypeFileByHandle (Node->Handle, AsciiMode, UnicodeMode);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_TYP_ERROR), gShellLevel3HiiHandle, Node->FileName, Status);
- ShellStatus = SHELL_INVALID_PARAMETER;
- }
- ASSERT(ShellStatus == SHELL_SUCCESS);
- }
- }
- }
- //
- // Free the fileList
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- Status = ShellCloseFileMetaArg(&FileList);
- }
- ASSERT_EFI_ERROR(Status);
- FileList = NULL;
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- if (ShellGetExecutionBreakFlag()) {
- return (SHELL_ABORTED);
- }
-
- return (ShellStatus);
-}
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c deleted file mode 100644 index e784872d63..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.c +++ /dev/null @@ -1,98 +0,0 @@ -/** @file
- Main file for NULL named library for level 3 shell command functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include "UefiShellLevel3CommandsLib.h"
-
-CONST CHAR16 gShellLevel3FileName[] = L"ShellCommands";
-EFI_HANDLE gShellLevel3HiiHandle = NULL;
-
-/**
- return the filename to get help from is not using HII.
-
- @retval The filename.
-**/
-CONST CHAR16*
-EFIAPI
-ShellCommandGetManFileNameLevel3 (
- VOID
- )
-{
- return (gShellLevel3FileName);
-}
-
-/**
- Constructor for the Shell Level 3 Commands library.
-
- Install the handlers for level 3 UEFI Shell 2.0 commands.
-
- @param ImageHandle the image handle of the process
- @param SystemTable the EFI System Table pointer
-
- @retval EFI_SUCCESS the shell command handlers were installed sucessfully
- @retval EFI_UNSUPPORTED the shell level required was not found.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel3CommandsLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- gShellLevel3HiiHandle = NULL;
- //
- // if shell level is less than 3 do nothing
- //
- if (PcdGet8(PcdShellSupportLevel) < 3) {
- return (EFI_SUCCESS);
- }
-
- gShellLevel3HiiHandle = HiiAddPackages (&gShellLevel3HiiGuid, gImageHandle, UefiShellLevel3CommandsLibStrings, NULL);
- if (gShellLevel3HiiHandle == NULL) {
- return (EFI_DEVICE_ERROR);
- }
- //
- // install our shell command handlers that are always installed
- //
- // Note: that Time, Timezone, and Date are part of level 2 library
- //
- ShellCommandRegisterCommandName(L"type", ShellCommandRunType , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_TYPE));
- ShellCommandRegisterCommandName(L"touch", ShellCommandRunTouch , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_TOUCH));
- ShellCommandRegisterCommandName(L"ver", ShellCommandRunVer , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_VER));
- ShellCommandRegisterCommandName(L"alias", ShellCommandRunAlias , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_ALIAS));
- ShellCommandRegisterCommandName(L"cls", ShellCommandRunCls , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_CLS));
- ShellCommandRegisterCommandName(L"echo", ShellCommandRunEcho , ShellCommandGetManFileNameLevel3, 3, L"", FALSE, gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_ECHO));
- ShellCommandRegisterCommandName(L"pause", ShellCommandRunPause , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_PAUSE));
- ShellCommandRegisterCommandName(L"getmtc", ShellCommandRunGetMtc , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_GETMTC));
- ShellCommandRegisterCommandName(L"help", ShellCommandRunHelp , ShellCommandGetManFileNameLevel3, 3, L"", TRUE , gShellLevel3HiiHandle, STRING_TOKEN(STR_GET_HELP_HELP));
-
- return (EFI_SUCCESS);
-}
-
-/**
- Destructor for the library. free any resources.
-
- @param ImageHandle The image handle of the process.
- @param SystemTable The EFI System Table pointer.
-**/
-EFI_STATUS
-EFIAPI
-ShellLevel3CommandsLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- if (gShellLevel3HiiHandle != NULL) {
- HiiRemovePackages(gShellLevel3HiiHandle);
- }
- return (EFI_SUCCESS);
-}
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h deleted file mode 100644 index bd5b9bec9c..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h +++ /dev/null @@ -1,162 +0,0 @@ -/** @file
- header file for NULL named library for level 3 shell command functions.
-
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
-#define _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
-
-#include <Uefi.h>
-#include <ShellBase.h>
-
-#include <Guid/ShellLibHiiGuid.h>
-
-#include <Protocol/EfiShell.h>
-#include <Protocol/EfiShellParameters.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/UnicodeCollation.h>
-
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/ShellCommandLib.h>
-#include <Library/ShellLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/FileHandleLib.h>
-
-extern EFI_HANDLE gShellLevel3HiiHandle;
-
-/**
- Function for 'type' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunType (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'touch' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunTouch (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'ver' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVer (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'alias' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunAlias (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'cls' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunCls (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'echo' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunEcho (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'pause' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunPause (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'getmtc' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunGetMtc (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Function for 'help' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunHelp (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-#endif
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf deleted file mode 100644 index 7316750fd8..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf +++ /dev/null @@ -1,71 +0,0 @@ -## @file
-# Provides shell level 3 functions
-# Note that the interactive versions of the time, date, and timezone functions are handled in the level 2 library.
-#
-# Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2009-2011, Intel Corporation. All rights reserved. <BR>
-#
-# This program and the accompanying materials
-# are licensed and made available under the terms and conditions of the BSD License
-# which accompanies this distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = UefiShellLevel3CommandsLib
- FILE_GUID = 71374B42-85D7-4753-AD17-AA84C3A0EB93
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
- CONSTRUCTOR = ShellLevel3CommandsLibConstructor
- DESTRUCTOR = ShellLevel3CommandsLibDestructor
-
-[Sources.common]
-# note that time, timezone, and date are part of the level 2 library
- Type.c
- Touch.c
- Ver.c
- UefiShellLevel3CommandsLib.uni
- UefiShellLevel3CommandsLib.c
- UefiShellLevel3CommandsLib.h
- Cls.c
- Alias.c
- Echo.c
- Pause.c
- GetMtc.c
- Help.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- MemoryAllocationLib
- BaseLib
- BaseMemoryLib
- DebugLib
- ShellCommandLib
- ShellLib
- UefiLib
- UefiRuntimeServicesTableLib
- UefiBootServicesTableLib
- PcdLib
- HiiLib
- FileHandleLib
-
-[Guids]
- gEfiFileInfoGuid
- gShellLevel3HiiGuid
-
-[Pcd.common]
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel
- gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize
- gEfiShellPkgTokenSpaceGuid.PcdShellSupplier
-
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni Binary files differdeleted file mode 100644 index 1a52329917..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.uni +++ /dev/null diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c deleted file mode 100644 index 765a6a3aba..0000000000 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Ver.c +++ /dev/null @@ -1,147 +0,0 @@ -/** @file
- Main file for Ver shell level 3 function.
-
- Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "UefiShellLevel3CommandsLib.h"
-
-#include <Library/ShellLib.h>
-
-STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
- {L"-s", TypeFlag},
- {L"-terse", TypeFlag},
- {L"-t", TypeFlag},
- {L"-_pa", TypeFlag},
- {NULL, TypeMax}
- };
-
-/**
- Function for 'ver' command.
-
- @param[in] ImageHandle Handle to the Image (NULL if Internal).
- @param[in] SystemTable Pointer to the System Table (NULL if Internal).
-**/
-SHELL_STATUS
-EFIAPI
-ShellCommandRunVer (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- UINT8 Level;
-
- Level = PcdGet8(PcdShellSupportLevel);
- ProblemParam = NULL;
- ShellStatus = SHELL_SUCCESS;
-
- //
- // initialize the shell lib (we must be in non-auto-init...)
- //
- Status = ShellInitialize();
- ASSERT_EFI_ERROR(Status);
-
- Status = CommandInit();
- ASSERT_EFI_ERROR(Status);
-
- //
- // parse the command line
- //
- Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);
- FreePool(ProblemParam);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- ASSERT(FALSE);
- }
- } else {
- //
- // check for "-?"
- //
- if (ShellCommandLineGetFlag(Package, L"-?")) {
- ASSERT(FALSE);
- }
- if (ShellCommandLineGetRawValue(Package, 1) != NULL) {
- //
- // we have too many parameters
- //
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);
- ShellStatus = SHELL_INVALID_PARAMETER;
- } else {
- if (ShellCommandLineGetFlag(Package, L"-s")) {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SIMPLE),
- gShellLevel3HiiHandle,
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion
- );
- } else {
- ShellPrintHiiEx (
- 0,
- gST->ConOut->Mode->CursorRow,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SHELL),
- gShellLevel3HiiHandle,
- SupportLevel[Level],
- gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion
- );
- if (!ShellCommandLineGetFlag(Package, L"-terse") && !ShellCommandLineGetFlag(Package, L"-t")){
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_SUPPLIER),
- gShellLevel3HiiHandle,
- (CHAR16 *) PcdGetPtr (PcdShellSupplier)
- );
-
-
- ShellPrintHiiEx (
- -1,
- -1,
- NULL,
- STRING_TOKEN (STR_VER_OUTPUT_UEFI),
- gShellLevel3HiiHandle,
- (gST->Hdr.Revision&0xffff0000)>>16,
- (gST->Hdr.Revision&0x0000ffff),
- gST->FirmwareVendor,
- gST->FirmwareRevision
- );
- }
- }
- //
- // implementation specific support for displaying processor architecture
- //
- if (ShellCommandLineGetFlag(Package, L"-_pa")) {
- ShellPrintEx(-1, -1, L"%d\r\n", sizeof(UINTN)==sizeof(UINT64)?64:32);
- }
- }
-
- //
- // free the command line package
- //
- ShellCommandLineFreeVarList (Package);
- }
-
- return (ShellStatus);
-}
-
|