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.4934.1604372310437088372 for ; Mon, 02 Nov 2020 18:58:30 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=LKQtmfAe; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0576d3f819=abner.chang@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A32t6vM023560; Tue, 3 Nov 2020 02:58:24 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; s=pps0720; bh=Z7rAfls3pKoJaCQGyh3Z304aMWeJcWqRZmEoib363fY=; b=LKQtmfAe1ywTvmQ7zcOJXJBn35OrHyLTwOGPfiuiQ+KtFtKsBFgXvrYYGhHF007QLGsk 4K7LhkEtdlV6133rCBjChHS2jdwXMp6ICOYoi/s5PtXbOsk06nsHbTy7OH0YrQrSbXhT vj/1vbni1DMOtL3ZtFe9Q6LPe7NV7gmAr3Xd/To1ziZTOa/WXs0iQjKzTJ21q/DP3hIz C5DUOq6f/punwoAWw5AP0xkuPjoAZRU1RLnon3JUigNZerriJb2rJAxl2QAPyaAAJ/cr 5az/lacSxPxG+CbaoU78+RDPpmjIWp5VlVWOi6pv1wX1bgA7twSKjW9Y7KpTyX80wgJ/ NA== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 34hh9wq8kq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 02:58:24 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id D85B056; Tue, 3 Nov 2020 02:58:23 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 7475846; Tue, 3 Nov 2020 02:58:22 +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 2/3] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Date: Tue, 3 Nov 2020 10:12:47 +0800 Message-Id: <20201103021248.7019-3-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201103021248.7019-1-abner.chang@hpe.com> References: <20201103021248.7019-1-abner.chang@hpe.com> X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-02_16:2020-11-02,2020-11-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 mlxscore=0 suspectscore=2 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011030019 Add REST_STYLE support on VFR language 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 --- 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