TianoCore EDK2 master
Loading...
Searching...
No Matches
IfrParse.c File Reference
#include "Setup.h"

Go to the source code of this file.

Functions

FORM_BROWSER_STATEMENTCreateStatement (IN UINT8 *OpCodeData, IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
 
FORM_BROWSER_STATEMENTCreateQuestion (IN UINT8 *OpCodeData, IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
 
FORM_EXPRESSIONCreateExpression (IN OUT FORM_BROWSER_FORM *Form, IN UINT8 *OpCode)
 
EFI_STATUS InitializeConfigHdr (IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORMSET_STORAGE *Storage)
 
BROWSER_STORAGEFindStorageInList (IN UINT8 StorageType, IN EFI_GUID *StorageGuid, IN CHAR16 *StorageName, IN EFI_HII_HANDLE HiiHandle)
 
VOID IntializeBrowserStorage (IN BROWSER_STORAGE *BrowserStorage, IN UINT8 StorageType, IN UINT8 *OpCodeData)
 
FORMSET_STORAGECreateStorage (IN FORM_BROWSER_FORMSET *FormSet, IN UINT8 StorageType, IN UINT8 *OpCodeData)
 
FORMSET_STORAGEGetFstStgFromVarId (IN FORM_BROWSER_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
 
FORMSET_STORAGEGetFstStgFromBrsStg (IN BROWSER_STORAGE *Storage)
 
EFI_STATUS InitializeRequestElement (IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_STATEMENT *Question, IN OUT FORM_BROWSER_FORM *Form)
 
VOID DestroyExpression (IN FORM_EXPRESSION *Expression)
 
VOID DestroyStorage (IN FORMSET_STORAGE *Storage)
 
VOID DestroyStatement (IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_STATEMENT *Statement)
 
VOID DestroyForm (IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
 
VOID DestroyFormSet (IN OUT FORM_BROWSER_FORMSET *FormSet)
 
BOOLEAN IsExpressionOpCode (IN UINT8 Operand)
 
BOOLEAN IsStatementOpCode (IN UINT8 Operand)
 
BOOLEAN IsUnKnownOpCode (IN UINT8 Operand)
 
VOID CountOpCodes (IN FORM_BROWSER_FORMSET *FormSet, OUT UINTN *NumberOfStatement, OUT UINTN *NumberOfExpression)
 
EFI_STATUS ParseOpCodes (IN FORM_BROWSER_FORMSET *FormSet)
 

Variables

UINTN mStatementIndex
 
UINTN mExpressionOpCodeIndex
 
EFI_QUESTION_ID mUsedQuestionId
 
LIST_ENTRY gBrowserStorageList
 

Detailed Description

Parser for IFR binary encoding.

Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file IfrParse.c.

Function Documentation

◆ CountOpCodes()

VOID CountOpCodes ( IN FORM_BROWSER_FORMSET FormSet,
OUT UINTN NumberOfStatement,
OUT UINTN NumberOfExpression 
)

Calculate number of Statemens(Questions) and Expression OpCodes.

Parameters
FormSetThe FormSet to be counted.
NumberOfStatementNumber of Statemens(Questions)
NumberOfExpressionNumber of Expression OpCodes

Definition at line 1119 of file IfrParse.c.

◆ CreateExpression()

FORM_EXPRESSION * CreateExpression ( IN OUT FORM_BROWSER_FORM Form,
IN UINT8 *  OpCode 
)

Allocate a FORM_EXPRESSION node.

Parameters
FormThe Form associated with this Expression
OpCodeThe binary opcode data.
Returns
Pointer to a FORM_EXPRESSION data structure.

Definition at line 210 of file IfrParse.c.

◆ CreateQuestion()

FORM_BROWSER_STATEMENT * CreateQuestion ( IN UINT8 *  OpCodeData,
IN OUT FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_FORM Form 
)

Initialize Question's members.

Parameters
OpCodeDataPointer of the raw OpCode data.
FormSetPointer of the current FormSet.
FormPointer of the current Form.
Returns
The Question.

Definition at line 101 of file IfrParse.c.

◆ CreateStatement()

FORM_BROWSER_STATEMENT * CreateStatement ( IN UINT8 *  OpCodeData,
IN OUT FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_FORM Form 
)

Initialize Statement header members.

Parameters
OpCodeDataPointer of the raw OpCode data.
FormSetPointer of the current FormSet.
FormPointer of the current Form.
Returns
The Statement.

Definition at line 27 of file IfrParse.c.

◆ CreateStorage()

FORMSET_STORAGE * CreateStorage ( IN FORM_BROWSER_FORMSET FormSet,
IN UINT8  StorageType,
IN UINT8 *  OpCodeData 
)

Allocate a FORMSET_STORAGE data structure and insert to FormSet Storage List.

Parameters
FormSetPointer of the current FormSet
StorageTypeStorage type.
OpCodeDataBinary data for this opcode.
Returns
Pointer to a FORMSET_STORAGE data structure.

Definition at line 382 of file IfrParse.c.

◆ DestroyExpression()

VOID DestroyExpression ( IN FORM_EXPRESSION Expression)

Free resources of a Expression.

Parameters
FormSetPointer of the Expression

Definition at line 710 of file IfrParse.c.

◆ DestroyForm()

VOID DestroyForm ( IN FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_FORM Form 
)

Free resources of a Form.

Parameters
FormSetPointer of the FormSet
FormPointer of the Form.

Definition at line 880 of file IfrParse.c.

◆ DestroyFormSet()

VOID DestroyFormSet ( IN OUT FORM_BROWSER_FORMSET FormSet)

Free resources allocated for a FormSet.

Parameters
FormSetPointer of the FormSet

Definition at line 943 of file IfrParse.c.

◆ DestroyStatement()

VOID DestroyStatement ( IN FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_STATEMENT Statement 
)

Free resources of a Statement.

Parameters
FormSetPointer of the FormSet
StatementPointer of the Statement

Definition at line 778 of file IfrParse.c.

◆ DestroyStorage()

VOID DestroyStorage ( IN FORMSET_STORAGE Storage)

Free resources of a storage.

Parameters
StoragePointer of the storage

Definition at line 755 of file IfrParse.c.

◆ FindStorageInList()

BROWSER_STORAGE * FindStorageInList ( IN UINT8  StorageType,
IN EFI_GUID StorageGuid,
IN CHAR16 *  StorageName,
IN EFI_HII_HANDLE  HiiHandle 
)

Find the global storage link base on the input storate type, name and guid.

For EFI_HII_VARSTORE_EFI_VARIABLE and EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER, same guid + name = same storage

For EFI_HII_VARSTORE_NAME_VALUE: same guid + HiiHandle = same storage

For EFI_HII_VARSTORE_BUFFER: same guid + name + HiiHandle = same storage

Parameters
StorageTypeStorage type.
StorageGuidStorage guid.
StorageNameStorage Name.
HiiHandleHiiHandle for this varstore.
Returns
Pointer to a GLOBAL_STORAGE data structure.

Definition at line 285 of file IfrParse.c.

◆ GetFstStgFromBrsStg()

FORMSET_STORAGE * GetFstStgFromBrsStg ( IN BROWSER_STORAGE Storage)

Get Formset_storage base on the input browser storage.

More than one formsets may share the same browser storage, this function just get the first formset storage which share the browser storage.

Parameters
Storagebrowser storage info.
Returns
Pointer to a FORMSET_STORAGE data structure.

Definition at line 510 of file IfrParse.c.

◆ GetFstStgFromVarId()

FORMSET_STORAGE * GetFstStgFromVarId ( IN FORM_BROWSER_FORMSET FormSet,
IN EFI_VARSTORE_ID  VarStoreId 
)

Get Formset_storage base on the input varstoreid info.

Parameters
FormSetPointer of the current FormSet.
VarStoreIdVarstore ID info.
Returns
Pointer to a FORMSET_STORAGE data structure.

Definition at line 467 of file IfrParse.c.

◆ InitializeConfigHdr()

EFI_STATUS InitializeConfigHdr ( IN FORM_BROWSER_FORMSET FormSet,
IN OUT FORMSET_STORAGE Storage 
)

Create ConfigHdr string for a storage.

Parameters
FormSetPointer of the current FormSet
StoragePointer of the storage
Return values
EFI_SUCCESSInitialize ConfigHdr success

Definition at line 236 of file IfrParse.c.

◆ InitializeRequestElement()

EFI_STATUS InitializeRequestElement ( IN OUT FORM_BROWSER_FORMSET FormSet,
IN OUT FORM_BROWSER_STATEMENT Question,
IN OUT FORM_BROWSER_FORM Form 
)

Initialize Request Element of a Question. <RequestElement> ::= '&'<BlockName> | '&'<Label>

Parameters
FormSetPointer of the current FormSet.
QuestionThe Question to be initialized.
FormPointer of the current form.
Return values
EFI_SUCCESSFunction success.
EFI_INVALID_PARAMETERNo storage associated with the Question.

Definition at line 559 of file IfrParse.c.

◆ IntializeBrowserStorage()

VOID IntializeBrowserStorage ( IN BROWSER_STORAGE BrowserStorage,
IN UINT8  StorageType,
IN UINT8 *  OpCodeData 
)

Intialize the Global Storage.

Parameters
BrowserStoragePointer to the global storage.
StorageTypeStorage type.
OpCodeDataBinary data for this opcode.

Definition at line 332 of file IfrParse.c.

◆ IsExpressionOpCode()

BOOLEAN IsExpressionOpCode ( IN UINT8  Operand)

Tell whether this Operand is an Expression OpCode or not

Parameters
OperandOperand of an IFR OpCode.
Return values
TRUEThis is an Expression OpCode.
FALSENot an Expression OpCode.

Definition at line 1037 of file IfrParse.c.

◆ IsStatementOpCode()

BOOLEAN IsStatementOpCode ( IN UINT8  Operand)

Tell whether this Operand is an Statement OpCode.

Parameters
OperandOperand of an IFR OpCode.
Return values
TRUEThis is an Statement OpCode.
FALSENot an Statement OpCode.

Definition at line 1068 of file IfrParse.c.

◆ IsUnKnownOpCode()

BOOLEAN IsUnKnownOpCode ( IN UINT8  Operand)

Tell whether this Operand is an known OpCode.

Parameters
OperandOperand of an IFR OpCode.
Return values
TRUEThis is an Statement OpCode.
FALSENot an Statement OpCode.

Definition at line 1103 of file IfrParse.c.

◆ ParseOpCodes()

EFI_STATUS ParseOpCodes ( IN FORM_BROWSER_FORMSET FormSet)

Parse opcodes in the formset IFR binary.

Parameters
FormSetPointer of the FormSet data structure.
Return values
EFI_SUCCESSOpcode parse success.
OtherOpcode parse fail.

Definition at line 1161 of file IfrParse.c.

Variable Documentation

◆ gBrowserStorageList

LIST_ENTRY gBrowserStorageList
extern

Definition at line 47 of file Setup.c.

◆ mExpressionOpCodeIndex

UINTN mExpressionOpCodeIndex

Definition at line 12 of file IfrParse.c.

◆ mStatementIndex

UINTN mStatementIndex

Definition at line 11 of file IfrParse.c.

◆ mUsedQuestionId

EFI_QUESTION_ID mUsedQuestionId

Definition at line 13 of file IfrParse.c.