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 
11 #include <string.h>
14 
15 /** GUID indicating formset compliance for IBM Unified Configuration Manager */
16 #define EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID \
17  { 0x5c8e9746, 0xa5f7, 0x4593, \
18  { 0xaf, 0x1f, 0x66, 0xa8, 0x2a, 0xa1, 0x9c, 0xb1 } }
19 
20 /** An EFI IFR builder */
22  /** IFR opcodes */
24  /** Length of IFR opcodes */
25  size_t ops_len;
26  /** Strings */
28  /** Length of strings */
29  size_t strings_len;
30  /** Current string identifier */
31  unsigned int string_id;
32  /** Current variable store identifier */
33  unsigned int varstore_id;
34  /** Current form identifier */
35  unsigned int form_id;
36  /** An allocation has failed */
37  int failed;
38 };
39 
40 /**
41  * Initialise IFR builder
42  *
43  * @v ifr IFR builder
44  *
45  * The caller must eventually call efi_ifr_free() to free the dynamic
46  * storage associated with the IFR builder.
47  */
48 static inline void efi_ifr_init ( struct efi_ifr_builder *ifr ) {
49  memset ( ifr, 0, sizeof ( *ifr ) );
50 }
51 
52 extern unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr,
53  const char *fmt, ... );
54 extern void efi_ifr_end_op ( struct efi_ifr_builder *ifr );
55 extern void efi_ifr_false_op ( struct efi_ifr_builder *ifr );
56 extern unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr,
57  unsigned int title_id );
58 extern void efi_ifr_form_set_op ( struct efi_ifr_builder *ifr,
59  const EFI_GUID *guid,
60  unsigned int title_id, unsigned int help_id,
61  ... );
62 void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id,
63  unsigned int varstore_info, unsigned int varstore_type );
64 extern void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr,
65  unsigned int class );
66 extern void efi_ifr_guid_subclass_op ( struct efi_ifr_builder *ifr,
67  unsigned int subclass );
68 extern void efi_ifr_numeric_op ( struct efi_ifr_builder *ifr,
69  unsigned int prompt_id,
70  unsigned int help_id, unsigned int question_id,
71  unsigned int varstore_id,
72  unsigned int varstore_info,
73  unsigned int vflags, unsigned long min_value,
74  unsigned long max_value, unsigned int step,
75  unsigned int flags );
76 extern void efi_ifr_string_op ( struct efi_ifr_builder *ifr,
77  unsigned int prompt_id, unsigned int help_id,
78  unsigned int question_id,
79  unsigned int varstore_id,
80  unsigned int varstore_info, unsigned int vflags,
81  unsigned int min_size, unsigned int max_size,
82  unsigned int flags );
83 extern void efi_ifr_suppress_if_op ( struct efi_ifr_builder *ifr );
84 extern void efi_ifr_text_op ( struct efi_ifr_builder *ifr,
85  unsigned int prompt_id, unsigned int help_id,
86  unsigned int text_id );
87 extern void efi_ifr_true_op ( struct efi_ifr_builder *ifr );
88 extern unsigned int
90  const EFI_GUID *guid );
91 extern void efi_ifr_free ( struct efi_ifr_builder *ifr );
93 efi_ifr_package ( struct efi_ifr_builder *ifr, const EFI_GUID *guid,
94  const char *language, unsigned int language_id );
95 
96 #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:525
static void efi_ifr_init(struct efi_ifr_builder *ifr)
Initialise IFR builder.
Definition: efi_hii.h:48
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:194
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
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:481
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:440
EFI_HII_STRING_BLOCK * strings
Strings.
Definition: efi_hii.h:27
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:386
void efi_ifr_suppress_if_op(struct efi_ifr_builder *ifr)
Add suppress-if opcode to IFR builder.
Definition: efi_hii.c:419
void efi_ifr_end_op(struct efi_ifr_builder *ifr)
Add end opcode to IFR builder.
Definition: efi_hii.c:132
unsigned int varstore_id
Current variable store identifier.
Definition: efi_hii.h:33
unsigned int string_id
Current string identifier.
Definition: efi_hii.h:31
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:505
size_t strings_len
Length of strings.
Definition: efi_hii.h:29
size_t ops_len
Length of IFR opcodes.
Definition: efi_hii.h:25
void efi_ifr_true_op(struct efi_ifr_builder *ifr)
Add true opcode to IFR builder.
Definition: efi_hii.c:463
int failed
An allocation has failed.
Definition: efi_hii.h:37
EFI_IFR_OP_HEADER * ops
IFR opcodes.
Definition: efi_hii.h:23
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:288
uint64_t guid
GUID.
Definition: edd.h:30
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:265
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:166
void efi_ifr_false_op(struct efi_ifr_builder *ifr)
Add false opcode to IFR builder.
Definition: efi_hii.c:148
void step(void)
Single-step a single process.
Definition: process.c:98
unsigned int form_id
Current form identifier.
Definition: efi_hii.h:35
int ssize_t const char * fmt
Definition: vsprintf.h:72
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:322
An EFI IFR builder.
Definition: efi_hii.h:21
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:243
unsigned int efi_ifr_string(struct efi_ifr_builder *ifr, const char *fmt,...)
Add string to IFR builder.
Definition: efi_hii.c:45
The header found at the start of each package list.
String functions.
void * memset(void *dest, int character, size_t len) __nonnull
uint8_t flags
Flags.
Definition: ena.h:18