]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / EfiIfrSupportLib / IfrLibrary.h
1 /*++
2
3 Copyright (c) 2004 - 2005, 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
8
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.
11
12 Module Name:
13
14 IfrLibrary.h
15
16 Abstract:
17 The file contain all library function for Ifr Operations.
18
19 --*/
20
21 #ifndef _IFRLIBRARY_H
22 #define _IFRLIBRARY_H
23
24 #include "Tiano.h"
25 #include "EfiDriverLib.h"
26
27 #include EFI_PROTOCOL_DEFINITION (Hii)
28 #include EFI_GUID_DEFINITION (GlobalVariable)
29
30 #define DEFAULT_FORM_BUFFER_SIZE 0xFFFF
31 #define DEFAULT_STRING_BUFFER_SIZE 0xFFFF
32
33 #pragma pack(1)
34 typedef struct {
35 CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation
36 STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already)
37 UINT16 Value;
38 UINT8 Flags;
39 UINT16 Key;
40 } IFR_OPTION;
41 #pragma pack()
42
43 EFI_STATUS
44 GetCurrentLanguage (
45 OUT CHAR16 *Lang
46 )
47 /*++
48
49 Routine Description:
50
51 Determine what is the current language setting
52
53 Arguments:
54
55 Lang - Pointer of system language
56
57 Returns:
58
59 Status code
60
61 --*/
62 ;
63
64 EFI_STATUS
65 AddString (
66 IN VOID *StringBuffer,
67 IN CHAR16 *Language,
68 IN CHAR16 *String,
69 IN OUT STRING_REF *StringToken
70 )
71 /*++
72
73 Routine Description:
74
75 Add a string to the incoming buffer and return the token and offset data
76
77 Arguments:
78
79 StringBuffer - The incoming buffer
80
81 Language - Currrent language
82
83 String - The string to be added
84
85 StringToken - The index where the string placed
86
87 Returns:
88
89 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
90
91 EFI_SUCCESS - String successfully added to the incoming buffer
92
93 --*/
94 ;
95
96 EFI_STATUS
97 AddOpCode (
98 IN VOID *FormBuffer,
99 IN OUT VOID *OpCodeData
100 )
101 /*++
102
103 Routine Description:
104
105 Add op-code data to the FormBuffer
106
107 Arguments:
108
109 FormBuffer - Form buffer to be inserted to
110
111 OpCodeData - Op-code data to be inserted
112
113 Returns:
114
115 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
116
117 EFI_SUCCESS - Op-code data successfully inserted
118
119 --*/
120 ;
121
122 EFI_STATUS
123 CreateFormSet (
124 IN CHAR16 *FormSetTitle,
125 IN EFI_GUID *Guid,
126 IN UINT8 Class,
127 IN UINT8 SubClass,
128 IN OUT VOID **FormBuffer,
129 IN OUT VOID **StringBuffer
130 )
131 /*++
132
133 Routine Description:
134
135 Create a formset
136
137 Arguments:
138
139 FormSetTitle - Title of formset
140
141 Guid - Guid of formset
142
143 Class - Class of formset
144
145 SubClass - Sub class of formset
146
147 FormBuffer - Pointer of the formset created
148
149 StringBuffer - Pointer of FormSetTitile string created
150
151 Returns:
152
153 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
154
155 EFI_SUCCESS - Formset successfully created
156
157 --*/
158 ;
159
160 EFI_STATUS
161 CreateForm (
162 IN CHAR16 *FormTitle,
163 IN UINT16 FormId,
164 IN OUT VOID *FormBuffer,
165 IN OUT VOID *StringBuffer
166 )
167 /*++
168
169 Routine Description:
170
171 Create a form
172
173 Arguments:
174
175 FormTitle - Title of the form
176
177 FormId - Id of the form
178
179 FormBuffer - Pointer of the form created
180
181 StringBuffer - Pointer of FormTitil string created
182
183 Returns:
184
185 EFI_SUCCESS - Form successfully created
186
187 --*/
188 ;
189
190 EFI_STATUS
191 CreateSubTitle (
192 IN CHAR16 *SubTitle,
193 IN OUT VOID *FormBuffer,
194 IN OUT VOID *StringBuffer
195 )
196 /*++
197
198 Routine Description:
199
200 Create a SubTitle
201
202 Arguments:
203
204 SubTitle - Sub title to be created
205
206 FormBuffer - Where this subtitle to add to
207
208 StringBuffer - String buffer created for subtitle
209
210 Returns:
211
212 EFI_SUCCESS - Subtitle successfully created
213
214 --*/
215 ;
216
217 EFI_STATUS
218 CreateText (
219 IN CHAR16 *String,
220 IN CHAR16 *String2,
221 IN CHAR16 *String3,
222 IN UINT8 Flags,
223 IN UINT16 Key,
224 IN OUT VOID *FormBuffer,
225 IN OUT VOID *StringBuffer
226 )
227 /*++
228
229 Routine Description:
230
231 Create a line of text
232
233 Arguments:
234
235 String - First string of the text
236
237 String2 - Second string of the text
238
239 String3 - Help string of the text
240
241 Flags - Flag of the text
242
243 Key - Key of the text
244
245 FormBuffer - The form where this text adds to
246
247 StringBuffer - String buffer created for String, String2 and String3
248
249 Returns:
250
251 EFI_SUCCESS - Text successfully created
252
253 --*/
254 ;
255
256 EFI_STATUS
257 CreateGoto (
258 IN UINT16 FormId,
259 IN CHAR16 *Prompt,
260 IN OUT VOID *FormBuffer,
261 IN OUT VOID *StringBuffer
262 )
263 /*++
264
265 Routine Description:
266
267 Create a hyperlink
268
269 Arguments:
270
271 FormId - Form ID of the hyperlink
272
273 Prompt - Prompt of the hyperlink
274
275 FormBuffer - The form where this hyperlink adds to
276
277 StringBuffer - String buffer created for Prompt
278
279 Returns:
280
281 EFI_SUCCESS - Hyperlink successfully created
282
283 --*/
284 ;
285
286 EFI_STATUS
287 CreateOneOf (
288 IN UINT16 QuestionId,
289 IN UINT8 DataWidth,
290 IN CHAR16 *Prompt,
291 IN CHAR16 *Help,
292 IN IFR_OPTION *OptionsList,
293 IN UINTN OptionCount,
294 IN OUT VOID *FormBuffer,
295 IN OUT VOID *StringBuffer
296 )
297 /*++
298
299 Routine Description:
300
301 Create a one-of question with a set of options to choose from. The
302 OptionsList is a pointer to a null-terminated list of option descriptions.
303
304 Arguments:
305
306 QuestionId - Question ID of the one-of box
307
308 DataWidth - DataWidth of the one-of box
309
310 Prompt - Prompt of the one-of box
311
312 Help - Help of the one-of box
313
314 OptionsList - Each string in it is an option of the one-of box
315
316 OptionCount - Option string count
317
318 FormBuffer - The form where this one-of box adds to
319
320 StringBuffer - String buffer created for Prompt, Help and Option strings
321
322 Returns:
323
324 EFI_DEVICE_ERROR - DataWidth > 2
325
326 EFI_SUCCESS - One-Of box successfully created.
327
328 --*/
329 ;
330
331 EFI_STATUS
332 CreateOrderedList (
333 IN UINT16 QuestionId,
334 IN UINT8 MaxEntries,
335 IN CHAR16 *Prompt,
336 IN CHAR16 *Help,
337 IN IFR_OPTION *OptionsList,
338 IN UINTN OptionCount,
339 IN OUT VOID *FormBuffer,
340 IN OUT VOID *StringBuffer
341 )
342 /*++
343
344 Routine Description:
345
346 Create a one-of question with a set of options to choose from. The
347 OptionsList is a pointer to a null-terminated list of option descriptions.
348
349 Arguments:
350
351 QuestionId - Question ID of the ordered list
352
353 MaxEntries - MaxEntries of the ordered list
354
355 Prompt - Prompt of the ordered list
356
357 Help - Help of the ordered list
358
359 OptionsList - Each string in it is an option of the ordered list
360
361 OptionCount - Option string count
362
363 FormBuffer - The form where this ordered list adds to
364
365 StringBuffer - String buffer created for Prompt, Help and Option strings
366
367 Returns:
368
369 EFI_SUCCESS - Ordered list successfully created.
370
371 --*/
372 ;
373
374 EFI_STATUS
375 CreateCheckBox (
376 IN UINT16 QuestionId,
377 IN UINT8 DataWidth,
378 IN CHAR16 *Prompt,
379 IN CHAR16 *Help,
380 IN UINT8 Flags,
381 IN OUT VOID *FormBuffer,
382 IN OUT VOID *StringBuffer
383 )
384 /*++
385
386 Routine Description:
387
388 Create a checkbox
389
390 Arguments:
391
392 QuestionId - Question ID of the check box
393
394 DataWidth - DataWidth of the check box
395
396 Prompt - Prompt of the check box
397
398 Help - Help of the check box
399
400 Flags - Flags of the check box
401
402 FormBuffer - The form where this check box adds to
403
404 StringBuffer - String buffer created for Prompt and Help.
405
406 Returns:
407
408 EFI_DEVICE_ERROR - DataWidth > 1
409
410 EFI_SUCCESS - Check box successfully created
411
412 --*/
413 ;
414
415 EFI_STATUS
416 CreateNumeric (
417 IN UINT16 QuestionId,
418 IN UINT8 DataWidth,
419 IN CHAR16 *Prompt,
420 IN CHAR16 *Help,
421 IN UINT16 Minimum,
422 IN UINT16 Maximum,
423 IN UINT16 Step,
424 IN UINT16 Default,
425 IN UINT8 Flags,
426 IN UINT16 Key,
427 IN OUT VOID *FormBuffer,
428 IN OUT VOID *StringBuffer
429 )
430 /*++
431
432 Routine Description:
433
434 Create a numeric
435
436 Arguments:
437
438 QuestionId - Question ID of the numeric
439
440 DataWidth - DataWidth of the numeric
441
442 Prompt - Prompt of the numeric
443
444 Help - Help of the numeric
445
446 Minimum - Minumun boundary of the numeric
447
448 Maximum - Maximum boundary of the numeric
449
450 Step - Step of the numeric
451
452 Default - Default value
453
454 Flags - Flags of the numeric
455
456 Key - Key of the numeric
457
458 FormBuffer - The form where this numeric adds to
459
460 StringBuffer - String buffer created for Prompt and Help.
461
462 Returns:
463
464 EFI_DEVICE_ERROR - DataWidth > 2
465
466 EFI_SUCCESS - Numeric is successfully created
467
468 --*/
469 ;
470
471 EFI_STATUS
472 CreateString (
473 IN UINT16 QuestionId,
474 IN UINT8 DataWidth,
475 IN CHAR16 *Prompt,
476 IN CHAR16 *Help,
477 IN UINT8 MinSize,
478 IN UINT8 MaxSize,
479 IN UINT8 Flags,
480 IN UINT16 Key,
481 IN OUT VOID *FormBuffer,
482 IN OUT VOID *StringBuffer
483 )
484 /*++
485
486 Routine Description:
487
488 Create a string
489
490 Arguments:
491
492 QuestionId - Question ID of the string
493
494 DataWidth - DataWidth of the string
495
496 Prompt - Prompt of the string
497
498 Help - Help of the string
499
500 MinSize - Min size boundary of the string
501
502 MaxSize - Max size boundary of the string
503
504 Flags - Flags of the string
505
506 Key - Key of the string
507
508 FormBuffer - The form where this string adds to
509
510 StringBuffer - String buffer created for Prompt and Help.
511
512 Returns:
513
514 EFI_SUCCESS - String successfully created.
515
516 --*/
517 ;
518
519 EFI_STATUS
520 ExtractDataFromHiiHandle (
521 IN EFI_HII_HANDLE HiiHandle,
522 IN OUT UINT16 *ImageLength,
523 OUT UINT8 *DefaultImage,
524 OUT EFI_GUID *Guid
525 )
526 /*++
527
528 Routine Description:
529
530 Extract information pertaining to the HiiHandle
531
532 Arguments:
533
534 HiiHandle - Hii handle
535
536 ImageLength - For input, length of DefaultImage;
537 For output, length of actually required
538
539 DefaultImage - Image buffer prepared by caller
540
541 Guid - Guid information about the form
542
543 Returns:
544
545 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
546
547 EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength
548
549 EFI_SUCCESS - Successfully extract data from Hii database.
550
551
552 --*/
553 ;
554
555 EFI_HII_HANDLE
556 FindHiiHandle (
557 IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
558 IN EFI_GUID *Guid
559 )
560 /*++
561
562 Routine Description:
563 Finds HII handle for given pack GUID previously registered with the HII.
564
565 Arguments:
566 HiiProtocol - pointer to pointer to HII protocol interface.
567 If NULL, the interface will be found but not returned.
568 If it points to NULL, the interface will be found and
569 written back to the pointer that is pointed to.
570 Guid - The GUID of the pack that registered with the HII.
571
572 Returns:
573 Handle to the HII pack previously registered by the memory driver.
574
575 --*/
576 ;
577
578 EFI_STATUS
579 CreateSubTitleOpCode (
580 IN STRING_REF StringToken,
581 IN OUT VOID *FormBuffer
582 )
583 /*++
584
585 Routine Description:
586
587 Create a SubTitle opcode independent of string creation
588 This is used primarily by users who need to create just one particular valid op-code and the string
589 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
590 location to pre-defined forms in HII)
591
592 Arguments:
593
594 StringToken - StringToken of the subtitle
595
596 FormBuffer - Output of subtitle as a form
597
598 Returns:
599
600 EFI_SUCCESS - Subtitle created to be a form
601
602 --*/
603 ;
604
605 EFI_STATUS
606 CreateTextOpCode (
607 IN STRING_REF StringToken,
608 IN STRING_REF StringTokenTwo,
609 IN STRING_REF StringTokenThree,
610 IN UINT8 Flags,
611 IN UINT16 Key,
612 IN OUT VOID *FormBuffer
613 )
614 /*++
615
616 Routine Description:
617
618 Create a Text opcode independent of string creation
619 This is used primarily by users who need to create just one particular valid op-code and the string
620 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
621 location to pre-defined forms in HII)
622
623 Arguments:
624
625 StringToken - First string token of the text
626
627 StringTokenTwo - Second string token of the text
628
629 StringTokenThree - Help string token of the text
630
631 Flags - Flag of the text
632
633 Key - Key of the text
634
635 FormBuffer - Output of text as a form
636
637 Returns:
638
639 EFI_SUCCESS - Text created to be a form
640
641 --*/
642 ;
643
644 EFI_STATUS
645 CreateGotoOpCode (
646 IN UINT16 FormId,
647 IN STRING_REF StringToken,
648 IN STRING_REF StringTokenTwo,
649 IN UINT8 Flags,
650 IN UINT16 Key,
651 IN OUT VOID *FormBuffer
652 )
653 /*++
654
655 Routine Description:
656
657 Create a hyperlink opcode independent of string creation
658 This is used primarily by users who need to create just one particular valid op-code and the string
659 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
660 location to pre-defined forms in HII)
661
662 Arguments:
663
664 FormId - Form ID of the hyperlink
665
666 StringToken - Prompt string token of the hyperlink
667
668 StringTokenTwo - Help string token of the hyperlink
669
670 Flags - Flags of the hyperlink
671
672 Key - Key of the hyperlink
673
674 FormBuffer - Output of hyperlink as a form
675
676 Returns:
677
678 EFI_SUCCESS - Hyperlink created to be a form
679
680 --*/
681 ;
682
683 EFI_STATUS
684 CreateOneOfOpCode (
685 IN UINT16 QuestionId,
686 IN UINT8 DataWidth,
687 IN STRING_REF PromptToken,
688 IN STRING_REF HelpToken,
689 IN IFR_OPTION *OptionsList,
690 IN UINTN OptionCount,
691 IN OUT VOID *FormBuffer
692 )
693 /*++
694
695 Routine Description:
696
697 Create a one-of opcode with a set of option op-codes to choose from independent of string creation.
698 This is used primarily by users who need to create just one particular valid op-code and the string
699 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
700 location to pre-defined forms in HII)
701
702 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
703 has been filled in since this routine will not generate StringToken values.
704
705 Arguments:
706
707 QuestionId - Question ID of the one-of box
708
709 DataWidth - DataWidth of the one-of box
710
711 PromptToken - Prompt string token of the one-of box
712
713 HelpToken - Help string token of the one-of box
714
715 OptionsList - Each string in it is an option of the one-of box
716
717 OptionCount - Option string count
718
719 FormBuffer - Output of One-Of box as a form
720
721 Returns:
722
723 EFI_SUCCESS - One-Of box created to be a form
724
725 EFI_DEVICE_ERROR - DataWidth > 2
726
727 --*/
728 ;
729
730 EFI_STATUS
731 CreateOrderedListOpCode (
732 IN UINT16 QuestionId,
733 IN UINT8 MaxEntries,
734 IN STRING_REF PromptToken,
735 IN STRING_REF HelpToken,
736 IN IFR_OPTION *OptionsList,
737 IN UINTN OptionCount,
738 IN OUT VOID *FormBuffer
739 )
740 /*++
741
742 Routine Description:
743
744 Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.
745 This is used primarily by users who need to create just one particular valid op-code and the string
746 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
747 location to pre-defined forms in HII)
748
749 OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
750 has been filled in since this routine will not generate StringToken values.
751
752 Arguments:
753
754 QuestionId - Question ID of the ordered list
755
756 MaxEntries - MaxEntries of the ordered list
757
758 PromptToken - Prompt string token of the ordered list
759
760 HelpToken - Help string token of the ordered list
761
762 OptionsList - Each string in it is an option of the ordered list
763
764 OptionCount - Option string count
765
766 FormBuffer - Output of ordered list as a form
767
768 Returns:
769
770 EFI_SUCCESS - Ordered list created to be a form
771
772 --*/
773 ;
774
775 EFI_STATUS
776 CreateCheckBoxOpCode (
777 IN UINT16 QuestionId,
778 IN UINT8 DataWidth,
779 IN STRING_REF PromptToken,
780 IN STRING_REF HelpToken,
781 IN UINT8 Flags,
782 IN UINT16 Key,
783 IN OUT VOID *FormBuffer
784 )
785 /*++
786
787 Routine Description:
788
789 Create a checkbox opcode independent of string creation
790 This is used primarily by users who need to create just one particular valid op-code and the string
791 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
792 location to pre-defined forms in HII)
793
794 Arguments:
795
796 QuestionId - Question ID of the check box
797
798 DataWidth - DataWidth of the check box
799
800 PromptToken - Prompt string token of the check box
801
802 HelpToken - Help string token of the check box
803
804 Flags - Flags of the check box
805
806 Key - Key of the check box
807
808 FormBuffer - Output of the check box as a form
809
810 Returns:
811
812 EFI_SUCCESS - Checkbox created to be a form
813
814 EFI_DEVICE_ERROR - DataWidth > 1
815
816 --*/
817 ;
818
819 EFI_STATUS
820 CreateNumericOpCode (
821 IN UINT16 QuestionId,
822 IN UINT8 DataWidth,
823 IN STRING_REF PromptToken,
824 IN STRING_REF HelpToken,
825 IN UINT16 Minimum,
826 IN UINT16 Maximum,
827 IN UINT16 Step,
828 IN UINT16 Default,
829 IN UINT8 Flags,
830 IN UINT16 Key,
831 IN OUT VOID *FormBuffer
832 )
833 /*++
834
835 Routine Description:
836
837 Create a numeric opcode independent of string creation
838 This is used primarily by users who need to create just one particular valid op-code and the string
839 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
840 location to pre-defined forms in HII)
841
842 Arguments:
843
844 QuestionId - Question ID of the numeric
845
846 DataWidth - DataWidth of the numeric
847
848 PromptToken - Prompt string token of the numeric
849
850 HelpToken - Help string token of the numeric
851
852 Minimum - Minumun boundary of the numeric
853
854 Maximum - Maximum boundary of the numeric
855
856 Step - Step of the numeric
857
858 Default - Default value of the numeric
859
860 Flags - Flags of the numeric
861
862 Key - Key of the numeric
863
864 FormBuffer - Output of the numeric as a form
865
866 Returns:
867
868 EFI_SUCCESS - The numeric created to be a form.
869
870 EFI_DEVICE_ERROR - DataWidth > 2
871
872 --*/
873 ;
874
875 EFI_STATUS
876 CreateStringOpCode (
877 IN UINT16 QuestionId,
878 IN UINT8 DataWidth,
879 IN STRING_REF PromptToken,
880 IN STRING_REF HelpToken,
881 IN UINT8 MinSize,
882 IN UINT8 MaxSize,
883 IN UINT8 Flags,
884 IN UINT16 Key,
885 IN OUT VOID *FormBuffer
886 )
887 /*++
888
889 Routine Description:
890
891 Create a numeric opcode independent of string creation
892 This is used primarily by users who need to create just one particular valid op-code and the string
893 data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
894 location to pre-defined forms in HII)
895
896 Arguments:
897
898 QuestionId - Question ID of the string
899
900 DataWidth - DataWidth of the string
901
902 PromptToken - Prompt token of the string
903
904 HelpToken - Help token of the string
905
906 MinSize - Min size boundary of the string
907
908 MaxSize - Max size boundary of the string
909
910 Flags - Flags of the string
911
912 Key - Key of the string
913
914 FormBuffer - Output of the string as a form
915
916 Returns:
917
918 EFI_SUCCESS - String created to be a form.
919
920 --*/
921 ;
922
923 EFI_STATUS
924 ValidateDataFromHiiHandle (
925 IN EFI_HII_HANDLE HiiHandle,
926 OUT BOOLEAN *Results
927 )
928 /*++
929
930 Routine Description:
931
932 Validate that the data associated with the HiiHandle in NVRAM is within
933 the reasonable parameters for that FormSet. Values for strings and passwords
934 are not verified due to their not having the equivalent of valid range settings.
935
936 Arguments:
937
938 HiiHandle - Handle of the HII database entry to query
939
940 Results - If return Status is EFI_SUCCESS, Results provides valid data
941 TRUE = NVRAM Data is within parameters
942 FALSE = NVRAM Data is NOT within parameters
943
944 Returns:
945
946 EFI_OUT_OF_RESOURCES - No enough buffer to allocate
947
948 EFI_SUCCESS - Data successfully validated
949 --*/
950 ;
951
952 EFI_STATUS
953 CreateBannerOpCode (
954 IN UINT16 Title,
955 IN UINT16 LineNumber,
956 IN UINT8 Alignment,
957 IN OUT VOID *FormBuffer
958 )
959 /*++
960
961 Routine Description:
962
963 Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.
964
965 Arguments:
966
967 Title - Title of the banner
968
969 LineNumber - LineNumber of the banner
970
971 Alignment - Alignment of the banner
972
973 FormBuffer - Output of banner as a form
974
975 Returns:
976
977 EFI_SUCCESS - Banner created to be a form.
978
979 --*/
980 ;
981
982 EFI_HII_PACKAGES *
983 PreparePackages (
984 IN UINTN NumberOfPackages,
985 IN EFI_GUID *GuidId,
986 ...
987 )
988 /*++
989
990 Routine Description:
991
992 Assemble EFI_HII_PACKAGES according to the passed in packages.
993
994 Arguments:
995
996 NumberOfPackages - Number of packages.
997 GuidId - Package GUID.
998
999 Returns:
1000
1001 Pointer of EFI_HII_PACKAGES.
1002
1003 --*/
1004 ;
1005
1006 VOID
1007 EfiLibHiiVariablePackGetMap (
1008 IN EFI_HII_VARIABLE_PACK *Pack,
1009 OUT CHAR16 **Name, OPTIONAL
1010 OUT EFI_GUID **Guid, OPTIONAL
1011 OUT UINT16 *Id, OPTIONAL
1012 OUT VOID **Var, OPTIONAL
1013 OUT UINTN *Size OPTIONAL
1014 )
1015 /*++
1016
1017 Routine Description:
1018
1019 Extracts a variable form a Pack.
1020
1021 Arguments:
1022
1023 Pack - List of variables
1024 Name - Name of the variable/map
1025 Guid - GUID of the variable/map
1026 Var - Pointer to the variable/map
1027 Size - Size of the variable/map in bytes
1028
1029 Returns:
1030
1031 VOID.
1032
1033 --*/
1034 ;
1035
1036 UINTN
1037 EfiLibHiiVariablePackListGetMapCnt (
1038 IN EFI_HII_VARIABLE_PACK_LIST *List
1039 )
1040 /*++
1041
1042 Routine Description:
1043
1044 Finds a count of the variables/maps in the List.
1045
1046 Arguments:
1047
1048 List - List of variables
1049
1050 Returns:
1051
1052 Number of Map in the variable pack list.
1053
1054 --*/
1055 ;
1056
1057 typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (
1058 IN CHAR16 *Name,
1059 IN EFI_GUID *Guid,
1060 IN UINT16 Id,
1061 IN VOID *Var,
1062 IN UINTN Size
1063 )
1064 /*++
1065
1066 Routine Description:
1067
1068 type definition for the callback to be
1069 used with EfiLibHiiVariablePackListForEachVar().
1070
1071 Arguments:
1072
1073 Id - Variable/Map ID
1074 Name - Name of the variable/map
1075 Guid - GUID of the variable/map
1076 Var - Pointer to the variable/map
1077 Size - Size of the variable/map in bytes
1078
1079 Returns:
1080
1081 VOID
1082
1083 --*/
1084 ;
1085
1086 VOID
1087 EfiLibHiiVariablePackListForEachVar (
1088 IN EFI_HII_VARIABLE_PACK_LIST *List,
1089 IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback
1090 )
1091 /*++
1092
1093 Routine Description:
1094
1095 Will iterate all variable/maps as appearing
1096 in List and for each, it will call the Callback.
1097
1098 Arguments:
1099
1100 List - List of variables
1101 Callback - Routine to be called for each iterated variable.
1102
1103 Returns:
1104
1105 VOID
1106
1107 --*/
1108 ;
1109
1110 EFI_STATUS
1111 EfiLibHiiVariablePackListGetMapByIdx (
1112 IN UINTN Idx,
1113 IN EFI_HII_VARIABLE_PACK_LIST *List,
1114 OUT CHAR16 **Name, OPTIONAL
1115 OUT EFI_GUID **Guid, OPTIONAL
1116 OUT UINT16 *Id, OPTIONAL
1117 OUT VOID **Var,
1118 OUT UINTN *Size
1119 )
1120 /*++
1121
1122 Routine Description:
1123
1124 Finds a variable form List given
1125 the order number as appears in the List.
1126
1127 Arguments:
1128
1129 Idx - The index of the variable/map to retrieve
1130 List - List of variables
1131 Name - Name of the variable/map
1132 Guid - GUID of the variable/map
1133 Var - Pointer to the variable/map
1134 Size - Size of the variable/map in bytes
1135
1136 Returns:
1137
1138 EFI_SUCCESS - Variable is found, OUT parameters are valid
1139 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
1140
1141 --*/
1142 ;
1143
1144 EFI_STATUS
1145 EfiLibHiiVariablePackListGetMapById (
1146 IN UINT16 Id,
1147 IN EFI_HII_VARIABLE_PACK_LIST *List,
1148 OUT CHAR16 **Name, OPTIONAL
1149 OUT EFI_GUID **Guid, OPTIONAL
1150 OUT VOID **Var,
1151 OUT UINTN *Size
1152 )
1153 /*++
1154
1155 Routine Description:
1156
1157 Finds a variable form List given the
1158 order number as appears in the List.
1159
1160 Arguments:
1161
1162 Id - The ID of the variable/map to retrieve
1163 List - List of variables
1164 Name - Name of the variable/map
1165 Guid - GUID of the variable/map
1166 Var - Pointer to the variable/map
1167 Size - Size of the variable/map in bytes
1168
1169 Returns:
1170
1171 EFI_SUCCESS - Variable is found, OUT parameters are valid
1172 EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
1173
1174 --*/
1175 ;
1176
1177 EFI_STATUS
1178 EfiLibHiiVariablePackListGetMap (
1179 IN EFI_HII_VARIABLE_PACK_LIST *List,
1180 IN CHAR16 *Name,
1181 IN EFI_GUID *Guid,
1182 OUT UINT16 *Id,
1183 OUT VOID **Var,
1184 OUT UINTN *Size
1185 )
1186 /*++
1187
1188 Routine Description:
1189
1190 Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.
1191
1192 Arguments:
1193
1194 List - List of variables
1195 Name - Name of the variable/map to be found
1196 Guid - GUID of the variable/map to be found
1197 Var - Pointer to the variable/map found
1198 Size - Size of the variable/map in bytes found
1199
1200 Returns:
1201
1202 EFI_SUCCESS - variable is found, OUT parameters are valid
1203 EFI_NOT_FOUND - variable is not found, OUT parameters are not valid
1204
1205 --*/
1206 ;
1207
1208 EFI_STATUS
1209 EfiLibHiiVariableRetrieveFromNv (
1210 IN CHAR16 *Name,
1211 IN EFI_GUID *Guid,
1212 IN UINTN Size,
1213 OUT VOID **Var
1214 )
1215 /*++
1216
1217 Routine Description:
1218 Finds out if a variable of specific Name/Guid/Size exists in NV.
1219 If it does, it will retrieve it into the Var.
1220
1221 Arguments:
1222 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1223 Var - Variable will be retrieved into buffer pointed by this pointer.
1224 If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.
1225 Returns:
1226 EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.
1227 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1228 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1229
1230 --*/
1231 ;
1232
1233 ////
1234 //// Variable override support.
1235 ////
1236
1237 EFI_STATUS
1238 EfiLibHiiVariableOverrideIfSuffix (
1239 IN CHAR16 *Suffix,
1240 IN CHAR16 *Name,
1241 IN EFI_GUID *Guid,
1242 IN UINTN Size,
1243 OUT VOID *Var
1244 )
1245 /*++
1246
1247 Routine Description:
1248 Overrrides the variable with NV data if found.
1249 But it only does it if the Name ends with specified Suffix.
1250 For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",
1251 the Suffix matches the end of Name, so the variable will be loaded from NV
1252 provided the variable exists and the GUID and Size matches.
1253
1254 Arguments:
1255 Suffix - Suffix the Name should end with.
1256 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1257 Var - Variable will be retrieved into this buffer.
1258 Caller is responsible for providing storage of exactly Size size in bytes.
1259 Returns:
1260 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
1261 EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.
1262 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1263 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1264
1265 --*/
1266 ;
1267
1268 EFI_STATUS
1269 EfiLibHiiVariableOverrideBySuffix (
1270 IN CHAR16 *Suffix,
1271 IN CHAR16 *Name,
1272 IN EFI_GUID *Guid,
1273 IN UINTN Size,
1274 OUT VOID *Var
1275 )
1276 /*++
1277
1278 Routine Description:
1279 Overrrides the variable with NV data if found.
1280 But it only does it if the NV contains the same variable with Name is appended with Suffix.
1281 For example, if Suffix="MyOverride" and the Name="XyzSetup",
1282 the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"
1283 will be loaded from NV provided the variable exists and the GUID and Size matches.
1284
1285 Arguments:
1286 Suffix - Suffix the variable will be appended with.
1287 Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
1288 Var - Variable will be retrieved into this buffer.
1289 Caller is responsible for providing storage of exactly Size size in bytes.
1290
1291 Returns:
1292 EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
1293 EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
1294 EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
1295
1296 --*/
1297 ;
1298
1299 #endif