]>
Commit | Line | Data |
---|---|---|
9226efe5 | 1 | /** @file\r |
2 | Library header file defines APIs that is related to IFR operations but \r | |
3 | specific to EDK II implementation.\r | |
4 | \r | |
1e354c03 | 5 | Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
9226efe5 | 13 | \r |
14 | **/\r | |
15 | \r | |
16 | #ifndef __EXTENDED_IFR_SUPPORT_LIB_H__\r | |
17 | #define __EXTENDED_IFR_SUPPORT_LIB_H__\r | |
18 | \r | |
19 | /**\r | |
20 | Create GUIDed opcode for banner. Banner opcode\r | |
21 | EFI_IFR_EXTEND_OP_BANNER is extended opcode specific\r | |
22 | to Intel's implementation.\r | |
23 | \r | |
24 | @param Title String ID for title\r | |
25 | @param LineNumber Line number for this banner\r | |
26 | @param Alignment Alignment for this banner, left, center or right\r | |
27 | @param Data Destination for the created opcode binary\r | |
28 | \r | |
29 | @retval EFI_SUCCESS Opcode create success\r | |
30 | @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.\r | |
31 | \r | |
32 | **/\r | |
33 | EFI_STATUS\r | |
5f597758 | 34 | EFIAPI\r |
9226efe5 | 35 | CreateBannerOpCode (\r |
36 | IN EFI_STRING_ID Title,\r | |
37 | IN UINT16 LineNumber,\r | |
38 | IN UINT8 Alignment,\r | |
39 | IN OUT EFI_HII_UPDATE_DATA *Data\r | |
ed66e1bc | 40 | );\r |
9226efe5 | 41 | \r |
8d00a0f1 | 42 | /**\r |
43 | This function initialize the data structure for dynamic opcode.\r | |
44 | \r | |
45 | @param UpdateData The adding data;\r | |
46 | @param BufferSize Length of the buffer to fill dynamic opcodes.\r | |
47 | \r | |
48 | @retval EFI_SUCCESS Update data is initialized.\r | |
49 | @retval EFI_INVALID_PARAMETER UpdateData is NULL.\r | |
50 | @retval EFI_OUT_OF_RESOURCES No enough memory to allocate.\r | |
51 | \r | |
52 | **/\r | |
53 | EFI_STATUS\r | |
b9982883 | 54 | EFIAPI\r |
8d00a0f1 | 55 | IfrLibInitUpdateData (\r |
56 | IN OUT EFI_HII_UPDATE_DATA *UpdateData,\r | |
57 | IN UINT32 BufferSize\r | |
58 | )\r | |
59 | ;\r | |
60 | \r | |
61 | /**\r | |
62 | \r | |
63 | This function free the resource of update data.\r | |
64 | \r | |
65 | @param UpdateData The adding data;\r | |
66 | \r | |
8d00a0f1 | 67 | **/\r |
f875a4f1 | 68 | VOID\r |
b9982883 | 69 | EFIAPI\r |
8d00a0f1 | 70 | IfrLibFreeUpdateData (\r |
71 | IN EFI_HII_UPDATE_DATA *UpdateData\r | |
72 | )\r | |
73 | ;\r | |
74 | \r | |
9226efe5 | 75 | /**\r |
76 | This function allows the caller to update a form that has\r | |
77 | previously been registered with the EFI HII database.\r | |
78 | The update make use of a extended opcode EFI_IFR_EXTEND_OP_LABEL\r | |
79 | specific to Intel's implementation to complete the operation.\r | |
80 | \r | |
81 | \r | |
82 | @param Handle Hii Handle\r | |
83 | @param FormSetGuid The formset should be updated.\r | |
84 | @param FormId The form should be updated.\r | |
85 | @param Label Update information starting immediately after this\r | |
86 | label in the IFR\r | |
87 | @param Insert If TRUE and Data is not NULL, insert data after\r | |
88 | Label. If FALSE, replace opcodes between two\r | |
89 | labels with Data.\r | |
90 | @param Data The adding data; If NULL, remove opcodes between\r | |
91 | two Label.\r | |
92 | \r | |
93 | @retval EFI_SUCCESS Update success.\r | |
94 | @retval Other Update fail.\r | |
95 | \r | |
96 | **/\r | |
97 | EFI_STATUS\r | |
5f597758 | 98 | EFIAPI\r |
9226efe5 | 99 | IfrLibUpdateForm (\r |
100 | IN EFI_HII_HANDLE Handle,\r | |
101 | IN EFI_GUID *FormSetGuid, OPTIONAL\r | |
102 | IN EFI_FORM_ID FormId,\r | |
103 | IN UINT16 Label,\r | |
104 | IN BOOLEAN Insert,\r | |
105 | IN EFI_HII_UPDATE_DATA *Data\r | |
ed66e1bc | 106 | );\r |
9226efe5 | 107 | \r |
108 | /**\r | |
b9982883 | 109 | Extract EDKII extended formset class for a given HII handle.\r |
9226efe5 | 110 | \r |
111 | If Handle is not a valid EFI_HII_HANDLE in the default HII database, then\r | |
112 | ASSERT.\r | |
113 | \r | |
114 | If Class is NULL, then ASSERT.\r | |
115 | IfFormSetTitle is NULL, then ASSERT.\r | |
116 | If FormSetHelp is NULL, then ASSERT.\r | |
117 | \r | |
118 | @param HiiHandle Hii handle\r | |
ebafc55b LG |
119 | @param Class On output, Class of the formset\r |
120 | @param FormSetTitle On output, Formset title string\r | |
121 | @param FormSetHelp On output, Formset help string\r | |
9226efe5 | 122 | \r |
123 | @retval EFI_SUCCESS Successfully extract Class for specified Hii\r | |
124 | handle.\r | |
125 | \r | |
126 | **/\r | |
127 | EFI_STATUS\r | |
5f597758 | 128 | EFIAPI\r |
9226efe5 | 129 | IfrLibExtractClassFromHiiHandle (\r |
130 | IN EFI_HII_HANDLE Handle,\r | |
131 | OUT UINT16 *Class,\r | |
132 | OUT EFI_STRING_ID *FormSetTitle,\r | |
133 | OUT EFI_STRING_ID *FormSetHelp\r | |
ed66e1bc | 134 | );\r |
9226efe5 | 135 | \r |
136 | /**\r | |
137 | Configure the buffer accrording to ConfigBody strings in the format of\r | |
138 | <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.\r | |
b9982883 | 139 | This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default\r |
53dff899 | 140 | values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000\r |
141 | constructed following this rule: \r | |
142 | "Vfr" + varstore.name + "Default" + defaultstore.attributes.\r | |
143 | Check the generated C file in Output for details.\r | |
9226efe5 | 144 | \r |
145 | @param Buffer the start address of buffer.\r | |
146 | @param BufferSize the size of buffer.\r | |
5f597758 LG |
147 | @param Number the number of the ConfigBody strings.\r |
148 | @param ... the ConfigBody strings\r | |
9226efe5 | 149 | \r |
150 | @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.\r | |
151 | @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.\r | |
152 | @retval EFI_SUCCESS Operation successful.\r | |
153 | \r | |
154 | **/\r | |
155 | EFI_STATUS\r | |
156 | EFIAPI\r | |
157 | IfrLibExtractDefault(\r | |
158 | IN VOID *Buffer,\r | |
159 | IN UINTN *BufferSize,\r | |
160 | UINTN Number,\r | |
161 | ...\r | |
ed66e1bc | 162 | );\r |
9226efe5 | 163 | \r |
164 | #endif\r | |
165 | \r |