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.web08.9803.1604474502600714598 for ; Tue, 03 Nov 2020 23:21:42 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=aHp9XWvb; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=057768be5f=abner.chang@hpe.com) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A47I74m017562; Wed, 4 Nov 2020 07:21:36 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=aHp9XWvbA3Zurtv8c9b9vqLsHlHIKMZjglt5hRwP4cXPuWt5/tS4GHnGBtoiGRVFA/n9 4ivNlkd2rC0x/sPYh0t6YJ2JLTx/6p5CPRC4hLIDQ4IbTbHmbQzbp9l4Tp0wC86nKMks KA3dKMTqbX2J/HrI3j7j4blVOr2htUw55xa92UzJUg6hvPYR25EsNTzpYV+sXCgCtb8B MjW9kiXeBy3g2qwTrAimuEU8Sl7hlaHDjVsHbsGm81ekepq2TMe6ttjhvKWdg5Q6S5AO WQPp9r55MBi75vaAttwl4CkmzQ1ZFZpvqnuO57guR4zI1TXsiuMl4UVhF+EdJ32Y5Lmq 2Q== Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0a-002e3701.pphosted.com with ESMTP id 34kc7umtan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 07:21:36 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 46F5E92; Wed, 4 Nov 2020 07:21:35 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id ED24C48; Wed, 4 Nov 2020 07:21:33 +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 v3 2/4] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Date: Wed, 4 Nov 2020 14:35:55 +0800 Message-Id: <20201104063557.22857-3-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104063557.22857-1-abner.chang@hpe.com> References: <20201104063557.22857-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-04_06:2020-11-04,2020-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 adultscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011040052 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