]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
Add some comments, clear describe the efi varstore type.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
CommitLineData
7936fb6a 1/** @file\r
d66e6c16 2Private MACRO, structure and function definitions for Setup Browser module.\r
7936fb6a 3\r
80a047f0 4Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
7936fb6a 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13\r
14**/\r
15\r
16#ifndef _SETUP_H_\r
17#define _SETUP_H_\r
18\r
19\r
39099938 20#include <PiDxe.h>\r
7936fb6a 21\r
7936fb6a 22#include <Protocol/SimpleTextOut.h>\r
23#include <Protocol/SimpleTextIn.h>\r
24#include <Protocol/FormBrowser2.h>\r
7c6c064c
ED
25#include <Protocol/FormBrowserEx2.h>\r
26#include <Protocol/DisplayProtocol.h>\r
7936fb6a 27#include <Protocol/DevicePath.h>\r
28#include <Protocol/UnicodeCollation.h>\r
29#include <Protocol/HiiConfigAccess.h>\r
30#include <Protocol/HiiConfigRouting.h>\r
31#include <Protocol/HiiDatabase.h>\r
32#include <Protocol/HiiString.h>\r
cbf73e50 33#include <Protocol/UserManager.h>\r
80a047f0 34#include <Protocol/DevicePathFromText.h>\r
7936fb6a 35\r
5c526736 36#include <Guid/MdeModuleHii.h>\r
0a1147ed 37#include <Guid/HiiPlatformSetupFormset.h>\r
2573712e 38#include <Guid/HiiFormMapMethodGuid.h>\r
7936fb6a 39\r
7936fb6a 40#include <Library/PrintLib.h>\r
41#include <Library/DebugLib.h>\r
42#include <Library/BaseMemoryLib.h>\r
43#include <Library/UefiRuntimeServicesTableLib.h>\r
44#include <Library/UefiDriverEntryPoint.h>\r
45#include <Library/UefiBootServicesTableLib.h>\r
46#include <Library/BaseLib.h>\r
47#include <Library/MemoryAllocationLib.h>\r
7936fb6a 48#include <Library/HiiLib.h>\r
f511d656 49#include <Library/PcdLib.h>\r
cb7d01c0 50#include <Library/DevicePathLib.h>\r
7c6c064c 51#include <Library/UefiLib.h>\r
7936fb6a 52\r
7936fb6a 53\r
54//\r
55// This is the generated header file which includes whatever needs to be exported (strings + IFR)\r
56//\r
57\r
7c6c064c
ED
58#define UI_ACTION_NONE 0\r
59#define UI_ACTION_REFRESH_FORM 1\r
60#define UI_ACTION_REFRESH_FORMSET 2\r
61#define UI_ACTION_EXIT 3\r
7936fb6a 62\r
63//\r
7936fb6a 64//\r
65// Time definitions\r
66//\r
67#define ONE_SECOND 10000000\r
68\r
7936fb6a 69// Incremental string lenght of ConfigRequest\r
70//\r
71#define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r
72\r
7936fb6a 73//\r
74// Incremental size of stack for expression\r
75//\r
76#define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r
77\r
0269d14b 78#define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))\r
7936fb6a 79\r
7936fb6a 80\r
f3f2e05d 81#define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')\r
7936fb6a 82typedef struct {\r
83 UINT32 Signature;\r
84\r
85 EFI_HANDLE Handle;\r
86\r
87 //\r
88 // Produced protocol\r
89 //\r
7c6c064c
ED
90 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
91 EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;\r
7936fb6a 92\r
7c6c064c 93 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2;\r
7936fb6a 94\r
7c6c064c 95} SETUP_DRIVER_PRIVATE_DATA;\r
25361615 96\r
7936fb6a 97//\r
98// IFR relative definition\r
99//\r
100#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r
101#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r
102#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r
103#define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r
104#define EFI_HII_EXPRESSION_DISABLE_IF 4\r
105#define EFI_HII_EXPRESSION_VALUE 5\r
106#define EFI_HII_EXPRESSION_RULE 6\r
2573712e
LG
107#define EFI_HII_EXPRESSION_READ 7\r
108#define EFI_HII_EXPRESSION_WRITE 8\r
7936fb6a 109\r
110#define EFI_HII_VARSTORE_BUFFER 0\r
111#define EFI_HII_VARSTORE_NAME_VALUE 1\r
c0462ea7
ED
112#define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.\r
113#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.\r
7936fb6a 114\r
115#define FORM_INCONSISTENT_VALIDATION 0\r
116#define FORM_NO_SUBMIT_VALIDATION 1\r
117\r
f3f2e05d 118#define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')\r
7936fb6a 119\r
120typedef struct {\r
121 UINTN Signature;\r
122 LIST_ENTRY Link;\r
123 CHAR16 *Name;\r
124 CHAR16 *Value;\r
125 CHAR16 *EditValue;\r
126} NAME_VALUE_NODE;\r
127\r
128#define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r
129\r
94f3aae7 130#define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')\r
7936fb6a 131\r
132typedef struct {\r
133 UINTN Signature;\r
134 LIST_ENTRY Link;\r
135\r
136 UINT8 Type; // Storage type\r
137\r
7936fb6a 138 EFI_GUID Guid;\r
139\r
140 CHAR16 *Name; // For EFI_IFR_VARSTORE\r
141 UINT16 Size;\r
142 UINT8 *Buffer;\r
143 UINT8 *EditBuffer; // Edit copy for Buffer Storage\r
144\r
145 LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r
146\r
147 UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r
148\r
149 CHAR16 *ConfigHdr; // <ConfigHdr>\r
efffd9c1
ED
150 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
151 // <RequestElement> includes all fields which is used by current form sets.\r
152 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
94f3aae7
ED
153 UINT8 ReferenceCount; // How many form set storage refrence this storage.\r
154} BROWSER_STORAGE;\r
155\r
156#define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)\r
157\r
158#define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')\r
159\r
160typedef struct {\r
161 UINTN Signature;\r
162 LIST_ENTRY Link;\r
163\r
164 UINT16 VarStoreId;\r
165\r
166 BROWSER_STORAGE *BrowserStorage;\r
167\r
7936fb6a 168 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
7c6c064c 169 CHAR16 *ConfigElements;// Elements need to load initial data.\r
7936fb6a 170 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
171 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
172} FORMSET_STORAGE;\r
173\r
174#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
175\r
2573712e
LG
176typedef union {\r
177 EFI_STRING_ID VarName;\r
178 UINT16 VarOffset;\r
179} VAR_STORE_INFO;\r
180\r
f3f2e05d 181#define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r
7936fb6a 182\r
183typedef struct {\r
184 UINTN Signature;\r
185 LIST_ENTRY Link;\r
186\r
187 UINT8 Operand;\r
188\r
189 UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r
190 UINT8 Flags; // For EFI_IFR_SPAN\r
191 UINT8 RuleId; // For EFI_IFR_RULE_REF\r
192\r
193 EFI_HII_VALUE Value; // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1\r
194\r
2654f642 195 EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r
7936fb6a 196 EFI_QUESTION_ID QuestionId2;\r
197\r
2654f642 198 UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r
7936fb6a 199 UINT16 *ValueList;\r
200\r
201 EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r
202 EFI_GUID Guid;\r
2573712e 203\r
94f3aae7 204 BROWSER_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r
2573712e
LG
205 VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET\r
206 UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET\r
207 UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET\r
208 CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET\r
209 LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode.\r
7936fb6a 210} EXPRESSION_OPCODE;\r
211\r
212#define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r
213\r
f3f2e05d 214#define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r
7936fb6a 215\r
216typedef struct {\r
217 UINTN Signature;\r
218 LIST_ENTRY Link;\r
219\r
220 UINT8 Type; // Type for this expression\r
221\r
222 UINT8 RuleId; // For EFI_IFR_RULE only\r
223 EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r
224\r
225 EFI_HII_VALUE Result; // Expression evaluation result\r
226\r
227 LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
228} FORM_EXPRESSION;\r
229\r
230#define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
231\r
31585af4
ED
232#define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')\r
233\r
234typedef struct {\r
235 UINTN Signature;\r
236 UINTN Count;\r
237 FORM_EXPRESSION *Expression[1]; // Array[Count] of expressions\r
238} FORM_EXPRESSION_LIST;\r
239\r
f3f2e05d 240#define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
7936fb6a 241\r
242typedef struct {\r
243 UINTN Signature;\r
244 LIST_ENTRY Link;\r
245\r
246 UINT16 DefaultId;\r
247 EFI_HII_VALUE Value; // Default value\r
248\r
249 FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r
250} QUESTION_DEFAULT;\r
251\r
252#define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r
253\r
f3f2e05d 254#define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
7936fb6a 255\r
256typedef struct {\r
31585af4
ED
257 UINTN Signature;\r
258 LIST_ENTRY Link;\r
7c6c064c
ED
259 \r
260 EFI_IFR_ONE_OF_OPTION *OpCode; // OneOfOption Data\r
7936fb6a 261\r
31585af4
ED
262 EFI_STRING_ID Text;\r
263 UINT8 Flags;\r
264 EFI_HII_VALUE Value;\r
265 EFI_IMAGE_ID ImageId;\r
7936fb6a 266\r
31585af4 267 FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
7936fb6a 268} QUESTION_OPTION;\r
269\r
270#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
271\r
31585af4
ED
272typedef enum {\r
273 ExpressFalse = 0,\r
274 ExpressGrayOut, \r
275 ExpressSuppress,\r
276 ExpressDisable\r
277} EXPRESS_RESULT;\r
278\r
279typedef enum {\r
280 ExpressNone = 0,\r
281 ExpressForm, \r
282 ExpressStatement,\r
283 ExpressOption\r
284} EXPRESS_LEVEL;\r
285\r
f3f2e05d 286#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r
1ccdbf2a 287\r
7936fb6a 288typedef struct {\r
289 UINTN Signature;\r
290 LIST_ENTRY Link;\r
291\r
292 UINT8 Operand; // The operand (first byte) of this Statement or Question\r
7c6c064c 293 EFI_IFR_OP_HEADER *OpCode;\r
7936fb6a 294\r
295 //\r
296 // Statement Header\r
297 //\r
298 EFI_STRING_ID Prompt;\r
299 EFI_STRING_ID Help;\r
300 EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r
301\r
7c6c064c
ED
302 //\r
303 // Fake Question Id, used for statement not has true QuestionId.\r
304 //\r
305 EFI_QUESTION_ID FakeQuestionId;\r
306\r
7936fb6a 307 //\r
308 // Question Header\r
309 //\r
310 EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r
311 EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r
94f3aae7 312 BROWSER_STORAGE *Storage;\r
1ccdbf2a 313 VAR_STORE_INFO VarStoreInfo;\r
7936fb6a 314 UINT16 StorageWidth;\r
315 UINT8 QuestionFlags;\r
316 CHAR16 *VariableName; // Name/Value or EFI Variable name\r
317 CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
318\r
319 EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r
320 UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r
d02847d3 321 UINT8 ValueType; // Data type for orderedlist value array\r
7936fb6a 322\r
323 //\r
324 // OpCode specific members\r
325 //\r
326 UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r
327 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r
328 UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r
329\r
330 UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r
331 EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r
332\r
333 UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r
334 UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r
335 UINT64 Step;\r
336\r
337 EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r
211cc6e5 338 EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r
f67c4382 339 BOOLEAN Locked; // Whether this statement is locked.\r
7c6c064c 340 BOOLEAN ValueChanged; // Whether this statement's value is changed.\r
7936fb6a 341 //\r
342 // Get from IFR parsing\r
343 //\r
344 FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r
345 LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r
346 LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
347\r
348 EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r
349 UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
350 BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE\r
351\r
352 LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
353 LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r
31585af4 354 FORM_EXPRESSION_LIST *Expression; // nesting inside of GrayOutIf/DisableIf/SuppressIf\r
7936fb6a 355\r
2573712e
LG
356 FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.\r
357 FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
7936fb6a 358} FORM_BROWSER_STATEMENT;\r
359\r
360#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
361\r
b18e7050
ED
362#define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')\r
363typedef struct {\r
364 UINTN Signature;\r
365 LIST_ENTRY Link;\r
366\r
367 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
368 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r
369 UINTN SpareStrLen;\r
370\r
94f3aae7 371 BROWSER_STORAGE *Storage;\r
b18e7050
ED
372} FORM_BROWSER_CONFIG_REQUEST;\r
373#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r
374\r
f3f2e05d 375#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
2573712e 376#define STANDARD_MAP_FORM_TYPE 0x01\r
7936fb6a 377\r
378typedef struct {\r
31585af4
ED
379 UINTN Signature;\r
380 LIST_ENTRY Link;\r
7936fb6a 381\r
31585af4
ED
382 UINT16 FormId; // FormId of normal form or formmap form.\r
383 EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form.\r
384 UINT16 FormType; // Specific form type for the different form.\r
7936fb6a 385\r
31585af4 386 EFI_IMAGE_ID ImageId;\r
7936fb6a 387\r
31585af4
ED
388 BOOLEAN ModalForm; // Whether this is a modal form.\r
389 BOOLEAN Locked; // Whether this form is locked.\r
b00964a9 390\r
31585af4
ED
391 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
392 LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
393 LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.\r
394 FORM_EXPRESSION_LIST *SuppressExpression; // nesting inside of SuppressIf\r
7936fb6a 395} FORM_BROWSER_FORM;\r
396\r
397#define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
398\r
f3f2e05d 399#define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r
7936fb6a 400\r
401typedef struct {\r
402 UINTN Signature;\r
403 LIST_ENTRY Link;\r
404\r
405 UINT16 DefaultId;\r
406 EFI_STRING_ID DefaultName;\r
407} FORMSET_DEFAULTSTORE;\r
408\r
409#define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r
410\r
48a9d5f7
LG
411#define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')\r
412\r
7936fb6a 413typedef struct {\r
48a9d5f7
LG
414 UINTN Signature;\r
415 LIST_ENTRY Link;\r
416 EFI_HII_HANDLE HiiHandle; // unique id for formset.\r
7936fb6a 417 EFI_HANDLE DriverHandle;\r
418 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
419 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
420\r
421 UINTN IfrBinaryLength;\r
422 UINT8 *IfrBinaryData;\r
423\r
7c6c064c 424 BOOLEAN QuestionInited; // Have finished question initilization?\r
7936fb6a 425 EFI_GUID Guid;\r
426 EFI_STRING_ID FormSetTitle;\r
427 EFI_STRING_ID Help;\r
0a1147ed
LG
428 UINT8 NumberOfClassGuid;\r
429 EFI_GUID ClassGuid[3]; // Up to three ClassGuid\r
430 UINT16 Class; // Tiano extended Class code\r
431 UINT16 SubClass; // Tiano extended Subclass code\r
7936fb6a 432 EFI_IMAGE_ID ImageId;\r
433\r
434 FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r
435 EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r
436\r
7c6c064c 437 LIST_ENTRY StatementListOSF; // Statement list out side of the form.\r
7936fb6a 438 LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r
439 LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r
440 LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r
0c66bc76 441 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
7936fb6a 442} FORM_BROWSER_FORMSET;\r
25361615 443#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)\r
b9feb4bd 444\r
7c6c064c
ED
445typedef struct {\r
446 LIST_ENTRY Link;\r
447 EFI_EVENT RefreshEvent;\r
448} FORM_BROWSER_REFRESH_EVENT_NODE;\r
449\r
450#define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)\r
451\r
b9feb4bd 452\r
48a9d5f7 453typedef struct {\r
7c6c064c 454 EFI_HII_HANDLE Handle;\r
48a9d5f7 455\r
7c6c064c
ED
456 //\r
457 // Target formset/form/Question information\r
458 //\r
459 EFI_GUID FormSetGuid;\r
460 UINT16 FormId;\r
461 UINT16 QuestionId;\r
462 UINTN Sequence; // used for time/date only.\r
463\r
464 UINTN TopRow;\r
465 UINTN BottomRow;\r
466 UINTN PromptCol;\r
467 UINTN OptionCol;\r
468 UINTN CurrentRow;\r
469\r
470 //\r
471 // Ation for Browser to taken:\r
472 // UI_ACTION_NONE - navigation inside a form\r
473 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form\r
474 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary\r
475 //\r
476 UINTN Action;\r
477\r
478 //\r
479 // Current selected fomset/form/Question\r
480 //\r
481 FORM_BROWSER_FORMSET *FormSet;\r
482 FORM_BROWSER_FORM *Form;\r
483 FORM_BROWSER_STATEMENT *Statement;\r
484\r
485 //\r
486 // Whether the Form is editable\r
487 //\r
488 BOOLEAN FormEditable;\r
489\r
490 FORM_ENTRY_INFO *CurrentMenu;\r
491} UI_MENU_SELECTION;\r
48a9d5f7 492\r
5a9f73bf
ED
493#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')\r
494\r
495typedef struct {\r
496 UINTN Signature;\r
497 LIST_ENTRY Link;\r
498\r
499 //\r
500 // Globals defined in Setup.c\r
501 //\r
502 BOOLEAN ResetRequired;\r
503 BOOLEAN ExitRequired;\r
504 EFI_HII_HANDLE HiiHandle;\r
505 EFI_GUID FormSetGuid;\r
506 EFI_FORM_ID FormId;\r
507 UI_MENU_SELECTION *Selection;\r
508\r
509 LIST_ENTRY FormHistoryList;\r
510} BROWSER_CONTEXT;\r
511\r
512#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r
513\r
09cdd7d2
ED
514//\r
515// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.\r
516//\r
517typedef enum {\r
518 GetDefaultForNoStorage, // Get default value for question which not has storage.\r
519 GetDefaultForStorage, // Get default value for question which has storage.\r
520 GetDefaultForAll, // Get default value for all questions.\r
521 GetDefaultForMax // Invalid value.\r
522} BROWSER_GET_DEFAULT_VALUE;\r
523\r
816a7110
ED
524//\r
525// Get/set question value from/to.\r
526//\r
527typedef enum {\r
528 GetSetValueWithEditBuffer, // Get/Set question value from/to editbuffer in the storage.\r
529 GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage.\r
530 GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver.\r
531 GetSetValueWithMax // Invalid value.\r
532} GET_SET_QUESTION_VALUE_WITH;\r
533\r
7936fb6a 534extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
7936fb6a 535extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
80a047f0 536extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r
7c6c064c 537extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;\r
7936fb6a 538\r
7936fb6a 539extern BOOLEAN gResetRequired;\r
7c6c064c 540extern BOOLEAN gExitRequired;\r
7936fb6a 541\r
48a9d5f7
LG
542extern LIST_ENTRY gBrowserFormSetList;\r
543extern LIST_ENTRY gBrowserHotKeyList;\r
544extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
545extern EXIT_HANDLER ExitHandlerFunction;\r
7c6c064c 546extern EFI_HII_HANDLE mCurrentHiiHandle;\r
7936fb6a 547//\r
548// Browser Global Strings\r
549//\r
7936fb6a 550extern CHAR16 *gEmptyString;\r
7936fb6a 551\r
552extern EFI_GUID gZeroGuid;\r
7936fb6a 553\r
7c6c064c
ED
554extern UI_MENU_SELECTION *gCurrentSelection;\r
555\r
7936fb6a 556//\r
557// Global Procedure Defines\r
558//\r
7c6c064c 559#include "Expression.h"\r
7936fb6a 560\r
561/**\r
562 Initialize the HII String Token to the correct values.\r
563\r
564**/\r
565VOID\r
566InitializeBrowserStrings (\r
567 VOID\r
ed66e1bc 568 );\r
7936fb6a 569\r
7936fb6a 570/**\r
571 Parse opcodes in the formset IFR binary.\r
572\r
573 @param FormSet Pointer of the FormSet data structure.\r
574\r
575 @retval EFI_SUCCESS Opcode parse success.\r
576 @retval Other Opcode parse fail.\r
577\r
578**/\r
579EFI_STATUS\r
580ParseOpCodes (\r
581 IN FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 582 );\r
7936fb6a 583\r
584/**\r
585 Free resources allocated for a FormSet.\r
586\r
587 @param FormSet Pointer of the FormSet\r
588\r
589**/\r
590VOID\r
591DestroyFormSet (\r
592 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 593 );\r
7936fb6a 594\r
7936fb6a 595\r
596/**\r
597 Create a new string in HII Package List.\r
598\r
599 @param String The String to be added\r
600 @param HiiHandle The package list in the HII database to insert the\r
601 specified string.\r
602\r
603 @return The output string.\r
604\r
605**/\r
606EFI_STRING_ID\r
607NewString (\r
608 IN CHAR16 *String,\r
609 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 610 );\r
7936fb6a 611\r
612/**\r
613 Delete a string from HII Package List.\r
614\r
615 @param StringId Id of the string in HII database.\r
616 @param HiiHandle The HII package list handle.\r
617\r
618 @retval EFI_SUCCESS The string was deleted successfully.\r
619\r
620**/\r
621EFI_STATUS\r
622DeleteString (\r
623 IN EFI_STRING_ID StringId,\r
624 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 625 );\r
7936fb6a 626\r
627/**\r
628 Get the string based on the StringId and HII Package List Handle.\r
629\r
630 @param Token The String's ID.\r
631 @param HiiHandle The package list in the HII database to search for\r
632 the specified string.\r
633\r
634 @return The output string.\r
635\r
636**/\r
637CHAR16 *\r
638GetToken (\r
639 IN EFI_STRING_ID Token,\r
640 IN EFI_HII_HANDLE HiiHandle\r
ed66e1bc 641 );\r
7936fb6a 642\r
2573712e
LG
643/**\r
644 Get Value for given Name from a NameValue Storage.\r
645\r
646 @param Storage The NameValue Storage.\r
647 @param Name The Name.\r
648 @param Value The retured Value.\r
816a7110 649 @param GetValueFrom Where to get source value, from EditValue or Value.\r
2573712e
LG
650\r
651 @retval EFI_SUCCESS Value found for given Name.\r
652 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
653\r
654**/\r
655EFI_STATUS\r
656GetValueByName (\r
94f3aae7 657 IN BROWSER_STORAGE *Storage,\r
816a7110
ED
658 IN CHAR16 *Name,\r
659 IN OUT CHAR16 **Value,\r
660 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
2573712e
LG
661 );\r
662\r
663/**\r
664 Set Value of given Name in a NameValue Storage.\r
665\r
666 @param Storage The NameValue Storage.\r
667 @param Name The Name.\r
668 @param Value The Value to set.\r
816a7110 669 @param SetValueTo Whether update editValue or Value.\r
7c6c064c 670 @param ReturnNode The node use the input name.\r
2573712e
LG
671\r
672 @retval EFI_SUCCESS Value found for given Name.\r
673 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
674\r
675**/\r
676EFI_STATUS\r
677SetValueByName (\r
7c6c064c
ED
678 IN BROWSER_STORAGE *Storage,\r
679 IN CHAR16 *Name,\r
680 IN CHAR16 *Value,\r
681 IN GET_SET_QUESTION_VALUE_WITH SetValueTo,\r
682 OUT NAME_VALUE_NODE **ReturnNode\r
683 );\r
684\r
685/**\r
686 Validate whether this question's value has changed.\r
687\r
688 @param FormSet FormSet data structure.\r
689 @param Form Form data structure.\r
690 @param Question Question to be initialized.\r
691 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
692\r
693 @retval TRUE Question's value has changed.\r
694 @retval FALSE Question's value has not changed\r
695\r
696**/\r
697BOOLEAN\r
698IsQuestionValueChanged (\r
699 IN FORM_BROWSER_FORMSET *FormSet,\r
700 IN FORM_BROWSER_FORM *Form,\r
701 IN OUT FORM_BROWSER_STATEMENT *Question,\r
702 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
2573712e
LG
703 );\r
704\r
7936fb6a 705/**\r
706 Get Question's current Value.\r
707\r
708 @param FormSet FormSet data structure.\r
709 @param Form Form data structure.\r
710 @param Question Question to be initialized.\r
816a7110 711 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
7936fb6a 712\r
713 @retval EFI_SUCCESS The function completed successfully.\r
714\r
715**/\r
716EFI_STATUS\r
717GetQuestionValue (\r
718 IN FORM_BROWSER_FORMSET *FormSet,\r
719 IN FORM_BROWSER_FORM *Form,\r
720 IN OUT FORM_BROWSER_STATEMENT *Question,\r
816a7110 721 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
ed66e1bc 722 );\r
7936fb6a 723\r
724/**\r
725 Save Question Value to edit copy(cached) or Storage(uncached).\r
726\r
727 @param FormSet FormSet data structure.\r
728 @param Form Form data structure.\r
729 @param Question Pointer to the Question.\r
816a7110 730 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.\r
7936fb6a 731\r
732 @retval EFI_SUCCESS The function completed successfully.\r
733\r
734**/\r
735EFI_STATUS\r
736SetQuestionValue (\r
737 IN FORM_BROWSER_FORMSET *FormSet,\r
738 IN FORM_BROWSER_FORM *Form,\r
739 IN OUT FORM_BROWSER_STATEMENT *Question,\r
816a7110 740 IN GET_SET_QUESTION_VALUE_WITH SetValueTo\r
ed66e1bc 741 );\r
7936fb6a 742\r
743/**\r
744 Perform inconsistent check for a Form.\r
745\r
746 @param FormSet FormSet data structure.\r
747 @param Form Form data structure.\r
748 @param Question The Question to be validated.\r
749 @param Type Validation type: InConsistent or NoSubmit\r
750\r
751 @retval EFI_SUCCESS Form validation pass.\r
752 @retval other Form validation failed.\r
753\r
754**/\r
755EFI_STATUS\r
756ValidateQuestion (\r
757 IN FORM_BROWSER_FORMSET *FormSet,\r
758 IN FORM_BROWSER_FORM *Form,\r
759 IN FORM_BROWSER_STATEMENT *Question,\r
760 IN UINTN Type\r
ed66e1bc 761 );\r
7936fb6a 762\r
48a9d5f7 763\r
7936fb6a 764/**\r
48a9d5f7 765 Discard data based on the input setting scope (Form, FormSet or System).\r
7936fb6a 766\r
767 @param FormSet FormSet data structure.\r
768 @param Form Form data structure.\r
48a9d5f7 769 @param SettingScope Setting Scope for Discard action.\r
b18e7050
ED
770\r
771 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 772 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
b18e7050
ED
773\r
774**/\r
775EFI_STATUS\r
776DiscardForm (\r
777 IN FORM_BROWSER_FORMSET *FormSet,\r
778 IN FORM_BROWSER_FORM *Form,\r
48a9d5f7 779 IN BROWSER_SETTING_SCOPE SettingScope\r
b18e7050
ED
780 );\r
781\r
782/**\r
48a9d5f7 783 Submit data based on the input Setting level (Form, FormSet or System).\r
b18e7050
ED
784\r
785 @param FormSet FormSet data structure.\r
786 @param Form Form data structure.\r
48a9d5f7 787 @param SettingScope Setting Scope for Submit action.\r
7936fb6a 788\r
789 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 790 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
7936fb6a 791\r
792**/\r
793EFI_STATUS\r
794SubmitForm (\r
795 IN FORM_BROWSER_FORMSET *FormSet,\r
b18e7050 796 IN FORM_BROWSER_FORM *Form,\r
48a9d5f7 797 IN BROWSER_SETTING_SCOPE SettingScope\r
ed66e1bc 798 );\r
7936fb6a 799\r
800/**\r
801 Reset Question to its default value.\r
802\r
803 @param FormSet The form set.\r
804 @param Form The form.\r
805 @param Question The question.\r
806 @param DefaultId The Class of the default.\r
807\r
808 @retval EFI_SUCCESS Question is reset to default value.\r
809\r
810**/\r
811EFI_STATUS\r
812GetQuestionDefault (\r
813 IN FORM_BROWSER_FORMSET *FormSet,\r
814 IN FORM_BROWSER_FORM *Form,\r
815 IN FORM_BROWSER_STATEMENT *Question,\r
816 IN UINT16 DefaultId\r
ed66e1bc 817 );\r
7936fb6a 818\r
819/**\r
820 Get current setting of Questions.\r
821\r
822 @param FormSet FormSet data structure.\r
823\r
7936fb6a 824**/\r
7c6c064c 825VOID\r
7936fb6a 826InitializeCurrentSetting (\r
827 IN OUT FORM_BROWSER_FORMSET *FormSet\r
ed66e1bc 828 );\r
7936fb6a 829\r
830/**\r
831 Initialize the internal data structure of a FormSet.\r
832\r
833 @param Handle PackageList Handle\r
834 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
835 GUID), take the first FormSet found in package\r
836 list.\r
837 @param FormSet FormSet data structure.\r
838\r
839 @retval EFI_SUCCESS The function completed successfully.\r
840 @retval EFI_NOT_FOUND The specified FormSet could not be found.\r
841\r
842**/\r
843EFI_STATUS\r
844InitializeFormSet (\r
845 IN EFI_HII_HANDLE Handle,\r
846 IN OUT EFI_GUID *FormSetGuid,\r
7c6c064c 847 OUT FORM_BROWSER_FORMSET *FormSet \r
ed66e1bc 848 );\r
7936fb6a 849\r
850/**\r
9776099f 851 Reset Questions to their initial value or default value in a Form, Formset or System.\r
7936fb6a 852\r
09cdd7d2
ED
853 GetDefaultValueScope parameter decides which questions will reset \r
854 to its default value.\r
855\r
7936fb6a 856 @param FormSet FormSet data structure.\r
48a9d5f7 857 @param Form Form data structure.\r
7936fb6a 858 @param DefaultId The Class of the default.\r
48a9d5f7 859 @param SettingScope Setting Scope for Default action.\r
09cdd7d2 860 @param GetDefaultValueScope Get default value scope.\r
3347d410 861 @param Storage Get default value only for this storage.\r
9776099f
ED
862 @param RetrieveValueFirst Whether call the retrieve call back to\r
863 get the initial value before get default\r
864 value.\r
7936fb6a 865\r
866 @retval EFI_SUCCESS The function completed successfully.\r
48a9d5f7 867 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
7936fb6a 868\r
869**/\r
870EFI_STATUS\r
48a9d5f7 871ExtractDefault (\r
7936fb6a 872 IN FORM_BROWSER_FORMSET *FormSet,\r
48a9d5f7
LG
873 IN FORM_BROWSER_FORM *Form,\r
874 IN UINT16 DefaultId,\r
3347d410 875 IN BROWSER_SETTING_SCOPE SettingScope,\r
09cdd7d2 876 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope,\r
94f3aae7 877 IN BROWSER_STORAGE *Storage,\r
9776099f 878 IN BOOLEAN RetrieveValueFirst\r
ed66e1bc 879 );\r
7936fb6a 880\r
881/**\r
882 Initialize Question's Edit copy from Storage.\r
883\r
eccfeab1
LG
884 @param Selection Selection contains the information about \r
885 the Selection, form and formset to be displayed.\r
886 Selection action may be updated in retrieve callback.\r
7d1b202d 887 If Selection is NULL, only initialize Question value.\r
7936fb6a 888 @param FormSet FormSet data structure.\r
889 @param Form Form data structure.\r
890\r
891 @retval EFI_SUCCESS The function completed successfully.\r
892\r
893**/\r
894EFI_STATUS\r
895LoadFormConfig (\r
eccfeab1
LG
896 IN OUT UI_MENU_SELECTION *Selection,\r
897 IN FORM_BROWSER_FORMSET *FormSet,\r
898 IN FORM_BROWSER_FORM *Form\r
ed66e1bc 899 );\r
7936fb6a 900\r
d66e6c16 901/**\r
902 Initialize Question's Edit copy from Storage for the whole Formset.\r
903\r
eccfeab1
LG
904 @param Selection Selection contains the information about \r
905 the Selection, form and formset to be displayed.\r
906 Selection action may be updated in retrieve callback.\r
7d1b202d 907 If Selection is NULL, only initialize Question value.\r
d66e6c16 908 @param FormSet FormSet data structure.\r
909\r
910 @retval EFI_SUCCESS The function completed successfully.\r
911\r
912**/\r
913EFI_STATUS\r
914LoadFormSetConfig (\r
eccfeab1
LG
915 IN OUT UI_MENU_SELECTION *Selection,\r
916 IN FORM_BROWSER_FORMSET *FormSet\r
d66e6c16 917 );\r
918\r
7936fb6a 919/**\r
920 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r
921\r
94f3aae7 922 @param Storage The Storage to be conveted.\r
7936fb6a 923 @param ConfigResp The returned <ConfigResp>.\r
94f3aae7 924 @param ConfigRequest The ConfigRequest string.\r
7c6c064c 925 @param GetEditBuf Get the data from editbuffer or buffer.\r
7936fb6a 926\r
927 @retval EFI_SUCCESS Convert success.\r
928 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
929\r
930**/\r
931EFI_STATUS\r
932StorageToConfigResp (\r
94f3aae7 933 IN BROWSER_STORAGE *Storage,\r
b18e7050 934 IN CHAR16 **ConfigResp,\r
7c6c064c
ED
935 IN CHAR16 *ConfigRequest,\r
936 IN BOOLEAN GetEditBuf\r
ed66e1bc 937 );\r
7936fb6a 938\r
939/**\r
940 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r
941\r
942 @param Storage The Storage to receive the settings.\r
943 @param ConfigResp The <ConfigResp> to be converted.\r
944\r
945 @retval EFI_SUCCESS Convert success.\r
946 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
947\r
948**/\r
949EFI_STATUS\r
950ConfigRespToStorage (\r
94f3aae7 951 IN BROWSER_STORAGE *Storage,\r
7936fb6a 952 IN CHAR16 *ConfigResp\r
ed66e1bc 953 );\r
7936fb6a 954\r
955/**\r
956 Fill storage's edit copy with settings requested from Configuration Driver.\r
957\r
958 @param FormSet FormSet data structure.\r
959 @param Storage Buffer Storage.\r
960\r
7936fb6a 961**/\r
7c6c064c 962VOID\r
7936fb6a 963LoadStorage (\r
964 IN FORM_BROWSER_FORMSET *FormSet,\r
965 IN FORMSET_STORAGE *Storage\r
ed66e1bc 966 );\r
7936fb6a 967\r
968/**\r
969 Fetch the Ifr binary data of a FormSet.\r
970\r
971 @param Handle PackageList Handle\r
972 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
973 GUID), take the first FormSet found in package\r
974 list.\r
975 @param BinaryLength The length of the FormSet IFR binary.\r
976 @param BinaryData The buffer designed to receive the FormSet.\r
977\r
978 @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r
979 BufferLength was updated.\r
980 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
981 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r
982 be found with the requested FormId.\r
983\r
984**/\r
985EFI_STATUS\r
986GetIfrBinaryData (\r
987 IN EFI_HII_HANDLE Handle,\r
988 IN OUT EFI_GUID *FormSetGuid,\r
989 OUT UINTN *BinaryLength,\r
990 OUT UINT8 **BinaryData\r
ed66e1bc 991 );\r
7936fb6a 992\r
ce6d12cc 993/**\r
994 Save globals used by previous call to SendForm(). SendForm() may be called from \r
995 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
996 So, save globals of previous call to SendForm() and restore them upon exit.\r
997\r
998**/\r
999VOID\r
1000SaveBrowserContext (\r
1001 VOID\r
1002 );\r
1003\r
1004/**\r
1005 Restore globals used by previous call to SendForm().\r
1006\r
1007**/\r
1008VOID\r
1009RestoreBrowserContext (\r
1010 VOID\r
1011 );\r
1012\r
7936fb6a 1013/**\r
1014 This is the routine which an external caller uses to direct the browser\r
1015 where to obtain it's information.\r
1016\r
1017\r
1018 @param This The Form Browser protocol instanse.\r
1019 @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r
1020 display a list of the formsets for the handles specified.\r
1021 @param HandleCount The number of Handles specified in Handle.\r
1022 @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r
1023 field in the EFI_IFR_FORM_SET op-code for the specified\r
1024 forms-based package. If FormSetGuid is NULL, then this\r
1025 function will display the first found forms package.\r
1026 @param FormId This field specifies which EFI_IFR_FORM to render as the first\r
1027 displayable page. If this field has a value of 0x0000, then\r
1028 the forms browser will render the specified forms in their encoded order.\r
1029 ScreenDimenions - This allows the browser to be called so that it occupies a\r
1030 portion of the physical screen instead of dynamically determining the screen dimensions.\r
1031 ActionRequest - Points to the action recommended by the form.\r
d66e6c16 1032 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r
7936fb6a 1033 characters.\r
1034 @param ActionRequest Points to the action recommended by the form.\r
1035\r
1036 @retval EFI_SUCCESS The function completed successfully.\r
1037 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1038 @retval EFI_NOT_FOUND No valid forms could be found to display.\r
1039\r
1040**/\r
1041EFI_STATUS\r
1042EFIAPI\r
1043SendForm (\r
1044 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1045 IN EFI_HII_HANDLE *Handles,\r
1046 IN UINTN HandleCount,\r
1047 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1048 IN UINT16 FormId, OPTIONAL\r
1049 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r
1050 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r
ed66e1bc 1051 );\r
7936fb6a 1052\r
1053/**\r
1054 This function is called by a callback handler to retrieve uncommitted state\r
1055 data from the browser.\r
1056\r
1057 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
1058 instance.\r
1059 @param ResultsDataSize A pointer to the size of the buffer associated\r
1060 with ResultsData.\r
1061 @param ResultsData A string returned from an IFR browser or\r
1062 equivalent. The results string will have no\r
1063 routing information in them.\r
1064 @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r
1065 (if RetrieveData = TRUE) data from the uncommitted\r
1066 browser state information or set (if RetrieveData\r
1067 = FALSE) data in the uncommitted browser state\r
1068 information.\r
1069 @param VariableGuid An optional field to indicate the target variable\r
1070 GUID name to use.\r
1071 @param VariableName An optional field to indicate the target\r
1072 human-readable variable name.\r
1073\r
1074 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1075 distribution.\r
1076 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r
1077 contain the results data.\r
1078\r
1079**/\r
1080EFI_STATUS\r
1081EFIAPI\r
1082BrowserCallback (\r
1083 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1084 IN OUT UINTN *ResultsDataSize,\r
1085 IN OUT EFI_STRING ResultsData,\r
1086 IN BOOLEAN RetrieveData,\r
1087 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
1088 IN CONST CHAR16 *VariableName OPTIONAL\r
ed66e1bc 1089 );\r
7936fb6a 1090\r
b18e7050
ED
1091/**\r
1092 Find menu which will show next time.\r
1093\r
1094 @param Selection On input, Selection tell setup browser the information\r
1095 about the Selection, form and formset to be displayed.\r
1096 On output, Selection return the screen item that is selected\r
1097 by user.\r
7c6c064c
ED
1098 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form. \r
1099 else, we need to exit current formset.\r
b18e7050 1100 \r
7c6c064c
ED
1101 @retval TRUE Exit current form.\r
1102 @retval FALSE User press ESC and keep in current form.\r
b18e7050
ED
1103**/\r
1104BOOLEAN\r
1105FindNextMenu (\r
7c6c064c
ED
1106 IN OUT UI_MENU_SELECTION *Selection,\r
1107 IN BROWSER_SETTING_SCOPE SettingLevel\r
b18e7050
ED
1108 );\r
1109\r
1110/**\r
7c6c064c 1111 check whether the form need to update the NV.\r
b18e7050 1112\r
7c6c064c 1113 @param Form Form data structure.\r
b18e7050 1114\r
7c6c064c
ED
1115 @retval TRUE Need to update the NV.\r
1116 @retval FALSE No need to update the NV.\r
b18e7050 1117**/\r
7c6c064c
ED
1118BOOLEAN\r
1119IsNvUpdateRequiredForForm (\r
1120 IN FORM_BROWSER_FORM *Form\r
b18e7050
ED
1121 );\r
1122\r
1123/**\r
1124 check whether the formset need to update the NV.\r
1125\r
1126 @param FormSet FormSet data structure.\r
1127\r
1128 @retval TRUE Need to update the NV.\r
1129 @retval FALSE No need to update the NV.\r
1130**/\r
7c6c064c
ED
1131BOOLEAN\r
1132IsNvUpdateRequiredForFormSet (\r
25361615 1133 IN FORM_BROWSER_FORMSET *FormSet\r
b9feb4bd
ED
1134 );\r
1135\r
7c6c064c
ED
1136/**\r
1137 Check whether the storage data for current form set is changed.\r
1138\r
1139 @param FormSet FormSet data structure.\r
1140\r
1141 @retval TRUE Data is changed.\r
1142 @retval FALSE Data is not changed.\r
1143**/\r
1144BOOLEAN \r
1145IsStorageDataChangedForFormSet (\r
1146 IN FORM_BROWSER_FORMSET *FormSet\r
1147 );\r
1148\r
b18e7050
ED
1149/**\r
1150 Call the call back function for the question and process the return action.\r
1151\r
1152 @param Selection On input, Selection tell setup browser the information\r
1153 about the Selection, form and formset to be displayed.\r
1154 On output, Selection return the screen item that is selected\r
1155 by user.\r
1156 @param Statement The Question which need to call.\r
1157 @param Action The action request.\r
1158 @param SkipSaveOrDiscard Whether skip save or discard action.\r
1159\r
1160 @retval EFI_SUCCESS The call back function excutes successfully.\r
1161 @return Other value if the call back function failed to excute. \r
1162**/\r
1163EFI_STATUS \r
1164ProcessCallBackFunction (\r
1165 IN OUT UI_MENU_SELECTION *Selection,\r
1166 IN FORM_BROWSER_STATEMENT *Question,\r
1167 IN EFI_BROWSER_ACTION Action,\r
1168 IN BOOLEAN SkipSaveOrDiscard\r
1169 );\r
9776099f
ED
1170 \r
1171/**\r
1172 Call the retrieve type call back function for one question to get the initialize data.\r
1173 \r
1174 This function only used when in the initialize stage, because in this stage, the \r
1175 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r
1176\r
1177 @param ConfigAccess The config access protocol produced by the hii driver.\r
1178 @param Statement The Question which need to call.\r
1179\r
1180 @retval EFI_SUCCESS The call back function excutes successfully.\r
1181 @return Other value if the call back function failed to excute. \r
1182**/\r
1183EFI_STATUS \r
1184ProcessRetrieveForQuestion (\r
1185 IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
1186 IN FORM_BROWSER_STATEMENT *Statement\r
1187 );\r
48a9d5f7
LG
1188\r
1189/**\r
1190 Find the matched FormSet context in the backup maintain list based on HiiHandle.\r
1191 \r
1192 @param Handle The Hii Handle.\r
1193 \r
1194 @return the found FormSet context. If no found, NULL will return.\r
1195\r
1196**/\r
1197FORM_BROWSER_FORMSET * \r
1198GetFormSetFromHiiHandle (\r
1199 EFI_HII_HANDLE Handle\r
1200 );\r
1201\r
1202/**\r
1203 Check whether the input HII handle is the FormSet that is being used.\r
1204 \r
1205 @param Handle The Hii Handle.\r
1206 \r
1207 @retval TRUE HII handle is being used.\r
1208 @retval FALSE HII handle is not being used.\r
1209\r
1210**/\r
1211BOOLEAN\r
1212IsHiiHandleInBrowserContext (\r
1213 EFI_HII_HANDLE Handle\r
1214 );\r
1215\r
1216/**\r
1217 Configure what scope the hot key will impact.\r
1218 All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r
1219 If no scope is set, the default scope will be FormSet level.\r
1220 After all registered hot keys are removed, previous Scope can reset to another level.\r
1221 \r
1222 @param[in] Scope Scope level to be set. \r
1223 \r
1224 @retval EFI_SUCCESS Scope is set correctly.\r
1225 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
1226 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r
1227\r
1228**/\r
1229EFI_STATUS\r
1230EFIAPI\r
1231SetScope (\r
1232 IN BROWSER_SETTING_SCOPE Scope\r
1233 );\r
1234\r
1235/**\r
1236 Register the hot key with its browser action, or unregistered the hot key.\r
1237 Only support hot key that is not printable character (control key, function key, etc.).\r
1238 If the action value is zero, the hot key will be unregistered if it has been registered.\r
1239 If the same hot key has been registered, the new action and help string will override the previous ones.\r
1240 \r
1241 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1242 information for the hot key. Its type is EFI_INPUT_KEY to \r
1243 be supported by all ConsoleIn devices.\r
1244 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r
1245 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r
1246 @param[in] HelpString Help string that describes the hot key information.\r
1247 Its value may be NULL for the unregistered hot key.\r
1248 \r
1249 @retval EFI_SUCCESS Hot key is registered or unregistered.\r
1250 @retval EFI_INVALID_PARAMETER KeyData is NULL.\r
1251 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.\r
1252 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.\r
1253**/\r
1254EFI_STATUS\r
1255EFIAPI\r
1256RegisterHotKey (\r
1257 IN EFI_INPUT_KEY *KeyData,\r
1258 IN UINT32 Action,\r
1259 IN UINT16 DefaultId,\r
1260 IN EFI_STRING HelpString OPTIONAL\r
1261 );\r
1262\r
1263/**\r
1264 Register Exit handler function. \r
1265 When more than one handler function is registered, the latter one will override the previous one. \r
1266 When NULL handler is specified, the previous Exit handler will be unregistered. \r
1267 \r
1268 @param[in] Handler Pointer to handler function. \r
1269\r
1270**/\r
1271VOID\r
1272EFIAPI\r
1273RegiserExitHandler (\r
1274 IN EXIT_HANDLER Handler\r
1275 );\r
1276\r
7c6c064c
ED
1277/**\r
1278 \r
1279 Check whether the browser data has been modified. \r
1280\r
1281 @retval TRUE Browser data is changed.\r
1282 @retval FALSE No browser data is changed.\r
1283\r
1284**/\r
1285BOOLEAN \r
1286EFIAPI\r
1287IsBrowserDataModified (\r
1288 VOID\r
1289 );\r
1290\r
1291/**\r
1292 \r
1293 Execute the action requested by the Action parameter. \r
1294\r
1295 @param[in] Action Execute the request action.\r
1296 @param[in] DefaultId The default Id info when need to load default value.\r
1297\r
1298 @retval EFI_SUCCESS Execute the request action succss.\r
1299 @retval EFI_INVALID_PARAMETER The input action value is invalid.\r
1300\r
1301**/\r
1302EFI_STATUS \r
1303EFIAPI\r
1304ExecuteAction (\r
1305 IN UINT32 Action,\r
1306 IN UINT16 DefaultId\r
1307 );\r
1308\r
48a9d5f7
LG
1309/**\r
1310 Create reminder to let user to choose save or discard the changed browser data.\r
1311 Caller can use it to actively check the changed browser data.\r
1312\r
1313 @retval BROWSER_NO_CHANGES No browser data is changed.\r
1314 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.\r
1315 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.\r
1316\r
1317**/\r
1318UINT32\r
1319EFIAPI\r
1320SaveReminder (\r
1321 VOID\r
1322 );\r
1323\r
1324/**\r
1325 Find the registered HotKey based on KeyData.\r
1326 \r
1327 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1328 information for the hot key.\r
1329\r
1330 @return The registered HotKey context. If no found, NULL will return.\r
1331**/\r
1332BROWSER_HOT_KEY *\r
1333GetHotKeyFromRegisterList (\r
1334 IN EFI_INPUT_KEY *KeyData\r
1335 );\r
1336\r
7c6c064c
ED
1337/**\r
1338\r
1339 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1340\r
1341 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1342\r
1343 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1344\r
1345**/\r
1346FORM_BROWSER_STATEMENT *\r
1347GetBrowserStatement (\r
1348 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1349 );\r
1350 \r
1351/**\r
1352 Password may be stored as encrypted by Configuration Driver. When change a\r
1353 password, user will be challenged with old password. To validate user input old\r
1354 password, we will send the clear text to Configuration Driver via Callback().\r
1355 Configuration driver is responsible to check the passed in password and return\r
1356 the validation result. If validation pass, state machine in password Callback()\r
1357 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.\r
1358 After user type in new password twice, Callback() will be invoked to send the\r
1359 new password to Configuration Driver.\r
1360\r
1361 @param Selection Pointer to UI_MENU_SELECTION.\r
1362 @param MenuOption The MenuOption for this password Question.\r
1363 @param String The clear text of password.\r
1364\r
1365 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.\r
1366 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:\r
1367 @retval EFI_SUCCESS Password correct, Browser will prompt for new\r
1368 password.\r
1369 @retval EFI_NOT_READY Password incorrect, Browser will show error\r
1370 message.\r
1371 @retval Other Browser will do nothing.\r
1372 @return In state of BROWSER_STATE_SET_PASSWORD:\r
1373 @retval EFI_SUCCESS Set password success.\r
1374 @retval Other Set password failed.\r
1375\r
1376**/\r
1377EFI_STATUS\r
1378PasswordCallback (\r
1379 IN UI_MENU_SELECTION *Selection,\r
1380 IN FORM_BROWSER_STATEMENT *Question,\r
1381 IN CHAR16 *String\r
1382 );\r
1383\r
1384/**\r
1385 Display error message for invalid password.\r
1386\r
1387**/\r
1388VOID\r
1389PasswordInvalid (\r
1390 VOID\r
1391 );\r
1392\r
1393/**\r
1394 The worker function that send the displays to the screen. On output,\r
1395 the selection made by user is returned.\r
1396\r
1397 @param Selection On input, Selection tell setup browser the information\r
1398 about the Selection, form and formset to be displayed.\r
1399 On output, Selection return the screen item that is selected\r
1400 by user.\r
1401\r
1402 @retval EFI_SUCCESS The page is displayed successfully.\r
1403 @return Other value if the page failed to be diplayed.\r
1404\r
1405**/\r
1406EFI_STATUS\r
1407SetupBrowser (\r
1408 IN OUT UI_MENU_SELECTION *Selection\r
1409 );\r
1410 \r
1411/**\r
1412 Free up the resource allocated for all strings required\r
1413 by Setup Browser.\r
1414\r
1415**/\r
1416VOID\r
1417FreeBrowserStrings (\r
1418 VOID\r
1419 );\r
1420\r
1421/**\r
1422 Create a menu with specified formset GUID and form ID, and add it as a child\r
1423 of the given parent menu.\r
1424\r
1425 @param HiiHandle Hii handle related to this formset.\r
1426 @param FormSetGuid The Formset Guid of menu to be added.\r
1427 @param FormId The Form ID of menu to be added.\r
1428 @param QuestionId The question id of this menu to be added.\r
1429\r
1430 @return A pointer to the newly added menu or NULL if memory is insufficient.\r
1431\r
1432**/\r
1433FORM_ENTRY_INFO *\r
1434UiAddMenuList (\r
1435 IN EFI_HII_HANDLE HiiHandle,\r
1436 IN EFI_GUID *FormSetGuid,\r
1437 IN UINT16 FormId,\r
1438 IN UINT16 QuestionId\r
1439 );\r
1440\r
1441/**\r
1442 Search Menu with given FormSetGuid and FormId in all cached menu list.\r
1443\r
1444 @param HiiHandle HiiHandle for FormSet.\r
1445 @param FormSetGuid The Formset GUID of the menu to search.\r
1446 @param FormId The Form ID of menu to search.\r
1447\r
1448 @return A pointer to menu found or NULL if not found.\r
1449\r
1450**/\r
1451FORM_ENTRY_INFO *\r
1452UiFindMenuList (\r
1453 IN EFI_HII_HANDLE HiiHandle, \r
1454 IN EFI_GUID *FormSetGuid,\r
1455 IN UINT16 FormId\r
1456 );\r
1457\r
1458/**\r
1459 Free Menu list linked list.\r
1460\r
1461 @param MenuListHead One Menu list point in the menu list.\r
1462\r
1463**/\r
1464VOID\r
1465UiFreeMenuList (\r
1466 LIST_ENTRY *MenuListHead\r
1467 );\r
1468\r
1469/**\r
1470 Find parent menu for current menu.\r
1471\r
1472 @param CurrentMenu Current Menu\r
1473\r
1474 @retval The parent menu for current menu.\r
1475**/\r
1476FORM_ENTRY_INFO *\r
1477UiFindParentMenu (\r
1478 IN FORM_ENTRY_INFO *CurrentMenu\r
1479 );\r
1480\r
1481/**\r
1482 Search an Option of a Question by its value.\r
1483\r
1484 @param Question The Question\r
1485 @param OptionValue Value for Option to be searched.\r
1486\r
1487 @retval Pointer Pointer to the found Option.\r
1488 @retval NULL Option not found.\r
1489\r
1490**/\r
1491QUESTION_OPTION *\r
1492ValueToOption (\r
1493 IN FORM_BROWSER_STATEMENT *Question,\r
1494 IN EFI_HII_VALUE *OptionValue\r
1495 );\r
1496/**\r
1497 Return data element in an Array by its Index.\r
1498\r
1499 @param Array The data array.\r
1500 @param Type Type of the data in this array.\r
1501 @param Index Zero based index for data in this array.\r
1502\r
1503 @retval Value The data to be returned\r
1504\r
1505**/\r
1506UINT64\r
1507GetArrayData (\r
1508 IN VOID *Array,\r
1509 IN UINT8 Type,\r
1510 IN UINTN Index\r
1511 );\r
1512\r
1513/**\r
1514 Set value of a data element in an Array by its Index.\r
1515\r
1516 @param Array The data array.\r
1517 @param Type Type of the data in this array.\r
1518 @param Index Zero based index for data in this array.\r
1519 @param Value The value to be set.\r
1520\r
1521**/\r
1522VOID\r
1523SetArrayData (\r
1524 IN VOID *Array,\r
1525 IN UINT8 Type,\r
1526 IN UINTN Index,\r
1527 IN UINT64 Value\r
1528 );\r
1529\r
1530/**\r
1531 Compare two Hii value.\r
1532 \r
1533 @param Value1 Expression value to compare on left-hand.\r
1534 @param Value2 Expression value to compare on right-hand.\r
1535 @param Result Return value after compare.\r
1536 retval 0 Two operators equal.\r
1537 return Positive value if Value1 is greater than Value2.\r
1538 retval Negative value if Value1 is less than Value2.\r
1539 @param HiiHandle Only required for string compare.\r
1540 \r
1541 @retval other Could not perform compare on two values.\r
1542 @retval EFI_SUCCESS Compare the value success.\r
1543 \r
1544**/\r
1545EFI_STATUS\r
1546CompareHiiValue (\r
1547 IN EFI_HII_VALUE *Value1,\r
1548 IN EFI_HII_VALUE *Value2,\r
1549 OUT INTN *Result,\r
1550 IN EFI_HII_HANDLE HiiHandle OPTIONAL\r
1551 );\r
1552\r
1553/**\r
1554 Perform Password check. \r
1555 Passwork may be encrypted by driver that requires the specific check.\r
1556 \r
1557 @param Form Form where Password Statement is in.\r
1558 @param Statement Password statement\r
1559 @param PasswordString Password string to be checked. It may be NULL.\r
1560 NULL means to restore password.\r
1561 "" string can be used to checked whether old password does exist.\r
1562 \r
1563 @return Status Status of Password check.\r
1564**/\r
1565EFI_STATUS\r
1566EFIAPI\r
1567PasswordCheck (\r
1568 IN FORM_DISPLAY_ENGINE_FORM *Form,\r
1569 IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r
1570 IN EFI_STRING PasswordString OPTIONAL\r
1571 );\r
1572\r
1573/**\r
1574\r
1575 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1576\r
1577 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1578\r
1579 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1580\r
1581**/\r
1582FORM_BROWSER_STATEMENT *\r
1583GetBrowserStatement (\r
1584 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1585 );\r
1586 \r
1587/**\r
1588\r
1589 Initialize the Display form structure data.\r
1590\r
1591**/\r
1592VOID\r
1593InitializeDisplayFormData (\r
1594 VOID\r
1595 );\r
1596\r
1597\r
0a6f8af5
ED
1598/**\r
1599 Base on the current formset info, clean the ConfigRequest string in browser storage.\r
1600\r
1601 @param FormSet Pointer of the FormSet\r
1602\r
1603**/\r
1604VOID\r
1605CleanBrowserStorage (\r
1606 IN OUT FORM_BROWSER_FORMSET *FormSet\r
1607 );\r
7c6c064c 1608 \r
7936fb6a 1609#endif\r