iPXE
efi_hii.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301, USA.
18  *
19  * You can also choose to distribute this program under the terms of
20  * the Unmodified Binary Distribution Licence (as given in the file
21  * COPYING.UBDL), provided that you have satisfied its requirements.
22  */
23 
24 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 
26 #include <stdlib.h>
27 #include <stddef.h>
28 #include <stdarg.h>
29 #include <string.h>
30 #include <ipxe/efi/efi.h>
31 #include <ipxe/efi/efi_strings.h>
32 #include <ipxe/efi/efi_hii.h>
33 
34 /** Tiano GUID */
36 
37 /**
38  * Add string to IFR builder
39  *
40  * @v ifr IFR builder
41  * @v fmt Format string
42  * @v ... Arguments
43  * @ret string_id String identifier, or zero on failure
44  */
45 unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr, const char *fmt,
46  ... ) {
47  EFI_HII_STRING_BLOCK *new_strings;
49  size_t new_strings_len;
50  va_list args;
51  size_t len;
52  unsigned int string_id;
53 
54  /* Do nothing if a previous allocation has failed */
55  if ( ifr->failed )
56  return 0;
57 
58  /* Calculate string length */
59  va_start ( args, fmt );
60  len = ( efi_vsnprintf ( NULL, 0, fmt, args ) + 1 /* wNUL */ );
61  va_end ( args );
62 
63  /* Reallocate strings */
64  new_strings_len = ( ifr->strings_len +
65  offsetof ( typeof ( *ucs2 ), StringText ) +
66  ( len * sizeof ( ucs2->StringText[0] ) ) );
67  new_strings = realloc ( ifr->strings, new_strings_len );
68  if ( ! new_strings ) {
69  ifr->failed = 1;
70  return 0;
71  }
72  ucs2 = ( ( ( void * ) new_strings ) + ifr->strings_len );
73  ifr->strings = new_strings;
74  ifr->strings_len = new_strings_len;
75 
76  /* Fill in string */
78  va_start ( args, fmt );
79  efi_vsnprintf ( ucs2->StringText, len, fmt, args );
80  va_end ( args );
81 
82  /* Allocate string ID */
83  string_id = ++(ifr->string_id);
84 
85  DBGC ( ifr, "IFR %p string %#04x is \"%ls\"\n",
86  ifr, string_id, ucs2->StringText );
87  return string_id;
88 }
89 
90 /**
91  * Add IFR opcode to IFR builder
92  *
93  * @v ifr IFR builder
94  * @v opcode Opcode
95  * @v len Opcode length
96  * @ret op Opcode, or NULL
97  */
98 static void * efi_ifr_op ( struct efi_ifr_builder *ifr, unsigned int opcode,
99  size_t len ) {
100  EFI_IFR_OP_HEADER *new_ops;
102  size_t new_ops_len;
103 
104  /* Do nothing if a previous allocation has failed */
105  if ( ifr->failed )
106  return NULL;
107 
108  /* Reallocate opcodes */
109  new_ops_len = ( ifr->ops_len + len );
110  new_ops = realloc ( ifr->ops, new_ops_len );
111  if ( ! new_ops ) {
112  ifr->failed = 1;
113  return NULL;
114  }
115  op = ( ( ( void * ) new_ops ) + ifr->ops_len );
116  ifr->ops = new_ops;
117  ifr->ops_len = new_ops_len;
118 
119  /* Fill in opcode header */
120  memset ( op, 0, len );
121  op->OpCode = opcode;
122  op->Length = len;
123 
124  return op;
125 }
126 
127 /**
128  * Add end opcode to IFR builder
129  *
130  * @v ifr IFR builder
131  */
132 void efi_ifr_end_op ( struct efi_ifr_builder *ifr ) {
133  size_t dispaddr = ifr->ops_len;
134  EFI_IFR_END *end;
135 
136  /* Add opcode */
137  end = efi_ifr_op ( ifr, EFI_IFR_END_OP, sizeof ( *end ) );
138 
139  DBGC ( ifr, "IFR %p end\n", ifr );
140  DBGC2_HDA ( ifr, dispaddr, end, sizeof ( *end ) );
141 }
142 
143 /**
144  * Add false opcode to IFR builder
145  *
146  * @v ifr IFR builder
147  */
148 void efi_ifr_false_op ( struct efi_ifr_builder *ifr ) {
149  size_t dispaddr = ifr->ops_len;
150  EFI_IFR_FALSE *false;
151 
152  /* Add opcode */
153  false = efi_ifr_op ( ifr, EFI_IFR_FALSE_OP, sizeof ( *false ) );
154 
155  DBGC ( ifr, "IFR %p false\n", ifr );
156  DBGC2_HDA ( ifr, dispaddr, false, sizeof ( *false ) );
157 }
158 
159 /**
160  * Add form opcode to IFR builder
161  *
162  * @v ifr IFR builder
163  * @v title_id Title string identifier
164  * @ret form_id Form identifier
165  */
166 unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr,
167  unsigned int title_id ) {
168  size_t dispaddr = ifr->ops_len;
169  EFI_IFR_FORM *form;
170 
171  /* Add opcode */
172  form = efi_ifr_op ( ifr, EFI_IFR_FORM_OP, sizeof ( *form ) );
173  if ( ! form )
174  return 0;
175  form->Header.Scope = 1;
176  form->FormId = ++(ifr->form_id);
177  form->FormTitle = title_id;
178 
179  DBGC ( ifr, "IFR %p name/value store %#04x title %#04x\n",
180  ifr, form->FormId, title_id );
181  DBGC2_HDA ( ifr, dispaddr, form, sizeof ( *form ) );
182  return form->FormId;
183 }
184 
185 /**
186  * Add formset opcode to IFR builder
187  *
188  * @v ifr IFR builder
189  * @v guid GUID
190  * @v title_id Title string identifier
191  * @v help_id Help string identifier
192  * @v ... Class GUIDs (terminated by NULL)
193  */
195  unsigned int title_id, unsigned int help_id, ... ) {
196  size_t dispaddr = ifr->ops_len;
197  EFI_IFR_FORM_SET *formset;
198  EFI_GUID *class_guid;
199  unsigned int num_class_guids = 0;
200  size_t len;
201  va_list args;
202 
203  /* Count number of class GUIDs */
204  va_start ( args, help_id );
205  while ( va_arg ( args, const EFI_GUID * ) != NULL )
206  num_class_guids++;
207  va_end ( args );
208 
209  /* Add opcode */
210  len = ( sizeof ( *formset ) +
211  ( num_class_guids * sizeof ( *class_guid ) ) );
212  formset = efi_ifr_op ( ifr, EFI_IFR_FORM_SET_OP, len );
213  if ( ! formset )
214  return;
215  formset->Header.Scope = 1;
216  memcpy ( &formset->Guid, guid, sizeof ( formset->Guid ) );
217  formset->FormSetTitle = title_id;
218  formset->Help = help_id;
219  formset->Flags = num_class_guids;
220 
221  /* Add class GUIDs */
222  class_guid = ( ( ( void * ) formset ) + sizeof ( *formset ) );
223  va_start ( args, help_id );
224  while ( num_class_guids-- ) {
225  memcpy ( class_guid++, va_arg ( args, const EFI_GUID * ),
226  sizeof ( *class_guid ) );
227  }
228  va_end ( args );
229 
230  DBGC ( ifr, "IFR %p formset title %#04x help %#04x\n",
231  ifr, title_id, help_id );
232  DBGC2_HDA ( ifr, dispaddr, formset, len );
233 }
234 
235 /**
236  * Add get opcode to IFR builder
237  *
238  * @v ifr IFR builder
239  * @v varstore_id Variable store identifier
240  * @v varstore_info Variable string identifier or offset
241  * @v varstore_type Variable type
242  */
243 void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id,
244  unsigned int varstore_info, unsigned int varstore_type ) {
245  size_t dispaddr = ifr->ops_len;
246  EFI_IFR_GET *get;
247 
248  /* Add opcode */
249  get = efi_ifr_op ( ifr, EFI_IFR_GET_OP, sizeof ( *get ) );
250  get->VarStoreId = varstore_id;
251  get->VarStoreInfo.VarName = varstore_info;
252  get->VarStoreType = varstore_type;
253 
254  DBGC ( ifr, "IFR %p get varstore %#04x:%#04x type %#02x\n",
255  ifr, varstore_id, varstore_info, varstore_type );
256  DBGC2_HDA ( ifr, dispaddr, get, sizeof ( *get ) );
257 }
258 
259 /**
260  * Add GUID class opcode to IFR builder
261  *
262  * @v ifr IFR builder
263  * @v class Class
264  */
265 void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr, unsigned int class ) {
266  size_t dispaddr = ifr->ops_len;
267  EFI_IFR_GUID_CLASS *guid_class;
268 
269  /* Add opcode */
270  guid_class = efi_ifr_op ( ifr, EFI_IFR_GUID_OP,
271  sizeof ( *guid_class ) );
272  if ( ! guid_class )
273  return;
274  memcpy ( &guid_class->Guid, &tiano_guid, sizeof ( guid_class->Guid ) );
276  guid_class->Class = class;
277 
278  DBGC ( ifr, "IFR %p GUID class %#02x\n", ifr, class );
279  DBGC2_HDA ( ifr, dispaddr, guid_class, sizeof ( *guid_class ) );
280 }
281 
282 /**
283  * Add GUID subclass opcode to IFR builder
284  *
285  * @v ifr IFR builder
286  * @v subclass Subclass
287  */
289  unsigned int subclass ) {
290  size_t dispaddr = ifr->ops_len;
291  EFI_IFR_GUID_SUBCLASS *guid_subclass;
292 
293  /* Add opcode */
294  guid_subclass = efi_ifr_op ( ifr, EFI_IFR_GUID_OP,
295  sizeof ( *guid_subclass ) );
296  if ( ! guid_subclass )
297  return;
298  memcpy ( &guid_subclass->Guid, &tiano_guid,
299  sizeof ( guid_subclass->Guid ) );
300  guid_subclass->ExtendOpCode = EFI_IFR_EXTEND_OP_SUBCLASS;
301  guid_subclass->SubClass = subclass;
302 
303  DBGC ( ifr, "IFR %p GUID subclass %#02x\n", ifr, subclass );
304  DBGC2_HDA ( ifr, dispaddr, guid_subclass, sizeof ( *guid_subclass ) );
305 }
306 
307 /**
308  * Add numeric opcode to IFR builder
309  *
310  * @v ifr IFR builder
311  * @v prompt_id Prompt string identifier
312  * @v help_id Help string identifier
313  * @v question_id Question identifier
314  * @v varstore_id Variable store identifier
315  * @v varstore_info Variable string identifier or offset
316  * @v vflags Variable flags
317  * @v min_value Minimum value
318  * @v max_value Maximum value
319  * @v step Step
320  * @v flags Flags
321  */
322 void efi_ifr_numeric_op ( struct efi_ifr_builder *ifr, unsigned int prompt_id,
323  unsigned int help_id, unsigned int question_id,
324  unsigned int varstore_id, unsigned int varstore_info,
325  unsigned int vflags, unsigned long min_value,
326  unsigned long max_value, unsigned int step,
327  unsigned int flags ) {
328  size_t dispaddr = ifr->ops_len;
329  EFI_IFR_NUMERIC *numeric;
330  unsigned int size;
331 
332  /* Add opcode */
333  numeric = efi_ifr_op ( ifr, EFI_IFR_NUMERIC_OP, sizeof ( *numeric ) );
334  if ( ! numeric )
335  return;
336  numeric->Question.Header.Prompt = prompt_id;
337  numeric->Question.Header.Help = help_id;
338  numeric->Question.QuestionId = question_id;
339  numeric->Question.VarStoreId = varstore_id;
340  numeric->Question.VarStoreInfo.VarName = varstore_info;
341  numeric->Question.Flags = vflags;
343  switch ( size ) {
345  numeric->data.u8.MinValue = min_value;
346  numeric->data.u8.MaxValue = max_value;
347  numeric->data.u8.Step = step;
348  break;
350  numeric->data.u16.MinValue = min_value;
351  numeric->data.u16.MaxValue = max_value;
352  numeric->data.u16.Step = step;
353  break;
355  numeric->data.u32.MinValue = min_value;
356  numeric->data.u32.MaxValue = max_value;
357  numeric->data.u32.Step = step;
358  break;
360  numeric->data.u64.MinValue = min_value;
361  numeric->data.u64.MaxValue = max_value;
362  numeric->data.u64.Step = step;
363  break;
364  }
365 
366  DBGC ( ifr, "IFR %p numeric prompt %#04x help %#04x question %#04x "
367  "varstore %#04x:%#04x\n", ifr, prompt_id, help_id, question_id,
368  varstore_id, varstore_info );
369  DBGC2_HDA ( ifr, dispaddr, numeric, sizeof ( *numeric ) );
370 }
371 
372 /**
373  * Add string opcode to IFR builder
374  *
375  * @v ifr IFR builder
376  * @v prompt_id Prompt string identifier
377  * @v help_id Help string identifier
378  * @v question_id Question identifier
379  * @v varstore_id Variable store identifier
380  * @v varstore_info Variable string identifier or offset
381  * @v vflags Variable flags
382  * @v min_size Minimum size
383  * @v max_size Maximum size
384  * @v flags Flags
385  */
386 void efi_ifr_string_op ( struct efi_ifr_builder *ifr, unsigned int prompt_id,
387  unsigned int help_id, unsigned int question_id,
388  unsigned int varstore_id, unsigned int varstore_info,
389  unsigned int vflags, unsigned int min_size,
390  unsigned int max_size, unsigned int flags ) {
391  size_t dispaddr = ifr->ops_len;
393 
394  /* Add opcode */
395  string = efi_ifr_op ( ifr, EFI_IFR_STRING_OP, sizeof ( *string ) );
396  if ( ! string )
397  return;
398  string->Question.Header.Prompt = prompt_id;
399  string->Question.Header.Help = help_id;
400  string->Question.QuestionId = question_id;
401  string->Question.VarStoreId = varstore_id;
402  string->Question.VarStoreInfo.VarName = varstore_info;
403  string->Question.Flags = vflags;
404  string->MinSize = min_size;
405  string->MaxSize = max_size;
406  string->Flags = flags;
407 
408  DBGC ( ifr, "IFR %p string prompt %#04x help %#04x question %#04x "
409  "varstore %#04x:%#04x\n", ifr, prompt_id, help_id, question_id,
410  varstore_id, varstore_info );
411  DBGC2_HDA ( ifr, dispaddr, string, sizeof ( *string ) );
412 }
413 
414 /**
415  * Add suppress-if opcode to IFR builder
416  *
417  * @v ifr IFR builder
418  */
420  size_t dispaddr = ifr->ops_len;
421  EFI_IFR_SUPPRESS_IF *suppress_if;
422 
423  /* Add opcode */
424  suppress_if = efi_ifr_op ( ifr, EFI_IFR_SUPPRESS_IF_OP,
425  sizeof ( *suppress_if ) );
426  suppress_if->Header.Scope = 1;
427 
428  DBGC ( ifr, "IFR %p suppress-if\n", ifr );
429  DBGC2_HDA ( ifr, dispaddr, suppress_if, sizeof ( *suppress_if ) );
430 }
431 
432 /**
433  * Add text opcode to IFR builder
434  *
435  * @v ifr IFR builder
436  * @v prompt_id Prompt string identifier
437  * @v help_id Help string identifier
438  * @v text_id Text string identifier
439  */
440 void efi_ifr_text_op ( struct efi_ifr_builder *ifr, unsigned int prompt_id,
441  unsigned int help_id, unsigned int text_id ) {
442  size_t dispaddr = ifr->ops_len;
443  EFI_IFR_TEXT *text;
444 
445  /* Add opcode */
446  text = efi_ifr_op ( ifr, EFI_IFR_TEXT_OP, sizeof ( *text ) );
447  if ( ! text )
448  return;
449  text->Statement.Prompt = prompt_id;
450  text->Statement.Help = help_id;
451  text->TextTwo = text_id;
452 
453  DBGC ( ifr, "IFR %p text prompt %#04x help %#04x text %#04x\n",
454  ifr, prompt_id, help_id, text_id );
455  DBGC2_HDA ( ifr, dispaddr, text, sizeof ( *text ) );
456 }
457 
458 /**
459  * Add true opcode to IFR builder
460  *
461  * @v ifr IFR builder
462  */
463 void efi_ifr_true_op ( struct efi_ifr_builder *ifr ) {
464  size_t dispaddr = ifr->ops_len;
465  EFI_IFR_TRUE *true;
466 
467  /* Add opcode */
468  true = efi_ifr_op ( ifr, EFI_IFR_TRUE_OP, sizeof ( *true ) );
469 
470  DBGC ( ifr, "IFR %p true\n", ifr );
471  DBGC2_HDA ( ifr, dispaddr, true, sizeof ( *true ) );
472 }
473 
474 /**
475  * Add name/value store opcode to IFR builder
476  *
477  * @v ifr IFR builder
478  * @v guid GUID
479  * @ret varstore_id Variable store identifier, or 0 on failure
480  */
482  const EFI_GUID *guid ) {
483  size_t dispaddr = ifr->ops_len;
484  EFI_IFR_VARSTORE_NAME_VALUE *varstore;
485 
486  /* Add opcode */
487  varstore = efi_ifr_op ( ifr, EFI_IFR_VARSTORE_NAME_VALUE_OP,
488  sizeof ( *varstore ) );
489  if ( ! varstore )
490  return 0;
491  varstore->VarStoreId = ++(ifr->varstore_id);
492  memcpy ( &varstore->Guid, guid, sizeof ( varstore->Guid ) );
493 
494  DBGC ( ifr, "IFR %p name/value store %#04x\n",
495  ifr, varstore->VarStoreId );
496  DBGC2_HDA ( ifr, dispaddr, varstore, sizeof ( *varstore ) );
497  return varstore->VarStoreId;
498 }
499 
500 /**
501  * Free memory used by IFR builder
502  *
503  * @v ifr IFR builder
504  */
505 void efi_ifr_free ( struct efi_ifr_builder *ifr ) {
506 
507  free ( ifr->ops );
508  free ( ifr->strings );
509  memset ( ifr, 0, sizeof ( *ifr ) );
510 }
511 
512 /**
513  * Construct package list from IFR builder
514  *
515  * @v ifr IFR builder
516  * @v guid Package GUID
517  * @v language Language
518  * @v language_id Language string ID
519  * @ret package Package list, or NULL
520  *
521  * The package list is allocated using malloc(), and must eventually
522  * be freed by the caller. (The caller must also call efi_ifr_free()
523  * to free the temporary storage used during construction.)
524  */
526  const EFI_GUID *guid,
527  const char *language,
528  unsigned int language_id ) {
529  struct {
531  struct {
533  uint8_t data[ifr->ops_len];
534  } __attribute__ (( packed )) ops;
535  struct {
536  union {
539  Language) +
540  strlen ( language ) + 1 /* NUL */ ];
541  } __attribute__ (( packed )) header;
542  uint8_t data[ifr->strings_len];
544  } __attribute__ (( packed )) strings;
546  } __attribute__ (( packed )) *package;
547 
548  /* Fail if any previous allocation failed */
549  if ( ifr->failed )
550  return NULL;
551 
552  /* Allocate package list */
553  package = zalloc ( sizeof ( *package ) );
554  if ( ! package )
555  return NULL;
556 
557  /* Populate package list */
558  package->header.PackageLength = sizeof ( *package );
559  memcpy ( &package->header.PackageListGuid, guid,
560  sizeof ( package->header.PackageListGuid ) );
561  package->ops.header.Length = sizeof ( package->ops );
562  package->ops.header.Type = EFI_HII_PACKAGE_FORMS;
563  memcpy ( package->ops.data, ifr->ops, sizeof ( package->ops.data ) );
564  package->strings.header.header.Header.Length =
565  sizeof ( package->strings );
566  package->strings.header.header.Header.Type =
568  package->strings.header.header.HdrSize =
569  sizeof ( package->strings.header );
570  package->strings.header.header.StringInfoOffset =
571  sizeof ( package->strings.header );
572  package->strings.header.header.LanguageName = language_id;
573  strcpy ( package->strings.header.header.Language, language );
574  memcpy ( package->strings.data, ifr->strings,
575  sizeof ( package->strings.data ) );
576  package->strings.end.BlockType = EFI_HII_SIBT_END;
577  package->end.Type = EFI_HII_PACKAGE_END;
578  package->end.Length = sizeof ( package->end );
579 
580  return &package->header;
581 }
582 
#define EFI_IFR_NUMERIC_SIZE_8
EFI human interface infrastructure.
UINT16 SubClass
Sub Class type from the above.
Definition: MdeModuleHii.h:140
#define EFI_IFR_NUMERIC_OP
#define __attribute__(x)
Definition: compiler.h:10
void efi_ifr_true_op(struct efi_ifr_builder *ifr)
Add true opcode to IFR builder.
Definition: efi_hii.c:463
#define EFI_IFR_NUMERIC_SIZE_4
#define EFI_IFR_FALSE_OP
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
#define va_end(ap)
Definition: stdarg.h:9
#define EFI_IFR_END_OP
userptr_t data
Raw file image.
Definition: image.h:41
void efi_ifr_end_op(struct efi_ifr_builder *ifr)
Add end opcode to IFR builder.
Definition: efi_hii.c:132
static const EFI_GUID tiano_guid
Tiano GUID.
Definition: efi_hii.c:35
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
uint8_t opcode
Opcode.
Definition: ena.h:16
#define EFI_IFR_STRING_OP
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
#define EFI_HII_SIBT_END
int efi_vsnprintf(wchar_t *wbuf, size_t wsize, const char *fmt, va_list args)
Write a formatted string to a wide-character buffer.
Definition: efi_strings.c:74
EFI strings.
UINT8 ExtendOpCode
EFI_IFR_EXTEND_OP_SUBCLASS.
Definition: MdeModuleHii.h:139
#define DBGC(...)
Definition: compiler.h:505
UINT16 Class
Device Class from the above.
Definition: MdeModuleHii.h:119
EFI_STRING_ID VarName
A 16-bit Buffer Storage offset.
uint32_t string
Definition: multiboot.h:14
void efi_ifr_suppress_if_op(struct efi_ifr_builder *ifr)
Add suppress-if opcode to IFR builder.
Definition: efi_hii.c:419
UINT8 ExtendOpCode
EFI_IFR_EXTEND_OP_CLASS.
Definition: MdeModuleHii.h:118
struct MINMAXSTEP_DATA::@535 u64
u32 pad[9]
Padding.
Definition: ar9003_mac.h:90
#define offsetof(type, field)
Get offset of a field within a structure.
Definition: stddef.h:24
union _EFI_IFR_QUESTION_HEADER::@531 VarStoreInfo
EFI_GUID Guid
EFI_IFR_TIANO_GUID.
Definition: MdeModuleHii.h:114
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
#define EFI_IFR_TRUE_OP
struct MINMAXSTEP_DATA::@534 u32
void efi_ifr_false_op(struct efi_ifr_builder *ifr)
Add false opcode to IFR builder.
Definition: efi_hii.c:148
EFI_HII_STRING_BLOCK * strings
Strings.
Definition: efi_hii.h:27
static void * efi_ifr_op(struct efi_ifr_builder *ifr, unsigned int opcode, size_t len)
Add IFR opcode to IFR builder.
Definition: efi_hii.c:98
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
#define EFI_IFR_FORM_SET_OP
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define va_arg(ap, type)
Definition: stdarg.h:8
Device Class opcode.
Definition: MdeModuleHii.h:109
#define EFI_IFR_EXTEND_OP_SUBCLASS
Definition: MdeModuleHii.h:39
union _EFI_IFR_GET::@537 VarStoreInfo
EFI_IFR_QUESTION_HEADER Question
#define EFI_HII_PACKAGE_FORMS
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
#define EFI_IFR_SUPPRESS_IF_OP
#define EFI_HII_PACKAGE_STRINGS
char * strcpy(char *dest, const char *src)
Copy string.
Definition: string.c:326
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
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_form_op(struct efi_ifr_builder *ifr, unsigned int title_id)
Add form opcode to IFR builder.
Definition: efi_hii.c:166
The fixed header consists of a standard record header and then the string identifiers contained in th...
#define EFI_HII_PACKAGE_END
#define EFI_IFR_NUMERIC_SIZE_2
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
#define DBGC2_HDA(...)
Definition: compiler.h:523
size_t strings_len
Length of strings.
Definition: efi_hii.h:29
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
EFI_IFR_STATEMENT_HEADER Statement
size_t ops_len
Length of IFR opcodes.
Definition: efi_hii.h:25
SubClass opcode.
Definition: MdeModuleHii.h:130
#define EFI_IFR_GUID_OP
size_t strlen(const char *src)
Get length of string.
Definition: string.c:243
unsigned char uint8_t
Definition: stdint.h:10
struct MINMAXSTEP_DATA::@532 u8
int failed
An allocation has failed.
Definition: efi_hii.h:37
#define EFI_IFR_VARSTORE_NAME_VALUE_OP
#define EFI_IFR_EXTEND_OP_CLASS
Definition: MdeModuleHii.h:38
EFI_IFR_OP_HEADER * ops
IFR opcodes.
Definition: efi_hii.h:23
#define EFI_IFR_TIANO_GUID
GUIDed opcodes defined for EDKII implementation.
Definition: MdeModuleHii.h:27
void efi_ifr_free(struct efi_ifr_builder *ifr)
Free memory used by IFR builder.
Definition: efi_hii.c:505
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
EFI API.
uint64_t guid
GUID.
Definition: edd.h:30
static uint16_t struct vmbus_xfer_pages_operations * op
Definition: netvsc.h:327
#define EFI_IFR_NUMERIC_SIZE
uint32_t len
Length.
Definition: ena.h:14
__builtin_va_list va_list
Definition: stdarg.h:6
UINT8 VarStoreType
Specifies the type used for storage.
unsigned int efi_ifr_string(struct efi_ifr_builder *ifr, const char *fmt,...)
Add string to IFR builder.
Definition: efi_hii.c:45
#define EFI_IFR_NUMERIC_SIZE_1
The header found at the start of each package.
#define EFI_HII_SIBT_STRING_UCS2
void step(void)
Single-step a single process.
Definition: process.c:98
struct MINMAXSTEP_DATA::@533 u16
struct ena_aq_header header
Header.
Definition: ena.h:12
unsigned int form_id
Current form identifier.
Definition: efi_hii.h:35
uint32_t end
Ending offset.
Definition: netvsc.h:18
uint8_t size
Entry size (in 32-bit words)
Definition: ena.h:16
int ssize_t const char * fmt
Definition: vsprintf.h:72
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
Definition: malloc.c:521
#define EFI_IFR_TEXT_OP
An EFI IFR builder.
Definition: efi_hii.h:21
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition: acpi.c:45
#define va_start(ap, last)
Definition: stdarg.h:7
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
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define EFI_IFR_FORM_OP
EFI_VARSTORE_ID VarStoreId
Specifies the identifier of a previously declared variable store to use when retrieving the value.
The header found at the start of each package list.
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
String functions.
EFI_GUID Guid
EFI_IFR_TIANO_GUID.
Definition: MdeModuleHii.h:135
#define EFI_IFR_GET_OP
void * memset(void *dest, int character, size_t len) __nonnull
uint8_t flags
Flags.
Definition: ena.h:18