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 
9 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
10 FILE_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 */
30  size_t strings_len;
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  */
49 static inline void efi_ifr_init ( struct efi_ifr_builder *ifr ) {
50  memset ( ifr, 0, sizeof ( *ifr ) );
51 }
52 
53 extern unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr,
54  const char *fmt, ... );
55 extern void efi_ifr_end_op ( struct efi_ifr_builder *ifr );
56 extern void efi_ifr_false_op ( struct efi_ifr_builder *ifr );
57 extern unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr,
58  unsigned int title_id );
59 extern 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  ... );
63 void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id,
64  unsigned int varstore_info, unsigned int varstore_type );
65 extern void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr,
66  unsigned int class );
67 extern void efi_ifr_guid_subclass_op ( struct efi_ifr_builder *ifr,
68  unsigned int subclass );
69 extern 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 );
77 extern 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 );
84 extern void efi_ifr_suppress_if_op ( struct efi_ifr_builder *ifr );
85 extern void efi_ifr_text_op ( struct efi_ifr_builder *ifr,
86  unsigned int prompt_id, unsigned int help_id,
87  unsigned int text_id );
88 extern void efi_ifr_true_op ( struct efi_ifr_builder *ifr );
89 extern unsigned int
91  const EFI_GUID *guid );
92 extern void efi_ifr_free ( struct efi_ifr_builder *ifr );
94 efi_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 */
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
static void efi_ifr_init(struct efi_ifr_builder *ifr)
Initialise IFR builder.
Definition: efi_hii.h:49
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
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
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
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
FILE_SECBOOT(PERMITTED)
EFI_HII_STRING_BLOCK * strings
Strings.
Definition: efi_hii.h:28
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
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_end_op(struct efi_ifr_builder *ifr)
Add end opcode to IFR builder.
Definition: efi_hii.c:133
unsigned int varstore_id
Current variable store identifier.
Definition: efi_hii.h:34
unsigned int string_id
Current string identifier.
Definition: efi_hii.h:32
This file defines the encoding for the VFR (Visual Form Representation) language.
void efi_ifr_free(struct efi_ifr_builder *ifr)
Free memory used by IFR builder.
Definition: efi_hii.c:506
size_t strings_len
Length of strings.
Definition: efi_hii.h:30
uint8_t flags
Flags.
Definition: ena.h:18
size_t ops_len
Length of IFR opcodes.
Definition: efi_hii.h:26
void efi_ifr_true_op(struct efi_ifr_builder *ifr)
Add true opcode to IFR builder.
Definition: efi_hii.c:464
int failed
An allocation has failed.
Definition: efi_hii.h:38
EFI_IFR_OP_HEADER * ops
IFR opcodes.
Definition: efi_hii.h:24
EDKII extented HII IFR guid opcodes.
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
uint64_t guid
GUID.
Definition: edd.h:31
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
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_false_op(struct efi_ifr_builder *ifr)
Add false opcode to IFR builder.
Definition: efi_hii.c:149
void step(void)
Single-step a single process.
Definition: process.c:99
unsigned int form_id
Current form identifier.
Definition: efi_hii.h:36
int ssize_t const char * fmt
Definition: vsprintf.h:73
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
An EFI IFR builder.
Definition: efi_hii.h:22
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
unsigned int efi_ifr_string(struct efi_ifr_builder *ifr, const char *fmt,...)
Add string to IFR builder.
Definition: efi_hii.c:46
The header found at the start of each package list.
String functions.
void * memset(void *dest, int character, size_t len) __nonnull