Add new HII FormMap Opcode support
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10065 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4b9fa12943
commit
6a8241983d
|
@ -85,6 +85,7 @@
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiIfrTianoGuid
|
gEfiIfrTianoGuid
|
||||||
gEfiIfrFrameworkGuid
|
gEfiIfrFrameworkGuid
|
||||||
|
gEfiHiiStandardFormGuid
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiHiiImageProtocolGuid
|
gEfiHiiImageProtocolGuid
|
||||||
|
|
|
@ -35,7 +35,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Protocol/HiiConfigRouting.h>
|
#include <Protocol/HiiConfigRouting.h>
|
||||||
#include <Protocol/HiiConfigAccess.h>
|
#include <Protocol/HiiConfigAccess.h>
|
||||||
#include <Protocol/UgaDraw.h>
|
#include <Protocol/UgaDraw.h>
|
||||||
|
#include <Guid/HiiFormMapMethodGuid.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
|
|
|
@ -408,9 +408,14 @@ IsExpressionOpCode (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (((Operand >= EFI_IFR_EQ_ID_VAL_OP) && (Operand <= EFI_IFR_NOT_OP)) ||
|
if (((Operand >= EFI_IFR_EQ_ID_VAL_OP) && (Operand <= EFI_IFR_NOT_OP)) ||
|
||||||
((Operand >= EFI_IFR_MATCH_OP) && (Operand <= EFI_IFR_SPAN_OP)) ||
|
((Operand >= EFI_IFR_MATCH_OP) && (Operand <= EFI_IFR_SET_OP)) ||
|
||||||
(Operand == EFI_IFR_CATENATE_OP)
|
((Operand >= EFI_IFR_EQUAL_OP) && (Operand <= EFI_IFR_SPAN_OP)) ||
|
||||||
) {
|
(Operand == EFI_IFR_CATENATE_OP) ||
|
||||||
|
(Operand == EFI_IFR_TO_LOWER_OP) ||
|
||||||
|
(Operand == EFI_IFR_TO_UPPER_OP) ||
|
||||||
|
(Operand == EFI_IFR_MAP_OP) ||
|
||||||
|
(Operand == EFI_IFR_VERSION_OP) ||
|
||||||
|
(Operand == EFI_IFR_SECURITY_OP)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -502,12 +507,14 @@ ParseOpCodes (
|
||||||
UINT8 OneOfType;
|
UINT8 OneOfType;
|
||||||
EFI_IFR_ONE_OF *OneOfOpcode;
|
EFI_IFR_ONE_OF *OneOfOpcode;
|
||||||
HII_THUNK_CONTEXT *ThunkContext;
|
HII_THUNK_CONTEXT *ThunkContext;
|
||||||
|
EFI_IFR_FORM_MAP_METHOD *MapMethod;
|
||||||
|
|
||||||
mInScopeSubtitle = FALSE;
|
mInScopeSubtitle = FALSE;
|
||||||
mInScopeSuppress = FALSE;
|
mInScopeSuppress = FALSE;
|
||||||
mInScopeGrayOut = FALSE;
|
mInScopeGrayOut = FALSE;
|
||||||
CurrentDefault = NULL;
|
CurrentDefault = NULL;
|
||||||
CurrentOption = NULL;
|
CurrentOption = NULL;
|
||||||
|
MapMethod = NULL;
|
||||||
ThunkContext = UefiHiiHandleToThunkContext ((CONST HII_THUNK_PRIVATE_DATA*) mHiiThunkPrivateData, FormSet->HiiHandle);
|
ThunkContext = UefiHiiHandleToThunkContext ((CONST HII_THUNK_PRIVATE_DATA*) mHiiThunkPrivateData, FormSet->HiiHandle);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -592,6 +599,49 @@ ParseOpCodes (
|
||||||
InsertTailList (&FormSet->FormListHead, &CurrentForm->Link);
|
InsertTailList (&FormSet->FormListHead, &CurrentForm->Link);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EFI_IFR_FORM_MAP_OP:
|
||||||
|
//
|
||||||
|
// Create a new Form Map for this FormSet
|
||||||
|
//
|
||||||
|
CurrentForm = AllocateZeroPool (sizeof (FORM_BROWSER_FORM));
|
||||||
|
CurrentForm->Signature = FORM_BROWSER_FORM_SIGNATURE;
|
||||||
|
|
||||||
|
InitializeListHead (&CurrentForm->StatementListHead);
|
||||||
|
|
||||||
|
CopyMem (&CurrentForm->FormId, &((EFI_IFR_FORM *) OpCodeData)->FormId, sizeof (UINT16));
|
||||||
|
MapMethod = (EFI_IFR_FORM_MAP_METHOD *) (OpCodeData + sizeof (EFI_IFR_FORM_MAP));
|
||||||
|
|
||||||
|
//
|
||||||
|
// FormMap Form must contain at least one Map Method.
|
||||||
|
//
|
||||||
|
if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length < ((UINTN) (UINT8 *) (MapMethod + 1) - (UINTN) OpCodeData)) {
|
||||||
|
return EFI_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Try to find the standard form map method.
|
||||||
|
//
|
||||||
|
while (((UINTN) (UINT8 *) MapMethod - (UINTN) OpCodeData) < ((EFI_IFR_OP_HEADER *) OpCodeData)->Length) {
|
||||||
|
if (CompareGuid ((EFI_GUID *) (VOID *) &MapMethod->MethodIdentifier, &gEfiHiiStandardFormGuid)) {
|
||||||
|
CopyMem (&CurrentForm->FormTitle, &MapMethod->MethodTitle, sizeof (EFI_STRING_ID));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
MapMethod ++;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// If the standard form map method is not found, the first map method title will be used.
|
||||||
|
//
|
||||||
|
if (CurrentForm->FormTitle == 0) {
|
||||||
|
MapMethod = (EFI_IFR_FORM_MAP_METHOD *) (OpCodeData + sizeof (EFI_IFR_FORM_MAP));
|
||||||
|
CopyMem (&CurrentForm->FormTitle, &MapMethod->MethodTitle, sizeof (EFI_STRING_ID));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Insert into Form list of this FormSet
|
||||||
|
//
|
||||||
|
InsertTailList (&FormSet->FormListHead, &CurrentForm->Link);
|
||||||
|
break;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Storage
|
// Storage
|
||||||
//
|
//
|
||||||
|
@ -917,6 +967,8 @@ ParseOpCodes (
|
||||||
// Expression
|
// Expression
|
||||||
//
|
//
|
||||||
case EFI_IFR_VALUE_OP:
|
case EFI_IFR_VALUE_OP:
|
||||||
|
case EFI_IFR_READ_OP:
|
||||||
|
case EFI_IFR_WRITE_OP:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_RULE_OP:
|
case EFI_IFR_RULE_OP:
|
||||||
|
@ -938,6 +990,7 @@ ParseOpCodes (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_FORM_OP:
|
case EFI_IFR_FORM_OP:
|
||||||
|
case EFI_IFR_FORM_MAP_OP:
|
||||||
ImageId = &CurrentForm->ImageId;
|
ImageId = &CurrentForm->ImageId;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1040,6 +1093,7 @@ ParseOpCodes (
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFI_IFR_FORM_OP:
|
case EFI_IFR_FORM_OP:
|
||||||
|
case EFI_IFR_FORM_MAP_OP:
|
||||||
//
|
//
|
||||||
// End of Form
|
// End of Form
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue