iPXE
efi_hii.h
Go to the documentation of this file.
00001 #ifndef _IPXE_EFI_HII_H
00002 #define _IPXE_EFI_HII_H
00003 
00004 /** @file
00005  *
00006  * EFI human interface infrastructure
00007  */
00008 
00009 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00010 
00011 #include <string.h>
00012 #include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h>
00013 #include <ipxe/efi/Guid/MdeModuleHii.h>
00014 
00015 /** GUID indicating formset compliance for IBM Unified Configuration Manager */
00016 #define EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID                             \
00017         { 0x5c8e9746, 0xa5f7, 0x4593,                                      \
00018           { 0xaf, 0x1f, 0x66, 0xa8, 0x2a, 0xa1, 0x9c, 0xb1 } }
00019 
00020 /** An EFI IFR builder */
00021 struct efi_ifr_builder {
00022         /** IFR opcodes */
00023         EFI_IFR_OP_HEADER *ops;
00024         /** Length of IFR opcodes */
00025         size_t ops_len;
00026         /** Strings */
00027         EFI_HII_STRING_BLOCK *strings;
00028         /** Length of strings */
00029         size_t strings_len;
00030         /** Current string identifier */
00031         unsigned int string_id;
00032         /** Current variable store identifier */
00033         unsigned int varstore_id;
00034         /** Current form identifier */
00035         unsigned int form_id;
00036         /** An allocation has failed */
00037         int failed;
00038 };
00039 
00040 /**
00041  * Initialise IFR builder
00042  *
00043  * @v ifr               IFR builder
00044  *
00045  * The caller must eventually call efi_ifr_free() to free the dynamic
00046  * storage associated with the IFR builder.
00047  */
00048 static inline void efi_ifr_init ( struct efi_ifr_builder *ifr ) {
00049         memset ( ifr, 0, sizeof ( *ifr ) );
00050 }
00051 
00052 extern unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr,
00053                                      const char *fmt, ... );
00054 extern void efi_ifr_end_op ( struct efi_ifr_builder *ifr );
00055 extern void efi_ifr_false_op ( struct efi_ifr_builder *ifr );
00056 extern unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr,
00057                                       unsigned int title_id );
00058 extern void efi_ifr_form_set_op ( struct efi_ifr_builder *ifr,
00059                                   const EFI_GUID *guid,
00060                                   unsigned int title_id, unsigned int help_id,
00061                                   ... );
00062 void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id,
00063                       unsigned int varstore_info, unsigned int varstore_type );
00064 extern void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr,
00065                                     unsigned int class );
00066 extern void efi_ifr_guid_subclass_op ( struct efi_ifr_builder *ifr,
00067                                        unsigned int subclass );
00068 extern void efi_ifr_numeric_op ( struct efi_ifr_builder *ifr,
00069                                  unsigned int prompt_id,
00070                                  unsigned int help_id, unsigned int question_id,
00071                                  unsigned int varstore_id,
00072                                  unsigned int varstore_info,
00073                                  unsigned int vflags, unsigned long min_value,
00074                                  unsigned long max_value, unsigned int step,
00075                                  unsigned int flags );
00076 extern void efi_ifr_string_op ( struct efi_ifr_builder *ifr,
00077                                 unsigned int prompt_id, unsigned int help_id,
00078                                 unsigned int question_id,
00079                                 unsigned int varstore_id,
00080                                 unsigned int varstore_info, unsigned int vflags,
00081                                 unsigned int min_size, unsigned int max_size,
00082                                 unsigned int flags );
00083 extern void efi_ifr_suppress_if_op ( struct efi_ifr_builder *ifr );
00084 extern void efi_ifr_text_op ( struct efi_ifr_builder *ifr,
00085                               unsigned int prompt_id, unsigned int help_id,
00086                               unsigned int text_id );
00087 extern void efi_ifr_true_op ( struct efi_ifr_builder *ifr );
00088 extern unsigned int
00089 efi_ifr_varstore_name_value_op ( struct efi_ifr_builder *ifr,
00090                                  const EFI_GUID *guid );
00091 extern void efi_ifr_free ( struct efi_ifr_builder *ifr );
00092 extern EFI_HII_PACKAGE_LIST_HEADER *
00093 efi_ifr_package ( struct efi_ifr_builder *ifr, const EFI_GUID *guid,
00094                   const char *language, unsigned int language_id );
00095 
00096 #endif /* _IPXE_EFI_HII_H */