TianoCore EDK2 master
Loading...
Searching...
No Matches
DmpStore.c File Reference

Go to the source code of this file.

Data Structures

struct  DMP_STORE_VARIABLE
 

Macros

#define DMP_STORE_VARIABLE_SIGNATURE   SIGNATURE_32 ('_', 'd', 's', 's')
 

Enumerations

enum  DMP_STORE_TYPE { DmpStoreDisplay , DmpStoreDelete , DmpStoreSave , DmpStoreLoad }
 

Functions

CHAR16 * GetAttrType (IN CONST UINT32 Atts)
 
CHAR16 * BinaryToHexString (IN VOID *Buffer, IN UINTN BufferSize, IN OUT CHAR16 *HexString, IN UINTN HexStringSize)
 
SHELL_STATUS LoadVariablesFromFile (IN SHELL_FILE_HANDLE FileHandle, IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, OUT BOOLEAN *Found)
 
EFI_STATUS AppendSingleVariableToFile (IN SHELL_FILE_HANDLE FileHandle, IN CONST CHAR16 *Name, IN CONST EFI_GUID *Guid, IN UINT32 Attributes, IN UINT32 DataSize, IN CONST UINT8 *Data)
 
SHELL_STATUS CascadeProcessVariables (IN CONST CHAR16 *Name OPTIONAL, IN CONST EFI_GUID *Guid OPTIONAL, IN DMP_STORE_TYPE Type, IN EFI_FILE_PROTOCOL *FileHandle OPTIONAL, IN CONST CHAR16 *CONST PrevName, IN EFI_GUID FoundVarGuid, IN BOOLEAN *FoundOne, IN BOOLEAN StandardFormatOutput)
 
SHELL_STATUS ProcessVariables (IN CONST CHAR16 *Name OPTIONAL, IN CONST EFI_GUID *Guid OPTIONAL, IN DMP_STORE_TYPE Type, IN SHELL_FILE_HANDLE FileHandle OPTIONAL, IN BOOLEAN StandardFormatOutput)
 
SHELL_STATUS EFIAPI ShellCommandRunDmpStore (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC CONST SHELL_PARAM_ITEM ParamList []
 

Detailed Description

Main file for DmpStore shell Debug1 function.

(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DmpStore.c.

Macro Definition Documentation

◆ DMP_STORE_VARIABLE_SIGNATURE

#define DMP_STORE_VARIABLE_SIGNATURE   SIGNATURE_32 ('_', 'd', 's', 's')

Definition at line 29 of file DmpStore.c.

Enumeration Type Documentation

◆ DMP_STORE_TYPE

enum DMP_STORE_TYPE

Definition at line 12 of file DmpStore.c.

Function Documentation

◆ AppendSingleVariableToFile()

EFI_STATUS AppendSingleVariableToFile ( IN SHELL_FILE_HANDLE  FileHandle,
IN CONST CHAR16 *  Name,
IN CONST EFI_GUID Guid,
IN UINT32  Attributes,
IN UINT32  DataSize,
IN CONST UINT8 *  Data 
)

Append one variable to file.

Parameters
[in]FileHandleThe file to be appended.
[in]NameThe variable name.
[in]GuidThe variable GUID.
[in]AttributesThe variable attributes.
[in]DataSizeThe variable data size.
[in]DataThe variable data.
Return values
EFI_OUT_OF_RESOURCESThere is not enough memory to perform the operation.
EFI_SUCCESSThe variable is appended to file successfully.
othersFailed to append the variable to file.

Definition at line 314 of file DmpStore.c.

◆ BinaryToHexString()

CHAR16 * BinaryToHexString ( IN VOID *  Buffer,
IN UINTN  BufferSize,
IN OUT CHAR16 *  HexString,
IN UINTN  HexStringSize 
)

Convert binary to hex format string.

Parameters
[in]BufferThe binary data.
[in]BufferSizeThe size in bytes of the binary data.
[in,out]HexStringHex format string.
[in]HexStringSizeThe size in bytes of the string.
Returns
The hex format string.

Definition at line 93 of file DmpStore.c.

◆ CascadeProcessVariables()

SHELL_STATUS CascadeProcessVariables ( IN CONST CHAR16 *Name  OPTIONAL,
IN CONST EFI_GUID *Guid  OPTIONAL,
IN DMP_STORE_TYPE  Type,
IN EFI_FILE_PROTOCOL *FileHandle  OPTIONAL,
IN CONST CHAR16 *CONST  PrevName,
IN EFI_GUID  FoundVarGuid,
IN BOOLEAN *  FoundOne,
IN BOOLEAN  StandardFormatOutput 
)

Recursive function to display or delete variables.

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.

This is necessary since once a delete happens GetNextVariableName() will work.

Parameters
[in]NameThe variable name of the EFI variable (or NULL).
[in]GuidThe GUID of the variable set (or NULL).
[in]TypeThe operation type.
[in]FileHandleThe file to operate on (or NULL).
[in]PrevNameThe previous variable name from GetNextVariableName. L"" to start.
[in]FoundVarGuidThe previous GUID from GetNextVariableName. ignored at start.
[in]FoundOneIf a VariableName or Guid was specified and one was printed or deleted, then set this to TRUE, otherwise ignored.
[in]StandardFormatOutputTRUE indicates Standard-Format Output.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_OUT_OF_RESOURCESA memorty allocation failed.
SHELL_ABORTEDThe abort message was received.
SHELL_DEVICE_ERRORUEFI Variable Services returned an error.
SHELL_NOT_FOUNDthe Name/Guid pair could not be found.

Definition at line 417 of file DmpStore.c.

◆ GetAttrType()

CHAR16 * GetAttrType ( IN CONST UINT32  Atts)

Base on the input attribute value to return the attribute string.

Parameters
[in]AttsThe input attribute value
Return values
Theattribute string info.

Definition at line 39 of file DmpStore.c.

◆ LoadVariablesFromFile()

SHELL_STATUS LoadVariablesFromFile ( IN SHELL_FILE_HANDLE  FileHandle,
IN CONST CHAR16 *  Name,
IN CONST EFI_GUID Guid,
OUT BOOLEAN *  Found 
)

Load the variable data from file and set to variable data base.

Parameters
[in]FileHandleThe file to be read.
[in]NameThe name of the variables to be loaded.
[in]GuidThe guid of the variables to be loaded.
[out]FoundTRUE when at least one variable was loaded and set.
Return values
SHELL_DEVICE_ERRORCannot access the file.
SHELL_VOLUME_CORRUPTEDThe file is in bad format.
SHELL_OUT_OF_RESOURCESThere is not enough memory to perform the operation.
SHELL_SUCCESSSuccessfully load and set the variables.

Definition at line 133 of file DmpStore.c.

◆ ProcessVariables()

SHELL_STATUS ProcessVariables ( IN CONST CHAR16 *Name  OPTIONAL,
IN CONST EFI_GUID *Guid  OPTIONAL,
IN DMP_STORE_TYPE  Type,
IN SHELL_FILE_HANDLE FileHandle  OPTIONAL,
IN BOOLEAN  StandardFormatOutput 
)

Function to display or delete variables. This will set up and call into the recursive function.

Parameters
[in]NameThe variable name of the EFI variable (or NULL).
[in]GuidThe GUID of the variable set (or NULL).
[in]TypeThe operation type.
[in]FileHandleThe file to save or load variables.
[in]StandardFormatOutputTRUE indicates Standard-Format Output.
Return values
SHELL_SUCCESSThe operation was successful.
SHELL_OUT_OF_RESOURCESA memorty allocation failed.
SHELL_ABORTEDThe abort message was received.
SHELL_DEVICE_ERRORUEFI Variable Services returned an error.
SHELL_NOT_FOUNDthe Name/Guid pair could not be found.

Definition at line 671 of file DmpStore.c.

◆ ShellCommandRunDmpStore()

SHELL_STATUS EFIAPI ShellCommandRunDmpStore ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Function for 'dmpstore' command.

Parameters
[in]ImageHandleHandle to the Image (NULL if Internal).
[in]SystemTablePointer to the System Table (NULL if Internal).

Definition at line 747 of file DmpStore.c.

Variable Documentation

◆ ParamList

Initial value:
= {
{ L"-d", TypeFlag },
{ L"-l", TypeValue },
{ L"-s", TypeValue },
{ L"-all", TypeFlag },
{ L"-guid", TypeValue },
{ L"-sfo", TypeFlag },
{ NULL, TypeMax }
}
#define NULL
Definition: Base.h:319
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
Definition: ShellLib.h:700
@ TypeFlag
A flag that is present or not present only (IE "-a").
Definition: ShellLib.h:699

Definition at line 729 of file DmpStore.c.