From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.7011.1604633727192210101 for ; Thu, 05 Nov 2020 19:35:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=PHAOFpCn; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=057929b778=abner.chang@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A63X5Nb032045; Fri, 6 Nov 2020 03:35:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version; s=pps0720; bh=5IE8YY6MnXNWB7b1ar2axvWCSzmVzs/o0Di760Rs6xU=; b=PHAOFpCnEYYqMWNQKI7bEV7rEb1yTl2qFIKGm1nlByc5Gs+gb5v1X6L9c/AKf7Ozl4eD T4kHODTK8kF+aBklHiY0yvpBve17UjW83FBgpi9QMZihXWgWbVsaBibE13Sbp3FwNSwR NFdz7HMyGT8bNRJD3sFiv0bm6fBNExcFeW2NCue0LVh5g+SAoGuAfbaWqQPsWsck/13q nALXAi8rc4UwSamvdY07A4Y5/KJM3bPrNs5l2jZTEYjlkNAxMoPslFKESiZ1x9QBfBDm Hv5J7PnHGP+VTSZrVDS2j5yYX0fh9wVbQwm5B/VVsEVPd3KnztGIAT93UMgb8DEy/nqe Zw== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 34kc8dxqdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Nov 2020 03:35:22 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 30E66A2; Fri, 6 Nov 2020 03:35:20 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id B4E9237; Fri, 6 Nov 2020 03:35:19 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen , Nickle Wang Subject: [VFR support REST_STYLE PATCH v4 2/4] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Date: Fri, 6 Nov 2020 10:49:37 +0800 Message-Id: <20201106024939.17761-3-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201106024939.17761-1-abner.chang@hpe.com> References: <20201106024939.17761-1-abner.chang@hpe.com> X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-06_01:2020-11-05,2020-11-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011060023 Add REST_STYLE support on VFR language BZ: 2916 https://bugzilla.tianocore.org/show_bug.cgi?id=2916 Signed-off-by: Wu Jiaxin Signed-off-by: Ye Ting Signed-off-by: Fu Siyuan Signed-off-by: Wang Fan Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Nickle Wang Reviewed-by: Liming Gao --- BaseTools/Source/C/VfrCompile/VfrSyntax.g | 25 ++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g index 127cb8b2b2..3f896c6f1a 100644 --- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g +++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g @@ -192,6 +192,7 @@ VfrParserStart ( #token LateCheckFlag("LATE_CHECK") "LATE_CHECK" #token ReadOnlyFlag("READ_ONLY") "READ_ONLY" #token OptionOnlyFlag("OPTIONS_ONLY") "OPTIONS_ONLY" +#token RestStyleFlag("REST_STYLE") "REST_STYLE" #token Class("class") "class" #token Subclass("subclass") "subclass" #token ClassGuid("classguid") "classguid" @@ -584,7 +585,7 @@ vfrFormSetDefinition : << EFI_GUID Guid; EFI_GUID DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID; - EFI_GUID ClassGuid1, ClassGuid2, ClassGuid3; + EFI_GUID ClassGuid1, ClassGuid2, ClassGuid3, ClassGuid4; UINT8 ClassGuidNum = 0; CIfrFormSet *FSObj = NULL; UINT16 C, SC; @@ -600,13 +601,16 @@ vfrFormSetDefinition : "\|" guidDefinition[ClassGuid2] << ++ClassGuidNum; >> { "\|" guidDefinition[ClassGuid3] << ++ClassGuidNum; >> + { + "\|" guidDefinition[ClassGuid4] << ++ClassGuidNum; >> + } } } "," } << - if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) { - _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!"); + if (mOverrideClassGuid != NULL && ClassGuidNum >= 4) { + _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 4 class guids, can't add extra class guid!"); } switch (ClassGuidNum) { case 0: @@ -643,10 +647,23 @@ vfrFormSetDefinition : } break; case 3: + if (mOverrideClassGuid != NULL) { + ClassGuidNum ++; + } + FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID)); + FSObj->SetClassGuid(&ClassGuid1); + FSObj->SetClassGuid(&ClassGuid2); + 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; default: break; @@ -1321,6 +1338,7 @@ questionheaderFlagsField[UINT8 & Flags] : ReadOnlyFlag << $Flags |= 0x01; >> | InteractiveFlag << $Flags |= 0x04; >> | ResetRequiredFlag << $Flags |= 0x10; >> + | RestStyleFlag << $Flags |= 0x20; >> | ReconnectRequiredFlag << $Flags |= 0x40; >> | O:OptionOnlyFlag << gCVfrErrorHandle.HandleWarning ( @@ -3766,6 +3784,7 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] : | "OPTION_DEFAULT_MFG" << $LFlags |= 0x20; >> | InteractiveFlag << $HFlags |= 0x04; >> | ResetRequiredFlag << $HFlags |= 0x10; >> + | RestStyleFlag << $HFlags |= 0x20; >> | ReconnectRequiredFlag << $HFlags |= 0x40; >> | ManufacturingFlag << $LFlags |= 0x20; >> | DefaultFlag << $LFlags |= 0x10; >> -- 2.17.1