ShellPkg: Use the new library for "bcfg" command

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Chris Phillips <chrisp@hp.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed by: Tapan Shah <tapandshah@hp.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16093 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jaben Carsey 2014-09-10 20:55:37 +00:00 committed by jcarsey
parent 7b01f0f312
commit fba9b6ba24
9 changed files with 10 additions and 2992 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
**/
#include "UefiShellDebug1CommandsLib.h"
#include <Library/BcfgCommandLib.h>
STATIC CONST CHAR16 mFileName[] = L"Debug1Commands";
EFI_HANDLE gShellDebug1HiiHandle = NULL;
@ -84,18 +85,10 @@ UefiShellDebug1CommandsLibConstructor (
ShellCommandRegisterCommandName(L"edit", ShellCommandRunEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_EDIT) );
ShellCommandRegisterCommandName(L"hexedit", ShellCommandRunHexEdit , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_HEXEDIT) );
//
// check install profile bit of the profiles mask is set
//
if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) {
ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfg , ShellCommandGetManFileNameDebug1, 0, L"Debug1", TRUE, gShellDebug1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG) );
}
ShellCommandRegisterAlias(L"dmem", L"mem");
BcfgLibraryRegisterBcfgCommand(ImageHandle, SystemTable, L"Debug1");
return (EFI_SUCCESS);
}
@ -115,6 +108,8 @@ UefiShellDebug1CommandsLibDestructor (
if (gShellDebug1HiiHandle != NULL) {
HiiRemovePackages(gShellDebug1HiiHandle);
}
BcfgLibraryUnregisterBcfgCommand(ImageHandle, SystemTable);
return (EFI_SUCCESS);
}

View File

@ -36,7 +36,6 @@
Mm.c
SetVar.c
SerMode.c
Bcfg.c
Pci.c
Pci.h
DmpStore.c
@ -115,6 +114,7 @@
UefiBootServicesTableLib
SortLib
PrintLib
BcfgCommandLib
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED

File diff suppressed because it is too large Load Diff

View File

@ -12,24 +12,7 @@
**/
#include "UefiShellInstall1CommandsLib.h"
STATIC CONST CHAR16 mFileName[] = L"ShellCommands";
EFI_HANDLE gShellInstall1HiiHandle = NULL;
/**
Function to get the filename with help context if HII will not be used.
@return The filename with help text in it.
**/
CONST CHAR16*
EFIAPI
ShellCommandGetManFileNameInstall1 (
VOID
)
{
return (mFileName);
}
#include <Library/BcfgCommandLib.h>
/**
Constructor for the Shell Level 1 Commands library.
@ -56,17 +39,7 @@ ShellInstall1CommandsLibConstructor (
return (EFI_SUCCESS);
}
gShellInstall1HiiHandle = HiiAddPackages (&gShellInstall1HiiGuid, gImageHandle, UefiShellInstall1CommandsLibStrings, NULL);
if (gShellInstall1HiiHandle == NULL) {
return (EFI_DEVICE_ERROR);
}
//
// install our shell command handlers that are always installed
//
ShellCommandRegisterCommandName(L"bcfg", ShellCommandRunBcfgInstall , ShellCommandGetManFileNameInstall1, 0, L"Install", FALSE, gShellInstall1HiiHandle, STRING_TOKEN(STR_GET_HELP_BCFG));
return (EFI_SUCCESS);
return (BcfgLibraryRegisterBcfgCommand(ImageHandle, SystemTable, L"Install1"));
}
/**
@ -82,8 +55,5 @@ ShellInstall1CommandsLibDestructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
if (gShellInstall1HiiHandle != NULL) {
HiiRemovePackages(gShellInstall1HiiHandle);
}
return (EFI_SUCCESS);
return (BcfgLibraryUnregisterBcfgCommand(ImageHandle, SystemTable));
}

View File

@ -1,59 +0,0 @@
/** @file
Main file for NULL named library for install 1 shell command functions.
Copyright (c) 2010 - 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.
**/
#ifndef _UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_
#define _UEFI_SHELL_INSTALL1_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/SortLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/HiiLib.h>
#include <Library/FileHandleLib.h>
extern EFI_HANDLE gShellInstall1HiiHandle;
/**
Function for 'bcfg' 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
ShellCommandRunBcfgInstall (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
#endif

View File

@ -24,9 +24,6 @@
[Sources.common]
UefiShellInstall1CommandsLib.c
UefiShellInstall1CommandsLib.h
UefiShellInstall1CommandsLib.uni
Bcfg.c
[Packages]
MdePkg/MdePkg.dec
@ -45,6 +42,7 @@
UefiBootServicesTableLib
SortLib
PrintLib
BcfgCommandLib
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask # ALWAYS_CONSUMED