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 0548A22436928 for ; Mon, 5 Mar 2018 06:14:43 -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:20:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,427,1515484800"; d="scan'208";a="208961403" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 05 Mar 2018 06:20:55 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) 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:20:55 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Mar 2018 06:20:54 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Mon, 5 Mar 2018 22:20:51 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Shaw, Kevin W" Thread-Topic: [Patch V2] INF spec: Add flexible PCD value format into spec Thread-Index: AQHToBBA4LjvPoU640uMHfpnW4Ee/KPB2itA Date: Mon, 5 Mar 2018 14:20:50 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D787B@SHSMSX104.ccr.corp.intel.com> References: <1518006956-2284-1-git-send-email-yonghong.zhu@intel.com> <1518006956-2284-5-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1518006956-2284-5-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] INF 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:14:44 -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] INF spec: Add flexible PCD value format into spec > >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 >--- > .../32_component_inf_definition.md | 75 +++++++++++++++++= ----- > 3_edk_ii_inf_file_format/38_pcd_sections.md | 39 ++++++----- > 2 files changed, 83 insertions(+), 31 deletions(-) > >diff --git a/3_edk_ii_inf_file_format/32_component_inf_definition.md >b/3_edk_ii_inf_file_format/32_component_inf_definition.md >index 72bcf2c..ef70927 100644 >--- a/3_edk_ii_inf_file_format/32_component_inf_definition.md >+++ b/3_edk_ii_inf_file_format/32_component_inf_definition.md >@@ -111,15 +111,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 >@@ -137,15 +138,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" > ::=3D ? ? ? >@@ -181,14 +183,14 @@ The following are common definitions used by >multiple section types. > ::=3D {} {} > ::=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 >@@ -209,14 +211,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 {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D {} {} {} >+ ::=3D "GUID(" ")" >+ ::=3D { } >+ {} {} >+ ::=3D "DEVICE_PATH(" ")" >+ ::=3D A double quoted string that follow the device= path >+ as string format defined in UEFI Specification = 2.6 >+ Section 9.6 >+ ::=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"} >@@ -233,10 +270,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 INF file, provided they >follow > the rules that a comment may not be enclosed within Section headers, and >that >@@ -252,14 +297,14 @@ in line comments must appear at the end of a >statement. > Expression syntax is defined the _EDK II Expression Syntax Specification_= . > > **_Unicode String_** > > 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 encoded string. >The >-build tools parser must treat all content between the field separators >+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 >encoded >+string. The build tools parser must treat all content between the field >separators > (excluding white space characters around the field separators) as ASCII l= iteral > content when generating the `AutoGen.c` and `AutoGen.h` files. > > **_Comments_** > >diff --git a/3_edk_ii_inf_file_format/38_pcd_sections.md >b/3_edk_ii_inf_file_format/38_pcd_sections.md >index cef87a8..82636d5 100644 >--- a/3_edk_ii_inf_file_format/38_pcd_sections.md >+++ b/3_edk_ii_inf_file_format/38_pcd_sections.md >@@ -124,34 +124,41 @@ content. > ::=3D > ::=3D > ::=3D [] > > ::=3D >- ::=3D >+ ::=3D {} {} > ::=3D "{" "}" > ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >- {"0x00"} {"0x01"} elif (pcddatumtype =3D=3D "UI= NT8"): >- elif (pcddatumtype =3D=3D "UINT16"): >- elif (pcddatumtype =3D=3D "UINT32"): = >+ {"0x00"} {"0x01"} >+ elif (pcddatumtype =3D=3D "UINT8"): >+ >+ elif (pcddatumtype =3D=3D "UINT16"): >+ >+ elif (pcddatumtype =3D=3D "UINT32"): >+ > elif (pcddatumtype =3D=3D "UINT64"): >- else: >- >+ >+ else: >+ > ::=3D [] > [] > ::=3D [] [] > ::=3D if (pcddatumtype =3D=3D "BOOLEAN"): >- elif (pcddatumtype =3D=3D "UINT8"): >- elif (pcddatumtype =3D=3D "UINT16= "): >- elif (pcddatumtype =3D=3D "UINT3= 2"): >- elif (pcddatumtype =3D=3D "UINT6= 4"): >- else: >- >- ::=3D {} {} >- ::=3D {} {} >+ >+ elif (pcddatumtype =3D=3D "UINT8"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT16"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT32"): >+ {} {} >+ elif (pcddatumtype =3D=3D "UINT64"): >+ {} {} >+ else: >+ {} {} > ::=3D >- <1 >-UsageBlock> ::=3D >+<1UsageBlock> ::=3D > ::=3D + > ::=3D > ::=3D ["##" ] > ::=3D {} {} > ::=3D {"CONSUMES"} {"SOMETIMES_CONSUMES"} >-- >2.6.1.windows.1