TianoCore EDK2 master
Loading...
Searching...
No Matches
HiiInternal.h File Reference

Go to the source code of this file.

Data Structures

struct  HII_FORM_CONFIG_REQUEST
 Definition of HII_FORM_CONFIG_REQUEST. More...
 

Macros

#define EXPRESSION_STACK_SIZE_INCREMENT   0x100
 
#define EFI_IFR_SPECIFICATION_VERSION   (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))
 
#define HII_FORM_CONFIG_REQUEST_SIGNATURE   SIGNATURE_32 ('F', 'C', 'R', 'S')
 
#define HII_FORM_CONFIG_REQUEST_FROM_LINK(a)   CR (a, HII_FORM_CONFIG_REQUEST, Link, HII_FORM_CONFIG_REQUEST_SIGNATURE)
 
#define CONFIG_REQUEST_STRING_INCREMENTAL   1024
 

Functions

VOID NewStringCopy (IN OUT CHAR16 **Dest, IN CHAR16 *Src)
 
EFI_STATUS SetValueByName (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *Name, IN CHAR16 *Value, OUT HII_NAME_VALUE_NODE **ReturnNode)
 
VOID GetBitsQuestionValue (IN HII_STATEMENT *Question, IN UINT8 *Buffer, OUT HII_STATEMENT_VALUE *QuestionValue)
 
VOID SetBitsQuestionValue (IN HII_STATEMENT *Question, IN OUT UINT8 *Buffer, IN UINT32 Value)
 
EFI_STATUS BufferToQuestionValue (IN HII_STATEMENT *Question, IN CHAR16 *Value, OUT HII_STATEMENT_VALUE *QuestionValue)
 
CHAR16 * GetTokenString (IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
 
VOID EFIAPI HiiStringToLowercase (IN EFI_STRING ConfigString)
 
BOOLEAN IsHiiValueTrue (IN EFI_HII_VALUE *Result)
 
EFI_STRING_ID NewHiiString (IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
 
EFI_STATUS ValidateNoSubmit (IN HII_FORMSET *FormSet, IN HII_FORM *Form, IN HII_STATEMENT *Question)
 
EFI_STATUS NoSubmitCheck (IN HII_FORMSET *FormSet, IN OUT HII_FORM **CurrentForm, OUT HII_STATEMENT **Statement)
 
EFI_STATUS StorageToConfigResp (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 **ConfigResp, IN CHAR16 *ConfigRequest)
 
EFI_STATUS ConfigRespToStorage (IN HII_FORMSET_STORAGE *Storage, IN CHAR16 *ConfigResp)
 
EFI_STATUS GetIfrBinaryData (IN EFI_HII_HANDLE Handle, IN OUT EFI_GUID *FormSetGuid, OUT UINTN *BinaryLength, OUT UINT8 **BinaryData)
 
VOID LoadFormSetStorage (IN HII_FORMSET *FormSet, IN HII_FORMSET_STORAGE *Storage)
 
VOID DestroyForm (IN HII_FORMSET *FormSet, IN OUT HII_FORM *Form)
 
HII_FORMSET_STORAGEGetFstStgFromVarId (IN HII_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
 
VOID ExtendValueToU64 (IN HII_STATEMENT_VALUE *Value)
 
EFI_STATUS ParseOpCodes (IN HII_FORMSET *FormSet)
 

Detailed Description

HII internal header file.

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 HiiInternal.h.

Macro Definition Documentation

◆ CONFIG_REQUEST_STRING_INCREMENTAL

#define CONFIG_REQUEST_STRING_INCREMENTAL   1024

Incremental string length of ConfigRequest

Definition at line 68 of file HiiInternal.h.

◆ EFI_IFR_SPECIFICATION_VERSION

#define EFI_IFR_SPECIFICATION_VERSION   (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))

Definition at line 43 of file HiiInternal.h.

◆ EXPRESSION_STACK_SIZE_INCREMENT

#define EXPRESSION_STACK_SIZE_INCREMENT   0x100

Definition at line 42 of file HiiInternal.h.

◆ HII_FORM_CONFIG_REQUEST_FROM_LINK

#define HII_FORM_CONFIG_REQUEST_FROM_LINK (   a)    CR (a, HII_FORM_CONFIG_REQUEST, Link, HII_FORM_CONFIG_REQUEST_SIGNATURE)

Definition at line 63 of file HiiInternal.h.

◆ HII_FORM_CONFIG_REQUEST_SIGNATURE

#define HII_FORM_CONFIG_REQUEST_SIGNATURE   SIGNATURE_32 ('F', 'C', 'R', 'S')

Definition at line 62 of file HiiInternal.h.

Function Documentation

◆ BufferToQuestionValue()

EFI_STATUS BufferToQuestionValue ( IN HII_STATEMENT Question,
IN CHAR16 *  Value,
OUT HII_STATEMENT_VALUE QuestionValue 
)

Convert the buffer value to HiiValue.

Parameters
[in]QuestionThe question.
[in]ValueUnicode buffer save the question value.
[out]QuestionValueThe Question Value retrieved from Buffer.
Return values
Statuswhether convert the value success.

Definition at line 178 of file HiiUtilityInternal.c.

◆ ConfigRespToStorage()

EFI_STATUS ConfigRespToStorage ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 *  ConfigResp 
)

Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.

Parameters
[in]StorageThe Storage to receive the settings.
[in]ConfigRespThe <ConfigResp> to be converted.
Return values
EFI_SUCCESSConvert success.
EFI_INVALID_PARAMETERIncorrect storage type.

Definition at line 679 of file HiiUtilityInternal.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.

◆ ExtendValueToU64()

VOID ExtendValueToU64 ( IN HII_STATEMENT_VALUE Value)

Zero extend integer/boolean/date/time to UINT64 for comparing.

Parameters
[in]ValueHII Value to be converted.

Definition at line 1294 of file HiiUtilityInternal.c.

◆ GetBitsQuestionValue()

VOID GetBitsQuestionValue ( IN HII_STATEMENT Question,
IN UINT8 *  Buffer,
OUT HII_STATEMENT_VALUE QuestionValue 
)

Get bit field value from the buffer and then set the value for the question. Note: Data type UINT32 can cover all the bit field value.

Parameters
[in]QuestionThe question refer to bit field.
[in]BufferPoint to the buffer which the question value get from.
[out]QuestionValueThe Question Value retrieved from Bits.

Definition at line 112 of file HiiUtilityInternal.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.

◆ GetIfrBinaryData()

EFI_STATUS GetIfrBinaryData ( IN EFI_HII_HANDLE  Handle,
IN OUT EFI_GUID FormSetGuid,
OUT UINTN BinaryLength,
OUT UINT8 **  BinaryData 
)

Fetch the Ifr binary data of a FormSet.

Parameters
[in]HandlePackageList Handle
[in,out]FormSetGuidOn input, GUID or class GUID of a formset. If not specified (NULL or zero GUID), take the first FormSet with class GUID EFI_HII_PLATFORM_SETUP_FORMSET_GUID found in package list. On output, GUID of the formset found(if not NULL).
[out]BinaryLengthThe length of the FormSet IFR binary.
[out]BinaryDataThe buffer designed to receive the FormSet.
Return values
EFI_SUCCESSBuffer filled with the requested FormSet. BufferLength was updated.
EFI_INVALID_PARAMETERThe handle is unknown.
EFI_NOT_FOUNDA form or FormSet on the requested handle cannot be found with the requested FormId.

Fetch the Ifr binary data of a FormSet.

Parameters
HandlePackageList Handle
FormSetGuidOn input, GUID or class GUID of a formset. If not specified (NULL or zero GUID), take the first FormSet with class GUID EFI_HII_PLATFORM_SETUP_FORMSET_GUID found in package list. On output, GUID of the formset found(if not NULL).
BinaryLengthThe length of the FormSet IFR binary.
BinaryDataThe buffer designed to receive the FormSet.
Return values
EFI_SUCCESSBuffer filled with the requested FormSet. BufferLength was updated.
EFI_INVALID_PARAMETERThe handle is unknown.
EFI_NOT_FOUNDA form or FormSet on the requested handle cannot be found with the requested FormId.

Definition at line 5843 of file Setup.c.

◆ GetTokenString()

CHAR16 * GetTokenString ( IN EFI_STRING_ID  Token,
IN EFI_HII_HANDLE  HiiHandle 
)

Get the string based on the StringId and HII Package List Handle.

Parameters
[in]TokenThe String's ID.
[in]HiiHandleThe package list in the HII database to search for the specified string.
Returns
The output string.

Definition at line 313 of file HiiUtilityInternal.c.

◆ HiiStringToLowercase()

VOID EFIAPI HiiStringToLowercase ( IN EFI_STRING  ConfigString)

Converts the unicode character of the string from uppercase to lowercase. This is a internal function.

Parameters
[in]ConfigStringString to be converted

Definition at line 344 of file HiiUtilityInternal.c.

◆ IsHiiValueTrue()

BOOLEAN IsHiiValueTrue ( IN EFI_HII_VALUE Result)

Evaluate if the result is a non-zero value.

Parameters
[in]ResultThe result to be evaluated.
Return values
TRUEIt is a non-zero value.
FALSEIt is a zero value.

Definition at line 375 of file HiiUtilityInternal.c.

◆ LoadFormSetStorage()

VOID LoadFormSetStorage ( IN HII_FORMSET FormSet,
IN HII_FORMSET_STORAGE Storage 
)

Fill storage with settings requested from Configuration Driver.

Parameters
[in]FormSetFormSet data structure.
[in]StorageBuffer Storage.

Definition at line 1161 of file HiiUtilityInternal.c.

◆ NewHiiString()

EFI_STRING_ID NewHiiString ( IN CHAR16 *  String,
IN EFI_HII_HANDLE  HiiHandle 
)

Set a new string to string package.

Parameters
[in]StringA pointer to the Null-terminated Unicode string to add or update in the String Package associated with HiiHandle.
[in]HiiHandleA handle that was previously registered in the HII Database.
Returns
the Id for this new string.

Definition at line 413 of file HiiUtilityInternal.c.

◆ NewStringCopy()

VOID NewStringCopy ( IN OUT CHAR16 **  Dest,
IN CHAR16 *  Src 
)

Allocate new memory and then copy the Unicode string Source to Destination.

Parameters
[in,out]DestLocation to copy string
[in]SrcString to copy

Definition at line 36 of file HiiUtilityInternal.c.

◆ NoSubmitCheck()

EFI_STATUS NoSubmitCheck ( IN HII_FORMSET FormSet,
IN OUT HII_FORM **  CurrentForm,
OUT HII_STATEMENT **  Statement 
)

Perform NoSubmit check for each Form in FormSet.

Parameters
[in]FormSetFormSet data structure.
[in,out]CurrentFormCurrent input form data structure.
[out]StatementThe statement for this check.
Return values
EFI_SUCCESSForm validation pass.
otherForm validation failed.

Definition at line 482 of file HiiUtilityInternal.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.

◆ SetBitsQuestionValue()

VOID SetBitsQuestionValue ( IN HII_STATEMENT Question,
IN OUT UINT8 *  Buffer,
IN UINT32  Value 
)

Set bit field value to the buffer. Note: Data type UINT32 can cover all the bit field value.

Parameters
[in]QuestionThe question refer to bit field.
[in,out]BufferPoint to the buffer which the question value set to.
[in]ValueThe bit field value need to set.

Definition at line 148 of file HiiUtilityInternal.c.

◆ SetValueByName()

EFI_STATUS SetValueByName ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 *  Name,
IN CHAR16 *  Value,
OUT HII_NAME_VALUE_NODE **  ReturnNode 
)

Set Value of given Name in a NameValue Storage.

Parameters
[in]StorageThe NameValue Storage.
[in]NameThe Name.
[in]ValueThe Value to set.
[out]ReturnNodeThe node use the input name.
Return values
EFI_SUCCESSValue found for given Name.
EFI_NOT_FOUNDNo such Name found in NameValue storage.

Definition at line 61 of file HiiUtilityInternal.c.

◆ StorageToConfigResp()

EFI_STATUS StorageToConfigResp ( IN HII_FORMSET_STORAGE Storage,
IN CHAR16 **  ConfigResp,
IN CHAR16 *  ConfigRequest 
)

Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.

Parameters
[in]StorageThe Storage to be converted.
[in]ConfigRespThe returned <ConfigResp>.
[in]ConfigRequestThe ConfigRequest string.
Return values
EFI_SUCCESSConvert success.
EFI_INVALID_PARAMETERIncorrect storage type.

Definition at line 572 of file HiiUtilityInternal.c.

◆ ValidateNoSubmit()

EFI_STATUS ValidateNoSubmit ( IN HII_FORMSET FormSet,
IN HII_FORM Form,
IN HII_STATEMENT Question 
)

Perform nosubmitif check for a Form.

Parameters
[in]FormSetFormSet data structure.
[in]FormForm data structure.
[in]QuestionThe Question to be validated.
Return values
EFI_SUCCESSForm validation pass.
otherForm validation failed.

Definition at line 436 of file HiiUtilityInternal.c.