mirror of https://github.com/acidanthera/audk.git
Support Framework IFR SELECT OP code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10240 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
213fecefbb
commit
61a2420125
|
@ -860,9 +860,19 @@ FwUpdateDataToUefiUpdateData (
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN DataCount;
|
UINTN DataCount;
|
||||||
UINT8 *OpCodeBuffer;
|
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;
|
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) {
|
for (Index = 0; Index < FwUpdateData->DataCount; Index += DataCount) {
|
||||||
switch (FwOpCode->OpCode) {
|
switch (FwOpCode->OpCode) {
|
||||||
case FRAMEWORK_EFI_IFR_SUBTITLE_OP:
|
case FRAMEWORK_EFI_IFR_SUBTITLE_OP:
|
||||||
|
@ -926,6 +936,31 @@ FwUpdateDataToUefiUpdateData (
|
||||||
OpCodeBuffer = F2UCreateNumericOpCode (UefiOpCodeHandle, ThunkContext, (FRAMEWORK_EFI_IFR_NUMERIC *) FwOpCode);
|
OpCodeBuffer = F2UCreateNumericOpCode (UefiOpCodeHandle, ThunkContext, (FRAMEWORK_EFI_IFR_NUMERIC *) FwOpCode);
|
||||||
DataCount = 1;
|
DataCount = 1;
|
||||||
break;
|
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:
|
default:
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
|
@ -939,6 +974,11 @@ FwUpdateDataToUefiUpdateData (
|
||||||
FwOpCode = (FRAMEWORK_EFI_IFR_OP_HEADER *)((UINT8 *) FwOpCode + FwOpCode->Length);
|
FwOpCode = (FRAMEWORK_EFI_IFR_OP_HEADER *)((UINT8 *) FwOpCode + FwOpCode->Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Revert FromSet default varstore ID.
|
||||||
|
//
|
||||||
|
FormSet->DefaultVarStoreId = DefaultVarStoreId;
|
||||||
|
FormSet->OriginalDefaultVarStoreName = DefaultVarStoreName;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue