+ EFI_QUESTION_ID QuestionId;\r
+ EFI_FORM_ID FormId;\r
+ EFI_GUID FormSetGuid;\r
+ EFI_STRING_ID DevicePath;\r
+} EFI_HII_REF;\r
+\r
+typedef union {\r
+ UINT8 u8;\r
+ UINT16 u16;\r
+ UINT32 u32;\r
+ UINT64 u64;\r
+ BOOLEAN b;\r
+ EFI_HII_TIME time;\r
+ EFI_HII_DATE date;\r
+ EFI_STRING_ID string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION\r
+ EFI_HII_REF ref; ///< EFI_IFR_TYPE_REF\r
+ // UINT8 buffer[]; ///< EFI_IFR_TYPE_BUFFER\r
+} EFI_IFR_TYPE_VALUE;\r
+\r
+//\r
+// IFR Opcodes\r
+//\r
+#define EFI_IFR_FORM_OP 0x01\r
+#define EFI_IFR_SUBTITLE_OP 0x02\r
+#define EFI_IFR_TEXT_OP 0x03\r
+#define EFI_IFR_IMAGE_OP 0x04\r
+#define EFI_IFR_ONE_OF_OP 0x05\r
+#define EFI_IFR_CHECKBOX_OP 0x06\r
+#define EFI_IFR_NUMERIC_OP 0x07\r
+#define EFI_IFR_PASSWORD_OP 0x08\r
+#define EFI_IFR_ONE_OF_OPTION_OP 0x09\r
+#define EFI_IFR_SUPPRESS_IF_OP 0x0A\r
+#define EFI_IFR_LOCKED_OP 0x0B\r
+#define EFI_IFR_ACTION_OP 0x0C\r
+#define EFI_IFR_RESET_BUTTON_OP 0x0D\r
+#define EFI_IFR_FORM_SET_OP 0x0E\r
+#define EFI_IFR_REF_OP 0x0F\r
+#define EFI_IFR_NO_SUBMIT_IF_OP 0x10\r
+#define EFI_IFR_INCONSISTENT_IF_OP 0x11\r
+#define EFI_IFR_EQ_ID_VAL_OP 0x12\r
+#define EFI_IFR_EQ_ID_ID_OP 0x13\r
+#define EFI_IFR_EQ_ID_VAL_LIST_OP 0x14\r
+#define EFI_IFR_AND_OP 0x15\r
+#define EFI_IFR_OR_OP 0x16\r
+#define EFI_IFR_NOT_OP 0x17\r
+#define EFI_IFR_RULE_OP 0x18\r
+#define EFI_IFR_GRAY_OUT_IF_OP 0x19\r
+#define EFI_IFR_DATE_OP 0x1A\r
+#define EFI_IFR_TIME_OP 0x1B\r
+#define EFI_IFR_STRING_OP 0x1C\r
+#define EFI_IFR_REFRESH_OP 0x1D\r
+#define EFI_IFR_DISABLE_IF_OP 0x1E\r
+#define EFI_IFR_ANIMATION_OP 0x1F\r
+#define EFI_IFR_TO_LOWER_OP 0x20\r
+#define EFI_IFR_TO_UPPER_OP 0x21\r
+#define EFI_IFR_MAP_OP 0x22\r
+#define EFI_IFR_ORDERED_LIST_OP 0x23\r
+#define EFI_IFR_VARSTORE_OP 0x24\r
+#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25\r
+#define EFI_IFR_VARSTORE_EFI_OP 0x26\r
+#define EFI_IFR_VARSTORE_DEVICE_OP 0x27\r
+#define EFI_IFR_VERSION_OP 0x28\r
+#define EFI_IFR_END_OP 0x29\r
+#define EFI_IFR_MATCH_OP 0x2A\r
+#define EFI_IFR_GET_OP 0x2B\r
+#define EFI_IFR_SET_OP 0x2C\r
+#define EFI_IFR_READ_OP 0x2D\r
+#define EFI_IFR_WRITE_OP 0x2E\r
+#define EFI_IFR_EQUAL_OP 0x2F\r
+#define EFI_IFR_NOT_EQUAL_OP 0x30\r
+#define EFI_IFR_GREATER_THAN_OP 0x31\r
+#define EFI_IFR_GREATER_EQUAL_OP 0x32\r
+#define EFI_IFR_LESS_THAN_OP 0x33\r
+#define EFI_IFR_LESS_EQUAL_OP 0x34\r
+#define EFI_IFR_BITWISE_AND_OP 0x35\r
+#define EFI_IFR_BITWISE_OR_OP 0x36\r
+#define EFI_IFR_BITWISE_NOT_OP 0x37\r
+#define EFI_IFR_SHIFT_LEFT_OP 0x38\r
+#define EFI_IFR_SHIFT_RIGHT_OP 0x39\r
+#define EFI_IFR_ADD_OP 0x3A\r
+#define EFI_IFR_SUBTRACT_OP 0x3B\r
+#define EFI_IFR_MULTIPLY_OP 0x3C\r
+#define EFI_IFR_DIVIDE_OP 0x3D\r
+#define EFI_IFR_MODULO_OP 0x3E\r
+#define EFI_IFR_RULE_REF_OP 0x3F\r
+#define EFI_IFR_QUESTION_REF1_OP 0x40\r
+#define EFI_IFR_QUESTION_REF2_OP 0x41\r
+#define EFI_IFR_UINT8_OP 0x42\r
+#define EFI_IFR_UINT16_OP 0x43\r
+#define EFI_IFR_UINT32_OP 0x44\r
+#define EFI_IFR_UINT64_OP 0x45\r
+#define EFI_IFR_TRUE_OP 0x46\r
+#define EFI_IFR_FALSE_OP 0x47\r
+#define EFI_IFR_TO_UINT_OP 0x48\r
+#define EFI_IFR_TO_STRING_OP 0x49\r
+#define EFI_IFR_TO_BOOLEAN_OP 0x4A\r
+#define EFI_IFR_MID_OP 0x4B\r
+#define EFI_IFR_FIND_OP 0x4C\r
+#define EFI_IFR_TOKEN_OP 0x4D\r
+#define EFI_IFR_STRING_REF1_OP 0x4E\r
+#define EFI_IFR_STRING_REF2_OP 0x4F\r
+#define EFI_IFR_CONDITIONAL_OP 0x50\r
+#define EFI_IFR_QUESTION_REF3_OP 0x51\r
+#define EFI_IFR_ZERO_OP 0x52\r
+#define EFI_IFR_ONE_OP 0x53\r
+#define EFI_IFR_ONES_OP 0x54\r
+#define EFI_IFR_UNDEFINED_OP 0x55\r
+#define EFI_IFR_LENGTH_OP 0x56\r
+#define EFI_IFR_DUP_OP 0x57\r
+#define EFI_IFR_THIS_OP 0x58\r
+#define EFI_IFR_SPAN_OP 0x59\r
+#define EFI_IFR_VALUE_OP 0x5A\r
+#define EFI_IFR_DEFAULT_OP 0x5B\r
+#define EFI_IFR_DEFAULTSTORE_OP 0x5C\r
+#define EFI_IFR_FORM_MAP_OP 0x5D\r
+#define EFI_IFR_CATENATE_OP 0x5E\r
+#define EFI_IFR_GUID_OP 0x5F\r
+#define EFI_IFR_SECURITY_OP 0x60\r
+#define EFI_IFR_MODAL_TAG_OP 0x61\r
+#define EFI_IFR_REFRESH_ID_OP 0x62\r
+#define EFI_IFR_WARNING_IF_OP 0x63\r
+#define EFI_IFR_MATCH2_OP 0x64\r
+\r
+//\r
+// Definitions of IFR Standard Headers\r
+// Section 27.3.8.2\r
+//\r
+\r
+typedef struct _EFI_IFR_OP_HEADER {\r
+ UINT8 OpCode;\r
+ UINT8 Length:7;\r
+ UINT8 Scope:1;\r
+} EFI_IFR_OP_HEADER;\r
+\r
+typedef struct _EFI_IFR_STATEMENT_HEADER {\r
+ EFI_STRING_ID Prompt;\r
+ EFI_STRING_ID Help;\r
+} EFI_IFR_STATEMENT_HEADER;\r
+\r
+typedef struct _EFI_IFR_QUESTION_HEADER {\r
+ EFI_IFR_STATEMENT_HEADER Header;\r
+ EFI_QUESTION_ID QuestionId;\r
+ EFI_VARSTORE_ID VarStoreId;\r
+ union {\r
+ EFI_STRING_ID VarName;\r
+ UINT16 VarOffset;\r
+ } VarStoreInfo;\r
+ UINT8 Flags;\r
+} EFI_IFR_QUESTION_HEADER;\r
+\r
+//\r
+// Flag values of EFI_IFR_QUESTION_HEADER\r
+//\r
+#define EFI_IFR_FLAG_READ_ONLY 0x01\r
+#define EFI_IFR_FLAG_CALLBACK 0x04\r
+#define EFI_IFR_FLAG_RESET_REQUIRED 0x10\r
+#define EFI_IFR_FLAG_RECONNECT_REQUIRED 0x40\r
+#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80\r
+\r
+//\r
+// Definition for Opcode Reference\r
+// Section 27.3.8.3\r
+//\r
+typedef struct _EFI_IFR_DEFAULTSTORE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_STRING_ID DefaultName;\r
+ UINT16 DefaultId;\r
+} EFI_IFR_DEFAULTSTORE;\r
+\r
+//\r
+// Default Identifier of default store\r
+//\r
+#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000\r
+#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001\r
+#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002\r
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000\r
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff\r
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000\r
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff\r
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000\r
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff\r
+\r
+typedef struct _EFI_IFR_VARSTORE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_GUID Guid;\r
+ EFI_VARSTORE_ID VarStoreId;\r
+ UINT16 Size;\r
+ UINT8 Name[1];\r
+} EFI_IFR_VARSTORE;\r
+\r
+typedef struct _EFI_IFR_VARSTORE_EFI {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_VARSTORE_ID VarStoreId;\r
+ EFI_GUID Guid;\r
+ UINT32 Attributes;\r
+ UINT16 Size;\r
+ UINT8 Name[1];\r
+} EFI_IFR_VARSTORE_EFI;\r
+\r
+typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_VARSTORE_ID VarStoreId;\r
+ EFI_GUID Guid;\r
+} EFI_IFR_VARSTORE_NAME_VALUE;\r
+\r
+typedef struct _EFI_IFR_FORM_SET {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_GUID Guid;\r
+ EFI_STRING_ID FormSetTitle;\r
+ EFI_STRING_ID Help;\r
+ UINT8 Flags;\r
+ // EFI_GUID ClassGuid[];\r
+} EFI_IFR_FORM_SET;\r
+\r
+typedef struct _EFI_IFR_END {\r
+ EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_END;\r
+\r
+typedef struct _EFI_IFR_FORM {\r
+ EFI_IFR_OP_HEADER Header;\r
+ UINT16 FormId;\r
+ EFI_STRING_ID FormTitle;\r
+} EFI_IFR_FORM;\r
+\r
+typedef struct _EFI_IFR_IMAGE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IMAGE_ID Id;\r
+} EFI_IFR_IMAGE;\r
+\r
+typedef struct _EFI_IFR_MODAL_TAG {\r
+ EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_MODAL_TAG;\r
+\r
+typedef struct _EFI_IFR_LOCKED {\r
+ EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_LOCKED;\r
+\r
+typedef struct _EFI_IFR_RULE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ UINT8 RuleId;\r
+} EFI_IFR_RULE;\r
+\r
+typedef struct _EFI_IFR_DEFAULT {\r
+ EFI_IFR_OP_HEADER Header;\r
+ UINT16 DefaultId;\r
+ UINT8 Type;\r
+ EFI_IFR_TYPE_VALUE Value;\r
+} EFI_IFR_DEFAULT;\r
+\r
+typedef struct _EFI_IFR_DEFAULT_2 {\r
+ EFI_IFR_OP_HEADER Header;\r
+ UINT16 DefaultId;\r
+ UINT8 Type;\r
+} EFI_IFR_DEFAULT_2;\r
+\r
+typedef struct _EFI_IFR_VALUE {\r
+ EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_VALUE;\r
+\r
+typedef struct _EFI_IFR_SUBTITLE {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_STATEMENT_HEADER Statement;\r
+ UINT8 Flags;\r
+} EFI_IFR_SUBTITLE;\r
+\r
+#define EFI_IFR_FLAGS_HORIZONTAL 0x01\r
+\r
+typedef struct _EFI_IFR_CHECKBOX {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_QUESTION_HEADER Question;\r
+ UINT8 Flags;\r
+} EFI_IFR_CHECKBOX;\r
+\r
+#define EFI_IFR_CHECKBOX_DEFAULT 0x01\r
+#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02\r
+\r
+typedef struct _EFI_IFR_TEXT {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_STATEMENT_HEADER Statement;\r
+ EFI_STRING_ID TextTwo;\r
+} EFI_IFR_TEXT;\r
+\r
+typedef struct _EFI_IFR_REF {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_QUESTION_HEADER Question;\r
+ EFI_FORM_ID FormId;\r
+} EFI_IFR_REF;\r
+\r
+typedef struct _EFI_IFR_REF2 {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_QUESTION_HEADER Question;\r
+ EFI_FORM_ID FormId;\r
+ EFI_QUESTION_ID QuestionId;\r
+} EFI_IFR_REF2;\r
+\r
+typedef struct _EFI_IFR_REF3 {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_QUESTION_HEADER Question;\r
+ EFI_FORM_ID FormId;\r
+ EFI_QUESTION_ID QuestionId;\r
+ EFI_GUID FormSetId;\r
+} EFI_IFR_REF3;\r
+\r
+typedef struct _EFI_IFR_REF4 {\r
+ EFI_IFR_OP_HEADER Header;\r
+ EFI_IFR_QUESTION_HEADER Question;\r
+ EFI_FORM_ID FormId;\r
+ EFI_QUESTION_ID QuestionId;\r
+ EFI_GUID FormSetId;\r
+ EFI_STRING_ID DevicePath;\r
+} EFI_IFR_REF4;\r
+\r
+typedef struct _EFI_IFR_REF5 {\r