From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8C34822436928 for ; Mon, 5 Mar 2018 06:14:47 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 06:21:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="208961440" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 05 Mar 2018 06:21:00 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:21:00 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:20:59 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Mon, 5 Mar 2018 22:20:57 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Shaw, Kevin W" Thread-Topic: [Patch V2] Expression spec: update format to support flexible Pcd format Thread-Index: AQHToBA+vEaSoNqkvESyalHcLf/w0aPB2jVA Date: Mon, 5 Mar 2018 14:20:56 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D7886@SHSMSX104.ccr.corp.intel.com> References: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> <1518006956-2284-4-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1518006956-2284-4-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch V2] Expression spec: update format to support flexible Pcd format X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2018 14:14:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Zhu, Yonghong >Sent: Wednesday, February 07, 2018 8:36 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming ; Kinney, Michael D >; Shaw, Kevin W >Subject: [Patch V2] Expression spec: update format to support flexible Pcd >format > >V2: update EBNF for Array format. > >Cc: Liming Gao >Cc: Michael Kinney >Cc: Kevin W Shaw >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > 2_expression_overview.md | 3 +++ > 3_expression_format.md | 50 >+++++++++++++++++++++++++++++++++++++++++++----- > 2 files changed, 48 insertions(+), 5 deletions(-) > >diff --git a/2_expression_overview.md b/2_expression_overview.md >index 34ceb97..c29a632 100644 >--- a/2_expression_overview.md >+++ b/2_expression_overview.md >@@ -100,5 +100,8 @@ directives section do not apply. > 12. Logical operators require operands that are type scalar. > > 13. For the Conditional Operator, the first operand must be scalar, while= the > second and third operands must have the same type (i.e., both being s= calar, > both being integers, or both being string literals). >+ >+14. Array format like "{0x10, 0x20}" can't be a operand of any operator >except >+ Relational and equality operators. >diff --git a/3_expression_format.md b/3_expression_format.md >index 50b94c4..1f90fc9 100644 >--- a/3_expression_format.md >+++ b/3_expression_format.md >@@ -93,10 +93,21 @@ GRACEFULLY._ > ::=3D > ::=3D []+ > ::=3D (a-fA-F0-9) > ::=3D {"0x"} {"0X"} > ::=3D {} {} >+ ::=3D (\x0 - \xFF) >+ ::=3D (\x0 - \xFFFF) >+ ::=3D (\x0 - \xFFFFFFFF) >+ ::=3D (\x0 - \xFFFFFFFFFFFFFFFF) >+ ::=3D (0-255) >+ ::=3D (0-65535) >+ ::=3D (0-4294967295) >+ ::=3D (0-18446744073709551615) >+ ::=3D "GUID(" ")" >+ ::=3D { } >+ {} {} > Rhex2 ::=3D [] > Rhex4 ::=3D [] [] Rhex2 > Rhex8 ::=3D [] [] [] [] Rhex4 > ::=3D Rghex8 "-" Rghex4 "-" Rghex4 "-" Rghex4 "-"= Rghex12 > Rghex2 ::=3D >@@ -111,19 +122,42 @@ Rghex12 ::=3D = > Rghex8 > ::=3D "{" []* > ::=3D "{" []* > ::=3D > ::=3D > ::=3D []* "}" []* "}" >- ::=3D {} {} >+ ::=3D {} {} > ::=3D "{" * "}" >- ::=3D "{" * [ ]* "}" >+ ::=3D "{" * [] >+ [ [] ]* "}" >+ ::=3D {} {} {} >+ ::=3D "DEVICE_PATH(" ")" >+ ::=3D A double quoted string that follow the devi= ce path >+ as string format defined in UEFI Specificatio= n 2.6 >+ Section 9.6 >+ ::=3D "LABEL(" ")" >+ ::=3D "OFFSET_OF(" ")" > ::=3D {} {"L" } >+ {} {"L" } > ::=3D 0x22 >+ ::=3D 0x27 > ::=3D []* >+ ::=3D []* > ::=3D {} {} >- ::=3D {0x20} {0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E= )} >- ::=3D "\" {"n"} {"r"} {"t"} {"f"} {"b"} {"0"} {"\= "} >{} >+ ::=3D {0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} >+ {(0x5D - 0x7E)} {} >+ ::=3D "\" {"n"} {"r"} {"t"} {"f"} {"b"} {"0"} {"\= "} >+ {} {} >+ ::=3D {} {} {} >{} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >{} >+ ::=3D "UINT8(" ")" >+ ::=3D "UINT16(" ")" >+ ::=3D "UINT32(" ")" >+ ::=3D "UINT64(" ")" > ::=3D {} {} > ::=3D "." > ::=3D {} { >} > ::=3D {} {} > ::=3D {"+"} {"-"} {"~"} >@@ -187,13 +221,19 @@ >gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress >| !gCrownBayTokenSpaceGuid. > > This is the value of the MACRO assigned in a DEFINE statement. > > **Expressions** > >-If the "|" character is used in an expression, the expression must be >+If the "|" or "||"character is used in an expression, the expression must= be > encapsulated by parenthesis. > >+**OFFSET_OF()** >+ >+LABEL() macro in byte arrays to tag the byte offset of a location in a by= te >+array. OFFSET_OF() macro in byte arrays that returns the byte offset of a >+LABEL() declared in a byte array. >+ > ## 3.2 Conditional Directive Expressions > > Conditional directive statements are defined in the EDK II Platform >Description > (DSC) File and Flash Definition (FDF) File. The following EBNF describes = the > format for expressions used in conditional directives. The format is base= d on >-- >2.6.1.windows.1