]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/HiiLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Include / Library / HiiLib.h
CommitLineData
4c76e9cc 1/** @file\r
2 Public include file for the HII Library\r
3\r
0d96664d
AC
4Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>\r
5(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>\r
9d510e61 6SPDX-License-Identifier: BSD-2-Clause-Patent\r
4c76e9cc 7\r
8**/\r
9\r
10#ifndef __HII_LIB_H__\r
11#define __HII_LIB_H__\r
12\r
33ae1b2d 13////////////////////////////////////////////////////////\r
14////////////////////////////////////////////////////////\r
15// HiiLib Functions\r
16////////////////////////////////////////////////////////\r
17////////////////////////////////////////////////////////\r
4c76e9cc 18\r
19/**\r
cb7d01c0 20 Registers a list of packages in the HII Database and returns the HII Handle\r
21 associated with that registration. If an HII Handle has already been registered\r
aa2614b7 22 with the same PackageListGuid and DeviceHandle, then NULL is returned. If there\r
23 are not enough resources to perform the registration, then NULL is returned.\r
24 If an empty list of packages is passed in, then NULL is returned. If the size of\r
25 the list of package is 0, then NULL is returned.\r
cb7d01c0 26\r
d1102dba 27 The variable arguments are pointers that point to package headers defined\r
cb7d01c0 28 by UEFI VFR compiler and StringGather tool.\r
29\r
30 #pragma pack (push, 1)\r
31 typedef struct {\r
32 UINT32 BinaryLength;\r
33 EFI_HII_PACKAGE_HEADER PackageHeader;\r
34 } EDKII_AUTOGEN_PACKAGES_HEADER;\r
35 #pragma pack (pop)\r
d1102dba 36\r
cb7d01c0 37 @param[in] PackageListGuid The GUID of the package list.\r
d1102dba 38 @param[in] DeviceHandle If not NULL, the Device Handle on which\r
cb7d01c0 39 an instance of DEVICE_PATH_PROTOCOL is installed.\r
d1102dba 40 This Device Handle uniquely defines the device that\r
cb7d01c0 41 the added packages are associated with.\r
d1102dba 42 @param[in] ... The variable argument list that contains pointers\r
cb7d01c0 43 to packages terminated by a NULL.\r
44\r
64a80549 45 @retval NULL An HII Handle has already been registered in the HII Database with\r
9c6595dc 46 the same PackageListGuid and DeviceHandle.\r
cb7d01c0 47 @retval NULL The HII Handle could not be created.\r
48 @retval NULL An empty list of packages was passed in.\r
49 @retval NULL All packages are empty.\r
50 @retval Other The HII Handle associated with the newly registered package list.\r
4c76e9cc 51\r
52**/\r
cb7d01c0 53EFI_HII_HANDLE\r
4c76e9cc 54EFIAPI\r
cb7d01c0 55HiiAddPackages (\r
56 IN CONST EFI_GUID *PackageListGuid,\r
57 IN EFI_HANDLE DeviceHandle OPTIONAL,\r
4c76e9cc 58 ...\r
b9982883
LG
59 )\r
60;\r
4c76e9cc 61\r
62/**\r
cb7d01c0 63 Removes a package list from the HII database.\r
4c76e9cc 64\r
e9b67286 65 If HiiHandle is NULL, then ASSERT().\r
66 If HiiHandle is not a valid EFI_HII_HANDLE in the HII database, then ASSERT().\r
4c76e9cc 67\r
cb7d01c0 68 @param[in] HiiHandle The handle that was previously registered in the HII database\r
4c76e9cc 69\r
70**/\r
71VOID\r
72EFIAPI\r
cb7d01c0 73HiiRemovePackages (\r
1436aea4 74 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
75 )\r
76;\r
4c76e9cc 77\r
78/**\r
d1102dba 79 This function creates a new string in String Package or updates an existing\r
cb7d01c0 80 string in a String Package. If StringId is 0, then a new string is added to\r
81 a String Package. If StringId is not zero, then a string in String Package is\r
82 updated. If SupportedLanguages is NULL, then the string is added or updated\r
83 for all the languages that the String Package supports. If SupportedLanguages\r
d1102dba 84 is not NULL, then the string is added or updated for the set of languages\r
cb7d01c0 85 specified by SupportedLanguages.\r
d1102dba 86\r
cb7d01c0 87 If HiiHandle is NULL, then ASSERT().\r
88 If String is NULL, then ASSERT().\r
89\r
d1102dba 90 @param[in] HiiHandle A handle that was previously registered in the\r
cb7d01c0 91 HII Database.\r
d1102dba
LG
92 @param[in] StringId If zero, then a new string is created in the\r
93 String Package associated with HiiHandle. If\r
94 non-zero, then the string specified by StringId\r
95 is updated in the String Package associated\r
cb7d01c0 96 with HiiHandle.\r
d1102dba
LG
97 @param[in] String A pointer to the Null-terminated Unicode string\r
98 to add or update in the String Package associated\r
99 with HiiHandle.\r
100 @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string of\r
101 language codes. If this parameter is NULL, then\r
102 String is added or updated in the String Package\r
103 associated with HiiHandle for all the languages\r
104 that the String Package supports. If this\r
105 parameter is not NULL, then String is added\r
106 or updated in the String Package associated with\r
107 HiiHandle for the set of languages specified by\r
108 SupportedLanguages. The format of\r
109 SupportedLanguages must follow the language\r
e9b67286 110 format assumed in the HII Database.\r
cb7d01c0 111\r
112 @retval 0 The string could not be added or updated in the String Package.\r
113 @retval Other The EFI_STRING_ID of the newly added or updated string.\r
4c76e9cc 114\r
115**/\r
cb7d01c0 116EFI_STRING_ID\r
4c76e9cc 117EFIAPI\r
cb7d01c0 118HiiSetString (\r
119 IN EFI_HII_HANDLE HiiHandle,\r
e3917e22 120 IN EFI_STRING_ID StringId OPTIONAL,\r
cb7d01c0 121 IN CONST EFI_STRING String,\r
122 IN CONST CHAR8 *SupportedLanguages OPTIONAL\r
b9982883
LG
123 )\r
124;\r
4c76e9cc 125\r
126/**\r
0d96664d
AC
127 Retrieves a string from a string package in a specific language specified in Language\r
128 or in the best lanaguage. See HiiGetStringEx () for the details.\r
4c76e9cc 129\r
cb7d01c0 130 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
d1102dba 131 @param[in] StringId The identifier of the string to retrieved from the string\r
cb7d01c0 132 package associated with HiiHandle.\r
d1102dba
LG
133 @param[in] Language The language of the string to retrieve. If this parameter\r
134 is NULL, then the current platform language is used. The\r
e9b67286 135 format of Language must follow the language format assumed in\r
cb7d01c0 136 the HII Database.\r
4c76e9cc 137\r
cb7d01c0 138 @retval NULL The string specified by StringId is not present in the string package.\r
139 @retval Other The string was returned.\r
4c76e9cc 140\r
141**/\r
cb7d01c0 142EFI_STRING\r
4c76e9cc 143EFIAPI\r
cb7d01c0 144HiiGetString (\r
145 IN EFI_HII_HANDLE HiiHandle,\r
146 IN EFI_STRING_ID StringId,\r
147 IN CONST CHAR8 *Language OPTIONAL\r
0d96664d
AC
148 );\r
149\r
150/**\r
151 Retrieves a string from a string package in a specific language or in the best\r
152 language at discretion of this function according to the priority of languages.\r
153 TryBestLanguage is used to get the string in the best language or in the language\r
154 specified in Language parameter. The behavior is,\r
155 If TryBestLanguage is TRUE, this function looks for the best language for the string.\r
156 - If the string can not be retrieved using the specified language or the current\r
157 platform language, then the string is retrieved from the string package in the\r
158 first language the string package supports.\r
159 If TryBestLanguage is FALSE, Language must be specified for retrieving the string.\r
160\r
161 The returned string is allocated using AllocatePool(). The caller is responsible\r
162 for freeing the allocated buffer using FreePool().\r
163\r
164 If HiiHandle is NULL, then ASSERT().\r
165 If StringId is 0, then ASSET.\r
166 If TryBestLanguage is FALE and Language is NULL, then ASSERT().\r
167\r
168 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
169 @param[in] StringId The identifier of the string to retrieved from the string\r
170 package associated with HiiHandle.\r
171 @param[in] Language The language of the string to retrieve. If this parameter\r
172 is NULL, then the current platform language is used. The\r
173 format of Language must follow the language format assumed\r
174 the HII Database.\r
175 @param[in] TryBestLanguage If TRUE, try to get the best matching language from all\r
176 supported languages.If FALSE, the Language must be assigned\r
177 for the StringID.\r
178\r
179 @retval NULL The string specified by StringId is not present in the string package.\r
180 @retval Other The string was returned.\r
181\r
182**/\r
183EFI_STRING\r
184EFIAPI\r
185HiiGetStringEx (\r
186 IN EFI_HII_HANDLE HiiHandle,\r
187 IN EFI_STRING_ID StringId,\r
188 IN CONST CHAR8 *Language OPTIONAL,\r
189 IN BOOLEAN TryBestLanguage\r
190 );\r
4c76e9cc 191\r
192/**\r
d1102dba
LG
193 Retrieves a string from a string package named by GUID, in the specified language.\r
194 If the language is not specified, then a string from a string package in the\r
195 current platform language is retrieved. If the string cannot be retrieved\r
196 using the specified language or the current platform language, then the string\r
197 is retrieved from the string package in the first language the string package\r
198 supports. The returned string is allocated using AllocatePool(). The caller\r
cb7d01c0 199 is responsible for freeing the allocated buffer using FreePool().\r
d1102dba 200\r
cb7d01c0 201 If PackageListGuid is NULL, then ASSERT().\r
e9b67286 202 If StringId is 0, then ASSERT().\r
cb7d01c0 203\r
d1102dba 204 @param[in] PackageListGuid The GUID of a package list that was previously\r
cb7d01c0 205 registered in the HII Database.\r
d1102dba 206 @param[in] StringId The identifier of the string to retrieved from the\r
cb7d01c0 207 string package associated with PackageListGuid.\r
d1102dba
LG
208 @param[in] Language The language of the string to retrieve. If this\r
209 parameter is NULL, then the current platform\r
210 language is used. The format of Language must\r
e9b67286 211 follow the language format assumed in the HII Database.\r
cb7d01c0 212\r
213 @retval NULL The package list specified by PackageListGuid is not present in the\r
214 HII Database.\r
215 @retval NULL The string specified by StringId is not present in the string package.\r
216 @retval Other The string was returned.\r
4c76e9cc 217\r
218**/\r
cb7d01c0 219EFI_STRING\r
4c76e9cc 220EFIAPI\r
cb7d01c0 221HiiGetPackageString (\r
222 IN CONST EFI_GUID *PackageListGuid,\r
223 IN EFI_STRING_ID StringId,\r
224 IN CONST CHAR8 *Language OPTIONAL\r
b9982883
LG
225 )\r
226;\r
4c76e9cc 227\r
228/**\r
7992c0b0 229 Retrieves the array of all the HII Handles or the HII handles of a specific\r
230 package list GUID in the HII Database.\r
cb7d01c0 231 This array is terminated with a NULL HII Handle.\r
232 This function allocates the returned array using AllocatePool().\r
233 The caller is responsible for freeing the array with FreePool().\r
234\r
d1102dba 235 @param[in] PackageListGuid An optional parameter that is used to request\r
7992c0b0 236 HII Handles associated with a specific\r
e9b67286 237 Package List GUID. If this parameter is NULL,\r
cb7d01c0 238 then all the HII Handles in the HII Database\r
e9b67286 239 are returned. If this parameter is not NULL,\r
d1102dba 240 then zero or more HII Handles associated with\r
7992c0b0 241 PackageListGuid are returned.\r
cb7d01c0 242\r
243 @retval NULL No HII handles were found in the HII database\r
244 @retval NULL The array of HII Handles could not be retrieved\r
245 @retval Other A pointer to the NULL terminated array of HII Handles\r
4c76e9cc 246\r
247**/\r
cb7d01c0 248EFI_HII_HANDLE *\r
4c76e9cc 249EFIAPI\r
cb7d01c0 250HiiGetHiiHandles (\r
251 IN CONST EFI_GUID *PackageListGuid OPTIONAL\r
b9982883
LG
252 )\r
253;\r
4c76e9cc 254\r
8a458283
DB
255/**\r
256 This function allows a caller to extract the form set opcode form the Hii Handle.\r
d1102dba 257 The returned buffer is allocated using AllocatePool().The caller is responsible\r
8a458283
DB
258 for freeing the allocated buffer using FreePool().\r
259\r
260 @param Handle The HII handle.\r
86ac8fb2 261 @param Buffer On return, points to a pointer which point to the buffer that contain the formset opcode.\r
8a458283
DB
262 @param BufferSize On return, points to the length of the buffer.\r
263\r
264 @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated.\r
265 @retval EFI_NOT_FOUND Can't find the package data for the input Handle.\r
266 @retval EFI_INVALID_PARAMETER The input parameters are not correct.\r
86ac8fb2 267 @retval EFI_SUCCESS Get the formset opcode from the hii handle successfully.\r
8a458283
DB
268\r
269**/\r
270EFI_STATUS\r
271EFIAPI\r
1436aea4
MK
272HiiGetFormSetFromHiiHandle (\r
273 IN EFI_HII_HANDLE Handle,\r
274 OUT EFI_IFR_FORM_SET **Buffer,\r
275 OUT UINTN *BufferSize\r
8a458283
DB
276 );\r
277\r
4c76e9cc 278/**\r
d1102dba
LG
279 Retrieves a pointer to a Null-terminated ASCII string containing the list\r
280 of languages that an HII handle in the HII Database supports. The returned\r
cb7d01c0 281 string is allocated using AllocatePool(). The caller is responsible for freeing\r
282 the returned string using FreePool(). The format of the returned string follows\r
e9b67286 283 the language format assumed in the HII Database.\r
d1102dba 284\r
cb7d01c0 285 If HiiHandle is NULL, then ASSERT().\r
4c76e9cc 286\r
cb7d01c0 287 @param[in] HiiHandle A handle that was previously registered in the HII Database.\r
4c76e9cc 288\r
cb7d01c0 289 @retval NULL HiiHandle is not registered in the HII database\r
86ac8fb2 290 @retval NULL There are not enough resources available to retrieve the supported\r
cb7d01c0 291 languages.\r
86ac8fb2 292 @retval NULL The list of supported languages could not be retrieved.\r
cb7d01c0 293 @retval Other A pointer to the Null-terminated ASCII string of supported languages.\r
4c76e9cc 294\r
295**/\r
cb7d01c0 296CHAR8 *\r
4c76e9cc 297EFIAPI\r
cb7d01c0 298HiiGetSupportedLanguages (\r
1436aea4 299 IN EFI_HII_HANDLE HiiHandle\r
b9982883
LG
300 )\r
301;\r
4c76e9cc 302\r
7e3bcccb 303/**\r
d1102dba 304 Allocates and returns a Null-terminated Unicode <ConfigHdr> string using routing\r
7e3bcccb 305 information that includes a GUID, an optional Unicode string name, and a device\r
d1102dba 306 path. The string returned is allocated with AllocatePool(). The caller is\r
7e3bcccb 307 responsible for freeing the allocated string with FreePool().\r
d1102dba 308\r
7e3bcccb
LG
309 The format of a <ConfigHdr> is as follows:\r
310\r
311 GUID=<HexCh>32&NAME=<Char>NameLength&PATH=<HexChar>DevicePathSize<Null>\r
312\r
64a80549 313 @param[in] Guid The pointer to an EFI_GUID that is the routing information\r
d1102dba 314 GUID. Each of the 16 bytes in Guid is converted to\r
86ac8fb2 315 a 2 Unicode character hexadecimal string. This is\r
7e3bcccb 316 an optional parameter that may be NULL.\r
d1102dba
LG
317 @param[in] Name The pointer to a Null-terminated Unicode string that is\r
318 the routing information NAME. This is an optional\r
319 parameter that may be NULL. Each 16-bit Unicode\r
320 character in Name is converted to a 4 character Unicode\r
86ac8fb2 321 hexadecimal string.\r
64a80549 322 @param[in] DriverHandle The driver handle that supports a Device Path Protocol\r
7e3bcccb
LG
323 that is the routing information PATH. Each byte of\r
324 the Device Path associated with DriverHandle is converted\r
86ac8fb2 325 to a two (Unicode) character hexadecimal string.\r
7e3bcccb
LG
326\r
327 @retval NULL DriverHandle does not support the Device Path Protocol.\r
328 @retval NULL DriverHandle does not support the Device Path Protocol.\r
329 @retval Other A pointer to the Null-terminate Unicode <ConfigHdr> string\r
330\r
331**/\r
332EFI_STRING\r
333EFIAPI\r
334HiiConstructConfigHdr (\r
e3917e22
MK
335 IN CONST EFI_GUID *Guid OPTIONAL,\r
336 IN CONST CHAR16 *Name OPTIONAL,\r
7e3bcccb
LG
337 IN EFI_HANDLE DriverHandle\r
338 );\r
339\r
84f9a9ec 340/**\r
84f9a9ec 341 Reset the default value specified by DefaultId to the driver\r
d1102dba 342 configuration specified by the Request string.\r
76c24251
LG
343\r
344 NULL request string support depends on the ExportConfig interface of\r
84f9a9ec 345 HiiConfigRouting protocol in UEFI specification.\r
d1102dba
LG
346\r
347 @param Request A null-terminated Unicode string in\r
76c24251 348 <MultiConfigRequest> format. It can be NULL.\r
64a80549 349 If it is NULL, all configurations for the\r
76c24251
LG
350 entirety of the current HII database will be reset.\r
351 @param DefaultId Specifies the type of defaults to retrieve.\r
d1102dba 352\r
86ac8fb2 353 @retval TRUE The default value was set successfully.\r
e9b67286 354 @retval FALSE The default value was not found.\r
84f9a9ec
LG
355**/\r
356BOOLEAN\r
d1102dba
LG
357EFIAPI\r
358HiiSetToDefaults (\r
e3917e22 359 IN CONST EFI_STRING Request OPTIONAL,\r
e40b7d5d 360 IN UINT16 DefaultId\r
84f9a9ec
LG
361 );\r
362\r
363/**\r
e9b67286 364 Validate the current configuration by parsing the IFR opcode in HII form.\r
84f9a9ec 365\r
4e069e8b 366 NULL request string support depends on the ExportConfig interface of\r
e9b67286 367 HiiConfigRouting protocol in the UEFI specification.\r
d1102dba
LG
368\r
369 @param Request A null-terminated Unicode string in\r
76c24251 370 <MultiConfigRequest> format. It can be NULL.\r
e9b67286 371 If it is NULL, all current configurations for the\r
76c24251 372 entirety of the current HII database will be validated.\r
d1102dba 373\r
9035e118 374 @retval TRUE The current configuration is valid.\r
64a80549 375 @retval FALSE The current configuration is invalid.\r
84f9a9ec
LG
376**/\r
377BOOLEAN\r
d1102dba 378EFIAPI\r
84f9a9ec 379HiiValidateSettings (\r
e40b7d5d 380 IN CONST EFI_STRING Request OPTIONAL\r
84f9a9ec
LG
381 );\r
382\r
7e3bcccb
LG
383/**\r
384 Determines if the routing data specified by GUID and NAME match a <ConfigHdr>.\r
385\r
386 If ConfigHdr is NULL, then ASSERT().\r
387\r
388 @param[in] ConfigHdr Either <ConfigRequest> or <ConfigResp>.\r
64a80549 389 @param[in] Guid The GUID of the storage.\r
390 @param[in] Name The NAME of the storage.\r
7e3bcccb
LG
391\r
392 @retval TRUE Routing information matches <ConfigHdr>.\r
393 @retval FALSE Routing information does not match <ConfigHdr>.\r
394\r
395**/\r
396BOOLEAN\r
397EFIAPI\r
398HiiIsConfigHdrMatch (\r
399 IN CONST EFI_STRING ConfigHdr,\r
e3917e22 400 IN CONST EFI_GUID *Guid OPTIONAL,\r
7e3bcccb
LG
401 IN CONST CHAR16 *Name OPTIONAL\r
402 );\r
403\r
404/**\r
e9b67286 405 Retrieves uncommitted data from the Form Browser and converts it to a binary\r
1d451ff9 406 buffer.\r
7e3bcccb 407\r
d1102dba 408 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional\r
7e3bcccb 409 parameter that may be NULL.\r
d1102dba 410 @param[in] VariableName The pointer to a Null-terminated Unicode string. This\r
84213069 411 is an optional parameter that may be NULL.\r
d1102dba 412 @param[in] BufferSize The length in bytes of buffer to hold retrieved data.\r
64a80549 413 @param[out] Buffer The buffer of data to be updated.\r
7e3bcccb 414\r
1d451ff9
LG
415 @retval FALSE The uncommitted data could not be retrieved.\r
416 @retval TRUE The uncommitted data was retrieved.\r
7e3bcccb
LG
417\r
418**/\r
1d451ff9 419BOOLEAN\r
7e3bcccb
LG
420EFIAPI\r
421HiiGetBrowserData (\r
e3917e22
MK
422 IN CONST EFI_GUID *VariableGuid OPTIONAL,\r
423 IN CONST CHAR16 *VariableName OPTIONAL,\r
84213069
LG
424 IN UINTN BufferSize,\r
425 OUT UINT8 *Buffer\r
7e3bcccb
LG
426 );\r
427\r
428/**\r
429 Updates uncommitted data in the Form Browser.\r
430\r
431 If Buffer is NULL, then ASSERT().\r
432\r
64a80549 433 @param[in] VariableGuid The pointer to an EFI_GUID structure. This is an optional\r
7e3bcccb 434 parameter that may be NULL.\r
64a80549 435 @param[in] VariableName The pointer to a Null-terminated Unicode string. This\r
84213069 436 is an optional parameter that may be NULL.\r
64a80549 437 @param[in] BufferSize The length, in bytes, of Buffer.\r
438 @param[in] Buffer The buffer of data to commit.\r
7e3bcccb
LG
439 @param[in] RequestElement An optional field to specify which part of the\r
440 buffer data will be send back to Browser. If NULL,\r
441 the whole buffer of data will be committed to\r
d1102dba 442 Browser.\r
7e3bcccb
LG
443 <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*\r
444\r
445 @retval FALSE The uncommitted data could not be updated.\r
446 @retval TRUE The uncommitted data was updated.\r
447\r
448**/\r
449BOOLEAN\r
450EFIAPI\r
451HiiSetBrowserData (\r
e3917e22
MK
452 IN CONST EFI_GUID *VariableGuid OPTIONAL,\r
453 IN CONST CHAR16 *VariableName OPTIONAL,\r
7e3bcccb
LG
454 IN UINTN BufferSize,\r
455 IN CONST UINT8 *Buffer,\r
456 IN CONST CHAR16 *RequestElement OPTIONAL\r
457 );\r
458\r
459/////////////////////////////////////////\r
460/////////////////////////////////////////\r
461/// IFR Functions\r
462/////////////////////////////////////////\r
463/////////////////////////////////////////\r
464\r
465/**\r
466 Returns a UINT64 value that contains bitfields for Hour, Minute, and Second.\r
d1102dba
LG
467 The lower 8-bits of Hour are placed in bits 0..7. The lower 8-bits of Minute\r
468 are placed in bits 8..15, and the lower 8-bits of Second are placed in bits\r
469 16..23. This format was selected because it can be easily translated to\r
7e3bcccb
LG
470 an EFI_HII_TIME structure in an EFI_IFR_TYPE_VALUE union.\r
471\r
472 @param Hour The hour value to be encoded.\r
e9b67286 473 @param Minute The minute value to be encoded.\r
7e3bcccb
LG
474 @param Second The second value to be encoded.\r
475\r
476 @return A 64-bit containing Hour, Minute, and Second.\r
477**/\r
478#define EFI_HII_TIME_UINT64(Hour, Minute, Second) \\r
479 (UINT64)((Hour & 0xff) | ((Minute & 0xff) << 8) | ((Second & 0xff) << 16))\r
480\r
481/**\r
84213069 482 Returns a UINT64 value that contains bit fields for Year, Month, and Day.\r
d1102dba
LG
483 The lower 16-bits of Year are placed in bits 0..15. The lower 8-bits of Month\r
484 are placed in bits 16..23, and the lower 8-bits of Day are placed in bits\r
485 24..31. This format was selected because it can be easily translated to\r
7e3bcccb
LG
486 an EFI_HII_DATE structure in an EFI_IFR_TYPE_VALUE union.\r
487\r
488 @param Year The year value to be encoded.\r
489 @param Month The month value to be encoded.\r
490 @param Day The day value to be encoded.\r
491\r
492 @return A 64-bit containing Year, Month, and Day.\r
493**/\r
494#define EFI_HII_DATE_UINT64(Year, Month, Day) \\r
495 (UINT64)((Year & 0xffff) | ((Month & 0xff) << 16) | ((Day & 0xff) << 24))\r
496\r
497/**\r
d1102dba 498 Allocates and returns a new OpCode Handle. OpCode Handles must be freed with\r
7e3bcccb
LG
499 HiiFreeOpCodeHandle().\r
500\r
501 @retval NULL There are not enough resources to allocate a new OpCode Handle.\r
502 @retval Other A new OpCode handle.\r
503\r
504**/\r
505VOID *\r
506EFIAPI\r
507HiiAllocateOpCodeHandle (\r
508 VOID\r
509 );\r
510\r
511/**\r
84213069 512 Frees an OpCode Handle that was previously allocated with HiiAllocateOpCodeHandle().\r
7e3bcccb
LG
513 When an OpCode Handle is freed, all of the opcodes associated with the OpCode\r
514 Handle are also freed.\r
515\r
516 If OpCodeHandle is NULL, then ASSERT().\r
517\r
64a80549 518 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
84213069 519\r
7e3bcccb
LG
520**/\r
521VOID\r
522EFIAPI\r
523HiiFreeOpCodeHandle (\r
524 VOID *OpCodeHandle\r
525 );\r
526\r
278663ab
LG
527/**\r
528 Append raw opcodes to an OpCodeHandle.\r
529\r
530 If OpCodeHandle is NULL, then ASSERT().\r
531 If RawBuffer is NULL, then ASSERT();\r
532\r
64a80549 533 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
534 @param[in] RawBuffer The buffer of opcodes to append.\r
278663ab
LG
535 @param[in] RawBufferSize The size, in bytes, of Buffer.\r
536\r
537 @retval NULL There is not enough space left in Buffer to add the opcode.\r
538 @retval Other A pointer to the appended opcodes.\r
539\r
540**/\r
541UINT8 *\r
542EFIAPI\r
543HiiCreateRawOpCodes (\r
544 IN VOID *OpCodeHandle,\r
545 IN UINT8 *RawBuffer,\r
546 IN UINTN RawBufferSize\r
547 );\r
548\r
7e3bcccb
LG
549/**\r
550 Create EFI_IFR_END_OP opcode.\r
551\r
552 If OpCodeHandle is NULL, then ASSERT().\r
553\r
554 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
555\r
556 @retval NULL There is not enough space left in Buffer to add the opcode.\r
557 @retval Other A pointer to the created opcode.\r
558\r
559**/\r
560UINT8 *\r
561EFIAPI\r
562HiiCreateEndOpCode (\r
563 IN VOID *OpCodeHandle\r
564 );\r
565\r
566/**\r
567 Create EFI_IFR_ONE_OF_OPTION_OP opcode.\r
568\r
569 If OpCodeHandle is NULL, then ASSERT().\r
570 If Type is invalid, then ASSERT().\r
571 If Flags is invalid, then ASSERT().\r
572\r
64a80549 573 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
574 @param[in] StringId StringId for the option.\r
575 @param[in] Flags The flags for the option.\r
576 @param[in] Type The type for the option.\r
577 @param[in] Value The value for the option.\r
7e3bcccb
LG
578\r
579 @retval NULL There is not enough space left in Buffer to add the opcode.\r
580 @retval Other A pointer to the created opcode.\r
581\r
582**/\r
583UINT8 *\r
584EFIAPI\r
585HiiCreateOneOfOptionOpCode (\r
586 IN VOID *OpCodeHandle,\r
587 IN UINT16 StringId,\r
588 IN UINT8 Flags,\r
589 IN UINT8 Type,\r
590 IN UINT64 Value\r
591 );\r
592\r
593/**\r
594 Create EFI_IFR_DEFAULT_OP opcode.\r
595\r
596 If OpCodeHandle is NULL, then ASSERT().\r
597 If Type is invalid, then ASSERT().\r
598\r
64a80549 599 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
600 @param[in] DefaultId The DefaultId for the default.\r
601 @param[in] Type The type for the default.\r
602 @param[in] Value The value for the default.\r
7e3bcccb
LG
603\r
604 @retval NULL There is not enough space left in Buffer to add the opcode.\r
605 @retval Other A pointer to the created opcode.\r
606\r
607**/\r
608UINT8 *\r
609EFIAPI\r
610HiiCreateDefaultOpCode (\r
611 IN VOID *OpCodeHandle,\r
612 IN UINT16 DefaultId,\r
613 IN UINT8 Type,\r
614 IN UINT64 Value\r
615 );\r
616\r
617/**\r
618 Create EFI_IFR_GUID opcode.\r
619\r
620 If OpCodeHandle is NULL, then ASSERT().\r
621 If Guid is NULL, then ASSERT().\r
622 If OpCodeSize < sizeof (EFI_IFR_GUID), then ASSERT().\r
623\r
64a80549 624 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
625 @param[in] Guid The pointer to EFI_GUID of this guided opcode.\r
d1102dba 626 @param[in] GuidOpCode The pointer to an EFI_IFR_GUID opcode. This is an\r
7e3bcccb 627 optional parameter that may be NULL. If this\r
d1102dba 628 parameter is NULL, then the GUID extension\r
7e3bcccb 629 region of the created opcode is filled with zeros.\r
d1102dba
LG
630 If this parameter is not NULL, then the GUID\r
631 extension region of GuidData will be copied to\r
7e3bcccb 632 the GUID extension region of the created opcode.\r
d1102dba 633 @param[in] OpCodeSize The size, in bytes, of created opcode. This value\r
7e3bcccb
LG
634 must be >= sizeof(EFI_IFR_GUID).\r
635\r
636 @retval NULL There is not enough space left in Buffer to add the opcode.\r
637 @retval Other A pointer to the created opcode.\r
638\r
639**/\r
640UINT8 *\r
641EFIAPI\r
642HiiCreateGuidOpCode (\r
643 IN VOID *OpCodeHandle,\r
644 IN CONST EFI_GUID *Guid,\r
e3917e22 645 IN CONST VOID *GuidOpCode OPTIONAL,\r
7e3bcccb
LG
646 IN UINTN OpCodeSize\r
647 );\r
648\r
649/**\r
650 Create EFI_IFR_ACTION_OP opcode.\r
651\r
652 If OpCodeHandle is NULL, then ASSERT().\r
653 If any reserved bits are set in QuestionFlags, then ASSERT().\r
654\r
64a80549 655 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
656 @param[in] QuestionId The Question ID.\r
657 @param[in] Prompt The String ID for Prompt.\r
658 @param[in] Help The String ID for Help.\r
659 @param[in] QuestionFlags The flags in the Question Header.\r
660 @param[in] QuestionConfig The String ID for the configuration.\r
7e3bcccb
LG
661\r
662 @retval NULL There is not enough space left in Buffer to add the opcode.\r
663 @retval Other A pointer to the created opcode.\r
664\r
665**/\r
666UINT8 *\r
667EFIAPI\r
668HiiCreateActionOpCode (\r
669 IN VOID *OpCodeHandle,\r
670 IN EFI_QUESTION_ID QuestionId,\r
671 IN EFI_STRING_ID Prompt,\r
672 IN EFI_STRING_ID Help,\r
673 IN UINT8 QuestionFlags,\r
674 IN EFI_STRING_ID QuestionConfig\r
675 );\r
676\r
677/**\r
678 Create EFI_IFR_SUBTITLE_OP opcode.\r
679\r
680 If OpCodeHandle is NULL, then ASSERT().\r
681 If any reserved bits are set in Flags, then ASSERT().\r
682 If Scope > 1, then ASSERT().\r
683\r
64a80549 684 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
685 @param[in] Prompt The string ID for Prompt.\r
686 @param[in] Help The string ID for Help.\r
687 @param[in] Flags The subtitle opcode flags.\r
84213069 688 @param[in] Scope 1 if this opcode is the beginning of a new scope.\r
7e3bcccb
LG
689 0 if this opcode is within the current scope.\r
690\r
691 @retval NULL There is not enough space left in Buffer to add the opcode.\r
692 @retval Other A pointer to the created opcode.\r
693\r
694**/\r
695UINT8 *\r
696EFIAPI\r
697HiiCreateSubTitleOpCode (\r
698 IN VOID *OpCodeHandle,\r
699 IN EFI_STRING_ID Prompt,\r
700 IN EFI_STRING_ID Help,\r
701 IN UINT8 Flags,\r
702 IN UINT8 Scope\r
703 );\r
704\r
705/**\r
706 Create EFI_IFR_REF_OP opcode.\r
707\r
708 If OpCodeHandle is NULL, then ASSERT().\r
709 If any reserved bits are set in QuestionFlags, then ASSERT().\r
710\r
64a80549 711 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
712 @param[in] FormId The Destination Form ID.\r
713 @param[in] Prompt The string ID for Prompt.\r
714 @param[in] Help The string ID for Help.\r
715 @param[in] QuestionFlags The flags in Question Header\r
716 @param[in] QuestionId Question ID.\r
7e3bcccb
LG
717\r
718 @retval NULL There is not enough space left in Buffer to add the opcode.\r
719 @retval Other A pointer to the created opcode.\r
720\r
721**/\r
722UINT8 *\r
723EFIAPI\r
724HiiCreateGotoOpCode (\r
725 IN VOID *OpCodeHandle,\r
726 IN EFI_FORM_ID FormId,\r
727 IN EFI_STRING_ID Prompt,\r
728 IN EFI_STRING_ID Help,\r
729 IN UINT8 QuestionFlags,\r
730 IN EFI_QUESTION_ID QuestionId\r
731 );\r
732\r
e8654a1a
LG
733/**\r
734 Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode.\r
735\r
d1102dba 736 When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created.\r
e8654a1a
LG
737 When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created.\r
738 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created.\r
739 When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is zero, EFI_IFR_REF opcode will be created.\r
740\r
741 If OpCodeHandle is NULL, then ASSERT().\r
742 If any reserved bits are set in QuestionFlags, then ASSERT().\r
743\r
744 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
745 @param[in] RefFormId The Destination Form ID.\r
746 @param[in] Prompt The string ID for Prompt.\r
747 @param[in] Help The string ID for Help.\r
748 @param[in] QuestionFlags The flags in Question Header\r
749 @param[in] QuestionId Question ID.\r
d1102dba 750 @param[in] RefQuestionId The question on the form to which this link is referring.\r
e8654a1a 751 If its value is zero, then the link refers to the top of the form.\r
d1102dba 752 @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is\r
e8654a1a 753 zero, then the link is to the current form set.\r
d1102dba 754 @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of\r
e8654a1a
LG
755 the device path to which the form set containing the form specified by FormId.\r
756 If its value is zero, then the link refers to the current page.\r
757\r
758 @retval NULL There is not enough space left in Buffer to add the opcode.\r
759 @retval Other A pointer to the created opcode.\r
760\r
761**/\r
762UINT8 *\r
763EFIAPI\r
764HiiCreateGotoExOpCode (\r
765 IN VOID *OpCodeHandle,\r
766 IN EFI_FORM_ID RefFormId,\r
767 IN EFI_STRING_ID Prompt,\r
768 IN EFI_STRING_ID Help,\r
769 IN UINT8 QuestionFlags,\r
770 IN EFI_QUESTION_ID QuestionId,\r
771 IN EFI_QUESTION_ID RefQuestionId,\r
e3917e22 772 IN EFI_GUID *RefFormSetId OPTIONAL,\r
e8654a1a
LG
773 IN EFI_STRING_ID RefDevicePath\r
774 );\r
775\r
7e3bcccb
LG
776/**\r
777 Create EFI_IFR_CHECKBOX_OP opcode.\r
778\r
779 If OpCodeHandle is NULL, then ASSERT().\r
780 If any reserved bits are set in QuestionFlags, then ASSERT().\r
781 If any reserved bits are set in CheckBoxFlags, then ASSERT().\r
782\r
64a80549 783 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
784 @param[in] QuestionId The question ID.\r
785 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
786 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
787 for this name/value pair.\r
64a80549 788 @param[in] Prompt The string ID for Prompt.\r
789 @param[in] Help The string ID for Help.\r
790 @param[in] QuestionFlags The flags in Question Header.\r
791 @param[in] CheckBoxFlags The flags for checkbox opcode.\r
792 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
793 is an optional parameter that may be NULL.\r
794\r
795 @retval NULL There is not enough space left in Buffer to add the opcode.\r
796 @retval Other A pointer to the created opcode.\r
797\r
798**/\r
799UINT8 *\r
800EFIAPI\r
801HiiCreateCheckBoxOpCode (\r
802 IN VOID *OpCodeHandle,\r
803 IN EFI_QUESTION_ID QuestionId,\r
804 IN EFI_VARSTORE_ID VarStoreId,\r
805 IN UINT16 VarOffset,\r
806 IN EFI_STRING_ID Prompt,\r
807 IN EFI_STRING_ID Help,\r
808 IN UINT8 QuestionFlags,\r
809 IN UINT8 CheckBoxFlags,\r
810 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
811 );\r
812\r
813/**\r
814 Create EFI_IFR_NUMERIC_OP opcode.\r
815\r
816 If OpCodeHandle is NULL, then ASSERT().\r
817 If any reserved bits are set in QuestionFlags, then ASSERT().\r
818 If any reserved bits are set in NumericFlags, then ASSERT().\r
819\r
64a80549 820 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
821 @param[in] QuestionId The question ID.\r
822 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
823 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
824 for this name/value pair.\r
64a80549 825 @param[in] Prompt The string ID for Prompt.\r
826 @param[in] Help The string ID for Help.\r
827 @param[in] QuestionFlags The flags in Question Header.\r
828 @param[in] NumericFlags The flags for a numeric opcode.\r
829 @param[in] Minimum The numeric minimum value.\r
830 @param[in] Maximum The numeric maximum value.\r
831 @param[in] Step The numeric step for edit.\r
832 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
833 is an optional parameter that may be NULL.\r
834\r
835 @retval NULL There is not enough space left in Buffer to add the opcode.\r
836 @retval Other A pointer to the created opcode.\r
837\r
838**/\r
839UINT8 *\r
840EFIAPI\r
841HiiCreateNumericOpCode (\r
842 IN VOID *OpCodeHandle,\r
843 IN EFI_QUESTION_ID QuestionId,\r
844 IN EFI_VARSTORE_ID VarStoreId,\r
845 IN UINT16 VarOffset,\r
846 IN EFI_STRING_ID Prompt,\r
847 IN EFI_STRING_ID Help,\r
848 IN UINT8 QuestionFlags,\r
849 IN UINT8 NumericFlags,\r
850 IN UINT64 Minimum,\r
851 IN UINT64 Maximum,\r
852 IN UINT64 Step,\r
853 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
854 );\r
855\r
856/**\r
857 Create EFI_IFR_STRING_OP opcode.\r
858\r
859 If OpCodeHandle is NULL, then ASSERT().\r
860 If any reserved bits are set in QuestionFlags, then ASSERT().\r
861 If any reserved bits are set in StringFlags, then ASSERT().\r
862\r
64a80549 863 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
864 @param[in] QuestionId The question ID.\r
865 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
866 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
867 for this name/value pair.\r
64a80549 868 @param[in] Prompt The string ID for Prompt.\r
869 @param[in] Help The string ID for Help.\r
870 @param[in] QuestionFlags The flags in Question Header.\r
871 @param[in] StringFlags The flags for a string opcode.\r
872 @param[in] MinSize The string minimum length.\r
873 @param[in] MaxSize The string maximum length.\r
874 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
875 is an optional parameter that may be NULL.\r
876\r
877 @retval NULL There is not enough space left in Buffer to add the opcode.\r
878 @retval Other A pointer to the created opcode.\r
879\r
880**/\r
881UINT8 *\r
882EFIAPI\r
883HiiCreateStringOpCode (\r
884 IN VOID *OpCodeHandle,\r
885 IN EFI_QUESTION_ID QuestionId,\r
886 IN EFI_VARSTORE_ID VarStoreId,\r
887 IN UINT16 VarOffset,\r
888 IN EFI_STRING_ID Prompt,\r
889 IN EFI_STRING_ID Help,\r
890 IN UINT8 QuestionFlags,\r
891 IN UINT8 StringFlags,\r
892 IN UINT8 MinSize,\r
893 IN UINT8 MaxSize,\r
894 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
895 );\r
896\r
897/**\r
898 Create EFI_IFR_ONE_OF_OP opcode.\r
899\r
900 If OpCodeHandle is NULL, then ASSERT().\r
901 If any reserved bits are set in QuestionFlags, then ASSERT().\r
902 If any reserved bits are set in OneOfFlags, then ASSERT().\r
903\r
64a80549 904 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
905 @param[in] QuestionId The question ID.\r
906 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
907 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
908 for this name/value pair.\r
64a80549 909 @param[in] Prompt The string ID for Prompt.\r
910 @param[in] Help The string ID for Help.\r
911 @param[in] QuestionFlags The flags in Question Header.\r
912 @param[in] OneOfFlags The flags for a oneof opcode.\r
913 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
914 @param[in] DefaultsOpCodeHandle The handle for a buffer of DEFAULT opcodes. This\r
7e3bcccb
LG
915 is an optional parameter that may be NULL.\r
916\r
917 @retval NULL There is not enough space left in Buffer to add the opcode.\r
918 @retval Other A pointer to the created opcode.\r
919\r
920**/\r
921UINT8 *\r
922EFIAPI\r
923HiiCreateOneOfOpCode (\r
924 IN VOID *OpCodeHandle,\r
925 IN EFI_QUESTION_ID QuestionId,\r
926 IN EFI_VARSTORE_ID VarStoreId,\r
927 IN UINT16 VarOffset,\r
928 IN EFI_STRING_ID Prompt,\r
929 IN EFI_STRING_ID Help,\r
930 IN UINT8 QuestionFlags,\r
931 IN UINT8 OneOfFlags,\r
932 IN VOID *OptionsOpCodeHandle,\r
933 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
934 );\r
935\r
936/**\r
937 Create EFI_IFR_ORDERED_LIST_OP opcode.\r
938\r
939 If OpCodeHandle is NULL, then ASSERT().\r
940 If any reserved bits are set in QuestionFlags, then ASSERT().\r
941 If any reserved bits are set in OrderedListFlags, then ASSERT().\r
942\r
64a80549 943 @param[in] OpCodeHandle The handle to the buffer of opcodes.\r
944 @param[in] QuestionId The question ID.\r
945 @param[in] VarStoreId The storage ID.\r
09acdc0b
ED
946 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
947 for this name/value pair.\r
64a80549 948 @param[in] Prompt The string ID for Prompt.\r
949 @param[in] Help The string ID for Help.\r
950 @param[in] QuestionFlags The flags in Question Header.\r
951 @param[in] OrderedListFlags The flags for an ordered list opcode.\r
952 @param[in] DataType The type for option value.\r
7e3bcccb 953 @param[in] MaxContainers Maximum count for options in this ordered list\r
64a80549 954 @param[in] OptionsOpCodeHandle The handle for a buffer of ONE_OF_OPTION opcodes.\r
7e3bcccb
LG
955 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
956 is an optional parameter that may be NULL.\r
957\r
958 @retval NULL There is not enough space left in Buffer to add the opcode.\r
959 @retval Other A pointer to the created opcode.\r
960\r
961**/\r
962UINT8 *\r
963EFIAPI\r
964HiiCreateOrderedListOpCode (\r
965 IN VOID *OpCodeHandle,\r
966 IN EFI_QUESTION_ID QuestionId,\r
967 IN EFI_VARSTORE_ID VarStoreId,\r
968 IN UINT16 VarOffset,\r
969 IN EFI_STRING_ID Prompt,\r
970 IN EFI_STRING_ID Help,\r
971 IN UINT8 QuestionFlags,\r
972 IN UINT8 OrderedListFlags,\r
973 IN UINT8 DataType,\r
974 IN UINT8 MaxContainers,\r
975 IN VOID *OptionsOpCodeHandle,\r
976 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
977 );\r
978\r
e22812c7
LG
979/**\r
980 Create EFI_IFR_TEXT_OP opcode.\r
981\r
982 If OpCodeHandle is NULL, then ASSERT().\r
983\r
984 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
985 @param[in] Prompt String ID for Prompt.\r
986 @param[in] Help String ID for Help.\r
987 @param[in] TextTwo String ID for TextTwo.\r
988\r
989 @retval NULL There is not enough space left in Buffer to add the opcode.\r
990 @retval Other A pointer to the created opcode.\r
991\r
992**/\r
993UINT8 *\r
994EFIAPI\r
995HiiCreateTextOpCode (\r
996 IN VOID *OpCodeHandle,\r
997 IN EFI_STRING_ID Prompt,\r
998 IN EFI_STRING_ID Help,\r
999 IN EFI_STRING_ID TextTwo\r
1000 );\r
1001\r
1002/**\r
1003 Create EFI_IFR_DATE_OP opcode.\r
1004\r
1005 If OpCodeHandle is NULL, then ASSERT().\r
1006 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1007 If any reserved bits are set in DateFlags, then ASSERT().\r
1008\r
1009 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1010 @param[in] QuestionId Question ID\r
1011 @param[in] VarStoreId Storage ID, optional. If DateFlags is not\r
1012 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
1013 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
1014 for this name/value pair, optional. If DateFlags is not\r
e22812c7
LG
1015 QF_DATE_STORAGE_NORMAL, this parameter is ignored.\r
1016 @param[in] Prompt String ID for Prompt\r
1017 @param[in] Help String ID for Help\r
1018 @param[in] QuestionFlags Flags in Question Header\r
1019 @param[in] DateFlags Flags for date opcode\r
1020 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1021 is an optional parameter that may be NULL.\r
1022\r
1023 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1024 @retval Other A pointer to the created opcode.\r
1025\r
1026**/\r
1027UINT8 *\r
1028EFIAPI\r
1029HiiCreateDateOpCode (\r
1030 IN VOID *OpCodeHandle,\r
1031 IN EFI_QUESTION_ID QuestionId,\r
e3917e22
MK
1032 IN EFI_VARSTORE_ID VarStoreId OPTIONAL,\r
1033 IN UINT16 VarOffset OPTIONAL,\r
e22812c7
LG
1034 IN EFI_STRING_ID Prompt,\r
1035 IN EFI_STRING_ID Help,\r
1036 IN UINT8 QuestionFlags,\r
1037 IN UINT8 DateFlags,\r
1038 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1039 );\r
1040\r
1041/**\r
1042 Create EFI_IFR_TIME_OP opcode.\r
1043\r
1044 If OpCodeHandle is NULL, then ASSERT().\r
1045 If any reserved bits are set in QuestionFlags, then ASSERT().\r
1046 If any reserved bits are set in TimeFlags, then ASSERT().\r
1047\r
1048 @param[in] OpCodeHandle Handle to the buffer of opcodes.\r
1049 @param[in] QuestionId Question ID\r
1050 @param[in] VarStoreId Storage ID, optional. If TimeFlags is not\r
1051 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
09acdc0b
ED
1052 @param[in] VarOffset Offset in Storage or String ID of the name (VarName)\r
1053 for this name/value pair, optional. If TimeFlags is not\r
e22812c7
LG
1054 QF_TIME_STORAGE_NORMAL, this parameter is ignored.\r
1055 @param[in] Prompt String ID for Prompt\r
1056 @param[in] Help String ID for Help\r
1057 @param[in] QuestionFlags Flags in Question Header\r
1058 @param[in] TimeFlags Flags for time opcode\r
1059 @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This\r
1060 is an optional parameter that may be NULL.\r
1061\r
1062 @retval NULL There is not enough space left in Buffer to add the opcode.\r
1063 @retval Other A pointer to the created opcode.\r
1064\r
1065**/\r
1066UINT8 *\r
1067EFIAPI\r
1068HiiCreateTimeOpCode (\r
1069 IN VOID *OpCodeHandle,\r
1070 IN EFI_QUESTION_ID QuestionId,\r
e3917e22
MK
1071 IN EFI_VARSTORE_ID VarStoreId OPTIONAL,\r
1072 IN UINT16 VarOffset OPTIONAL,\r
e22812c7
LG
1073 IN EFI_STRING_ID Prompt,\r
1074 IN EFI_STRING_ID Help,\r
1075 IN UINT8 QuestionFlags,\r
1076 IN UINT8 TimeFlags,\r
1077 IN VOID *DefaultsOpCodeHandle OPTIONAL\r
1078 );\r
1079\r
7e3bcccb 1080/**\r
d1102dba 1081 This function updates a form that has previously been registered with the HII\r
7e3bcccb 1082 Database. This function will perform at most one update operation.\r
d1102dba
LG
1083\r
1084 The form to update is specified by Handle, FormSetGuid, and FormId. Binary\r
1085 comparisons of IFR opcodes are performed from the beginning of the form being\r
1086 updated until an IFR opcode is found that exactly matches the first IFR opcode\r
84213069 1087 specified by StartOpCodeHandle. The following rules are used to determine if\r
e9b67286 1088 an insert, replace, or delete operation is performed:\r
d1102dba
LG
1089\r
1090 1) If no matches are found, then NULL is returned.\r
7e3bcccb 1091 2) If a match is found, and EndOpCodeHandle is NULL, then all of the IFR opcodes\r
d1102dba 1092 from StartOpCodeHandle except the first opcode are inserted immediately after\r
84213069 1093 the matching IFR opcode in the form to be updated.\r
d1102dba
LG
1094 3) If a match is found, and EndOpCodeHandle is not NULL, then a search is made\r
1095 from the matching IFR opcode until an IFR opcode exactly matches the first\r
7e3bcccb
LG
1096 IFR opcode specified by EndOpCodeHandle. If no match is found for the first\r
1097 IFR opcode specified by EndOpCodeHandle, then NULL is returned. If a match\r
d1102dba 1098 is found, then all of the IFR opcodes between the start match and the end\r
7e3bcccb 1099 match are deleted from the form being updated and all of the IFR opcodes\r
d1102dba 1100 from StartOpCodeHandle except the first opcode are inserted immediately after\r
7e3bcccb 1101 the matching start IFR opcode. If StartOpCcodeHandle only contains one\r
84213069 1102 IFR instruction, then the result of this operation will delete all of the IFR\r
7e3bcccb
LG
1103 opcodes between the start end matches.\r
1104\r
1105 If HiiHandle is NULL, then ASSERT().\r
1106 If StartOpCodeHandle is NULL, then ASSERT().\r
1107\r
1108 @param[in] HiiHandle The HII Handle of the form to update.\r
1109 @param[in] FormSetGuid The Formset GUID of the form to update. This\r
1110 is an optional parameter that may be NULL.\r
1111 If it is NULL, all FormSet will be updated.\r
1112 @param[in] FormId The ID of the form to update.\r
d1102dba 1113 @param[in] StartOpCodeHandle An OpCode Handle that contains the set of IFR\r
7e3bcccb 1114 opcodes to be inserted or replaced in the form.\r
d1102dba
LG
1115 The first IFR instruction in StartOpCodeHandle\r
1116 is used to find matching IFR opcode in the\r
1117 form.\r
7e3bcccb
LG
1118 @param[in] EndOpCodeHandle An OpCcode Handle that contains the IFR opcode\r
1119 that marks the end of a replace operation in\r
1120 the form. This is an optional parameter that\r
e9b67286 1121 may be NULL. If it is NULL, then the IFR\r
d1102dba 1122 opcodes specified by StartOpCodeHandle are\r
7e3bcccb 1123 inserted into the form.\r
d1102dba 1124\r
e9b67286 1125 @retval EFI_OUT_OF_RESOURCES Not enough memory resources are allocated.\r
1126 @retval EFI_NOT_FOUND The following cases will return EFI_NOT_FOUND:\r
d1102dba 1127 1) The form specified by HiiHandle, FormSetGuid,\r
7e3bcccb
LG
1128 and FormId could not be found in the HII Database.\r
1129 2) No IFR opcodes in the target form match the first\r
1130 IFR opcode in StartOpCodeHandle.\r
d1102dba
LG
1131 3) EndOpCOde is not NULL, and no IFR opcodes in the\r
1132 target form following a matching start opcode match\r
7e3bcccb
LG
1133 the first IFR opcode in EndOpCodeHandle.\r
1134 @retval EFI_SUCCESS The matched form is updated by StartOpcode.\r
1135\r
1136**/\r
1137EFI_STATUS\r
1138EFIAPI\r
1139HiiUpdateForm (\r
1140 IN EFI_HII_HANDLE HiiHandle,\r
e3917e22 1141 IN EFI_GUID *FormSetGuid OPTIONAL,\r
7e3bcccb 1142 IN EFI_FORM_ID FormId,\r
84213069
LG
1143 IN VOID *StartOpCodeHandle,\r
1144 IN VOID *EndOpCodeHandle OPTIONAL\r
7e3bcccb
LG
1145 );\r
1146\r
4c76e9cc 1147#endif\r