From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (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 8DD292257C2B7 for ; Mon, 5 Mar 2018 06:22:56 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 06:29:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="21931608" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga007.fm.intel.com with ESMTP; 05 Mar 2018 06:29:09 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:29:08 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:29:08 -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:29:06 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Shaw, Kevin W" Thread-Topic: [edk2] [Patch V3] DSC spec: Add flexible PCD value format into spec Thread-Index: AQHTrtidUJ19YR/KwEmM4hin6f5Y/KPBvuqQ Date: Mon, 5 Mar 2018 14:29:05 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D78CF@SHSMSX104.ccr.corp.intel.com> References: <1519632316-2368-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1519632316-2368-1-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 V3] DSC spec: Add flexible PCD value format into spec 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:22:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Yonghong Zhu >Sent: Monday, February 26, 2018 4:05 PM >To: edk2-devel@lists.01.org >Cc: Kinney, Michael D ; Shaw, Kevin W >; Gao, Liming >Subject: [edk2] [Patch V3] DSC spec: Add flexible PCD value format into sp= ec > >V3: Update the Pcd value format in [Components] section >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 >--- > 3_edk_ii_dsc_file_format/310_pcd_sections.md | 160 +++++++++++++--- >----- > .../311_[components]_sections.md | 23 +-- > .../33_platform_dsc_definition.md | 78 +++++++--- > 3 files changed, 174 insertions(+), 87 deletions(-) > >diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md >b/3_edk_ii_dsc_file_format/310_pcd_sections.md >index 2af42cc..18a243d 100644 >--- a/3_edk_ii_dsc_file_format/310_pcd_sections.md >+++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md >@@ -98,13 +98,11 @@ is permissible to list multiple architectures in a sin= gle >method section as in: > It is permissible to list a PCD in a common architecture section and also= list > it in an architecturally modified section. In this case, the value in the > architectural section overrides the value specified in the common section= . > > The PCD values must match the datum type declared for a given PCD in the >DEC >-file. While a PCD of datum type `BOOLEAN` is permitted to have a `1` or a= `0` >-(instead of TRUE or FALSE) in the value field, a PCD of type UINT* cannot= use >-`TRUE` or `FALSE` for values. >+file. > > PCDs with a data type of `VOID`* can optionally provide the maximum size = of >the > value. If not provided, the maximum length will be calculated as the larg= est of > the size of the data in the DSC file, the size of the data in the INF fil= e or > the size of the data in the DEC file that declares the PCD. >@@ -220,21 +218,24 @@ fields that are separated by the pipe character, "|"= . > ::=3D [ ]* > ::=3D > ::=3D > ::=3D {} {} {} > ::=3D [ ] >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} {} >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} > else: >- [] >+ [] > ::=3D "VOID*" {} {} >- ::=3D {} {} {} >- {} {} >+ ::=3D {} {} {} > ``` > > #### Parameters > > **_Expression_** >@@ -325,21 +326,24 @@ of the DSC file. > ::=3D [ ]* > ::=3D > ::=3D > ::=3D {} {} >{} > ::=3D [ ] >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} {} >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} > else: >- [] >+ [] > ::=3D {} {} >- ::=3D {} {} {} >- {} {} >+ ::=3D {} {} {} > ``` > > #### Parameters > > **_Expression_** >@@ -458,41 +462,58 @@ sections of the DSC file. > ::=3D "." ["." ] > ::=3D [ ]* > ::=3D > ::=3D > ::=3D [ ] >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} >- {} else: >- [] >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ [] > ::=3D "VOID*" [ ] > ::=3D {} {} >- ::=3D {} {} {} {} >- {} >+ ::=3D {} {} {} > ::=3D [ ] > ::=3D {} {"*"} >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} >- {} else: >- >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif(pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ > ::=3D [ ] > ::=3D > ::=3D {} {} > ::=3D [] > ::=3D > ::=3D [ ] > ::=3D >- ::=3D {} {} {} {} >- {} {} >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ > ::=3D [ ]* > ::=3D {"NV"} {"BS"} {"RT"} {"RO"} > ``` > > #### Parameters >@@ -618,41 +639,58 @@ sections of the DSC file. > ::=3D "." ["." ] > ::=3D [ ]* > ::=3D > ::=3D > ::=3D [ ] >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} >- {} else: >- [] >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ [] > ::=3D "VOID*" [ ] > ::=3D {} {} >- ::=3D {} {} {} {} >- {} >+ ::=3D {} {} {} > ::=3D [ ] > ::=3D {} {"*"} >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >{} >- elif (pcddatumtype =3D=3D "UINT8"): {} >- {} elif (pcddatumtype =3D=3D "UINT16"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT32"): {} {} elif >- (pcddatumtype =3D=3D "UINT64"): {} >- {} else: >- >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ > ::=3D [ ] > ::=3D > ::=3D {} {} > ::=3D [] > ::=3D > ::=3D [ ] > ::=3D >- ::=3D {} {} {} {} >- {} {} >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif(pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ > ::=3D [ ]* > ::=3D {"NV"} {"BS"} {"RT"} {"RO"} > ``` > > #### Parameters >diff --git a/3_edk_ii_dsc_file_format/311_[components]_sections.md >b/3_edk_ii_dsc_file_format/311_[components]_sections.md >index 119d17b..5a3594a 100644 >--- a/3_edk_ii_dsc_file_format/311_[components]_sections.md >+++ b/3_edk_ii_dsc_file_format/311_[components]_sections.md >@@ -165,22 +165,25 @@ modules in a binary image (the FDF file describes >that ordering). > ::=3D {} {} > { } > ::=3D "" > * > ::=3D [ ] >- ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): {} >- {} elif (pcddatumtype =3D=3D "UINT8"): >- {} {} elif (pcddatumtype = =3D=3D >- "UINT16"): {} {} elif >- (pcddatumtype =3D=3D "UINT32"): {} >- {} elif (pcddatumtype =3D=3D "UINT64")= : >- {} {} else: >- [] >+ ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ [] > ::=3D "VOID*" [ ] > ::=3D {} {} >- ::=3D {} {} {} >- {} >+ ::=3D {} {} {} > ::=3D "" > []* > [ ]+ > [ ]* > [ ]* >diff --git a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md >b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md >index bfe730c..bbe6b10 100644 >--- a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md >+++ b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md >@@ -112,15 +112,16 @@ The following are common definitions used by >multiple section types. > ::=3D (0-9) > ::=3D (a-zA-Z_) > ::=3D [ ]* > ::=3D # A valid C variable name. > ::=3D (0x21 - 0x7E) >- ::=3D [{0x21} {(0x23 - 0x5B)} {(0x5D - 0x7E)} >- {}]* >+ ::=3D [{0x21} {(0x23 - 0x26)} {(0x28 - 0x5B)} >+ {(0x5D - 0x7E)} {}]* > ::=3D 0x22 >+ ::=3D 0x27 > ::=3D "\" {"n"} {"t"} {"f"} {"r"} {"b"} {"0"} {"\"= } >- {} >+ {} {} > ::=3D {} {} > ::=3D * > ::=3D + > ::=3D 0x09 > ::=3D 0x20 >@@ -138,15 +139,16 @@ The following are common definitions used by >multiple section types. > ::=3D [ * * ]* > ::=3D > ::=3D > ::=3D {} {} > ::=3D * >- ::=3D ["L"] >+ ::=3D * >+ ::=3D {} {} > ::=3D [{} {}]+ > ::=3D "#" [] + > ::=3D "#" + >- ::=3D "L" >+ ::=3D "L" {} {} > ::=3D (a-fA-F0-9) > ::=3D {"0x"} {"0X"} [] > ::=3D {"0x"} {"0X"} + > ::=3D "0x" [0]* > ::=3D ? ? ? >@@ -184,11 +186,12 @@ The following are common definitions used by >multiple section types. > ::=3D (\x1 - \xFFFFFFFFFFFFFFFF) > ::=3D (1-18446744073709551615) > ::=3D {} {} > ::=3D {"TRUE"} {"true"} {"True"} {"0x1"} {"0x01"} = {"1"} > ::=3D {"FALSE"} {"false"} {"False"} {"0x0"} {"0x00= "} {"0"} >- ::=3D {} {} >+ ::=3D {} {} >+ ::=3D {} {"{""}"} > ::=3D (A-Z)(A-Z0-9_)* > ::=3D "$(" ")" > ::=3D "." > ::=3D > ::=3D >@@ -210,14 +213,49 @@ The following are common definitions used by >multiple section types. > > ::=3D (0-255) > ::=3D (0-65535) > ::=3D (0-4294967295) > ::=3D (0-18446744073709551615) >- ::=3D {} {} >- ::=3D {} {} >- ::=3D {} {} >- ::=3D {} {} >+ ::=3D {} {} {} >+ {} {} >+ ::=3D {} {} {} >+ {} {} >+ ::=3D {} {} {} >+ {} {} >+ ::=3D {} {} {} >+ {} {} >+ ::=3D {} {"{""}"} >+ ::=3D {} >+ {"{" [ ]*"}"} >+ ::=3D {} >+ {"{" [ ]*"}"} >+ ::=3D {} >+ {"{" [ ]*"}"} >+ ::=3D {} {} {} >+ ::=3D "{" {} {[] >+ [ [] ]* } "}" >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ {} {} >+ ::=3D "GUID(" ")" >+ ::=3D { } >+ {} {} >+ ::=3D "DEVICE_PATH(" ")" >+ ::=3D A double quoted string that follow the devic= e path >+ as string format defined in UEFI Specification= 2.6 >+ Section 9.6 >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >{} >+ ::=3D "UINT8(" ")" >+ ::=3D "UINT16(" ")" >+ ::=3D "UINT32(" ")" >+ ::=3D "UINT64(" ")" >+ ::=3D "LABEL(" ")" >+ ::=3D "OFFSET_OF(" ")" > ::=3D {"BASE"} {"SEC"} {"PEI_CORE"} {"PEIM"} > {"DXE_CORE"} {"DXE_DRIVER"} {"SMM_CORE"} > {"DXE_RUNTIME_DRIVER"} {"DXE_SAL_DRIVER"} > {"DXE_SMM_DRIVER"} {"UEFI_DRIVER"} > {"UEFI_APPLICATION"} {"USER_DEFINED"} >@@ -244,10 +282,18 @@ The following are common definitions used by >multiple section types. > {"SMM_CORE"} {"DXE_SMM_DRIVER"} > {"UEFI_DRIVER"} {"UEFI_APPLICATION"} > ``` > > ********** >+**Note:** When using CString, UnicodeString or byte array format as >+UINT8/UINT16/UINT32/UINT64 values, please make sure they fit in the >+target type's size, otherwise tool would report failure. >+********** >+**Note:** LABEL() macro in byte arrays to tag the byte offset of a >+location in a byte array. OFFSET_OF() macro in byte arrays that returns >+the byte offset of a LABEL() declared in a byte array. >+********** > **Note:** When using the characters "|" or "||" in an expression, the > expression must be encapsulated in open "(" and close ")" parenthesis. > ********** > **Note:** Comments may appear anywhere within a DSC file, provided they >follow > the rules that a comment may not be enclosed within Section headers, and >that >@@ -265,16 +311,16 @@ chain tag names that are being built. Refer to the >EDK II Expression Syntax > Specification for additional information. > > **_UnicodeString_** > > When the `` element (these characters are string literals = as >-defined by the C99 specification: L"string", not actual Unicode character= s) is >-included in a value, the build tools may be required to expand the ASCII = string >-between the quotation marks into a valid UCS-2 character string. The buil= d >-tools parser must treat all content between the field separators (excludi= ng >-white space characters around the field separators) as ASCII literal cont= ent >-when generating the AutoGen.c and AutoGen.h files. >+defined by the C99 specification: L"string"/L'string', not actual Unicode >+characters) is included in a value, the build tools may be required to ex= pand >+the ASCII string between the quotation marks into a valid UCS-2 character >string. >+The build tools parser must treat all content between the field separator= s >+(excluding white space characters around the field separators) as ASCII l= iteral >+content when generating the AutoGen.c and AutoGen.h files. > > **_Comments_** > > Strings that appear in comments may be ignored by the build tools. An ASC= II > string matching the format of the ASCII string defined by `` >-- >2.6.1.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel