TianoCore EDK2 master
|
#include <Uefi.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ShellLibHiiGuid.h>
#include <Protocol/Shell.h>
#include <Protocol/ShellParameters.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>
#include <Library/PrintLib.h>
#include <Library/HandleParsingLib.h>
#include <Library/DevicePathLib.h>
#include <Library/UefiBootManagerLib.h>
Go to the source code of this file.
Data Structures | |
struct | BGFG_OPERATION |
Functions | |
EFI_STATUS | UpdateOptionalData (UINT16 Index, UINTN DataSize, UINT8 *Data, IN CONST BCFG_OPERATION_TARGET Target) |
EFI_STATUS | GetBootOptionCrc (UINT32 *Crc, UINT16 BootIndex) |
EFI_STATUS | GetDevicePathForDriverHandle (IN EFI_HANDLE TheHandle, IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath) |
SHELL_STATUS | GetDevicePathByHandle (IN EFI_HANDLE TheHandle, IN BCFG_OPERATION_TARGET Target, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath) |
SHELL_STATUS | BcfgMod (IN CONST BGFG_OPERATION *BcfgOperation, IN CONST UINTN OrderCount) |
SHELL_STATUS | BcfgAdd (IN UINTN Position, IN CONST CHAR16 *File, IN CONST CHAR16 *Desc, IN CONST UINT16 *CurrentOrder, IN CONST UINTN OrderCount, IN CONST BCFG_OPERATION_TARGET Target, IN CONST BOOLEAN UseHandle, IN CONST BOOLEAN UsePath, IN CONST UINTN HandleNumber) |
SHELL_STATUS | BcfgRemove (IN CONST BCFG_OPERATION_TARGET Target, IN CONST UINT16 *CurrentOrder, IN CONST UINTN OrderCount, IN CONST UINT16 Location) |
SHELL_STATUS | BcfgMove (IN CONST BCFG_OPERATION_TARGET Target, IN CONST UINT16 *CurrentOrder, IN CONST UINTN OrderCount, IN CONST UINT16 OldLocation, IN UINT16 NewLocation) |
SHELL_STATUS | BcfgAddOpt (IN CONST CHAR16 *OptData, IN CONST UINT16 *CurrentOrder, IN CONST UINTN OrderCount, IN CONST BCFG_OPERATION_TARGET Target) |
SHELL_STATUS | BcfgDisplayDump (IN CONST CHAR16 *Op, IN CONST UINTN OrderCount, IN CONST UINT16 *CurrentOrder, IN CONST BOOLEAN VerboseOutput) |
VOID | InitBcfgStruct (IN BGFG_OPERATION *Struct) |
SHELL_STATUS EFIAPI | ShellCommandRunBcfg (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
CONST CHAR16 *EFIAPI | ShellCommandGetManFileNameBcfg (VOID) |
EFI_STATUS EFIAPI | BcfgLibraryRegisterBcfgCommand (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable, IN CONST CHAR16 *Name) |
EFI_STATUS EFIAPI | BcfgLibraryUnregisterBcfgCommand (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
STATIC CONST CHAR16 | mFileName [] = L"ShellCommands" |
STATIC EFI_HII_HANDLE | gShellBcfgHiiHandle = NULL |
STATIC CONST SHELL_PARAM_ITEM | ParamList [] |
Main file for BCFG command.
(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UefiShellBcfgCommandLib.c.
enum BCFG_OPERATION_TARGET |
Definition at line 42 of file UefiShellBcfgCommandLib.c.
enum BCFG_OPERATION_TYPE |
Definition at line 48 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgAdd | ( | IN UINTN | Position, |
IN CONST CHAR16 * | File, | ||
IN CONST CHAR16 * | Desc, | ||
IN CONST UINT16 * | CurrentOrder, | ||
IN CONST UINTN | OrderCount, | ||
IN CONST BCFG_OPERATION_TARGET | Target, | ||
IN CONST BOOLEAN | UseHandle, | ||
IN CONST BOOLEAN | UsePath, | ||
IN CONST UINTN | HandleNumber | ||
) |
Function to add a option.
[in] | Position | The position to add Target at. |
[in] | File | The file to make the target. |
[in] | Desc | The description text. |
[in] | CurrentOrder | The pointer to the current order of items. |
[in] | OrderCount | The number if items in CurrentOrder. |
[in] | Target | The info on the option to add. |
[in] | UseHandle | TRUE to use HandleNumber, FALSE to use File and Desc. |
[in] | UsePath | TRUE to convert to devicepath. |
[in] | HandleNumber | The handle number to add. |
SHELL_SUCCESS | The operation was successful. |
SHELL_INVALID_PARAMETER | A parameter was invalid. |
Definition at line 569 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgAddOpt | ( | IN CONST CHAR16 * | OptData, |
IN CONST UINT16 * | CurrentOrder, | ||
IN CONST UINTN | OrderCount, | ||
IN CONST BCFG_OPERATION_TARGET | Target | ||
) |
Function to add optional data to an option.
[in] | OptData | The optional data to add. |
[in] | CurrentOrder | The pointer to the current order of items. |
[in] | OrderCount | The number if items in CurrentOrder. |
[in] | Target | The target of the operation. |
SHELL_SUCCESS | The operation was succesful. |
Definition at line 1038 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgDisplayDump | ( | IN CONST CHAR16 * | Op, |
IN CONST UINTN | OrderCount, | ||
IN CONST UINT16 * | CurrentOrder, | ||
IN CONST BOOLEAN | VerboseOutput | ||
) |
Function to dump the Bcfg information.
[in] | Op | The operation. |
[in] | OrderCount | How many to dump. |
[in] | CurrentOrder | The pointer to the current order of items. |
[in] | VerboseOutput | TRUE for extra output. FALSE otherwise. |
SHELL_SUCCESS | The dump was successful. |
SHELL_INVALID_PARAMETER | A parameter was invalid. |
Definition at line 1352 of file UefiShellBcfgCommandLib.c.
EFI_STATUS EFIAPI BcfgLibraryRegisterBcfgCommand | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable, | ||
IN CONST CHAR16 * | Name | ||
) |
"Constructor" for the library.
This will register the handler for the bcfg command.
[in] | ImageHandle | the image handle of the process |
[in] | SystemTable | the EFI System Table pointer |
[in] | Name | the profile name to use |
EFI_SUCCESS | the shell command handlers were installed successfully |
EFI_UNSUPPORTED | the shell level required was not found. |
Definition at line 1981 of file UefiShellBcfgCommandLib.c.
EFI_STATUS EFIAPI BcfgLibraryUnregisterBcfgCommand | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Destructor for the library. free any resources.
ImageHandle | The image handle of the process. |
SystemTable | The EFI System Table pointer. |
Definition at line 2012 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgMod | ( | IN CONST BGFG_OPERATION * | BcfgOperation, |
IN CONST UINTN | OrderCount | ||
) |
Function to modify an option.
[in] | BcfgOperation | Pointer to BCFG operation. |
[in] | OrderCount | The number if items in CurrentOrder. |
SHELL_SUCCESS | The operation was successful. |
SHELL_INVALID_PARAMETER | A parameter was invalid. |
SHELL_OUT_OF_RESOUCES | A memory allocation failed. |
Definition at line 400 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgMove | ( | IN CONST BCFG_OPERATION_TARGET | Target, |
IN CONST UINT16 * | CurrentOrder, | ||
IN CONST UINTN | OrderCount, | ||
IN CONST UINT16 | OldLocation, | ||
IN UINT16 | NewLocation | ||
) |
Function to move a item to another location.
[in] | Target | The target item to move. |
[in] | CurrentOrder | The pointer to the current order of items. |
[in] | OrderCount | The number if items in CurrentOrder. |
[in] | OldLocation | The current location of the Target. |
[in] | NewLocation | The desired location of the Target. |
SHELL_SUCCESS | The operation was successful. |
SHELL_INVALID_PARAMETER | A parameter was invalid. |
Definition at line 976 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS BcfgRemove | ( | IN CONST BCFG_OPERATION_TARGET | Target, |
IN CONST UINT16 * | CurrentOrder, | ||
IN CONST UINTN | OrderCount, | ||
IN CONST UINT16 | Location | ||
) |
Function to remove an item.
[in] | Target | The target item to move. |
[in] | CurrentOrder | The pointer to the current order of items. |
[in] | OrderCount | The number if items in CurrentOrder. |
[in] | Location | The current location of the Target. |
SHELL_SUCCESS | The operation was successful. |
SHELL_INVALID_PARAMETER | A parameter was invalid. |
Definition at line 911 of file UefiShellBcfgCommandLib.c.
EFI_STATUS GetBootOptionCrc | ( | UINT32 * | Crc, |
UINT16 | BootIndex | ||
) |
This function will get a CRC for a boot option.
[in,out] | Crc | The CRC value to return. |
[in] | BootIndex | The boot option index to CRC. |
EFI_SUCCESS | The CRC was successfully returned. |
other | A error occurred. |
Definition at line 183 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS GetDevicePathByHandle | ( | IN EFI_HANDLE | TheHandle, |
IN BCFG_OPERATION_TARGET | Target, | ||
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DevicePath | ||
) |
Function to get Device Path by a handle.
[in] | TheHandle | Use it to get DevicePath. |
[in] | Target | Boot option target. |
[in,out] | DevicePath | On a successful return the device path to the handle. |
SHELL_INVALID_PARAMETER | The handle was NULL. |
SHELL_NOT_FOUND | Not found device path by handle. |
SHELL_SUCCESS | Get device path successfully. |
Definition at line 306 of file UefiShellBcfgCommandLib.c.
EFI_STATUS GetDevicePathForDriverHandle | ( | IN EFI_HANDLE | TheHandle, |
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | FilePath | ||
) |
This function will populate the device path protocol parameter based on TheHandle.
[in] | TheHandle | Driver handle. |
[in,out] | FilePath | On a successful return the device path to the handle. |
EFI_SUCCESS | The device path was successfully returned. |
other | A error from gBS->HandleProtocol. |
Definition at line 245 of file UefiShellBcfgCommandLib.c.
VOID InitBcfgStruct | ( | IN BGFG_OPERATION * | Struct | ) |
Function to initialize the BCFG operation structure.
[in] | Struct | The stuct to initialize. |
Definition at line 1491 of file UefiShellBcfgCommandLib.c.
CONST CHAR16 *EFIAPI ShellCommandGetManFileNameBcfg | ( | VOID | ) |
Function to get the filename with help context if HII will not be used.
Definition at line 1960 of file UefiShellBcfgCommandLib.c.
SHELL_STATUS EFIAPI ShellCommandRunBcfg | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Function for 'bcfg' command.
[in] | ImageHandle | Handle to the Image (NULL if Internal). |
[in] | SystemTable | Pointer to the System Table (NULL if Internal). |
Definition at line 1521 of file UefiShellBcfgCommandLib.c.
EFI_STATUS UpdateOptionalData | ( | UINT16 | Index, |
UINTN | DataSize, | ||
UINT8 * | Data, | ||
IN CONST BCFG_OPERATION_TARGET | Target | ||
) |
Update the optional data for a boot or driver option.
If optional data exists it will be changed.
[in] | Index | The boot or driver option index update. |
[in] | DataSize | The size in bytes of Data. |
[in] | Data | The buffer for the optional data. |
[in] | Target | The target of the operation. |
EFI_SUCCESS | The data was successfully updated. |
other | A error occurred. |
Definition at line 89 of file UefiShellBcfgCommandLib.c.
STATIC EFI_HII_HANDLE gShellBcfgHiiHandle = NULL |
Definition at line 40 of file UefiShellBcfgCommandLib.c.
Definition at line 39 of file UefiShellBcfgCommandLib.c.
STATIC CONST SHELL_PARAM_ITEM ParamList[] |
Definition at line 1507 of file UefiShellBcfgCommandLib.c.