iPXE
|
EFI human interface infrastructure. More...
#include <string.h>
#include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h>
#include <ipxe/efi/Guid/MdeModuleHii.h>
Go to the source code of this file.
Data Structures | |
struct | efi_ifr_builder |
An EFI IFR builder. More... | |
Macros | |
#define | EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID |
GUID indicating formset compliance for IBM Unified Configuration Manager. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | efi_ifr_init (struct efi_ifr_builder *ifr) |
Initialise IFR builder. More... | |
unsigned int | efi_ifr_string (struct efi_ifr_builder *ifr, const char *fmt,...) |
Add string to IFR builder. More... | |
void | efi_ifr_end_op (struct efi_ifr_builder *ifr) |
Add end opcode to IFR builder. More... | |
void | efi_ifr_false_op (struct efi_ifr_builder *ifr) |
Add false opcode to IFR builder. More... | |
unsigned int | efi_ifr_form_op (struct efi_ifr_builder *ifr, unsigned int title_id) |
Add form opcode to IFR builder. More... | |
void | efi_ifr_form_set_op (struct efi_ifr_builder *ifr, const EFI_GUID *guid, unsigned int title_id, unsigned int help_id,...) |
Add formset opcode to IFR builder. More... | |
void | efi_ifr_get_op (struct efi_ifr_builder *ifr, unsigned int varstore_id, unsigned int varstore_info, unsigned int varstore_type) |
Add get opcode to IFR builder. More... | |
void | efi_ifr_guid_class_op (struct efi_ifr_builder *ifr, unsigned int class) |
Add GUID class opcode to IFR builder. More... | |
void | efi_ifr_guid_subclass_op (struct efi_ifr_builder *ifr, unsigned int subclass) |
Add GUID subclass opcode to IFR builder. More... | |
void | efi_ifr_numeric_op (struct efi_ifr_builder *ifr, unsigned int prompt_id, unsigned int help_id, unsigned int question_id, unsigned int varstore_id, unsigned int varstore_info, unsigned int vflags, unsigned long min_value, unsigned long max_value, unsigned int step, unsigned int flags) |
Add numeric opcode to IFR builder. More... | |
void | efi_ifr_string_op (struct efi_ifr_builder *ifr, unsigned int prompt_id, unsigned int help_id, unsigned int question_id, unsigned int varstore_id, unsigned int varstore_info, unsigned int vflags, unsigned int min_size, unsigned int max_size, unsigned int flags) |
Add string opcode to IFR builder. More... | |
void | efi_ifr_suppress_if_op (struct efi_ifr_builder *ifr) |
Add suppress-if opcode to IFR builder. More... | |
void | efi_ifr_text_op (struct efi_ifr_builder *ifr, unsigned int prompt_id, unsigned int help_id, unsigned int text_id) |
Add text opcode to IFR builder. More... | |
void | efi_ifr_true_op (struct efi_ifr_builder *ifr) |
Add true opcode to IFR builder. More... | |
unsigned int | efi_ifr_varstore_name_value_op (struct efi_ifr_builder *ifr, const EFI_GUID *guid) |
Add name/value store opcode to IFR builder. More... | |
void | efi_ifr_free (struct efi_ifr_builder *ifr) |
Free memory used by IFR builder. More... | |
EFI_HII_PACKAGE_LIST_HEADER * | efi_ifr_package (struct efi_ifr_builder *ifr, const EFI_GUID *guid, const char *language, unsigned int language_id) |
Construct package list from IFR builder. More... | |
EFI human interface infrastructure.
Definition in file efi_hii.h.
#define EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise IFR builder.
ifr | IFR builder |
The caller must eventually call efi_ifr_free() to free the dynamic storage associated with the IFR builder.
Definition at line 48 of file efi_hii.h.
References memset().
Referenced by efi_snp_hii_package_list().
unsigned int efi_ifr_string | ( | struct efi_ifr_builder * | ifr, |
const char * | fmt, | ||
... | |||
) |
Add string to IFR builder.
ifr | IFR builder |
fmt | Format string |
... | Arguments |
string_id | String identifier, or zero on failure |
Definition at line 45 of file efi_hii.c.
References EFI_HII_STRING_BLOCK::BlockType, DBGC, EFI_HII_SIBT_STRING_UCS2, efi_vsnprintf(), efi_ifr_builder::failed, fmt, _EFI_HII_SIBT_STRING_UCS2_BLOCK::Header, len, NULL, offsetof, realloc(), efi_ifr_builder::string_id, efi_ifr_builder::strings, efi_ifr_builder::strings_len, _EFI_HII_SIBT_STRING_UCS2_BLOCK::StringText, typeof(), va_end, and va_start.
Referenced by efi_snp_hii_package_list(), and efi_snp_hii_questions().
void efi_ifr_end_op | ( | struct efi_ifr_builder * | ifr | ) |
Add end opcode to IFR builder.
ifr | IFR builder |
Definition at line 132 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_END_OP, efi_ifr_op(), end, and efi_ifr_builder::ops_len.
Referenced by efi_snp_hii_package_list().
void efi_ifr_false_op | ( | struct efi_ifr_builder * | ifr | ) |
Add false opcode to IFR builder.
ifr | IFR builder |
Definition at line 148 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_FALSE_OP, efi_ifr_op(), and efi_ifr_builder::ops_len.
unsigned int efi_ifr_form_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | title_id | ||
) |
Add form opcode to IFR builder.
ifr | IFR builder |
title_id | Title string identifier |
form_id | Form identifier |
Definition at line 166 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_FORM_OP, efi_ifr_op(), efi_ifr_builder::form_id, and efi_ifr_builder::ops_len.
Referenced by efi_snp_hii_package_list().
void efi_ifr_form_set_op | ( | struct efi_ifr_builder * | ifr, |
const EFI_GUID * | guid, | ||
unsigned int | title_id, | ||
unsigned int | help_id, | ||
... | |||
) |
Add formset opcode to IFR builder.
ifr | IFR builder |
guid | GUID |
title_id | Title string identifier |
help_id | Help string identifier |
... | Class GUIDs (terminated by NULL) |
Definition at line 194 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_FORM_SET_OP, efi_ifr_op(), _EFI_IFR_FORM_SET::Flags, _EFI_IFR_FORM_SET::FormSetTitle, guid, _EFI_IFR_FORM_SET::Guid, _EFI_IFR_FORM_SET::Header, _EFI_IFR_FORM_SET::Help, len, memcpy(), NULL, efi_ifr_builder::ops_len, _EFI_IFR_OP_HEADER::Scope, va_arg, va_end, and va_start.
Referenced by efi_snp_hii_package_list().
void efi_ifr_get_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | varstore_id, | ||
unsigned int | varstore_info, | ||
unsigned int | varstore_type | ||
) |
Add get opcode to IFR builder.
ifr | IFR builder |
varstore_id | Variable store identifier |
varstore_info | Variable string identifier or offset |
varstore_type | Variable type |
Definition at line 243 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_GET_OP, efi_ifr_op(), efi_ifr_builder::ops_len, _EFI_IFR_GET::VarName, _EFI_IFR_GET::VarStoreId, _EFI_IFR_GET::VarStoreInfo, and _EFI_IFR_GET::VarStoreType.
void efi_ifr_guid_class_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | class | ||
) |
Add GUID class opcode to IFR builder.
ifr | IFR builder |
class | Class |
Definition at line 265 of file efi_hii.c.
References _EFI_IFR_GUID_CLASS::Class, DBGC, DBGC2_HDA, EFI_IFR_EXTEND_OP_CLASS, EFI_IFR_GUID_OP, efi_ifr_op(), _EFI_IFR_GUID_CLASS::ExtendOpCode, _EFI_IFR_GUID_CLASS::Guid, memcpy(), efi_ifr_builder::ops_len, and tiano_guid.
Referenced by efi_snp_hii_package_list().
void efi_ifr_guid_subclass_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | subclass | ||
) |
Add GUID subclass opcode to IFR builder.
ifr | IFR builder |
subclass | Subclass |
Definition at line 288 of file efi_hii.c.
References DBGC, DBGC2_HDA, EFI_IFR_EXTEND_OP_SUBCLASS, EFI_IFR_GUID_OP, efi_ifr_op(), _EFI_IFR_GUID_SUBCLASS::ExtendOpCode, _EFI_IFR_GUID_SUBCLASS::Guid, memcpy(), efi_ifr_builder::ops_len, _EFI_IFR_GUID_SUBCLASS::SubClass, and tiano_guid.
Referenced by efi_snp_hii_package_list().
void efi_ifr_numeric_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | prompt_id, | ||
unsigned int | help_id, | ||
unsigned int | question_id, | ||
unsigned int | varstore_id, | ||
unsigned int | varstore_info, | ||
unsigned int | vflags, | ||
unsigned long | min_value, | ||
unsigned long | max_value, | ||
unsigned int | step, | ||
unsigned int | flags | ||
) |
Add numeric opcode to IFR builder.
ifr | IFR builder |
prompt_id | Prompt string identifier |
help_id | Help string identifier |
question_id | Question identifier |
varstore_id | Variable store identifier |
varstore_info | Variable string identifier or offset |
vflags | Variable flags |
min_value | Minimum value |
max_value | Maximum value |
step | Step |
flags | Flags |
Definition at line 322 of file efi_hii.c.
References _EFI_IFR_NUMERIC::data, DBGC, DBGC2_HDA, EFI_IFR_NUMERIC_OP, EFI_IFR_NUMERIC_SIZE, EFI_IFR_NUMERIC_SIZE_1, EFI_IFR_NUMERIC_SIZE_2, EFI_IFR_NUMERIC_SIZE_4, EFI_IFR_NUMERIC_SIZE_8, efi_ifr_op(), flags, _EFI_IFR_QUESTION_HEADER::Flags, _EFI_IFR_QUESTION_HEADER::Header, _EFI_IFR_STATEMENT_HEADER::Help, MINMAXSTEP_DATA::MaxValue, MINMAXSTEP_DATA::MinValue, efi_ifr_builder::ops_len, _EFI_IFR_STATEMENT_HEADER::Prompt, _EFI_IFR_NUMERIC::Question, _EFI_IFR_QUESTION_HEADER::QuestionId, size, step(), MINMAXSTEP_DATA::Step, MINMAXSTEP_DATA::u16, MINMAXSTEP_DATA::u32, MINMAXSTEP_DATA::u64, MINMAXSTEP_DATA::u8, _EFI_IFR_QUESTION_HEADER::VarName, _EFI_IFR_QUESTION_HEADER::VarStoreId, and _EFI_IFR_QUESTION_HEADER::VarStoreInfo.
void efi_ifr_string_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | prompt_id, | ||
unsigned int | help_id, | ||
unsigned int | question_id, | ||
unsigned int | varstore_id, | ||
unsigned int | varstore_info, | ||
unsigned int | vflags, | ||
unsigned int | min_size, | ||
unsigned int | max_size, | ||
unsigned int | flags | ||
) |
Add string opcode to IFR builder.
ifr | IFR builder |
prompt_id | Prompt string identifier |
help_id | Help string identifier |
question_id | Question identifier |
varstore_id | Variable store identifier |
varstore_info | Variable string identifier or offset |
vflags | Variable flags |
min_size | Minimum size |
max_size | Maximum size |
flags | Flags |
Definition at line 386 of file efi_hii.c.
References DBGC, DBGC2_HDA, efi_ifr_op(), EFI_IFR_STRING_OP, flags, efi_ifr_builder::ops_len, and string.
Referenced by efi_snp_hii_questions().
void efi_ifr_suppress_if_op | ( | struct efi_ifr_builder * | ifr | ) |
Add suppress-if opcode to IFR builder.
ifr | IFR builder |
Definition at line 419 of file efi_hii.c.
References DBGC, DBGC2_HDA, efi_ifr_op(), EFI_IFR_SUPPRESS_IF_OP, _EFI_IFR_SUPPRESS_IF::Header, efi_ifr_builder::ops_len, and _EFI_IFR_OP_HEADER::Scope.
void efi_ifr_text_op | ( | struct efi_ifr_builder * | ifr, |
unsigned int | prompt_id, | ||
unsigned int | help_id, | ||
unsigned int | text_id | ||
) |
Add text opcode to IFR builder.
ifr | IFR builder |
prompt_id | Prompt string identifier |
help_id | Help string identifier |
text_id | Text string identifier |
Definition at line 440 of file efi_hii.c.
References DBGC, DBGC2_HDA, efi_ifr_op(), EFI_IFR_TEXT_OP, _EFI_IFR_STATEMENT_HEADER::Help, efi_ifr_builder::ops_len, _EFI_IFR_STATEMENT_HEADER::Prompt, _EFI_IFR_TEXT::Statement, and _EFI_IFR_TEXT::TextTwo.
Referenced by efi_snp_hii_package_list().
void efi_ifr_true_op | ( | struct efi_ifr_builder * | ifr | ) |
Add true opcode to IFR builder.
ifr | IFR builder |
Definition at line 463 of file efi_hii.c.
References DBGC, DBGC2_HDA, efi_ifr_op(), EFI_IFR_TRUE_OP, and efi_ifr_builder::ops_len.
unsigned int efi_ifr_varstore_name_value_op | ( | struct efi_ifr_builder * | ifr, |
const EFI_GUID * | guid | ||
) |
Add name/value store opcode to IFR builder.
ifr | IFR builder |
guid | GUID |
varstore_id | Variable store identifier, or 0 on failure |
Definition at line 481 of file efi_hii.c.
References DBGC, DBGC2_HDA, efi_ifr_op(), EFI_IFR_VARSTORE_NAME_VALUE_OP, guid, _EFI_IFR_VARSTORE_NAME_VALUE::Guid, memcpy(), efi_ifr_builder::ops_len, efi_ifr_builder::varstore_id, and _EFI_IFR_VARSTORE_NAME_VALUE::VarStoreId.
Referenced by efi_snp_hii_package_list().
void efi_ifr_free | ( | struct efi_ifr_builder * | ifr | ) |
Free memory used by IFR builder.
ifr | IFR builder |
Definition at line 505 of file efi_hii.c.
References free, memset(), efi_ifr_builder::ops, and efi_ifr_builder::strings.
Referenced by efi_snp_hii_package_list().
EFI_HII_PACKAGE_LIST_HEADER* efi_ifr_package | ( | struct efi_ifr_builder * | ifr, |
const EFI_GUID * | guid, | ||
const char * | language, | ||
unsigned int | language_id | ||
) |
Construct package list from IFR builder.
ifr | IFR builder |
guid | Package GUID |
language | Language |
language_id | Language string ID |
package | Package list, or NULL |
The package list is allocated using malloc(), and must eventually be freed by the caller. (The caller must also call efi_ifr_free() to free the temporary storage used during construction.)
Definition at line 525 of file efi_hii.c.
References __attribute__, image::data, EFI_HII_PACKAGE_END, EFI_HII_PACKAGE_FORMS, EFI_HII_PACKAGE_STRINGS, EFI_HII_SIBT_END, end, efi_ifr_builder::failed, guid, header, memcpy(), NULL, offsetof, efi_ifr_builder::ops, efi_ifr_builder::ops_len, pad, strcpy(), efi_ifr_builder::strings, efi_ifr_builder::strings_len, and strlen().