public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abner Chang" <abner.chang@hpe.com>
To: devel@edk2.groups.io
Cc: Bob Feng <bob.c.feng@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Yuwei Chen <yuwei.chen@intel.com>,
	Nickle Wang <nickle.wang@hpe.com>
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	[thread overview]
Message-ID: <20201106024939.17761-3-abner.chang@hpe.com> (raw)
In-Reply-To: <20201106024939.17761-1-abner.chang@hpe.com>

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>
---
 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


  parent reply	other threads:[~2020-11-06  3:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  2:49 [VFR support REST_STYLE PATCH v4 0/4] VFR support REST_STYLE Abner Chang
2020-11-06  2:49 ` [VFR support REST_STYLE PATCH v4 1/4] MdePkg: Add GUID for REST Style Formset Abner Chang
2020-11-06  2:49 ` Abner Chang [this message]
2020-11-06  2:49 ` [VFR support REST_STYLE PATCH v4 3/4] MdeModulePkg/Library: Revise HiiLib to check REST_STYLE Abner Chang
2020-11-06  2:49 ` [VFR support REST_STYLE PATCH v4 4/4] MdeModulePkg/DriverSampleDxe: Add HII sample options Abner Chang
     [not found] ` <1644CDDEC21AD05F.25549@groups.io>
2020-11-06  3:55   ` [edk2-devel] [VFR support REST_STYLE PATCH v4 3/4] MdeModulePkg/Library: Revise HiiLib to check REST_STYLE Abner Chang
     [not found] ` <1644CDDF508612CA.7247@groups.io>
2020-11-06  3:56   ` [edk2-devel] [VFR support REST_STYLE PATCH v4 4/4] MdeModulePkg/DriverSampleDxe: Add HII sample options Abner Chang
2020-11-09  1:17 ` 回复: [edk2-devel] [VFR support REST_STYLE PATCH v4 0/4] VFR support REST_STYLE gaoliming
     [not found] ` <1645B211979911D7.24110@groups.io>
2020-11-11  0:49   ` gaoliming
2020-11-11  1:03     ` Abner Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201106024939.17761-3-abner.chang@hpe.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox