12UINTN mExpressionOpCodeIndex;
13EFI_QUESTION_ID mUsedQuestionId;
35 INTN ConditionalExprCount;
44 Statement = &FormSet->StatementBuffer[mStatementIndex];
53 Statement->Signature = FORM_BROWSER_STATEMENT_SIGNATURE;
57 Statement->QuestionReferToBitField =
FALSE;
60 CopyMem (&Statement->Prompt, &StatementHdr->Prompt, sizeof (EFI_STRING_ID));
61 CopyMem (&Statement->Help, &StatementHdr->Help, sizeof (EFI_STRING_ID));
64 if (ConditionalExprCount > 0) {
72 ASSERT (Statement->Expression !=
NULL);
73 Statement->Expression->Count = (
UINTN)ConditionalExprCount;
74 Statement->Expression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;
102 IN UINT8 *OpCodeData,
115 if (Statement ==
NULL) {
120 CopyMem (&Statement->QuestionId, &QuestionHdr->QuestionId, sizeof (EFI_QUESTION_ID));
121 CopyMem (&Statement->VarStoreId, &QuestionHdr->VarStoreId, sizeof (EFI_VARSTORE_ID));
122 CopyMem (&Statement->VarStoreInfo.VarOffset, &QuestionHdr->VarStoreInfo.VarOffset, sizeof (UINT16));
124 Statement->QuestionFlags = QuestionHdr->Flags;
126 if (Statement->VarStoreId == 0) {
137 while (!
IsNull (&FormSet->StorageListHead, Link)) {
138 Storage = FORMSET_STORAGE_FROM_LINK (Link);
140 if (Storage->VarStoreId == Statement->VarStoreId) {
141 Statement->Storage = Storage->BrowserStorage;
145 Link =
GetNextNode (&FormSet->StorageListHead, Link);
148 ASSERT (Statement->Storage !=
NULL);
153 if ((Statement->Storage->Type == EFI_HII_VARSTORE_NAME_VALUE) ||
154 (Statement->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE))
156 Statement->VariableName =
GetToken (Statement->VarStoreInfo.VarName, FormSet->HiiHandle);
157 ASSERT (Statement->VariableName !=
NULL);
159 if (Statement->Storage->Type == EFI_HII_VARSTORE_NAME_VALUE) {
164 if (!
IsListEmpty (&Statement->Storage->NameValueListHead)) {
165 Link =
GetFirstNode (&Statement->Storage->NameValueListHead);
166 while (!
IsNull (&Statement->Storage->NameValueListHead, Link)) {
167 NameValueNode = NAME_VALUE_NODE_FROM_LINK (Link);
169 if (
StrCmp (Statement->VariableName, NameValueNode->Name) == 0) {
174 Link =
GetNextNode (&Statement->Storage->NameValueListHead, Link);
183 ASSERT (NameValueNode !=
NULL);
184 NameValueNode->Signature = NAME_VALUE_NODE_SIGNATURE;
186 ASSERT (NameValueNode->Name !=
NULL);
188 ASSERT (NameValueNode->Value !=
NULL);
190 ASSERT (NameValueNode->EditValue !=
NULL);
192 InsertTailList (&Statement->Storage->NameValueListHead, &NameValueNode->Link);
218 ASSERT (Expression !=
NULL);
219 Expression->Signature = FORM_EXPRESSION_SIGNATURE;
243 if ((Storage->BrowserStorage->Type == EFI_HII_VARSTORE_BUFFER) ||
244 (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER))
246 Name = Storage->BrowserStorage->Name;
252 &Storage->BrowserStorage->Guid,
254 FormSet->DriverHandle
257 if (Storage->ConfigHdr ==
NULL) {
258 return EFI_NOT_FOUND;
286 IN UINT8 StorageType,
288 IN CHAR16 *StorageName,
296 while (!
IsNull (&gBrowserStorageList, Link)) {
297 BrowserStorage = BROWSER_STORAGE_FROM_LINK (Link);
300 if ((BrowserStorage->Type == StorageType) &&
CompareGuid (&BrowserStorage->Guid, StorageGuid)) {
301 if (StorageType == EFI_HII_VARSTORE_NAME_VALUE) {
302 if (BrowserStorage->HiiHandle == HiiHandle) {
303 return BrowserStorage;
309 ASSERT (StorageName !=
NULL);
310 if (
StrCmp (BrowserStorage->Name, StorageName) == 0) {
311 if ((StorageType == EFI_HII_VARSTORE_EFI_VARIABLE) || (StorageType == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER)) {
312 return BrowserStorage;
313 }
else if ((StorageType == EFI_HII_VARSTORE_BUFFER) && (BrowserStorage->HiiHandle == HiiHandle)) {
314 return BrowserStorage;
334 IN UINT8 StorageType,
338 switch (StorageType) {
339 case EFI_HII_VARSTORE_BUFFER:
347 case EFI_HII_VARSTORE_EFI_VARIABLE:
348 case EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER:
353 if (StorageType == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
360 case EFI_HII_VARSTORE_NAME_VALUE:
384 IN UINT8 StorageType,
389 CHAR16 *UnicodeString;
395 UnicodeString =
NULL;
397 switch (StorageType) {
398 case EFI_HII_VARSTORE_BUFFER:
403 case EFI_HII_VARSTORE_EFI_VARIABLE:
404 case EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER:
410 ASSERT (StorageType == EFI_HII_VARSTORE_NAME_VALUE);
415 if (StorageType != EFI_HII_VARSTORE_NAME_VALUE) {
416 ASSERT (StorageName !=
NULL);
419 ASSERT (UnicodeString !=
NULL);
420 for (Index = 0; StorageName[Index] != 0; Index++) {
421 UnicodeString[Index] = (CHAR16)StorageName[Index];
426 ASSERT (Storage !=
NULL);
427 Storage->Signature = FORMSET_STORAGE_SIGNATURE;
430 BrowserStorage =
FindStorageInList (StorageType, StorageGuid, UnicodeString, FormSet->HiiHandle);
431 if (BrowserStorage ==
NULL) {
433 ASSERT (BrowserStorage !=
NULL);
435 BrowserStorage->Signature = BROWSER_STORAGE_SIGNATURE;
439 BrowserStorage->Type = StorageType;
440 if (StorageType != EFI_HII_VARSTORE_NAME_VALUE) {
441 BrowserStorage->Name = UnicodeString;
444 BrowserStorage->HiiHandle = FormSet->HiiHandle;
446 BrowserStorage->Initialized =
FALSE;
449 Storage->BrowserStorage = BrowserStorage;
452 Storage->SpareStrLen = 0;
469 IN EFI_VARSTORE_ID VarStoreId
477 FormsetStorage =
NULL;
482 while (!
IsNull (&FormSet->StorageListHead, Link)) {
483 FormsetStorage = FORMSET_STORAGE_FROM_LINK (Link);
485 if (FormsetStorage->VarStoreId == VarStoreId) {
490 Link =
GetNextNode (&FormSet->StorageListHead, Link);
493 return Found ? FormsetStorage :
NULL;
521 FormsetStorage =
NULL;
524 while (!
IsNull (&gBrowserFormSetList, FormsetLink)) {
525 FormSet = FORM_BROWSER_FORMSET_FROM_LINK (FormsetLink);
526 FormsetLink =
GetNextNode (&gBrowserFormSetList, FormsetLink);
529 while (!
IsNull (&FormSet->StorageListHead, Link)) {
530 FormsetStorage = FORMSET_STORAGE_FROM_LINK (Link);
531 Link =
GetNextNode (&FormSet->StorageListHead, Link);
533 if (FormsetStorage->BrowserStorage == Storage) {
544 return Found ? FormsetStorage :
NULL;
570 CHAR16 RequestElement[30];
576 Storage = Question->Storage;
577 if (Storage ==
NULL) {
578 return EFI_INVALID_PARAMETER;
581 if (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE) {
592 if ((Storage->Type == EFI_HII_VARSTORE_BUFFER) ||
593 (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER))
597 30 *
sizeof (CHAR16),
598 L
"&OFFSET=%04x&WIDTH=%04x",
599 Question->VarStoreInfo.VarOffset,
600 Question->StorageWidth
605 StrLen =
UnicodeSPrint (RequestElement, 30 *
sizeof (CHAR16), L
"&%s", Question->VariableName);
608 if ((Question->Operand == EFI_IFR_PASSWORD_OP) && ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK)) {
620 ASSERT (FormsetStorage !=
NULL);
621 StringSize = (FormsetStorage->ConfigRequest !=
NULL) ?
StrSize (FormsetStorage->ConfigRequest) :
sizeof (CHAR16);
622 MaxLen = StringSize /
sizeof (CHAR16) + FormsetStorage->SpareStrLen;
627 if (
StrLen > FormsetStorage->SpareStrLen) {
631 MaxLen = StringSize /
sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL;
633 ASSERT (NewStr !=
NULL);
634 if (FormsetStorage->ConfigRequest !=
NULL) {
635 CopyMem (NewStr, FormsetStorage->ConfigRequest, StringSize);
636 FreePool (FormsetStorage->ConfigRequest);
639 FormsetStorage->ConfigRequest = NewStr;
640 FormsetStorage->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL;
643 StrCatS (FormsetStorage->ConfigRequest, MaxLen, RequestElement);
644 FormsetStorage->ElementCount++;
645 FormsetStorage->SpareStrLen -=
StrLen;
653 while (!
IsNull (&Form->ConfigRequestHead, Link)) {
654 ConfigInfo = FORM_BROWSER_CONFIG_REQUEST_FROM_LINK (Link);
656 if ((ConfigInfo !=
NULL) && (ConfigInfo->Storage == FormsetStorage->BrowserStorage)) {
661 Link =
GetNextNode (&Form->ConfigRequestHead, Link);
666 ASSERT (ConfigInfo !=
NULL);
667 ConfigInfo->Signature = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE;
669 ASSERT (ConfigInfo->ConfigRequest !=
NULL);
670 ConfigInfo->SpareStrLen = 0;
671 ConfigInfo->Storage = FormsetStorage->BrowserStorage;
675 StringSize = (ConfigInfo->ConfigRequest !=
NULL) ?
StrSize (ConfigInfo->ConfigRequest) :
sizeof (CHAR16);
676 MaxLen = StringSize /
sizeof (CHAR16) + ConfigInfo->SpareStrLen;
681 if (
StrLen > ConfigInfo->SpareStrLen) {
685 MaxLen = StringSize /
sizeof (CHAR16) + CONFIG_REQUEST_STRING_INCREMENTAL;
687 ASSERT (NewStr !=
NULL);
688 if (ConfigInfo->ConfigRequest !=
NULL) {
689 CopyMem (NewStr, ConfigInfo->ConfigRequest, StringSize);
690 FreePool (ConfigInfo->ConfigRequest);
693 ConfigInfo->ConfigRequest = NewStr;
694 ConfigInfo->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL;
697 StrCatS (ConfigInfo->ConfigRequest, MaxLen, RequestElement);
698 ConfigInfo->ElementCount++;
699 ConfigInfo->SpareStrLen -=
StrLen;
719 while (!
IsListEmpty (&Expression->OpCodeListHead)) {
721 OpCode = EXPRESSION_OPCODE_FROM_LINK (Link);
724 if (OpCode->ValueList !=
NULL) {
728 if (OpCode->ValueName !=
NULL) {
732 if (OpCode->MapExpressionList.ForwardLink !=
NULL) {
733 while (!
IsListEmpty (&OpCode->MapExpressionList)) {
734 SubExpressionLink =
GetFirstNode (&OpCode->MapExpressionList);
735 SubExpression = FORM_EXPRESSION_FROM_LINK (SubExpressionLink);
759 if (Storage ==
NULL) {
763 if (Storage->ConfigRequest !=
NULL) {
791 while (!
IsListEmpty (&Statement->DefaultListHead)) {
793 Default = QUESTION_DEFAULT_FROM_LINK (Link);
796 if (Default->Value.Buffer !=
NULL) {
806 while (!
IsListEmpty (&Statement->OptionListHead)) {
808 Option = QUESTION_OPTION_FROM_LINK (Link);
809 if (Option->SuppressExpression !=
NULL) {
810 FreePool (Option->SuppressExpression);
821 while (!
IsListEmpty (&Statement->InconsistentListHead)) {
823 Expression = FORM_EXPRESSION_FROM_LINK (Link);
832 while (!
IsListEmpty (&Statement->NoSubmitListHead)) {
834 Expression = FORM_EXPRESSION_FROM_LINK (Link);
843 while (!
IsListEmpty (&Statement->WarningListHead)) {
845 Expression = FORM_EXPRESSION_FROM_LINK (Link);
851 if (Statement->Expression !=
NULL) {
855 if (Statement->VariableName !=
NULL) {
859 if (Statement->BlockName !=
NULL) {
863 if (Statement->BufferValue !=
NULL) {
867 if ((Statement->Operand == EFI_IFR_STRING_OP) || (Statement->Operand == EFI_IFR_PASSWORD_OP)) {
868 DeleteString (Statement->HiiValue.Value.string, FormSet->HiiHandle);
895 Expression = FORM_EXPRESSION_FROM_LINK (Link);
906 Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
917 ConfigInfo = FORM_BROWSER_CONFIG_REQUEST_FROM_LINK (Link);
920 FreePool (ConfigInfo->ConfigRequest);
924 if (Form->SuppressExpression !=
NULL) {
925 FreePool (Form->SuppressExpression);
953 if (FormSet->IfrBinaryData ==
NULL) {
969 if (FormSet->StorageListHead.ForwardLink !=
NULL) {
972 Storage = FORMSET_STORAGE_FROM_LINK (Link);
982 if (FormSet->DefaultStoreListHead.ForwardLink !=
NULL) {
983 while (!
IsListEmpty (&FormSet->DefaultStoreListHead)) {
985 DefaultStore = FORMSET_DEFAULTSTORE_FROM_LINK (Link);
995 while (!
IsListEmpty (&FormSet->ExpressionListHead)) {
997 Expression = FORM_EXPRESSION_FROM_LINK (Link);
1006 if (FormSet->FormListHead.ForwardLink !=
NULL) {
1009 Form = FORM_BROWSER_FORM_FROM_LINK (Link);
1016 if (FormSet->StatementBuffer !=
NULL) {
1017 FreePool (FormSet->StatementBuffer);
1020 if (FormSet->ExpressionBuffer !=
NULL) {
1021 FreePool (FormSet->ExpressionBuffer);
1041 if (((Operand >= EFI_IFR_EQ_ID_VAL_OP) && (Operand <= EFI_IFR_NOT_OP)) ||
1042 ((Operand >= EFI_IFR_MATCH_OP) && (Operand <= EFI_IFR_SET_OP)) ||
1043 ((Operand >= EFI_IFR_EQUAL_OP) && (Operand <= EFI_IFR_SPAN_OP)) ||
1044 (Operand == EFI_IFR_CATENATE_OP) ||
1045 (Operand == EFI_IFR_TO_LOWER_OP) ||
1046 (Operand == EFI_IFR_TO_UPPER_OP) ||
1047 (Operand == EFI_IFR_MAP_OP) ||
1048 (Operand == EFI_IFR_VERSION_OP) ||
1049 (Operand == EFI_IFR_SECURITY_OP) ||
1050 (Operand == EFI_IFR_MATCH2_OP))
1072 if ((Operand == EFI_IFR_SUBTITLE_OP) ||
1073 (Operand == EFI_IFR_TEXT_OP) ||
1074 (Operand == EFI_IFR_RESET_BUTTON_OP) ||
1075 (Operand == EFI_IFR_REF_OP) ||
1076 (Operand == EFI_IFR_ACTION_OP) ||
1077 (Operand == EFI_IFR_NUMERIC_OP) ||
1078 (Operand == EFI_IFR_ORDERED_LIST_OP) ||
1079 (Operand == EFI_IFR_CHECKBOX_OP) ||
1080 (Operand == EFI_IFR_STRING_OP) ||
1081 (Operand == EFI_IFR_PASSWORD_OP) ||
1082 (Operand == EFI_IFR_DATE_OP) ||
1083 (Operand == EFI_IFR_TIME_OP) ||
1084 (Operand == EFI_IFR_GUID_OP) ||
1085 (Operand == EFI_IFR_ONE_OF_OP))
1107 return Operand > EFI_IFR_MATCH2_OP ?
TRUE :
FALSE;
1125 UINTN StatementCount;
1126 UINTN ExpressionCount;
1133 ExpressionCount = 0;
1135 while (Offset < FormSet->IfrBinaryLength) {
1136 OpCodeData = FormSet->IfrBinaryData + Offset;
1138 Offset += OpCodeLen;
1147 *NumberOfStatement = StatementCount;
1148 *NumberOfExpression = ExpressionCount;
1182 UINTN NumberOfStatement;
1183 UINTN NumberOfExpression;
1184 EFI_IMAGE_ID *ImageId;
1185 BOOLEAN SuppressForQuestion;
1186 BOOLEAN SuppressForOption;
1187 UINT16 DepthOfDisable;
1188 BOOLEAN OpCodeDisabled;
1189 BOOLEAN SingleOpCodeExpression;
1190 BOOLEAN InScopeDefault;
1193 UINT8 MapScopeDepth;
1197 EFI_VARSTORE_ID TempVarstoreId;
1198 BOOLEAN InScopeDisable;
1199 INTN ConditionalExprCount;
1200 BOOLEAN InUnknownScope;
1204 BOOLEAN HaveInserted;
1206 BOOLEAN QuestionReferBitField;
1208 SuppressForQuestion =
FALSE;
1209 SuppressForOption =
FALSE;
1210 InScopeDisable =
FALSE;
1212 OpCodeDisabled =
FALSE;
1213 SingleOpCodeExpression =
FALSE;
1214 InScopeDefault =
FALSE;
1215 CurrentExpression =
NULL;
1216 CurrentDefault =
NULL;
1217 CurrentOption =
NULL;
1223 MapExpressionList =
NULL;
1225 ConditionalExprCount = 0;
1226 InUnknownScope =
FALSE;
1228 QuestionReferBitField =
FALSE;
1233 CountOpCodes (FormSet, &NumberOfStatement, &NumberOfExpression);
1235 mStatementIndex = 0;
1236 mUsedQuestionId = 1;
1238 if (FormSet->StatementBuffer ==
NULL) {
1239 return EFI_OUT_OF_RESOURCES;
1242 mExpressionOpCodeIndex = 0;
1244 if (FormSet->ExpressionBuffer ==
NULL) {
1245 return EFI_OUT_OF_RESOURCES;
1258 CurrentStatement =
NULL;
1259 ParentStatement =
NULL;
1264 while (OpCodeOffset < FormSet->IfrBinaryLength) {
1265 OpCodeData = FormSet->IfrBinaryData + OpCodeOffset;
1268 OpCodeOffset += OpCodeLength;
1272 if (InUnknownScope) {
1273 if (Operand == EFI_IFR_END_OP) {
1276 if (UnknownDepth == 0) {
1277 InUnknownScope =
FALSE;
1290 InUnknownScope =
TRUE;
1304 if (OpCodeDisabled) {
1309 if (Operand == EFI_IFR_DISABLE_IF_OP) {
1311 }
else if (Operand == EFI_IFR_END_OP) {
1313 if (EFI_ERROR (Status)) {
1317 if (ScopeOpCode == EFI_IFR_DISABLE_IF_OP) {
1318 if (DepthOfDisable == 0) {
1319 InScopeDisable =
FALSE;
1320 OpCodeDisabled =
FALSE;
1331 ExpressionOpCode = &FormSet->ExpressionBuffer[mExpressionOpCodeIndex];
1332 mExpressionOpCodeIndex++;
1334 ExpressionOpCode->Signature = EXPRESSION_OPCODE_SIGNATURE;
1335 ExpressionOpCode->Operand = Operand;
1336 Value = &ExpressionOpCode->Value;
1339 case EFI_IFR_EQ_ID_VAL_OP:
1342 Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
1346 case EFI_IFR_EQ_ID_ID_OP:
1347 CopyMem (&ExpressionOpCode->QuestionId, &((
EFI_IFR_EQ_ID_ID *)OpCodeData)->QuestionId1, sizeof (EFI_QUESTION_ID));
1348 CopyMem (&ExpressionOpCode->QuestionId2, &((
EFI_IFR_EQ_ID_ID *)OpCodeData)->QuestionId2, sizeof (EFI_QUESTION_ID));
1351 case EFI_IFR_EQ_ID_VAL_LIST_OP:
1357 case EFI_IFR_TO_STRING_OP:
1358 case EFI_IFR_FIND_OP:
1362 case EFI_IFR_STRING_REF1_OP:
1363 Value->Type = EFI_IFR_TYPE_STRING;
1367 case EFI_IFR_RULE_REF_OP:
1371 case EFI_IFR_SPAN_OP:
1372 ExpressionOpCode->Flags = ((
EFI_IFR_SPAN *)OpCodeData)->Flags;
1375 case EFI_IFR_THIS_OP:
1376 ASSERT (ParentStatement !=
NULL);
1377 ExpressionOpCode->QuestionId = ParentStatement->QuestionId;
1380 case EFI_IFR_SECURITY_OP:
1384 case EFI_IFR_MATCH2_OP:
1388 case EFI_IFR_GET_OP:
1389 case EFI_IFR_SET_OP:
1390 CopyMem (&TempVarstoreId, &((
EFI_IFR_GET *)OpCodeData)->VarStoreId,
sizeof (TempVarstoreId));
1391 if (TempVarstoreId != 0) {
1392 if (FormSet->StorageListHead.ForwardLink !=
NULL) {
1394 while (!
IsNull (&FormSet->StorageListHead, Link)) {
1395 VarStorage = FORMSET_STORAGE_FROM_LINK (Link);
1396 if (VarStorage->VarStoreId == ((
EFI_IFR_GET *)OpCodeData)->VarStoreId) {
1397 ExpressionOpCode->VarStorage = VarStorage->BrowserStorage;
1401 Link =
GetNextNode (&FormSet->StorageListHead, Link);
1405 if (ExpressionOpCode->VarStorage ==
NULL) {
1409 return EFI_INVALID_PARAMETER;
1413 ExpressionOpCode->ValueType = ((
EFI_IFR_GET *)OpCodeData)->VarStoreType;
1414 switch (ExpressionOpCode->ValueType) {
1415 case EFI_IFR_TYPE_BOOLEAN:
1416 case EFI_IFR_TYPE_NUM_SIZE_8:
1417 ExpressionOpCode->ValueWidth = 1;
1420 case EFI_IFR_TYPE_NUM_SIZE_16:
1421 case EFI_IFR_TYPE_STRING:
1422 ExpressionOpCode->ValueWidth = 2;
1425 case EFI_IFR_TYPE_NUM_SIZE_32:
1426 ExpressionOpCode->ValueWidth = 4;
1429 case EFI_IFR_TYPE_NUM_SIZE_64:
1430 ExpressionOpCode->ValueWidth = 8;
1433 case EFI_IFR_TYPE_DATE:
1434 ExpressionOpCode->ValueWidth = (UINT8)
sizeof (
EFI_IFR_DATE);
1437 case EFI_IFR_TYPE_TIME:
1438 ExpressionOpCode->ValueWidth = (UINT8)
sizeof (
EFI_IFR_TIME);
1441 case EFI_IFR_TYPE_REF:
1442 ExpressionOpCode->ValueWidth = (UINT8)
sizeof (
EFI_IFR_REF);
1445 case EFI_IFR_TYPE_OTHER:
1446 case EFI_IFR_TYPE_UNDEFINED:
1447 case EFI_IFR_TYPE_ACTION:
1448 case EFI_IFR_TYPE_BUFFER:
1453 return EFI_INVALID_PARAMETER;
1456 CopyMem (&ExpressionOpCode->VarStoreInfo.VarName, &((
EFI_IFR_GET *)OpCodeData)->VarStoreInfo.VarName, sizeof (EFI_STRING_ID));
1457 CopyMem (&ExpressionOpCode->VarStoreInfo.VarOffset, &((
EFI_IFR_GET *)OpCodeData)->VarStoreInfo.VarOffset, sizeof (UINT16));
1458 if ((ExpressionOpCode->VarStorage !=
NULL) &&
1459 ((ExpressionOpCode->VarStorage->Type == EFI_HII_VARSTORE_NAME_VALUE) ||
1460 (ExpressionOpCode->VarStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)))
1462 ExpressionOpCode->ValueName =
GetToken (ExpressionOpCode->VarStoreInfo.VarName, FormSet->HiiHandle);
1463 if (ExpressionOpCode->ValueName ==
NULL) {
1467 return EFI_INVALID_PARAMETER;
1473 case EFI_IFR_QUESTION_REF1_OP:
1477 case EFI_IFR_QUESTION_REF3_OP:
1491 case EFI_IFR_TRUE_OP:
1492 Value->Type = EFI_IFR_TYPE_BOOLEAN;
1493 Value->Value.b =
TRUE;
1496 case EFI_IFR_FALSE_OP:
1497 Value->Type = EFI_IFR_TYPE_BOOLEAN;
1498 Value->Value.b =
FALSE;
1501 case EFI_IFR_ONE_OP:
1502 Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
1503 Value->Value.u8 = 1;
1506 case EFI_IFR_ZERO_OP:
1507 Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
1508 Value->Value.u8 = 0;
1511 case EFI_IFR_ONES_OP:
1512 Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
1513 Value->Value.u64 = 0xffffffffffffffffULL;
1516 case EFI_IFR_UINT8_OP:
1517 Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
1521 case EFI_IFR_UINT16_OP:
1522 Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
1526 case EFI_IFR_UINT32_OP:
1527 Value->Type = EFI_IFR_TYPE_NUM_SIZE_32;
1531 case EFI_IFR_UINT64_OP:
1532 Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
1536 case EFI_IFR_UNDEFINED_OP:
1537 Value->Type = EFI_IFR_TYPE_UNDEFINED;
1540 case EFI_IFR_VERSION_OP:
1541 Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
1542 Value->Value.u16 = EFI_IFR_SPECIFICATION_VERSION;
1552 if ((CurrentExpression ==
NULL) && (MapScopeDepth > 0)) {
1554 ASSERT (MapExpressionList !=
NULL);
1557 SingleOpCodeExpression =
TRUE;
1561 ASSERT (CurrentExpression !=
NULL);
1562 InsertTailList (&CurrentExpression->OpCodeListHead, &ExpressionOpCode->Link);
1563 if (Operand == EFI_IFR_MAP_OP) {
1567 if (MapExpressionList !=
NULL) {
1574 MapExpressionList = &ExpressionOpCode->MapExpressionList;
1580 CurrentExpression =
NULL;
1582 }
else if (SingleOpCodeExpression) {
1588 SingleOpCodeExpression =
FALSE;
1590 if (InScopeDisable && (CurrentForm ==
NULL)) {
1595 if (EFI_ERROR (Status)) {
1599 OpCodeDisabled =
IsTrue (&CurrentExpression->Result);
1602 CurrentExpression =
NULL;
1612 case EFI_IFR_FORM_SET_OP:
1617 return EFI_INVALID_PARAMETER;
1628 FormSet->NumberOfClassGuid = (UINT8)(((
EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
1634 case EFI_IFR_FORM_OP:
1639 ASSERT (CurrentForm !=
NULL);
1640 CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE;
1646 CurrentForm->FormType = STANDARD_MAP_FORM_TYPE;
1648 CopyMem (&CurrentForm->FormTitle, &((
EFI_IFR_FORM *)OpCodeData)->FormTitle, sizeof (EFI_STRING_ID));
1651 if ( ConditionalExprCount > 0) {
1658 ASSERT (CurrentForm->SuppressExpression !=
NULL);
1659 CurrentForm->SuppressExpression->Count = (
UINTN)ConditionalExprCount;
1660 CurrentForm->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;
1668 SuppressForQuestion =
TRUE;
1677 case EFI_IFR_FORM_MAP_OP:
1682 ASSERT (CurrentForm !=
NULL);
1683 CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE;
1696 return EFI_INVALID_PARAMETER;
1705 CurrentForm->FormType = STANDARD_MAP_FORM_TYPE;
1715 if (CurrentForm->FormTitle == 0) {
1721 if ( ConditionalExprCount > 0) {
1728 ASSERT (CurrentForm->SuppressExpression !=
NULL);
1729 CurrentForm->SuppressExpression->Count = (
UINTN)ConditionalExprCount;
1730 CurrentForm->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;
1738 SuppressForQuestion =
TRUE;
1750 case EFI_IFR_VARSTORE_OP:
1754 Storage =
CreateStorage (FormSet, EFI_HII_VARSTORE_BUFFER, OpCodeData);
1758 case EFI_IFR_VARSTORE_NAME_VALUE_OP:
1762 Storage =
CreateStorage (FormSet, EFI_HII_VARSTORE_NAME_VALUE, OpCodeData);
1766 case EFI_IFR_VARSTORE_EFI_OP:
1774 Storage =
CreateStorage (FormSet, EFI_HII_VARSTORE_EFI_VARIABLE, OpCodeData);
1779 Storage =
CreateStorage (FormSet, EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER, OpCodeData);
1788 case EFI_IFR_DEFAULTSTORE_OP:
1789 HaveInserted =
FALSE;
1791 ASSERT (DefaultStore !=
NULL);
1792 DefaultStore->Signature = FORMSET_DEFAULTSTORE_SIGNATURE;
1799 if (!
IsListEmpty (&FormSet->DefaultStoreListHead)) {
1800 DefaultLink =
GetFirstNode (&FormSet->DefaultStoreListHead);
1801 while (!
IsNull (&FormSet->DefaultStoreListHead, DefaultLink)) {
1802 PreDefaultStore = FORMSET_DEFAULTSTORE_FROM_LINK (DefaultLink);
1803 DefaultLink =
GetNextNode (&FormSet->DefaultStoreListHead, DefaultLink);
1804 if (DefaultStore->DefaultId < PreDefaultStore->DefaultId) {
1806 HaveInserted =
TRUE;
1812 if (!HaveInserted) {
1813 InsertTailList (&FormSet->DefaultStoreListHead, &DefaultStore->Link);
1821 case EFI_IFR_SUBTITLE_OP:
1822 CurrentStatement =
CreateStatement (OpCodeData, FormSet, CurrentForm);
1823 ASSERT (CurrentStatement !=
NULL);
1826 CurrentStatement->FakeQuestionId = mUsedQuestionId++;
1829 case EFI_IFR_TEXT_OP:
1830 CurrentStatement =
CreateStatement (OpCodeData, FormSet, CurrentForm);
1831 ASSERT (CurrentStatement !=
NULL);
1832 CurrentStatement->FakeQuestionId = mUsedQuestionId++;
1833 CopyMem (&CurrentStatement->TextTwo, &((
EFI_IFR_TEXT *)OpCodeData)->TextTwo, sizeof (EFI_STRING_ID));
1836 case EFI_IFR_RESET_BUTTON_OP:
1837 CurrentStatement =
CreateStatement (OpCodeData, FormSet, CurrentForm);
1838 ASSERT (CurrentStatement !=
NULL);
1839 CurrentStatement->FakeQuestionId = mUsedQuestionId++;
1846 case EFI_IFR_ACTION_OP:
1847 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
1848 ASSERT (CurrentStatement !=
NULL);
1849 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_ACTION;
1855 CurrentStatement->QuestionConfig = 0;
1857 CopyMem (&CurrentStatement->QuestionConfig, &((
EFI_IFR_ACTION *)OpCodeData)->QuestionConfig, sizeof (EFI_STRING_ID));
1862 case EFI_IFR_REF_OP:
1863 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
1864 ASSERT (CurrentStatement !=
NULL);
1865 Value = &CurrentStatement->HiiValue;
1866 Value->Type = EFI_IFR_TYPE_REF;
1868 CopyMem (&Value->Value.ref.FormId, &((
EFI_IFR_REF *)OpCodeData)->FormId, sizeof (EFI_FORM_ID));
1871 CopyMem (&Value->Value.ref.QuestionId, &((
EFI_IFR_REF2 *)OpCodeData)->QuestionId, sizeof (EFI_QUESTION_ID));
1877 CopyMem (&Value->Value.ref.DevicePath, &((
EFI_IFR_REF4 *)OpCodeData)->DevicePath, sizeof (EFI_STRING_ID));
1883 CurrentStatement->StorageWidth = (UINT16)
sizeof (
EFI_HII_REF);
1887 case EFI_IFR_ONE_OF_OP:
1888 case EFI_IFR_NUMERIC_OP:
1889 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
1890 ASSERT (CurrentStatement !=
NULL);
1893 Value = &CurrentStatement->HiiValue;
1895 if (QuestionReferBitField) {
1899 CurrentStatement->QuestionReferToBitField =
TRUE;
1900 CurrentStatement->BitStorageWidth = CurrentStatement->Flags & EDKII_IFR_NUMERIC_SIZE_BIT;
1901 CurrentStatement->BitVarOffset = CurrentStatement->VarStoreInfo.VarOffset;
1902 CurrentStatement->VarStoreInfo.VarOffset = CurrentStatement->BitVarOffset / 8;
1903 TotalBits = CurrentStatement->BitVarOffset % 8 + CurrentStatement->BitStorageWidth;
1904 CurrentStatement->StorageWidth = (TotalBits % 8 == 0 ? TotalBits / 8 : TotalBits / 8 + 1);
1909 CurrentStatement->Minimum = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MinValue;
1910 CurrentStatement->Maximum = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MaxValue;
1911 CurrentStatement->Step = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.Step;
1919 switch (CurrentStatement->StorageWidth) {
1922 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.MinValue = (UINT8)CurrentStatement->Minimum;
1923 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.MaxValue = (UINT8)CurrentStatement->Maximum;
1924 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.Step = (UINT8)CurrentStatement->Step;
1925 Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
1929 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u16.MinValue = (UINT16)CurrentStatement->Minimum;
1930 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u16.MaxValue = (UINT16)CurrentStatement->Maximum;
1931 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u16.Step = (UINT16)CurrentStatement->Step;
1932 Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
1937 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MinValue = (UINT32)CurrentStatement->Minimum;
1938 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MaxValue = (UINT32)CurrentStatement->Maximum;
1939 ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.Step = (UINT32)CurrentStatement->Step;
1940 Value->Type = EFI_IFR_TYPE_NUM_SIZE_32;
1946 switch (CurrentStatement->Flags & EFI_IFR_NUMERIC_SIZE) {
1947 case EFI_IFR_NUMERIC_SIZE_1:
1948 CurrentStatement->Minimum = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.MinValue;
1949 CurrentStatement->Maximum = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.MaxValue;
1950 CurrentStatement->Step = ((
EFI_IFR_NUMERIC *)OpCodeData)->data.u8.Step;
1951 CurrentStatement->StorageWidth = (UINT16)
sizeof (UINT8);
1952 Value->Type = EFI_IFR_TYPE_NUM_SIZE_8;
1955 case EFI_IFR_NUMERIC_SIZE_2:
1956 CopyMem (&CurrentStatement->Minimum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u16.MinValue, sizeof (UINT16));
1957 CopyMem (&CurrentStatement->Maximum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u16.MaxValue, sizeof (UINT16));
1959 CurrentStatement->StorageWidth = (UINT16)
sizeof (UINT16);
1960 Value->Type = EFI_IFR_TYPE_NUM_SIZE_16;
1963 case EFI_IFR_NUMERIC_SIZE_4:
1964 CopyMem (&CurrentStatement->Minimum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MinValue, sizeof (UINT32));
1965 CopyMem (&CurrentStatement->Maximum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u32.MaxValue, sizeof (UINT32));
1967 CurrentStatement->StorageWidth = (UINT16)
sizeof (UINT32);
1968 Value->Type = EFI_IFR_TYPE_NUM_SIZE_32;
1971 case EFI_IFR_NUMERIC_SIZE_8:
1972 CopyMem (&CurrentStatement->Minimum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u64.MinValue, sizeof (UINT64));
1973 CopyMem (&CurrentStatement->Maximum, &((
EFI_IFR_NUMERIC *)OpCodeData)->data.u64.MaxValue, sizeof (UINT64));
1975 CurrentStatement->StorageWidth = (UINT16)
sizeof (UINT64);
1976 Value->Type = EFI_IFR_TYPE_NUM_SIZE_64;
1986 if ((Operand == EFI_IFR_ONE_OF_OP) && (Scope != 0)) {
1987 SuppressForOption =
TRUE;
1992 case EFI_IFR_ORDERED_LIST_OP:
1993 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
1994 ASSERT (CurrentStatement !=
NULL);
1999 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_BUFFER;
2000 CurrentStatement->BufferValue =
NULL;
2003 SuppressForOption =
TRUE;
2008 case EFI_IFR_CHECKBOX_OP:
2009 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
2010 ASSERT (CurrentStatement !=
NULL);
2013 CurrentStatement->StorageWidth = (UINT16)
sizeof (BOOLEAN);
2014 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_BOOLEAN;
2016 if (QuestionReferBitField) {
2020 CurrentStatement->QuestionReferToBitField =
TRUE;
2021 CurrentStatement->BitStorageWidth = 1;
2022 CurrentStatement->BitVarOffset = CurrentStatement->VarStoreInfo.VarOffset;
2023 CurrentStatement->VarStoreInfo.VarOffset = CurrentStatement->BitVarOffset / 8;
2024 TotalBits = CurrentStatement->BitVarOffset % 8 + CurrentStatement->BitStorageWidth;
2025 CurrentStatement->StorageWidth = (TotalBits % 8 == 0 ? TotalBits / 8 : TotalBits / 8 + 1);
2032 case EFI_IFR_STRING_OP:
2033 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
2034 ASSERT (CurrentStatement !=
NULL);
2040 CurrentStatement->Minimum = ((
EFI_IFR_STRING *)OpCodeData)->MinSize;
2041 CurrentStatement->Maximum = ((
EFI_IFR_STRING *)OpCodeData)->MaxSize;
2042 CurrentStatement->StorageWidth = (UINT16)((
UINTN)CurrentStatement->Maximum *
sizeof (CHAR16));
2045 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING;
2046 CurrentStatement->BufferValue =
AllocateZeroPool (CurrentStatement->StorageWidth + sizeof (CHAR16));
2047 CurrentStatement->HiiValue.Value.
string =
NewString ((CHAR16 *)CurrentStatement->BufferValue, FormSet->HiiHandle);
2052 case EFI_IFR_PASSWORD_OP:
2053 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
2054 ASSERT (CurrentStatement !=
NULL);
2062 CurrentStatement->StorageWidth = (UINT16)((
UINTN)CurrentStatement->Maximum *
sizeof (CHAR16));
2064 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_STRING;
2065 CurrentStatement->BufferValue =
AllocateZeroPool ((CurrentStatement->StorageWidth + sizeof (CHAR16)));
2066 CurrentStatement->HiiValue.Value.
string =
NewString ((CHAR16 *)CurrentStatement->BufferValue, FormSet->HiiHandle);
2071 case EFI_IFR_DATE_OP:
2072 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
2073 ASSERT (CurrentStatement !=
NULL);
2075 CurrentStatement->Flags = ((
EFI_IFR_DATE *)OpCodeData)->Flags;
2076 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_DATE;
2078 if ((CurrentStatement->Flags & EFI_QF_DATE_STORAGE) == QF_DATE_STORAGE_NORMAL) {
2079 CurrentStatement->StorageWidth = (UINT16)
sizeof (
EFI_HII_DATE);
2086 CurrentStatement->Storage =
NULL;
2087 CurrentStatement->StorageWidth = 0;
2092 case EFI_IFR_TIME_OP:
2093 CurrentStatement =
CreateQuestion (OpCodeData, FormSet, CurrentForm);
2094 ASSERT (CurrentStatement !=
NULL);
2096 CurrentStatement->Flags = ((
EFI_IFR_TIME *)OpCodeData)->Flags;
2097 CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_TIME;
2099 if ((CurrentStatement->Flags & QF_TIME_STORAGE) == QF_TIME_STORAGE_NORMAL) {
2100 CurrentStatement->StorageWidth = (UINT16)
sizeof (
EFI_HII_TIME);
2107 CurrentStatement->Storage =
NULL;
2108 CurrentStatement->StorageWidth = 0;
2116 case EFI_IFR_DEFAULT_OP:
2123 ASSERT (CurrentDefault !=
NULL);
2124 CurrentDefault->Signature = QUESTION_DEFAULT_SIGNATURE;
2128 if (CurrentDefault->Value.Type == EFI_IFR_TYPE_BUFFER) {
2131 ASSERT (CurrentDefault->Value.Buffer !=
NULL);
2140 InsertTailList (&ParentStatement->DefaultListHead, &CurrentDefault->Link);
2143 InScopeDefault =
TRUE;
2151 case EFI_IFR_ONE_OF_OPTION_OP:
2152 ASSERT (ParentStatement !=
NULL);
2153 if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && ((((
EFI_IFR_ONE_OF_OPTION *)OpCodeData)->Flags & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_DEFAULT_MFG)) != 0)) {
2158 ASSERT (CurrentDefault !=
NULL);
2159 CurrentDefault->Signature = QUESTION_DEFAULT_SIGNATURE;
2161 CurrentDefault->Value.Type = EFI_IFR_TYPE_BUFFER;
2163 CurrentDefault->DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
2165 CurrentDefault->DefaultId = EFI_HII_DEFAULT_CLASS_MANUFACTURING;
2170 ASSERT (CurrentDefault->Value.Buffer !=
NULL);
2175 InsertTailList (&ParentStatement->DefaultListHead, &CurrentDefault->Link);
2184 ASSERT (CurrentOption !=
NULL);
2185 CurrentOption->Signature = QUESTION_OPTION_SIGNATURE;
2195 if ( ConditionalExprCount > 0) {
2202 ASSERT (CurrentOption->SuppressExpression !=
NULL);
2203 CurrentOption->SuppressExpression->Count = (
UINTN)ConditionalExprCount;
2204 CurrentOption->SuppressExpression->Signature = FORM_EXPRESSION_LIST_SIGNATURE;
2211 InsertTailList (&ParentStatement->OptionListHead, &CurrentOption->Link);
2215 if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (ParentStatement->BufferValue ==
NULL)) {
2217 switch (CurrentOption->Value.Type) {
2218 case EFI_IFR_TYPE_NUM_SIZE_8:
2222 case EFI_IFR_TYPE_NUM_SIZE_16:
2226 case EFI_IFR_TYPE_NUM_SIZE_32:
2230 case EFI_IFR_TYPE_NUM_SIZE_64:
2241 ParentStatement->StorageWidth = (UINT16)(ParentStatement->MaxContainers * Width);
2242 ParentStatement->BufferValue =
AllocateZeroPool (ParentStatement->StorageWidth);
2243 ParentStatement->ValueType = CurrentOption->Value.Type;
2244 if (ParentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
2245 ParentStatement->HiiValue.Buffer = ParentStatement->BufferValue;
2246 ParentStatement->HiiValue.BufferLen = ParentStatement->StorageWidth;
2257 case EFI_IFR_NO_SUBMIT_IF_OP:
2258 case EFI_IFR_INCONSISTENT_IF_OP:
2265 if (Operand == EFI_IFR_NO_SUBMIT_IF_OP) {
2266 CurrentExpression->Type = EFI_HII_EXPRESSION_NO_SUBMIT_IF;
2267 InsertTailList (&ParentStatement->NoSubmitListHead, &CurrentExpression->Link);
2269 CurrentExpression->Type = EFI_HII_EXPRESSION_INCONSISTENT_IF;
2270 InsertTailList (&ParentStatement->InconsistentListHead, &CurrentExpression->Link);
2278 SingleOpCodeExpression =
TRUE;
2283 case EFI_IFR_WARNING_IF_OP:
2290 CurrentExpression->Type = EFI_HII_EXPRESSION_WARNING_IF;
2291 InsertTailList (&ParentStatement->WarningListHead, &CurrentExpression->Link);
2298 SingleOpCodeExpression =
TRUE;
2303 case EFI_IFR_SUPPRESS_IF_OP:
2308 CurrentExpression->Type = EFI_HII_EXPRESSION_SUPPRESS_IF;
2310 if (CurrentForm ==
NULL) {
2311 InsertTailList (&FormSet->ExpressionListHead, &CurrentExpression->Link);
2313 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2316 if (SuppressForOption) {
2318 }
else if (SuppressForQuestion) {
2329 SingleOpCodeExpression =
TRUE;
2334 case EFI_IFR_GRAY_OUT_IF_OP:
2339 CurrentExpression->Type = EFI_HII_EXPRESSION_GRAY_OUT_IF;
2340 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2348 SingleOpCodeExpression =
TRUE;
2353 case EFI_IFR_DISABLE_IF_OP:
2359 ASSERT (CurrentExpression !=
NULL);
2360 CurrentExpression->Signature = FORM_EXPRESSION_SIGNATURE;
2361 CurrentExpression->Type = EFI_HII_EXPRESSION_DISABLE_IF;
2364 if (CurrentForm !=
NULL) {
2368 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2372 OpCodeDisabled =
FALSE;
2373 InScopeDisable =
TRUE;
2379 SingleOpCodeExpression =
TRUE;
2387 case EFI_IFR_VALUE_OP:
2389 CurrentExpression->Type = EFI_HII_EXPRESSION_VALUE;
2390 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2392 if (InScopeDefault) {
2396 CurrentDefault->ValueExpression = CurrentExpression;
2406 ASSERT (ParentStatement !=
NULL);
2407 ParentStatement->ValueExpression = CurrentExpression;
2415 SingleOpCodeExpression =
TRUE;
2420 case EFI_IFR_RULE_OP:
2422 CurrentExpression->Type = EFI_HII_EXPRESSION_RULE;
2424 CurrentExpression->RuleId = ((
EFI_IFR_RULE *)OpCodeData)->RuleId;
2425 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2432 SingleOpCodeExpression =
TRUE;
2437 case EFI_IFR_READ_OP:
2439 CurrentExpression->Type = EFI_HII_EXPRESSION_READ;
2440 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2447 ASSERT (ParentStatement !=
NULL);
2448 ParentStatement->ReadExpression = CurrentExpression;
2455 SingleOpCodeExpression =
TRUE;
2460 case EFI_IFR_WRITE_OP:
2462 CurrentExpression->Type = EFI_HII_EXPRESSION_WRITE;
2463 InsertTailList (&CurrentForm->ExpressionListHead, &CurrentExpression->Link);
2470 ASSERT (ParentStatement !=
NULL);
2471 ParentStatement->WriteExpression = CurrentExpression;
2478 SingleOpCodeExpression =
TRUE;
2486 case EFI_IFR_IMAGE_OP:
2493 switch (ScopeOpCode) {
2494 case EFI_IFR_FORM_SET_OP:
2495 ImageId = &FormSet->ImageId;
2498 case EFI_IFR_FORM_OP:
2499 case EFI_IFR_FORM_MAP_OP:
2500 ASSERT (CurrentForm !=
NULL);
2501 ImageId = &CurrentForm->ImageId;
2504 case EFI_IFR_ONE_OF_OPTION_OP:
2505 ASSERT (CurrentOption !=
NULL);
2506 ImageId = &CurrentOption->ImageId;
2515 ASSERT (ParentStatement !=
NULL);
2516 ImageId = &ParentStatement->ImageId;
2520 ASSERT (ImageId !=
NULL);
2527 case EFI_IFR_REFRESH_OP:
2528 ASSERT (ParentStatement !=
NULL);
2529 ParentStatement->RefreshInterval = ((
EFI_IFR_REFRESH *)OpCodeData)->RefreshInterval;
2535 case EFI_IFR_REFRESH_ID_OP:
2542 switch (ScopeOpCode) {
2543 case EFI_IFR_FORM_OP:
2544 case EFI_IFR_FORM_MAP_OP:
2545 ASSERT (CurrentForm !=
NULL);
2550 ASSERT (ParentStatement !=
NULL);
2560 case EFI_IFR_MODAL_TAG_OP:
2561 ASSERT (CurrentForm !=
NULL);
2562 CurrentForm->ModalForm =
TRUE;
2568 case EFI_IFR_LOCKED_OP:
2574 switch (ScopeOpCode) {
2575 case EFI_IFR_FORM_OP:
2576 case EFI_IFR_FORM_MAP_OP:
2577 ASSERT (CurrentForm !=
NULL);
2578 CurrentForm->Locked =
TRUE;
2582 ASSERT (ParentStatement !=
NULL);
2583 ParentStatement->Locked =
TRUE;
2591 case EFI_IFR_GUID_OP:
2592 CurrentStatement =
CreateStatement (OpCodeData, FormSet, CurrentForm);
2595 QuestionReferBitField =
TRUE;
2603 case EFI_IFR_END_OP:
2604 QuestionReferBitField =
FALSE;
2606 if (EFI_ERROR (Status)) {
2614 if (
IsStatementOpCode (ScopeOpCode) && (ParentStatement !=
NULL) && (ParentStatement->Operand == ScopeOpCode)) {
2615 ParentStatement = ParentStatement->ParentStatement;
2618 switch (ScopeOpCode) {
2619 case EFI_IFR_FORM_SET_OP:
2624 FormSet->IfrBinaryLength = OpCodeOffset;
2627 case EFI_IFR_FORM_OP:
2628 case EFI_IFR_FORM_MAP_OP:
2633 SuppressForQuestion =
FALSE;
2636 case EFI_IFR_ONE_OF_OPTION_OP:
2640 CurrentOption =
NULL;
2643 case EFI_IFR_NO_SUBMIT_IF_OP:
2644 case EFI_IFR_INCONSISTENT_IF_OP:
2645 case EFI_IFR_WARNING_IF_OP:
2651 case EFI_IFR_SUPPRESS_IF_OP:
2652 if (SuppressForOption) {
2654 }
else if (SuppressForQuestion) {
2662 case EFI_IFR_GRAY_OUT_IF_OP:
2666 case EFI_IFR_DISABLE_IF_OP:
2667 if (CurrentForm !=
NULL) {
2671 InScopeDisable =
FALSE;
2672 OpCodeDisabled =
FALSE;
2675 case EFI_IFR_ONE_OF_OP:
2676 case EFI_IFR_ORDERED_LIST_OP:
2677 SuppressForOption =
FALSE;
2680 case EFI_IFR_DEFAULT_OP:
2681 InScopeDefault =
FALSE;
2684 case EFI_IFR_MAP_OP:
2689 if (Status == EFI_ACCESS_DENIED) {
2690 MapExpressionList =
NULL;
2698 ASSERT (MapScopeDepth > 0);
2704 if (InScopeDisable && (CurrentForm ==
NULL)) {
2708 ASSERT (CurrentExpression !=
NULL);
2710 if (EFI_ERROR (Status)) {
2714 OpCodeDisabled =
IsTrue (&CurrentExpression->Result);
2725 CurrentExpression =
NULL;
2738 CurrentStatement->ParentStatement = ParentStatement;
2744 ParentStatement = CurrentStatement;
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
UINTN EFIAPI AsciiStrSize(IN CONST CHAR8 *String)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID HiiToLower(IN EFI_STRING ConfigString)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EvaluateExpression(IN FORM_BROWSER_FORMSET *FormSet, IN FORM_BROWSER_FORM *Form, IN OUT FORM_EXPRESSION *Expression)
EFI_STATUS PopMapExpressionList(OUT VOID **Pointer)
VOID ResetScopeStack(VOID)
VOID ExtendValueToU64(IN EFI_HII_VALUE *Value)
EFI_STATUS PushCurrentExpression(IN VOID *Pointer)
VOID ResetCurrentExpressionStack(VOID)
EFI_STATUS PushConditionalExpression(IN FORM_EXPRESSION *Pointer, IN EXPRESS_LEVEL Level)
EFI_STATUS PushScope(IN UINT8 Operand)
EFI_STATUS PopConditionalExpression(IN EXPRESS_LEVEL Level)
INTN GetConditionalExpressionCount(IN EXPRESS_LEVEL Level)
EFI_STATUS PopCurrentExpression(OUT VOID **Pointer)
EFI_STATUS PushMapExpressionList(IN VOID *Pointer)
EFI_STATUS PopScope(OUT UINT8 *Operand)
FORM_EXPRESSION ** GetConditionalExpressionList(IN EXPRESS_LEVEL Level)
VOID ResetMapExpressionListStack(VOID)
BOOLEAN IsTrue(IN EFI_HII_VALUE *Result)
EFI_STRING EFIAPI HiiConstructConfigHdr(IN CONST EFI_GUID *Guid OPTIONAL, IN CONST CHAR16 *Name OPTIONAL, IN EFI_HANDLE DriverHandle)
FORMSET_STORAGE * GetFstStgFromBrsStg(IN BROWSER_STORAGE *Storage)
BOOLEAN IsStatementOpCode(IN UINT8 Operand)
FORM_BROWSER_STATEMENT * CreateStatement(IN UINT8 *OpCodeData, IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
EFI_STATUS ParseOpCodes(IN FORM_BROWSER_FORMSET *FormSet)
VOID DestroyFormSet(IN OUT FORM_BROWSER_FORMSET *FormSet)
VOID DestroyStatement(IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_STATEMENT *Statement)
EFI_STATUS InitializeConfigHdr(IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORMSET_STORAGE *Storage)
VOID DestroyExpression(IN FORM_EXPRESSION *Expression)
FORMSET_STORAGE * CreateStorage(IN FORM_BROWSER_FORMSET *FormSet, IN UINT8 StorageType, IN UINT8 *OpCodeData)
VOID CountOpCodes(IN FORM_BROWSER_FORMSET *FormSet, OUT UINTN *NumberOfStatement, OUT UINTN *NumberOfExpression)
BOOLEAN IsExpressionOpCode(IN UINT8 Operand)
VOID IntializeBrowserStorage(IN BROWSER_STORAGE *BrowserStorage, IN UINT8 StorageType, IN UINT8 *OpCodeData)
BROWSER_STORAGE * FindStorageInList(IN UINT8 StorageType, IN EFI_GUID *StorageGuid, IN CHAR16 *StorageName, IN EFI_HII_HANDLE HiiHandle)
BOOLEAN IsUnKnownOpCode(IN UINT8 Operand)
VOID DestroyForm(IN FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
FORMSET_STORAGE * GetFstStgFromVarId(IN FORM_BROWSER_FORMSET *FormSet, IN EFI_VARSTORE_ID VarStoreId)
VOID DestroyStorage(IN FORMSET_STORAGE *Storage)
FORM_BROWSER_STATEMENT * CreateQuestion(IN UINT8 *OpCodeData, IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_FORM *Form)
EFI_STATUS InitializeRequestElement(IN OUT FORM_BROWSER_FORMSET *FormSet, IN OUT FORM_BROWSER_STATEMENT *Question, IN OUT FORM_BROWSER_FORM *Form)
FORM_EXPRESSION * CreateExpression(IN OUT FORM_BROWSER_FORM *Form, IN UINT8 *OpCode)
#define EDKII_IFR_DISPLAY_BIT
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define OFFSET_OF(TYPE, Field)
#define ASSERT_EFI_ERROR(StatusParameter)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID UiFreeMenuList(LIST_ENTRY *MenuListHead)
EFI_STATUS DeleteString(IN EFI_STRING_ID StringId, IN EFI_HII_HANDLE HiiHandle)
EFI_STRING_ID NewString(IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
EFI_GUID MethodIdentifier
EFI_STRING_ID MethodTitle
EFI_STRING_ID string
EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION.