TianoCore EDK2 master
Loading...
Searching...
No Matches
HiiIfrParse.c File Reference
#include "HiiInternal.h"

Go to the source code of this file.

Functions

HII_STATEMENTCreateStatement (IN UINT8 *OpCodeData, IN OUT HII_FORMSET *FormSet, IN OUT HII_FORM *Form)
 
HII_STATEMENTCreateQuestion (IN UINT8 *OpCodeData, IN OUT HII_FORMSET *FormSet, IN OUT HII_FORM *Form)
 
HII_EXPRESSIONCreateExpression (IN OUT HII_FORM *Form, IN UINT8 *OpCode)
 
EFI_STATUS InitializeConfigHdr (IN HII_FORMSET *FormSet, IN OUT HII_FORMSET_STORAGE *Storage)
 
VOID AsciiToUnicode (IN CHAR8 *AsciiString, OUT CHAR16 *UnicodeString)
 
HII_FORMSET_STORAGECreateStorage (IN HII_FORMSET *FormSet, IN UINT8 StorageType, IN UINT8 *OpCodeData)
 
HII_FORMSET_STORAGEGetFstStgFromVarId (IN HII_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
 
EFI_STATUS InitializeRequestElement (IN OUT HII_FORMSET *FormSet, IN OUT HII_STATEMENT *Question, IN OUT HII_FORM *Form)
 
VOID DestroyExpression (IN HII_EXPRESSION *Expression)
 
EFI_STATUS DeleteString (IN EFI_STRING_ID StringId, IN EFI_HII_HANDLE HiiHandle)
 
VOID DestroyStatement (IN HII_FORMSET *FormSet, IN OUT HII_STATEMENT *Statement)
 
VOID DestroyForm (IN HII_FORMSET *FormSet, IN OUT HII_FORM *Form)
 
BOOLEAN IsExpressionOpCode (IN UINT8 Operand)
 
BOOLEAN IsStatementOpCode (IN UINT8 Operand)
 
BOOLEAN IsUnKnownOpCode (IN UINT8 Operand)
 
VOID CountOpCodes (IN HII_FORMSET *FormSet, IN OUT UINT16 *NumberOfStatement, IN OUT UINT16 *NumberOfExpression)
 
EFI_STATUS ParseOpCodes (IN HII_FORMSET *FormSet)
 

Detailed Description

The implementation of HII IFR parser.

Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HiiIfrParse.c.

Function Documentation

◆ AsciiToUnicode()

VOID AsciiToUnicode ( IN CHAR8 *  AsciiString,
OUT CHAR16 *  UnicodeString 
)

Convert Ascii string to Unicode.

This is an internal function.

Parameters
[in]AsciiStringThe Ascii string to be converted.
[out]UnicodeStringThe Unicode string retrieved.

Definition at line 297 of file HiiIfrParse.c.

◆ CountOpCodes()

VOID CountOpCodes ( IN HII_FORMSET FormSet,
IN OUT UINT16 *  NumberOfStatement,
IN OUT UINT16 *  NumberOfExpression 
)

Calculate number of Statements(Questions) and Expression OpCodes.

Parameters
[in]FormSetThe FormSet to be counted.
[in,out]NumberOfStatementNumber of Statements(Questions)
[in,out]NumberOfExpressionNumber of Expression OpCodes

Definition at line 943 of file HiiIfrParse.c.

◆ CreateExpression()

HII_EXPRESSION * CreateExpression ( IN OUT HII_FORM Form,
IN UINT8 *  OpCode 
)

Allocate a HII_EXPRESSION node.

Parameters
[in,out]FormThe Form associated with this Expression
[in]OpCodeThe binary opcode data.
Returns
Pointer to a HII_EXPRESSION data structure.

Definition at line 230 of file HiiIfrParse.c.

◆ CreateQuestion()

HII_STATEMENT * CreateQuestion ( IN UINT8 *  OpCodeData,
IN OUT HII_FORMSET FormSet,
IN OUT HII_FORM Form 
)

Initialize Question's members.

Parameters
[in]OpCodeDataPointer of the raw OpCode data.
[in,out]FormSetPointer of the current FormSet.
[in,out]FormPointer of the current Form.
Returns
The Question.

Definition at line 108 of file HiiIfrParse.c.

◆ CreateStatement()

HII_STATEMENT * CreateStatement ( IN UINT8 *  OpCodeData,
IN OUT HII_FORMSET FormSet,
IN OUT HII_FORM Form 
)

Initialize Statement header members.

Parameters
[in]OpCodeDataPointer of the raw OpCode data.
[in,out]FormSetPointer of the current FormSet.
[in,out]FormPointer of the current Form.
Returns
The Statement.

Definition at line 25 of file HiiIfrParse.c.

◆ CreateStorage()

HII_FORMSET_STORAGE * CreateStorage ( IN HII_FORMSET FormSet,
IN UINT8  StorageType,
IN UINT8 *  OpCodeData 
)

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

Parameters
[in]FormSetPointer of the current FormSet
[in]StorageTypeStorage type.
[in]OpCodeDataBinary data for this opcode.
Returns
Pointer to a HII_FORMSET_STORAGE data structure.

Definition at line 324 of file HiiIfrParse.c.

◆ DeleteString()

EFI_STATUS DeleteString ( IN EFI_STRING_ID  StringId,
IN EFI_HII_HANDLE  HiiHandle 
)

Delete a string from HII Package List.

Parameters
[in]StringIdId of the string in HII database.
[in]HiiHandleThe HII package list handle.
Return values
EFI_SUCCESSThe string was deleted successfully.

Definition at line 675 of file HiiIfrParse.c.

◆ DestroyExpression()

VOID DestroyExpression ( IN HII_EXPRESSION Expression)

Free resources of a Expression.

Parameters
[in]FormSetPointer of the Expression

Definition at line 625 of file HiiIfrParse.c.

◆ DestroyForm()

VOID DestroyForm ( IN HII_FORMSET FormSet,
IN OUT HII_FORM Form 
)

Free resources of a Form.

Parameters
[in]FormSetPointer of the FormSet
[in,out]FormPointer of the Form.

Definition at line 798 of file HiiIfrParse.c.

◆ DestroyStatement()

VOID DestroyStatement ( IN HII_FORMSET FormSet,
IN OUT HII_STATEMENT Statement 
)

Free resources of a Statement.

Parameters
[in]FormSetPointer of the FormSet
[in,out]StatementPointer of the Statement

Definition at line 695 of file HiiIfrParse.c.

◆ GetFstStgFromVarId()

HII_FORMSET_STORAGE * GetFstStgFromVarId ( IN HII_FORMSET FormSet,
IN EFI_VARSTORE_ID  VarStoreId 
)

Get formset storage based on the input varstoreid info.

Parameters
[in]FormSetPointer of the current FormSet.
[in]VarStoreIdVarstore ID info.
Returns
Pointer to a HII_FORMSET_STORAGE data structure.

Definition at line 417 of file HiiIfrParse.c.

◆ InitializeConfigHdr()

EFI_STATUS InitializeConfigHdr ( IN HII_FORMSET FormSet,
IN OUT HII_FORMSET_STORAGE Storage 
)

Create ConfigHdr string for a storage.

Parameters
[in]FormSetPointer of the current FormSet
[in,out]StoragePointer of the storage
Return values
EFI_SUCCESSInitialize ConfigHdr success

Definition at line 259 of file HiiIfrParse.c.

◆ InitializeRequestElement()

EFI_STATUS InitializeRequestElement ( IN OUT HII_FORMSET FormSet,
IN OUT HII_STATEMENT Question,
IN OUT HII_FORM Form 
)

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

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

Definition at line 458 of file HiiIfrParse.c.

◆ IsExpressionOpCode()

BOOLEAN IsExpressionOpCode ( IN UINT8  Operand)

Tell whether this Operand is an Expression OpCode or not

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

Definition at line 861 of file HiiIfrParse.c.

◆ IsStatementOpCode()

BOOLEAN IsStatementOpCode ( IN UINT8  Operand)

Tell whether this Operand is an Statement OpCode.

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

Definition at line 892 of file HiiIfrParse.c.

◆ IsUnKnownOpCode()

BOOLEAN IsUnKnownOpCode ( IN UINT8  Operand)

Tell whether this Operand is an known OpCode.

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

Definition at line 927 of file HiiIfrParse.c.

◆ ParseOpCodes()

EFI_STATUS ParseOpCodes ( IN HII_FORMSET FormSet)

Parse opcodes in the formset IFR binary.

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

Definition at line 985 of file HiiIfrParse.c.