3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 The file contain all library function for Ifr Operations.
26 #include "EfiDriverLib.h"
29 #include EFI_PROTOCOL_DEFINITION (HiiFont)
30 #include EFI_PROTOCOL_DEFINITION (HiiImage)
31 #include EFI_PROTOCOL_DEFINITION (HiiString)
32 #include EFI_PROTOCOL_DEFINITION (HiiDatabase)
33 #include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
34 #include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
35 #include EFI_PROTOCOL_DEFINITION (FormBrowser2)
36 #include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
38 #include EFI_GUID_DEFINITION (GlobalVariable)
40 #define IFR_LIB_DEFAULT_STRING_SIZE 0x200
43 // The architectural variable "Lang" and "LangCodes" are deprecated in UEFI
44 // specification. While, UEFI specification also states that these deprecated
45 // variables may be provided for backwards compatibility.
46 // If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced;
47 // If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced.
51 #define EFI_LANGUAGE_VARIABLE L"Lang"
52 #define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"
54 #define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
55 #define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
58 // Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
59 // (42 characters plus a NULL terminator)
61 #define RFC_3066_ENTRY_SIZE (42 + 1)
62 #define ISO_639_2_ENTRY_SIZE 3
64 #define INVALID_VARSTORE_ID 0
66 #define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
67 #define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
69 extern EFI_GUID mIfrVendorGuid
;
70 extern EFI_HII_DATABASE_PROTOCOL
*gIfrLibHiiDatabase
;
71 extern EFI_HII_STRING_PROTOCOL
*gIfrLibHiiString
;
75 EFI_STRING_ID StringToken
;
76 EFI_IFR_TYPE_VALUE Value
;
82 VENDOR_DEVICE_PATH VendorDevicePath
;
83 UINT32 MonotonicCount
;
84 } HII_VENDOR_DEVICE_PATH_NODE
;
87 HII_VENDOR_DEVICE_PATH_NODE Node
;
88 EFI_DEVICE_PATH_PROTOCOL End
;
89 } HII_VENDOR_DEVICE_PATH
;
93 // Buffer size allocated for Data.
98 // Offset in Data to append the newly created opcode binary.
99 // It will be adjusted automatically in Create***OpCode(), and should be
100 // initialized to 0 before invocation of a serial of Create***OpCode()
105 // The destination buffer for created op-codes
108 } EFI_HII_UPDATE_DATA
;
117 This function locate Hii relative protocols for later usage.
129 // Exported Library functions
133 IN OUT EFI_HII_UPDATE_DATA
*Data
138 Create EFI_IFR_END_OP opcode.
141 Data - Destination for the created opcode binary
144 EFI_SUCCESS - Opcode create success
150 CreateDefaultOpCode (
151 IN EFI_IFR_TYPE_VALUE
*Value
,
153 IN OUT EFI_HII_UPDATE_DATA
*Data
158 Create EFI_IFR_DEFAULT_OP opcode.
161 Value - Value for the default
162 Type - Type for the default
163 Data - Destination for the created opcode binary
166 EFI_SUCCESS - Opcode create success
173 IN EFI_QUESTION_ID QuestionId
,
174 IN EFI_STRING_ID Prompt
,
175 IN EFI_STRING_ID Help
,
176 IN UINT8 QuestionFlags
,
177 IN EFI_STRING_ID QuestionConfig
,
178 IN OUT EFI_HII_UPDATE_DATA
*Data
183 Create EFI_IFR_ACTION_OP opcode.
186 QuestionId - Question ID
187 Prompt - String ID for Prompt
188 Help - String ID for Help
189 QuestionFlags - Flags in Question Header
190 QuestionConfig - String ID for configuration
191 Data - Destination for the created opcode binary
194 EFI_SUCCESS - Opcode create success
200 CreateSubTitleOpCode (
201 IN EFI_STRING_ID Prompt
,
202 IN EFI_STRING_ID Help
,
205 IN OUT EFI_HII_UPDATE_DATA
*Data
210 Create EFI_IFR_SUBTITLE_OP opcode.
213 Prompt - String ID for Prompt
214 Help - String ID for Help
215 Flags - Subtitle opcode flags
216 Scope - Subtitle Scope bit
217 Data - Destination for the created opcode binary
220 EFI_SUCCESS - Opcode create success
227 IN EFI_STRING_ID Prompt
,
228 IN EFI_STRING_ID Help
,
229 IN EFI_STRING_ID TextTwo
,
230 IN OUT EFI_HII_UPDATE_DATA
*Data
235 Create EFI_IFR_TEXT_OP opcode.
238 Prompt - String ID for Prompt
239 Help - String ID for Help
240 TextTwo - String ID for text two
241 Data - Destination for the created opcode binary
244 EFI_SUCCESS - Opcode create success
251 IN EFI_FORM_ID FormId
,
252 IN EFI_STRING_ID Prompt
,
253 IN EFI_STRING_ID Help
,
254 IN UINT8 QuestionFlags
,
255 IN EFI_QUESTION_ID QuestionId
,
256 IN OUT EFI_HII_UPDATE_DATA
*Data
261 Create EFI_IFR_REF_OP opcode.
264 FormId - Destination Form ID
265 Prompt - String ID for Prompt
266 Help - String ID for Help
267 QuestionFlags - Flags in Question Header
268 QuestionId - Question ID
269 Data - Destination for the created opcode binary
272 EFI_SUCCESS - Opcode create success
278 CreateOneOfOptionOpCode (
279 IN UINTN OptionCount
,
280 IN IFR_OPTION
*OptionsList
,
282 IN OUT EFI_HII_UPDATE_DATA
*Data
287 IN EFI_QUESTION_ID QuestionId
,
288 IN EFI_VARSTORE_ID VarStoreId
,
290 IN EFI_STRING_ID Prompt
,
291 IN EFI_STRING_ID Help
,
292 IN UINT8 QuestionFlags
,
294 IN IFR_OPTION
*OptionsList
,
295 IN UINTN OptionCount
,
296 IN OUT EFI_HII_UPDATE_DATA
*Data
301 Create EFI_IFR_ONE_OF_OP opcode.
304 QuestionId - Question ID
305 VarStoreId - Storage ID
306 VarOffset - Offset in Storage
307 Prompt - String ID for Prompt
308 Help - String ID for Help
309 QuestionFlags - Flags in Question Header
310 OneOfFlags - Flags for oneof opcode
311 OptionsList - List of options
312 OptionCount - Number of options in option list
313 Data - Destination for the created opcode binary
316 EFI_SUCCESS - Opcode create success
322 CreateOrderedListOpCode (
323 IN EFI_QUESTION_ID QuestionId
,
324 IN EFI_VARSTORE_ID VarStoreId
,
326 IN EFI_STRING_ID Prompt
,
327 IN EFI_STRING_ID Help
,
328 IN UINT8 QuestionFlags
,
331 IN UINT8 MaxContainers
,
332 IN IFR_OPTION
*OptionsList
,
333 IN UINTN OptionCount
,
334 IN OUT EFI_HII_UPDATE_DATA
*Data
339 Create EFI_IFR_ORDERED_LIST_OP opcode.
342 QuestionId - Question ID
343 VarStoreId - Storage ID
344 VarOffset - Offset in Storage
345 Prompt - String ID for Prompt
346 Help - String ID for Help
347 QuestionFlags - Flags in Question Header
348 Flags - Flags for ordered list opcode
349 DataType - Type for option value
350 MaxContainers - Maximum count for options in this ordered list
351 OptionsList - List of options
352 OptionCount - Number of options in option list
353 Data - Destination for the created opcode binary
356 EFI_SUCCESS - Opcode create success
362 CreateCheckBoxOpCode (
363 IN EFI_QUESTION_ID QuestionId
,
364 IN EFI_VARSTORE_ID VarStoreId
,
366 IN EFI_STRING_ID Prompt
,
367 IN EFI_STRING_ID Help
,
368 IN UINT8 QuestionFlags
,
369 IN UINT8 CheckBoxFlags
,
370 IN OUT EFI_HII_UPDATE_DATA
*Data
375 Create EFI_IFR_CHECKBOX_OP opcode.
378 QuestionId - Question ID
379 VarStoreId - Storage ID
380 VarOffset - Offset in Storage
381 Prompt - String ID for Prompt
382 Help - String ID for Help
383 QuestionFlags - Flags in Question Header
384 CheckBoxFlags - Flags for checkbox opcode
385 Data - Destination for the created opcode binary
388 EFI_SUCCESS - Opcode create success
394 CreateNumericOpCode (
395 IN EFI_QUESTION_ID QuestionId
,
396 IN EFI_VARSTORE_ID VarStoreId
,
398 IN EFI_STRING_ID Prompt
,
399 IN EFI_STRING_ID Help
,
400 IN UINT8 QuestionFlags
,
401 IN UINT8 NumericFlags
,
406 IN OUT EFI_HII_UPDATE_DATA
*Data
411 Create EFI_IFR_NUMERIC_OP opcode.
414 QuestionId - Question ID
415 VarStoreId - Storage ID
416 VarOffset - Offset in Storage
417 Prompt - String ID for Prompt
418 Help - String ID for Help
419 QuestionFlags - Flags in Question Header
420 NumericFlags - Flags for numeric opcode
421 Minimum - Numeric minimum value
422 Maximum - Numeric maximum value
423 Step - Numeric step for edit
424 Default - Numeric default value
425 Data - Destination for the created opcode binary
428 EFI_SUCCESS - Opcode create success
435 IN EFI_QUESTION_ID QuestionId
,
436 IN EFI_VARSTORE_ID VarStoreId
,
438 IN EFI_STRING_ID Prompt
,
439 IN EFI_STRING_ID Help
,
440 IN UINT8 QuestionFlags
,
441 IN UINT8 StringFlags
,
444 IN OUT EFI_HII_UPDATE_DATA
*Data
449 Create EFI_IFR_STRING_OP opcode.
452 QuestionId - Question ID
453 VarStoreId - Storage ID
454 VarOffset - Offset in Storage
455 Prompt - String ID for Prompt
456 Help - String ID for Help
457 QuestionFlags - Flags in Question Header
458 StringFlags - Flags for string opcode
459 MinSize - String minimum length
460 MaxSize - String maximum length
461 Data - Destination for the created opcode binary
464 EFI_SUCCESS - Opcode create success
471 IN EFI_STRING_ID Title
,
472 IN UINT16 LineNumber
,
474 IN OUT EFI_HII_UPDATE_DATA
*Data
479 Create GUIDed opcode for banner.
482 Title - String ID for title
483 LineNumber - Line number for this banner
484 Alignment - Alignment for this banner, left, center or right
485 Data - Destination for the created opcode binary
488 EFI_SUCCESS - Opcode create success
493 EFI_HII_PACKAGE_LIST_HEADER
*
495 IN UINTN NumberOfPackages
,
502 Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
505 NumberOfPackages - Number of packages.
506 GuidId - Package GUID.
509 Pointer of EFI_HII_PACKAGE_LIST_HEADER.
515 CreateHiiDriverHandle (
516 OUT EFI_HANDLE
*DriverHandle
521 The HII driver handle passed in for HiiDatabase.NewPackageList() requires
522 that there should be DevicePath Protocol installed on it.
523 This routine create a virtual Driver Handle by installing a vendor device
524 path on it, so as to use it to invoke HiiDatabase.NewPackageList().
527 DriverHandle - Handle to be returned
530 EFI_SUCCESS - Handle destroy success.
531 EFI_OUT_OF_RESOURCES - Not enough memory.
537 DestroyHiiDriverHandle (
538 IN EFI_HANDLE DriverHandle
543 Destroy the Driver Handle created by CreateHiiDriverHandle().
546 DriverHandle - Handle returned by CreateHiiDriverHandle()
549 EFI_SUCCESS - Handle destroy success.
550 other - Handle destroy fail.
556 DevicePathToHiiHandle (
557 IN EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
,
558 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
563 Find HII Handle associated with given Device Path.
566 HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
567 DevicePath - Device Path associated with the HII package list handle.
570 Handle - HII package list Handle associated with the Device Path.
571 NULL - Hii Package list handle is not found.
579 IN UINTN
*BufferSize
,
586 Configure the buffer accrording to ConfigBody strings.
589 DefaultId - the ID of default.
590 Buffer - the start address of buffer.
591 BufferSize - the size of buffer.
592 Number - the number of the strings.
595 EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
596 EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
597 EFI_SUCCESS - Operation successful.
603 ExtractGuidFromHiiHandle (
604 IN EFI_HII_HANDLE Handle
,
610 Extract Hii package list GUID for given HII handle.
613 HiiHandle - Hii handle
614 Guid - Package list GUID
617 EFI_SUCCESS - Successfully extract GUID from Hii database.
623 ExtractClassFromHiiHandle (
624 IN EFI_HII_HANDLE Handle
,
626 OUT EFI_STRING_ID
*FormSetTitle
,
627 OUT EFI_STRING_ID
*FormSetHelp
632 Extract formset class for given HII handle.
635 HiiHandle - Hii handle
636 Class - Class of the formset
637 FormSetTitle - Formset title string
638 FormSetHelp - Formset help string
641 EFI_SUCCESS - Successfully extract Class for specified Hii handle.
655 Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
658 Str - String for output
659 Buffer - Binary buffer.
660 BufferSize - Size of the buffer in bytes.
663 EFI_SUCCESS - The function completed successfully.
670 IN OUT UINT8
*Buffer
,
671 IN OUT UINTN
*BufferSize
,
677 Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
680 Buffer - Pointer to buffer that receives the data.
681 BufferSize - Length in bytes of the buffer to hold converted data.
682 If routine return with EFI_SUCCESS, containing length of converted data.
683 If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
684 Str - String to be converted from.
687 EFI_SUCCESS - The function completed successfully.
694 IN OUT CHAR16
*ConfigHdr
,
695 IN OUT UINTN
*StrBufferLen
,
697 IN CHAR16
*Name
, OPTIONAL
698 IN EFI_HANDLE
*DriverHandle
703 Construct <ConfigHdr> using routing information GUID/NAME/PATH.
706 ConfigHdr - Pointer to the ConfigHdr string.
707 StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.
709 If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
710 If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
711 Guid - Routing information: GUID.
712 Name - Routing information: NAME.
713 DriverHandle - Driver handle which contains the routing information: PATH.
716 EFI_SUCCESS - Routine success.
717 EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
724 IN OUT CHAR16
*String
,
731 Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
734 String - The string to be searched in.
735 Offset - Offset in BlockName.
736 Width - Width in BlockName.
739 TRUE - Block name found.
740 FALSE - Block name not found.
747 EFI_GUID
*VariableGuid
, OPTIONAL
748 CHAR16
*VariableName
, OPTIONAL
755 This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
758 VariableGuid - An optional field to indicate the target variable GUID name to use.
759 VariableName - An optional field to indicate the target human-readable variable name.
760 BufferSize - On input: Length in bytes of buffer to hold retrived data.
762 If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
763 Buffer - Buffer to hold retrived data.
766 EFI_SUCCESS - Routine success.
767 EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
774 IN OUT UINTN
*HandleBufferLength
,
775 OUT EFI_HII_HANDLE
**HiiHandleBuffer
780 Determines the handles that are currently active in the database.
781 It's the caller's responsibility to free handle buffer.
784 HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
785 HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
786 the length of the handle buffer that is required for the handles found.
787 HiiHandleBuffer - Pointer to an array of Hii Handles returned.
790 EFI_SUCCESS - Get an array of Hii Handles successfully.
791 EFI_INVALID_PARAMETER - Hii is NULL.
792 EFI_NOT_FOUND - Database not found.
799 EFI_GUID
*VariableGuid
, OPTIONAL
800 CHAR16
*VariableName
, OPTIONAL
803 CHAR16
*RequestElement OPTIONAL
808 This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
811 VariableGuid - An optional field to indicate the target variable GUID name to use.
812 VariableName - An optional field to indicate the target human-readable variable name.
813 BufferSize - Length in bytes of buffer to hold retrived data.
814 Buffer - Buffer to hold retrived data.
815 RequestElement - An optional field to specify which part of the buffer data
816 will be send back to Browser. If NULL, the whole buffer of
817 data will be committed to Browser.
818 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
821 EFI_SUCCESS - Routine success.
822 Other - Updating Browser uncommitted data failed.
828 ConvertRfc3066LanguageToIso639Language (
829 CHAR8
*LanguageRfc3066
,
830 CHAR8
*LanguageIso639
835 Convert language code from RFC3066 to ISO639-2.
838 LanguageRfc3066 - RFC3066 language code.
839 LanguageIso639 - ISO639-2 language code.
842 EFI_SUCCESS - Language code converted.
843 EFI_NOT_FOUND - Language code not found.
850 CHAR8
*SupportedLanguages
855 Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
856 be converted to "engfra".
859 SupportedLanguages - The RFC3066 language list.
862 The ISO639-2 language list.
874 Determine what is the current language setting
877 Lang - Pointer of system language
887 IN OUT CHAR8
**LangCode
,
893 Get next language from language code list.
896 LangCode - The language code.
897 Lang - Returned language.
906 GetSupportedLanguages (
907 IN EFI_HII_HANDLE HiiHandle
912 This function returns the list of supported languages, in the format specified
913 in UEFI specification Appendix M.
916 HiiHandle - The HII package list handle.
919 The supported languages.
925 GetSupportedLanguageNumber (
926 IN EFI_HII_HANDLE HiiHandle
931 This function returns the number of supported languages
934 HiiHandle - The HII package list handle.
937 The number of supported languages.
943 GetStringFromHandle (
944 IN EFI_HII_HANDLE HiiHandle
,
945 IN EFI_STRING_ID StringId
,
946 OUT EFI_STRING
*String
951 Get string specified by StringId form the HiiHandle.
954 HiiHandle - The HII handle of package list.
955 StringId - The String ID.
956 String - The output string.
959 EFI_NOT_FOUND - String is not found.
960 EFI_SUCCESS - Operation is successful.
961 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
962 EFI_INVALID_PARAMETER - The String is NULL.
969 IN EFI_GUID
*ProducerGuid
,
970 IN EFI_STRING_ID StringId
,
971 OUT EFI_STRING
*String
976 Get the string given the StringId and String package Producer's Guid.
979 ProducerGuid - The Guid of String package list.
980 StringId - The String ID.
981 String - The output string.
984 EFI_NOT_FOUND - String is not found.
985 EFI_SUCCESS - Operation is successful.
986 EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
993 IN EFI_HII_HANDLE PackageList
,
994 OUT EFI_STRING_ID
*StringId
,
995 IN CONST EFI_STRING String
1000 This function adds the string into String Package of each language.
1003 PackageList - Handle of the package list where this string will be added.
1004 StringId - On return, contains the new strings id, which is unique within PackageList.
1005 String - Points to the new null-terminated string.
1008 EFI_SUCCESS - The new string was added successfully.
1009 EFI_NOT_FOUND - The specified PackageList could not be found in database.
1010 EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
1011 EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
1018 IN EFI_HII_HANDLE PackageList
,
1019 IN EFI_STRING_ID StringId
,
1020 OUT EFI_STRING String
,
1021 IN OUT UINTN
*StringSize
1025 Routine Description:
1026 This function try to retrieve string from String package of current language.
1027 If fail, it try to retrieve string from String package of first language it support.
1030 PackageList - The package list in the HII database to search for the specified string.
1031 StringId - The string's id, which is unique within PackageList.
1032 String - Points to the new null-terminated string.
1033 StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
1034 points to the length of the string, in bytes.
1037 EFI_SUCCESS - The string was returned successfully.
1038 EFI_NOT_FOUND - The string specified by StringId is not available.
1039 EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
1040 EFI_INVALID_PARAMETER - The String or StringSize was NULL.
1047 IN EFI_HII_HANDLE PackageList
,
1048 IN EFI_STRING_ID StringId
,
1049 IN CONST EFI_STRING String
1053 Routine Description:
1054 This function updates the string in String package of current language.
1057 PackageList - The package list containing the strings.
1058 StringId - The string's id, which is unique within PackageList.
1059 String - Points to the new null-terminated string.
1062 EFI_SUCCESS - The string was updated successfully.
1063 EFI_NOT_FOUND - The string specified by StringId is not in the database.
1064 EFI_INVALID_PARAMETER - The String was NULL.
1065 EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
1072 IN UINTN NumberOfLines
,
1073 OUT EFI_INPUT_KEY
*KeyValue
,
1079 Routine Description:
1080 Draw a dialog and return the selected key.
1083 NumberOfLines - The number of lines for the dialog box
1084 KeyValue - The EFI_KEY value returned if HotKey is TRUE..
1085 String - Pointer to the first string in the list
1086 ... - A series of (quantity == NumberOfLines) text strings which
1087 will be used to construct the dialog box
1090 EFI_SUCCESS - Displayed dialog and received user interaction
1091 EFI_INVALID_PARAMETER - One of the parameters was invalid.
1098 IN EFI_HII_HANDLE Handle
,
1099 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1100 IN EFI_FORM_ID FormId
,
1103 IN EFI_HII_UPDATE_DATA
*Data
1107 Routine Description:
1108 This function allows the caller to update a form that has
1109 previously been registered with the EFI HII database.
1113 FormSetGuid - The formset should be updated.
1114 FormId - The form should be updated.
1115 Label - Update information starting immediately after this label in the IFR
1116 Insert - If TRUE and Data is not NULL, insert data after Label.
1117 If FALSE, replace opcodes between two labels with Data.
1118 Data - The adding data; If NULL, remove opcodes between two Label.
1121 EFI_SUCCESS - Update success.
1122 Other - Update fail.