iPXE
efi_hii.h
Go to the documentation of this file.
1#ifndef _IPXE_EFI_HII_H
2#define _IPXE_EFI_HII_H
3
4/** @file
5 *
6 * EFI human interface infrastructure
7 */
8
9FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
10FILE_SECBOOT ( PERMITTED );
11
12#include <string.h>
15
16/** GUID indicating formset compliance for IBM Unified Configuration Manager */
17#define EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID \
18 { 0x5c8e9746, 0xa5f7, 0x4593, \
19 { 0xaf, 0x1f, 0x66, 0xa8, 0x2a, 0xa1, 0x9c, 0xb1 } }
20
21/** An EFI IFR builder */
23 /** IFR opcodes */
25 /** Length of IFR opcodes */
26 size_t ops_len;
27 /** Strings */
29 /** Length of strings */
31 /** Current string identifier */
32 unsigned int string_id;
33 /** Current variable store identifier */
34 unsigned int varstore_id;
35 /** Current form identifier */
36 unsigned int form_id;
37 /** An allocation has failed */
38 int failed;
39};
40
41/**
42 * Initialise IFR builder
43 *
44 * @v ifr IFR builder
45 *
46 * The caller must eventually call efi_ifr_free() to free the dynamic
47 * storage associated with the IFR builder.
48 */
49static inline void efi_ifr_init ( struct efi_ifr_builder *ifr ) {
50 memset ( ifr, 0, sizeof ( *ifr ) );
51}
52
53extern unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr,
54 const char *fmt, ... );
55extern void efi_ifr_end_op ( struct efi_ifr_builder *ifr );
56extern void efi_ifr_false_op ( struct efi_ifr_builder *ifr );
57extern unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr,
58 unsigned int title_id );
59extern void efi_ifr_form_set_op ( struct efi_ifr_builder *ifr,
60 const EFI_GUID *guid,
61 unsigned int title_id, unsigned int help_id,
62 ... );
63void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id,
64 unsigned int varstore_info, unsigned int varstore_type );
65extern void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr,
66 unsigned int class );
67extern void efi_ifr_guid_subclass_op ( struct efi_ifr_builder *ifr,
68 unsigned int subclass );
69extern void efi_ifr_numeric_op ( struct efi_ifr_builder *ifr,
70 unsigned int prompt_id,
71 unsigned int help_id, unsigned int question_id,
72 unsigned int varstore_id,
73 unsigned int varstore_info,
74 unsigned int vflags, unsigned long min_value,
75 unsigned long max_value, unsigned int step,
76 unsigned int flags );
77extern void efi_ifr_string_op ( struct efi_ifr_builder *ifr,
78 unsigned int prompt_id, unsigned int help_id,
79 unsigned int question_id,
80 unsigned int varstore_id,
81 unsigned int varstore_info, unsigned int vflags,
82 unsigned int min_size, unsigned int max_size,
83 unsigned int flags );
84extern void efi_ifr_suppress_if_op ( struct efi_ifr_builder *ifr );
85extern void efi_ifr_text_op ( struct efi_ifr_builder *ifr,
86 unsigned int prompt_id, unsigned int help_id,
87 unsigned int text_id );
88extern void efi_ifr_true_op ( struct efi_ifr_builder *ifr );
89extern unsigned int
91 const EFI_GUID *guid );
92extern void efi_ifr_free ( struct efi_ifr_builder *ifr );
94efi_ifr_package ( struct efi_ifr_builder *ifr, const EFI_GUID *guid,
95 const char *language, unsigned int language_id );
96
97#endif /* _IPXE_EFI_HII_H */
EDKII extented HII IFR guid opcodes.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
This file defines the encoding for the VFR (Visual Form Representation) language.
struct _EFI_IFR_OP_HEADER EFI_IFR_OP_HEADER
uint64_t guid
GUID.
Definition edd.h:1
void efi_ifr_suppress_if_op(struct efi_ifr_builder *ifr)
Add suppress-if opcode to IFR builder.
Definition efi_hii.c:420
void efi_ifr_false_op(struct efi_ifr_builder *ifr)
Add false opcode to IFR builder.
Definition efi_hii.c:149
unsigned int efi_ifr_form_op(struct efi_ifr_builder *ifr, unsigned int title_id)
Add form opcode to IFR builder.
Definition efi_hii.c:167
void efi_ifr_end_op(struct efi_ifr_builder *ifr)
Add end opcode to IFR builder.
Definition efi_hii.c:133
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.
Definition efi_hii.c:323
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.
Definition efi_hii.c:441
unsigned int efi_ifr_string(struct efi_ifr_builder *ifr, const char *fmt,...)
Add string to IFR builder.
Definition efi_hii.c:46
void efi_ifr_guid_subclass_op(struct efi_ifr_builder *ifr, unsigned int subclass)
Add GUID subclass opcode to IFR builder.
Definition efi_hii.c:289
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.
Definition efi_hii.c:195
void efi_ifr_free(struct efi_ifr_builder *ifr)
Free memory used by IFR builder.
Definition efi_hii.c:506
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.
Definition efi_hii.c:244
void efi_ifr_true_op(struct efi_ifr_builder *ifr)
Add true opcode to IFR builder.
Definition efi_hii.c:464
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.
Definition efi_hii.c:526
void efi_ifr_guid_class_op(struct efi_ifr_builder *ifr, unsigned int class)
Add GUID class opcode to IFR builder.
Definition efi_hii.c:266
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.
Definition efi_hii.c:387
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.
Definition efi_hii.c:482
static void efi_ifr_init(struct efi_ifr_builder *ifr)
Initialise IFR builder.
Definition efi_hii.h:49
uint8_t flags
Flags.
Definition ena.h:7
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
String functions.
void * memset(void *dest, int character, size_t len) __nonnull
void step(void)
Single-step a single process.
Definition process.c:99
The header found at the start of each package list.
An EFI IFR builder.
Definition efi_hii.h:22
EFI_HII_STRING_BLOCK * strings
Strings.
Definition efi_hii.h:28
unsigned int string_id
Current string identifier.
Definition efi_hii.h:32
unsigned int varstore_id
Current variable store identifier.
Definition efi_hii.h:34
int failed
An allocation has failed.
Definition efi_hii.h:38
EFI_IFR_OP_HEADER * ops
IFR opcodes.
Definition efi_hii.h:24
size_t ops_len
Length of IFR opcodes.
Definition efi_hii.h:26
unsigned int form_id
Current form identifier.
Definition efi_hii.h:36
size_t strings_len
Length of strings.
Definition efi_hii.h:30
int ssize_t const char * fmt
Definition vsprintf.h:73