BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option

Add REST_STYLE support on VFR language

BZ: 2916
https://bugzilla.tianocore.org/show_bug.cgi?id=2916

Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Ye Ting <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Wang Fan <fan.wang@intel.com>

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Abner Chang 2020-11-06 10:49:37 +08:00 committed by mergify[bot]
parent 5ec3033154
commit 1b840718f7
1 changed files with 22 additions and 3 deletions

View File

@ -192,6 +192,7 @@ VfrParserStart (
#token LateCheckFlag("LATE_CHECK") "LATE_CHECK" #token LateCheckFlag("LATE_CHECK") "LATE_CHECK"
#token ReadOnlyFlag("READ_ONLY") "READ_ONLY" #token ReadOnlyFlag("READ_ONLY") "READ_ONLY"
#token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY" #token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY"
#token RestStyleFlag("REST_STYLE") "REST_STYLE"
#token Class("class") "class" #token Class("class") "class"
#token Subclass("subclass") "subclass" #token Subclass("subclass") "subclass"
#token ClassGuid("classguid") "classguid" #token ClassGuid("classguid") "classguid"
@ -584,7 +585,7 @@ vfrFormSetDefinition :
<< <<
EFI_GUID Guid; EFI_GUID Guid;
EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID; EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID;
EFI_GUID ClassGuid1, ClassGuid2, ClassGuid3; EFI_GUID ClassGuid1, ClassGuid2, ClassGuid3, ClassGuid4;
UINT8 ClassGuidNum = 0; UINT8 ClassGuidNum = 0;
CIfrFormSet *FSObj = NULL; CIfrFormSet *FSObj = NULL;
UINT16 C, SC; UINT16 C, SC;
@ -600,13 +601,16 @@ vfrFormSetDefinition :
"\|" guidDefinition[ClassGuid2] << ++ClassGuidNum; >> "\|" guidDefinition[ClassGuid2] << ++ClassGuidNum; >>
{ {
"\|" guidDefinition[ClassGuid3] << ++ClassGuidNum; >> "\|" guidDefinition[ClassGuid3] << ++ClassGuidNum; >>
{
"\|" guidDefinition[ClassGuid4] << ++ClassGuidNum; >>
}
} }
} }
"," ","
} }
<< <<
if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) { if (mOverrideClassGuid != NULL && ClassGuidNum >= 4) {
_PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!"); _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 4 class guids, can't add extra class guid!");
} }
switch (ClassGuidNum) { switch (ClassGuidNum) {
case 0: case 0:
@ -643,10 +647,23 @@ vfrFormSetDefinition :
} }
break; break;
case 3: case 3:
if (mOverrideClassGuid != NULL) {
ClassGuidNum ++;
}
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID)); FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1); FSObj->SetClassGuid(&ClassGuid1);
FSObj->SetClassGuid(&ClassGuid2); FSObj->SetClassGuid(&ClassGuid2);
FSObj->SetClassGuid(&ClassGuid3); FSObj->SetClassGuid(&ClassGuid3);
if (mOverrideClassGuid != NULL) {
FSObj->SetClassGuid(mOverrideClassGuid);
}
break;
case 4:
FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
FSObj->SetClassGuid(&ClassGuid1);
FSObj->SetClassGuid(&ClassGuid2);
FSObj->SetClassGuid(&ClassGuid3);
FSObj->SetClassGuid(&ClassGuid4);
break; break;
default: default:
break; break;
@ -1321,6 +1338,7 @@ questionheaderFlagsField[UINT8 & Flags] :
ReadOnlyFlag << $Flags |= 0x01; >> ReadOnlyFlag << $Flags |= 0x01; >>
| InteractiveFlag << $Flags |= 0x04; >> | InteractiveFlag << $Flags |= 0x04; >>
| ResetRequiredFlag << $Flags |= 0x10; >> | ResetRequiredFlag << $Flags |= 0x10; >>
| RestStyleFlag << $Flags |= 0x20; >>
| ReconnectRequiredFlag << $Flags |= 0x40; >> | ReconnectRequiredFlag << $Flags |= 0x40; >>
| O:OptionOnlyFlag << | O:OptionOnlyFlag <<
gCVfrErrorHandle.HandleWarning ( gCVfrErrorHandle.HandleWarning (
@ -3766,6 +3784,7 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
| "OPTION_DEFAULT_MFG" << $LFlags |= 0x20; >> | "OPTION_DEFAULT_MFG" << $LFlags |= 0x20; >>
| InteractiveFlag << $HFlags |= 0x04; >> | InteractiveFlag << $HFlags |= 0x04; >>
| ResetRequiredFlag << $HFlags |= 0x10; >> | ResetRequiredFlag << $HFlags |= 0x10; >>
| RestStyleFlag << $HFlags |= 0x20; >>
| ReconnectRequiredFlag << $HFlags |= 0x40; >> | ReconnectRequiredFlag << $HFlags |= 0x40; >>
| ManufacturingFlag << $LFlags |= 0x20; >> | ManufacturingFlag << $LFlags |= 0x20; >>
| DefaultFlag << $LFlags |= 0x10; >> | DefaultFlag << $LFlags |= 0x10; >>