diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-14 07:07:46 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-14 07:07:46 +0000 |
commit | 61a2420125d0500288e4b806f5755305cce2c283 (patch) | |
tree | 6049482ec2de1f88adab92413444ccb5171d2574 /EdkCompatibilityPkg | |
parent | 213fecefbbc2fa9badd2ac371a569908390999f0 (diff) | |
download | edk2-61a2420125d0500288e4b806f5755305cce2c283.tar.gz edk2-61a2420125d0500288e4b806f5755305cce2c283.tar.bz2 edk2-61a2420125d0500288e4b806f5755305cce2c283.zip |
Support Framework IFR SELECT OP code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10240 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c index 27969d2d24..0692c2a599 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c @@ -860,9 +860,19 @@ FwUpdateDataToUefiUpdateData ( UINTN Index;
UINTN DataCount;
UINT8 *OpCodeBuffer;
+ LIST_ENTRY *StorageList;
+ FORMSET_STORAGE *Storage;
+ FORM_BROWSER_FORMSET *FormSet;
+ CHAR16 *DefaultVarStoreName;
+ UINT16 DefaultVarStoreId;
+ EFI_IFR_VARSTORE_SELECT *SelectVarOp;
FwOpCode = (FRAMEWORK_EFI_IFR_OP_HEADER *) &FwUpdateData->Data;
+ FormSet = ThunkContext->FormSet;
+ DefaultVarStoreId = FormSet->DefaultVarStoreId;
+ DefaultVarStoreName = FormSet->OriginalDefaultVarStoreName;
+
for (Index = 0; Index < FwUpdateData->DataCount; Index += DataCount) {
switch (FwOpCode->OpCode) {
case FRAMEWORK_EFI_IFR_SUBTITLE_OP:
@@ -926,6 +936,31 @@ FwUpdateDataToUefiUpdateData ( OpCodeBuffer = F2UCreateNumericOpCode (UefiOpCodeHandle, ThunkContext, (FRAMEWORK_EFI_IFR_NUMERIC *) FwOpCode);
DataCount = 1;
break;
+
+ case EFI_IFR_VARSTORE_SELECT_OP:
+ OpCodeBuffer = (UINT8 *) FwOpCode;
+ SelectVarOp = (EFI_IFR_VARSTORE_SELECT *) FwOpCode;
+ //
+ // Check whether the selected VarId is in StorageList.
+ //
+ StorageList = GetFirstNode (&FormSet->StorageListHead);
+ while (!IsNull (&FormSet->StorageListHead, StorageList)) {
+ Storage = FORMSET_STORAGE_FROM_LINK (StorageList);
+ if (Storage->VarStoreId == SelectVarOp->VarId) {
+ break;
+ }
+ StorageList = GetNextNode (&FormSet->StorageListHead, StorageList);
+ }
+ ASSERT (!IsNull (&FormSet->StorageListHead, StorageList));
+ //
+ // Change VarStoreId to the selected VarId.
+ //
+ FormSet->DefaultVarStoreId = SelectVarOp->VarId;
+ if (SelectVarOp->VarId == DefaultVarStoreId) {
+ FormSet->OriginalDefaultVarStoreName = DefaultVarStoreName;
+ }
+ DataCount = 1;
+ break;
default:
ASSERT (FALSE);
@@ -939,6 +974,11 @@ FwUpdateDataToUefiUpdateData ( FwOpCode = (FRAMEWORK_EFI_IFR_OP_HEADER *)((UINT8 *) FwOpCode + FwOpCode->Length);
}
+ //
+ // Revert FromSet default varstore ID.
+ //
+ FormSet->DefaultVarStoreId = DefaultVarStoreId;
+ FormSet->OriginalDefaultVarStoreName = DefaultVarStoreName;
return EFI_SUCCESS;
}
|